• R/O
  • SSH
  • HTTPS

adp: Commit


Commit MetaInfo

Revisión289 (tree)
Tiempo2012-06-06 13:35:38
Autorohfuji

Log Message

unify系の整理が一通り終わった

Cambiar Resumen

Diferencia incremental

--- trunk/adp_builtin.h (revision 288)
+++ trunk/adp_builtin.h (revision 289)
@@ -28,7 +28,7 @@
2828 PObjectArray::const_iterator i = pred->begin();
2929 PObjectArray::const_iterator end = pred->end();
3030 for (; i < end; i++ ) {
31- const PObject * item = (*i)->getval( this, gl);
31+ const PObject * item = (*i)->getval( this);
3232 item->err();
3333 }
3434 return true;
@@ -42,7 +42,7 @@
4242 PObjectArray::const_iterator i = pred->begin();
4343 PObjectArray::const_iterator end = pred->end();
4444 for (; i < end; i++ ) {
45- (*i)->getval( this, gl)->err();
45+ (*i)->getval( this)->err();
4646 }
4747 get_gc()->err("\n");
4848 return true;
@@ -58,7 +58,7 @@
5858 PObjectArray::const_iterator i = pred->begin();
5959 PObjectArray::const_iterator end = pred->end();
6060 for (; i < end; i++ ) {
61- (*i)->getval( this, gl)->prt();
61+ (*i)->getval( this)->prt();
6262 }
6363 return true;
6464 };
@@ -72,7 +72,7 @@
7272 PObjectArray::const_iterator i = pred->begin();
7373 PObjectArray::const_iterator end = pred->end();
7474 for (; i < end; i++ ) {
75- const PObject * item = (*i)->getval( this, gl);
75+ const PObject * item = (*i)->getval( this);
7676 item->prt();
7777 }
7878 get_gc()->prt("\n");
@@ -221,7 +221,7 @@
221221 if ( pred->size() != 2 ) return RERR_argment_number(excp, 2);
222222 const PObject **args = &pred->arglist.value.front();
223223
224- const PINTEGER *a1 = args[0]->c_integer(this);
224+ const PINTEGER *a1 = args[0]->p_integer(this);
225225 if ( a1 ) {
226226 const PInteger *result = pmm.newPInteger( pobjs, - *a1);
227227 return args[1]->unify( *result, this);
@@ -279,8 +279,8 @@
279279 const PObject *args0 = args[0];
280280 const PObject *args1 = args[1];
281281 // 両方が整数の場合
282- const PINTEGER *a1 = args0->c_integer(this);
283- const PINTEGER *a2 = args1->c_integer(this);
282+ const PINTEGER *a1 = args0->p_integer(this);
283+ const PINTEGER *a2 = args1->p_integer(this);
284284 if ( a1 && a2 ) {
285285 PObject *dst = pmm.newPInteger( pobjs, mypow(*a1, *a2));
286286 return args[2]->unify(*dst, this);
@@ -320,8 +320,8 @@
320320 const PObject **args = &pred->arglist.value.front();
321321
322322 // 試しの最適化
323- const PINTEGER *a1 = args[0]->c_integer(this);
324- const PINTEGER *a2 = args[1]->c_integer(this);
323+ const PINTEGER *a1 = args[0]->p_integer(this);
324+ const PINTEGER *a2 = args[1]->p_integer(this);
325325 if ( a1 && a2 ) {
326326 const PInteger *result = pmm.newPInteger( pobjs, sign(*a1 - *a2));
327327 return args[2]->unify( *result, this);
@@ -342,8 +342,8 @@
342342 const PObject **args = &pred->arglist.value.front();
343343
344344 // 試しの最適化
345- const PINTEGER *a1 = args[0]->c_integer(this);
346- const PINTEGER *a2 = args[1]->c_integer(this);
345+ const PINTEGER *a1 = args[0]->p_integer(this);
346+ const PINTEGER *a2 = args[1]->p_integer(this);
347347 if ( a1 && a2 ) {
348348 return *a1 < *a2;
349349 }
@@ -361,8 +361,8 @@
361361 const PObject **args = &pred->arglist.value.front();
362362
363363 // 試しの最適化
364- const PINTEGER *a1 = args[0]->c_integer(this);
365- const PINTEGER *a2 = args[1]->c_integer(this);
364+ const PINTEGER *a1 = args[0]->p_integer(this);
365+ const PINTEGER *a2 = args[1]->p_integer(this);
366366 if ( a1 && a2 ) {
367367 return *a1 <= *a2;
368368 }
@@ -380,8 +380,8 @@
380380 const PObject **args = &pred->arglist.value.front();
381381
382382 // 試しの最適化
383- const PINTEGER *a1 = args[0]->c_integer(this);
384- const PINTEGER *a2 = args[1]->c_integer(this);
383+ const PINTEGER *a1 = args[0]->p_integer(this);
384+ const PINTEGER *a2 = args[1]->p_integer(this);
385385 if ( a1 && a2 ) {
386386 return *a1 > *a2;
387387 }
@@ -399,8 +399,8 @@
399399 const PObject **args = &pred->arglist.value.front();
400400
401401 // 試しの最適化
402- const PINTEGER *a1 = args[0]->c_integer(this);
403- const PINTEGER *a2 = args[1]->c_integer(this);
402+ const PINTEGER *a1 = args[0]->p_integer(this);
403+ const PINTEGER *a2 = args[1]->p_integer(this);
404404 if ( a1 && a2 ) {
405405 return *a1 >= *a2;
406406 }
@@ -451,7 +451,7 @@
451451 const PObject **args = &pred->arglist.value.front();
452452
453453 // 試しの最適化
454- const PINTEGER *a1 = args[0]->c_integer(this);
454+ const PINTEGER *a1 = args[0]->p_integer(this);
455455 if ( a1 ) {
456456 const PInteger *result = pmm.newPInteger( pobjs, ~*a1);
457457 return args[1]->unify( *result, this);
--- trunk/adp_builtin_system.h (revision 288)
+++ trunk/adp_builtin_system.h (revision 289)
@@ -36,7 +36,7 @@
3636 time_t now_t;
3737 time(&now_t);
3838 if ( pred->size() == 2 ) {
39- const PINTEGER *dif = (*pred)[0]->c_integer(this);
39+ const PINTEGER *dif = (*pred)[0]->p_integer(this);
4040 if ( !dif ) return RERR_argment_type(excp, 0);
4141 now_t += *dif;
4242 }
--- trunk/adp_builtin_db.h (revision 288)
+++ trunk/adp_builtin_db.h (revision 289)
@@ -75,8 +75,8 @@
7575 }
7676 } else if ( parameter->c_double() ) {
7777 stmt, *parameter->c_double();
78- } else if ( parameter->c_integer32(this) ) {
79- stmt, *parameter->c_integer32(this);
78+ } else if ( parameter->p_integer32(this) ) {
79+ stmt, *parameter->p_integer32(this);
8080 } else if ( parameter->c_integer() ) {
8181 stmt, *parameter->c_integer();
8282 } else {
--- trunk/adp_unify.cpp (revision 288)
+++ trunk/adp_unify.cpp (revision 289)
@@ -19,35 +19,37 @@
1919 #include "adp.h"
2020
2121 /*************************************** GetValsOne/GetValuesTwo() ******************************************/
22-template<class RETURN, class V, class EC, class VL, class FUNC> inline RETURN GetValsOne( const V &v, EC args, VL local, FUNC fn)
22+template<class RETURN, class V, class ARG1, class VL, class FUNC> inline RETURN GetValsOne( const V &v, ARG1 arg, VL local, FUNC fn, RETURN def)
2323 {
2424 assert( v.idx < local->size());
2525 const PObject *item = (*local)[v.idx];
2626 if ( item != 0 ) {
27- return (item->*fn)(args);
27+ return (item->*fn)(arg);
2828 } else {
29- return 0;
29+ return def;
3030 }
3131 }
3232
33-/*************************************** getPridicate() ******************************************/
34-const PPredicate *PVeriable::getPredicate(VLocal *local) const { return ::GetValsOne<const PPredicate*>( *this, local, local, &PObject::getPredicate); }
35-const PPredicate *PEVeriable::getPredicate(VLocal *local) const { return ::GetValsOne<const PPredicate*>( *this, local, local, &PObject::getPredicate); }
36-
37-/*************************************** getPridicateName() ******************************************/
38-template<class V> inline const string *getPredicateName( V &v, bool &docache, VLocal *local)
33+template<class RETURN, class V, class ARG1, class ARG2, class VL, class FUNC> inline RETURN GetValsTwo( const V &v, ARG1 arg1, ARG2 arg2, VL local, FUNC fn, RETURN def)
3934 {
40- docache = false;
35+ assert( v.idx < local->size());
4136 const PObject *item = (*local)[v.idx];
42- if ( item == 0 ) {
43- return 0;
44- } else {
45- return item->getPredicateName(docache,local);
37+ if ( item != 0 ) {
38+ return (item->*fn)(arg1, arg2);
39+ } else {
40+ return def;
4641 }
4742 }
48-const string *PVeriable::getPredicateName(bool &docache, VLocal *local) const { return ::getPredicateName( *this, docache, local); }
49-const string *PEVeriable::getPredicateName(bool &docache, VLocal *local) const { return ::getPredicateName( *this, docache, local); }
5043
44+
45+/*************************************** getPridicate() ******************************************/
46+const PPredicate *PVeriable::getPredicate(VLocal *local) const { return ::GetValsOne<const PPredicate*>( *this, local, local, &PObject::getPredicate, 0); }
47+const PPredicate *PEVeriable::getPredicate(VLocal *local) const { return ::GetValsOne<const PPredicate*>( *this, local, local, &PObject::getPredicate, 0); }
48+
49+/*************************************** getPridicateName() ******************************************/
50+const string *PVeriable::getPredicateName(bool &docache, VLocal *local) const { docache = false; return ::GetValsTwo<const string *>( *this, docache, local, local, &PObject::getPredicateName, 0); }
51+const string *PEVeriable::getPredicateName(bool &docache, VLocal *local) const { docache = false; return ::GetValsTwo<const string *>( *this, docache, local, local, &PObject::getPredicateName, 0); }
52+
5153 /*************************************** unify ******************************************/
5254
5355 // 変項のunify本体で使うテンプレート関数
@@ -67,7 +69,7 @@
6769 {
6870 const PObject *gitem = (*glocal)[goal.idx];
6971 if ( gitem == 0 ) {
70- const PObject *p = horn.getval(c, hlocal);
72+ const PObject *p = horn.getval2(c, hlocal);
7173 (*glocal)[goal.idx] = p;
7274 if ( p->isc() ) return true;
7375 } else {
@@ -90,12 +92,12 @@
9092 if ( hval != 0 ) {
9193 return hval->unify( *gval, c, hlocal, glocal);
9294 } else {
93- const PObject *p = gval->getval(c, glocal);
95+ const PObject *p = gval->getval2(c, glocal);
9496 (*hlocal)[horn.idx] = p;
9597 if ( p->isc() ) return true;
9698 }
9799 } else if ( hval != 0 ) {
98- const PObject *p = hval->getval(c, hlocal);
100+ const PObject *p = hval->getval2(c, hlocal);
99101 (*glocal)[goal.idx] = p;
100102 if ( p->isc() ) return true;
101103 }
@@ -332,12 +334,12 @@
332334 return lo ? lo : this;
333335 }
334336
335-const PObject *PList::getval( ExecContextRoot *c, VLocal *vlocal) const
337+const PObject *PList::getval2( ExecContextRoot *c, VLocal *vlocal) const
336338 {
337339 if ( constant ) return this;
338340 PList *lo = 0;
339- const PObject *l = lvalue->getval(c, vlocal);
340- const PObject *r = rvalue->getval(c, vlocal);
341+ const PObject *l = lvalue->getval2(c, vlocal);
342+ const PObject *r = rvalue->getval2(c, vlocal);
341343 if ( l != lvalue || r != rvalue ) {
342344 lo = pmm.newPList(c->pobjs, const_cast<PObject*>(l), const_cast<PObject*>(r));
343345 }
@@ -364,13 +366,13 @@
364366 }
365367
366368
367-const PObject *PArray::getval( ExecContextRoot *c, VLocal *vlocal) const
369+const PObject *PArray::getval2( ExecContextRoot *c, VLocal *vlocal) const
368370 {
369371 if ( constant ) return this;
370372 PArray *po = 0;
371373
372374 for ( PObjectArray::const_iterator i = value.begin(); i < value.end(); i++ ) {
373- const PObject *p = (*i)->getval( c, vlocal);
375+ const PObject *p = (*i)->getval2( c, vlocal);
374376 if ( p != *i && po == 0 ) {
375377 po = pmm.newPArray(c->pobjs, *this);
376378 }
@@ -397,12 +399,12 @@
397399 return this;
398400 }
399401
400-const PObject *PPredicate::getval( ExecContextRoot *c, VLocal *vlocal) const
402+const PObject *PPredicate::getval2( ExecContextRoot *c, VLocal *vlocal) const
401403 {
402404 if ( constant ) return this;
403405
404- const PObject *no = name->getval(c, vlocal);
405- const PArray *ao = dynamic_cast<const PArray *>(arglist.getval( c, vlocal));
406+ const PObject *no = name->getval2(c, vlocal);
407+ const PArray *ao = dynamic_cast<const PArray *>(arglist.getval2( c, vlocal));
406408
407409 if ( no != name || ao != &arglist ) {
408410 PPredicate *po = pmm.newPPredicate(c->pobjs,nspace,no,ao,opt);
@@ -424,7 +426,7 @@
424426 }
425427 }
426428
427-const PObject *PVeriable::getval( ExecContextRoot *c, VLocal *vlocal) const
429+const PObject *PVeriable::getval2( ExecContextRoot *c, VLocal *vlocal) const
428430 {
429431 assert( idx < vlocal->size());
430432 const PObject *item = (*vlocal)[idx];
@@ -432,78 +434,15 @@
432434 PObject *po = pmm.newPEVeriable(c->pobjs, *this, vlocal);
433435 return po;
434436 } else {
435- return item->getval(c, vlocal);
437+ return item->getval2(c, vlocal);
436438 }
437439 }
438440
439-const PObject *PEVeriable::getval( ExecContextRoot *c) const
440-{
441- VLocal *local = vl;
442- const PObject *item = (*local)[idx];
443- if ( item == 0 ) {
444- return this;
445- } else {
446- return item->getval(c);
447- }
448-}
441+const PObject *PEVeriable::getval( ExecContextRoot *c) const { return GetValsOne<const PObject *>( *this, c, vl, &PObject::getval, this); }
442+const PObject *PEVeriable::getval2( ExecContextRoot *c, VLocal *) const { return GetValsTwo<const PObject *>( *this, c, vl, vl, &PObject::getval2, this); }
449443
450-const PObject *PEVeriable::getval( ExecContextRoot *c, VLocal *) const
451-{
452- VLocal *local = vl;
453- const PObject *item = (*local)[idx];
454- if ( item == 0 ) {
455- return this;
456- } else {
457- return item->getval(c, local);
458- }
459-}
460-
461444 /*************************************** c_integer?? ******************************************/
462-const PINTEGER32 *PVeriable::c_integer32(ExecContextRoot *c) const
463-{
464-// return GetValsOne<const PINTEGER32*, PVeriable, ExecContextRoot *, VLocal *, const PINTEGER32 *( PObject::* )(ExecContextRoot *) const>
465- return GetValsOne<const PINTEGER32*>( *this, c, c->gl, &PObject::c_integer32);
466-#if 0
467- assert( idx < c->gl->size());
468- const PObject *item = (*c->gl)[idx];
469- if ( item == 0 ) {
470- return 0;
471- } else {
472- return item->c_integer32(c);
473- }
474-#endif
475-}
476-
477-const PINTEGER *PVeriable::c_integer(ExecContextRoot *c) const
478-{
479- assert( idx < c->gl->size());
480- const PObject *item = (*c->gl)[idx];
481- if ( item == 0 ) {
482- return 0;
483- } else {
484- return item->c_integer(c);
485- }
486-}
487-
488-const PINTEGER32 *PEVeriable::c_integer32(ExecContextRoot *c) const
489-{
490- VLocal *local = vl;
491- const PObject *item = (*local)[idx];
492- if ( item == 0 ) {
493- return 0;
494- } else {
495- return item->c_integer32(c);
496- }
497-}
498-
499-
500-const PINTEGER *PEVeriable::c_integer(ExecContextRoot *c) const
501-{
502- VLocal *local = vl;
503- const PObject *item = (*local)[idx];
504- if ( item == 0 ) {
505- return 0;
506- } else {
507- return item->c_integer(c);
508- }
509-}
445+const PINTEGER32 *PVeriable::p_integer32(ExecContextRoot *c) const { return GetValsOne<const PINTEGER32*>( *this, c, c->gl, &PObject::p_integer32, 0); }
446+const PINTEGER *PVeriable::p_integer(ExecContextRoot *c) const { return GetValsOne<const PINTEGER*>( *this, c, c->gl, &PObject::p_integer, 0); }
447+const PINTEGER32 *PEVeriable::p_integer32(ExecContextRoot *c) const { return GetValsOne<const PINTEGER32*>( *this, c, vl, &PObject::p_integer32, 0); }
448+const PINTEGER *PEVeriable::p_integer(ExecContextRoot *c) const { return GetValsOne<const PINTEGER*>( *this, c, vl, &PObject::p_integer, 0); }
--- trunk/adp_compile.h (revision 288)
+++ trunk/adp_compile.h (revision 289)
@@ -176,19 +176,15 @@
176176
177177 // 値の取得(unify時に使用、必要なら代入用の変更PEVariableを作成する)
178178 virtual const PObject *getval( ExecContextRoot *) const { return this; }
179- virtual const PObject *getval( ExecContextRoot *, VLocal *) const { return this; }
179+ virtual const PObject *getval2( ExecContextRoot *, VLocal *) const { return this; }
180180
181181 // 値の取得
182182 virtual const char *c_str() const { return 0; };
183183 virtual const double *c_double() const { return 0; };
184184 virtual const PINTEGER *c_integer() const { return 0; };
185- virtual const PINTEGER32 *c_integer32(ExecContextRoot *) const { return 0; };
186- virtual const PINTEGER *c_integer(ExecContextRoot *) const { return 0; };
185+ virtual const PINTEGER *p_integer(ExecContextRoot *) const { return 0; };
186+ virtual const PINTEGER32 *p_integer32(ExecContextRoot *) const { return 0; };
187187
188- typedef const PINTEGER32 *(func_c_integer32)(ExecContextRoot *) const;
189- typedef const PINTEGER *(func_c_integer)(ExecContextRoot *) const;
190-
191-
192188 // ラベルの取得(変数の名前の取得:PArrayのハッシュで使用)
193189 virtual const char *label() const { return 0; };
194190
@@ -636,7 +632,7 @@
636632
637633 // 値の取得
638634 mutable PINTEGER32 value32;
639- virtual const PINTEGER32 *c_integer32(ExecContextRoot *) const {
635+ virtual const PINTEGER32 *p_integer32(ExecContextRoot *) const {
640636 if ( value <= INT_MAX ) {
641637 value32 = (PINTEGER32)value;
642638 return &value32;
@@ -645,7 +641,7 @@
645641 }
646642 };
647643 virtual const PINTEGER *c_integer() const { return &value; };
648- virtual const PINTEGER *c_integer(ExecContextRoot *) const { return &value; };
644+ virtual const PINTEGER *p_integer(ExecContextRoot *) const { return &value; };
649645
650646 // 変換して値を取得
651647 void NOALIAS_FUNC qcnv(char *buf, int &idx) const {
@@ -840,7 +836,7 @@
840836
841837 // 値の取得
842838 virtual const PObject *getval( ExecContextRoot *) const;
843- virtual const PObject *getval( ExecContextRoot *c, VLocal *vlocal) const;
839+ virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const;
844840
845841
846842 // 変換して値を取得
@@ -1153,7 +1149,7 @@
11531149
11541150 // 値の取得
11551151 virtual const PObject *getval( ExecContextRoot *c) const;
1156- virtual const PObject *getval( ExecContextRoot *c, VLocal *vlocal) const;
1152+ virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const;
11571153
11581154 // 変換して値を取得
11591155 virtual bool cnv_string(string &value) const {
@@ -1396,7 +1392,7 @@
13961392
13971393 // 値の取得
13981394 virtual const PObject *getval( ExecContextRoot *c) const;
1399- virtual const PObject *getval( ExecContextRoot *c, VLocal *vlocal) const;
1395+ virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const;
14001396
14011397 // メモリマネージャによるdelete
14021398 virtual void del();
@@ -1500,10 +1496,10 @@
15001496
15011497 // 値の取得
15021498 virtual const PObject *getval( ExecContextRoot *c) const ;
1503- virtual const PObject *getval( ExecContextRoot *c, VLocal *vlocal) const ;
1499+ virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const ;
15041500 // 値の取得
1505- virtual const PINTEGER32 *c_integer32(ExecContextRoot *c) const ;
1506- virtual const PINTEGER *c_integer(ExecContextRoot *c) const ;
1501+ virtual const PINTEGER32 *p_integer32(ExecContextRoot *c) const ;
1502+ virtual const PINTEGER *p_integer(ExecContextRoot *c) const ;
15071503
15081504 // ラベルの取得(変数の名前の取得:PArrayのハッシュで使用)
15091505 virtual const char *label() const { return name.c_str(); };
@@ -1671,10 +1667,10 @@
16711667
16721668 // 値の取得
16731669 virtual const PObject *getval( ExecContextRoot *c) const;
1674- virtual const PObject *getval( ExecContextRoot *c, VLocal *) const;
1670+ virtual const PObject *getval2( ExecContextRoot *c, VLocal *) const;
16751671 // 値の取得
1676- virtual const PINTEGER32 *c_integer32(ExecContextRoot *c) const ;
1677- virtual const PINTEGER *c_integer(ExecContextRoot *c) const ;
1672+ virtual const PINTEGER32 *p_integer32(ExecContextRoot *c) const ;
1673+ virtual const PINTEGER *p_integer(ExecContextRoot *c) const ;
16781674
16791675 // メモリマネージャによるdelete
16801676 virtual void del();
--- trunk/adp_execute.h (revision 288)
+++ trunk/adp_execute.h (revision 289)
@@ -84,7 +84,7 @@
8484 // Cの文字列を期待する(変換なし)
8585 const char *get_charp(size_t idx) {
8686 if ( pred->size() <= idx ) return 0;
87- const PObject *obj = (*pred)[idx]->getval( this, gl);
87+ const PObject *obj = (*pred)[idx]->getval( this);
8888 if ( obj == 0 ) return 0;
8989 return obj->c_str();
9090 }
@@ -91,7 +91,7 @@
9191 // Cの文字列を期待する(変換あり)
9292 const char *cnv_charp(size_t idx, string& str) {
9393 if ( pred->size() <= idx ) return 0;
94- const PObject *obj = (*pred)[idx]->getval( this, gl);
94+ const PObject *obj = (*pred)[idx]->getval( this);
9595 if ( obj == 0 ) return 0;
9696 if ( obj->c_str() ) return obj->c_str();
9797
@@ -307,8 +307,8 @@
307307 // Expression functions
308308 PObject *add(const PObject *args0, const PObject *args1, PObjectArray *pobjs_, bool w) {
309309 // 試しの最適化
310- const PINTEGER *a1 = args0->c_integer(this);
311- const PINTEGER *a2 = args1->c_integer(this);
310+ const PINTEGER *a1 = args0->p_integer(this);
311+ const PINTEGER *a2 = args1->p_integer(this);
312312 if ( a1 && a2 ) {
313313 if ( w ) {
314314 PInteger *ret = dynamic_cast<PInteger *>(const_cast<PObject*>(args0));
@@ -324,8 +324,8 @@
324324
325325 PObject *sub(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
326326 // 試しの最適化
327- const PINTEGER *a1 = args0->c_integer(this);
328- const PINTEGER *a2 = args1->c_integer(this);
327+ const PINTEGER *a1 = args0->p_integer(this);
328+ const PINTEGER *a2 = args1->p_integer(this);
329329 if ( a1 && a2 ) {
330330 return pmm.newPInteger( pobjs_, *a1 - *a2);
331331 }
@@ -334,8 +334,8 @@
334334
335335 PObject *mul(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
336336 // 試しの最適化
337- const PINTEGER *a1 = args0->c_integer(this);
338- const PINTEGER *a2 = args1->c_integer(this);
337+ const PINTEGER *a1 = args0->p_integer(this);
338+ const PINTEGER *a2 = args1->p_integer(this);
339339 if ( a1 && a2 ) {
340340 return pmm.newPInteger( pobjs_, *a1 * *a2);
341341 }
@@ -344,8 +344,8 @@
344344
345345 PObject *div(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
346346 // 試しの最適化
347- const PINTEGER *a1 = args0->c_integer(this);
348- const PINTEGER *a2 = args1->c_integer(this);
347+ const PINTEGER *a1 = args0->p_integer(this);
348+ const PINTEGER *a2 = args1->p_integer(this);
349349 if ( a1 && a2 ) {
350350 return pmm.newPInteger( pobjs_, *a1 / *a2);
351351 }
@@ -354,8 +354,8 @@
354354
355355 PObject *mod(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
356356 // 試しの最適化
357- const PINTEGER *a1 = args0->c_integer(this);
358- const PINTEGER *a2 = args1->c_integer(this);
357+ const PINTEGER *a1 = args0->p_integer(this);
358+ const PINTEGER *a2 = args1->p_integer(this);
359359 if ( a1 && a2 ) {
360360 return pmm.newPInteger( pobjs_, *a1 % *a2);
361361 }
@@ -363,8 +363,8 @@
363363 }
364364
365365 PObject *_and(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
366- const PINTEGER *a1 = args0->c_integer(this);
367- const PINTEGER *a2 = args1->c_integer(this);
366+ const PINTEGER *a1 = args0->p_integer(this);
367+ const PINTEGER *a2 = args1->p_integer(this);
368368 if ( a1 && a2 ) {
369369 return pmm.newPInteger( pobjs_, *a1 & *a2);
370370 }
@@ -372,8 +372,8 @@
372372 }
373373
374374 PObject *_or(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
375- const PINTEGER *a1 = args0->c_integer(this);
376- const PINTEGER *a2 = args1->c_integer(this);
375+ const PINTEGER *a1 = args0->p_integer(this);
376+ const PINTEGER *a2 = args1->p_integer(this);
377377 if ( a1 && a2 ) {
378378 return pmm.newPInteger( pobjs_, *a1 | *a2);
379379 }
@@ -381,8 +381,8 @@
381381 }
382382
383383 PObject *_xor(const PObject *args0, const PObject *args1, PObjectArray *pobjs_) {
384- const PINTEGER *a1 = args0->c_integer(this);
385- const PINTEGER *a2 = args1->c_integer(this);
384+ const PINTEGER *a1 = args0->p_integer(this);
385+ const PINTEGER *a2 = args1->p_integer(this);
386386 if ( a1 && a2 ) {
387387 return pmm.newPInteger( pobjs_, *a1 ^ *a2);
388388 }
@@ -482,7 +482,7 @@
482482 }
483483 if ( !result ) return;
484484 if ( record ) {
485- const PObject *p = pred->getval( this, gl);
485+ const PObject *p = pred->getval( this);
486486 cache->values.push_back(dynamic_cast<PPredicate*>(p->clone(&cache->objs)));
487487 cache->result++;
488488 }
@@ -706,7 +706,7 @@
706706 for ( size_t i = 0; i < p->hlocal.size(); i++ ) {
707707 const PObject *o = p->hlocal[i];
708708 if ( o != 0 && !o->isc() ) {
709- p->hlocal[i] = o->getval(p,&p->hlocal)->clone(&p->objs);
709+ p->hlocal[i] = o->getval2(p,&p->hlocal)->clone(&p->objs);
710710 }
711711 }
712712 for ( size_t i = 0; i < p->goalidx; i++ ) {
--- trunk/adp_execute.cpp (revision 288)
+++ trunk/adp_execute.cpp (revision 289)
@@ -78,7 +78,7 @@
7878 firstflg = false;
7979 // キャッシュ
8080 if ( pred->opt.cachable ) {
81- pred_a = dynamic_cast<const PPredicate*>(pred->getval( this, gl));
81+ pred_a = dynamic_cast<const PPredicate*>(pred->getval( this));
8282 PINTEGER hash = pred_a->chash();
8383 pcmap::iterator i = pccache.find(hash);
8484 if ( i != pccache.end() && i->second.key->cmatch(pred_a) ) {
@@ -666,7 +666,7 @@
666666 const PVeriable *v = dynamic_cast<const PVeriable*>((*pred)[*i]);
667667 if ( v ) {
668668 const PObject *p = (*gl)[v->idx];
669- if ( p ) (*gl)[v->idx] = p->getval(this,gl)->clone(&this->p->objs);
669+ if ( p ) (*gl)[v->idx] = p->getval(this)->clone(&this->p->objs);
670670 }
671671 }
672672 #endif
@@ -747,7 +747,7 @@
747747 const PVeriable *v = dynamic_cast<const PVeriable*>((*pred)[*i]);
748748 if ( v ) {
749749 const PObject *p = (*gl)[v->idx];
750- if ( p ) (*gl)[v->idx] = p->getval(this,gl)->clone(&this->p->objs);
750+ if ( p ) (*gl)[v->idx] = p->getval(this)->clone(&this->p->objs);
751751 }
752752 }
753753 #endif
Show on old repository browser