/////////////////////////////////////////////// Primitive Failure needs to return a unique code, not (oop)0 which is a GOTO. How about (oop)2 is Failure. (Remember Failure is normal and mild; it just goes into the smalltalk code.) ///////////////////////////////////////////// Correct the "towardness" of negative and modulo, which I ignored earlier. ///////////////////////////////////////////// Rename all Cinnabar(x?) to Cinnabark ------------------------------------ Loaded .so classes do NOT override the foundation. why not? for CinnabarTestCollections: Block ^answer must use non-local OopGOTO and vat->returning_value. SEE block_236 for CinnabarTestDouble: primitive 100: Object >> perform: withArguments:inSuperclass: also 84: perform:withArguments: also 83: perform:with:... /////////////////////////////////////////////////////////////////////////// block_236 "return" in a BLOCK needs to do the GOTO thing back to its home context. -- add returning_value to the Vat -- change error_string to oop throwing_value -- clear thrown_value during returns 1170 } (gdb) Func_Dictionary_includesKey$58$ (vat=0x8ea4868, v_self=0x8e5f3f4, selector=0x8d44470, v_t1=0x15) at _Dictionary.cc:2584 2584 if (!send_235) goto ERROR; (gdb) n 2586 return OopTrue; (gdb) l 2581 BIND_CACHE( Cache[104], typeNumber, SymbolTable[83654] ); /* at:ifAbsent: */ 2582 FUNC2* f= (FUNC2*) Cache[104].func; 2583 send_235= f(PASS_VAT v_self, SymbolTable[83654], v_t1/*tempVar*/, oclosure_236); 2584 if (!send_235) goto ERROR; 2585 } 2586 return OopTrue; 2587 unflat_234= OopNOTREACHED; 2588 /*(234)*/ } 2589 /*END*/ return v_self; 2590 } (gdb) l block_236 2546 static Function Obj_block_236; 2547 2548 static oop block_236(PARM_VAT 2549 Closure* closure 2550 2551 ) { 2552 oop v_self= closure->f_myself; 2553 oop octx_000= closure->f_context; 2554 ///===contextStack=== an OrderedCollection() 2555 C_Dictionary* self= (C_Dictionary*) OopToHeader(v_self); (gdb) 2556 // {[^ false]} 2557 oop unflat_237= OopNil; 2558 /*(237)*/ { 2559 return OopFalse; 2560 unflat_237= OopNOTREACHED; 2561 /*(237)*/ } 2562 /*END*/ return unflat_237; 2563 ERROR: AddVatErrorString(PASS_VAT Name_block_236 ); 2564 return OopGOTO; 2565 } (gdb) 2566 oop Func_Dictionary_includesKey$58$(PARM_VAT oop v_self, Symbol* selector, oop v_t1/*tempVar*/) { 2567 { 2568 // includesKey: t1 self at: t1 ifAbsent: [^ false]. ^ true 2569 C_Dictionary* self= (C_Dictionary*) OopToHeader(v_self); 2570 oop unflat_234= OopNil; 2571 /*(234)*/ { 2572 // {self at: t1 ifAbsent: [^ false]} 2573 oop send_235= OopNil; 2574 { 2575 oop oclosure_236= BasicNew(PASS_VAT &ClosureType); (gdb) 2576 Closure* closure_236= (Closure*) OopToHeader( oclosure_236); 2577 closure_236->f_function= OopFromHeader( & Obj_block_236 ); 2578 closure_236->f_context= 0; 2579 closure_236->f_myself= v_self; 2580 word typeNumber= OopToTypeNumber(v_self); 2581 BIND_CACHE( Cache[104], typeNumber, SymbolTable[83654] ); /* at:ifAbsent: */ 2582 FUNC2* f= (FUNC2*) Cache[104].func; 2583 send_235= f(PASS_VAT v_self, SymbolTable[83654], v_t1/*tempVar*/, oclosure_236); 2584 if (!send_235) goto ERROR; 2585 } (gdb) 2586 return OopTrue; 2587 unflat_234= OopNOTREACHED; 2588 /*(234)*/ } 2589 /*END*/ return v_self; 2590 } 2591 ERROR: 2592 AddVatErrorString(PASS_VAT "in Dictionary>>includesKey: ..."); 2593 return (oop)0; 2594 } 2595 Function F_Func_Dictionary_includesKey$58$; (gdb) where #0 Func_Dictionary_includesKey$58$ (vat=0x8ea4868, v_self=0x8e5f3f4, selector=0x8d44470, v_t1=0x15) at _Dictionary.cc:2586 #1 0x0855a23d in Func_Bag_includes$58$ (vat=0x8ea4868, v_self=0x8e5f3e8, selector=0x8d44550, v_t1=0x15) at _Bag.cc:761 #2 0x0855a2ea in Func_Bag_occurrencesOf$58$ (vat=0x8ea4868, v_self=0x8e5f3e8, selector=0x8d4b180, v_t1=0x15) at _Bag.cc:789 #3 0x00137246 in block_91 (vat=0x8ea4868, closure=0x8e5fc4c) at __CinnabarTestCollections.cc:618 #4 0x0811672d in Prim_Closure_value (vat=0x8ea4868, closure=0x8e5fc4c, selector=0x0) at cinnabar.cc:324 #5 0x08119b67 in Prim_Closure_assert (vat=0x8ea4868, closure=0x8e5fc4c, selector=0x8d365a0) at cinnabar.cc:397 #6 0x001374d1 in block_87 (vat=0x8ea4868, closure=0x8e5fc24, v_t2=0x15) at __CinnabarTestCollections.cc:678 #7 0x08116955 in Prim_Closure_valueColon (vat=0x8ea4868, closure=0x8e5fc24, selector=0x8d581a8, arg1=0x15) at cinnabar.cc:342 #8 0x082d7e56 in Func_SequenceableCollection_do$58$ (vat=0x8ea4868, v_self=0x8e57654, selector=0x8d3ef00, v_t1=0x8e5fc24) at _SequenceableCollection.cc:5926 #9 0x001378dc in Func_CinnabarTestCollections_ttestBag (vat=0x8ea4868, v_self=0x8ea4970, selector=0x8e715e0) at __CinnabarTestCollections.cc:771 #10 0x0811953b in RunAllTTests () at cinnabar.cc:722 #11 0x081197ae in main (argc=9, argv=0xbfc15694) at cinnabar.cc:777 (gdb)