[commit] r2380 - Fix snafu in cloneContext:.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2380 - Fix snafu in cloneContext:.

commits-3
 
Author: eliot
Date: 2011-04-26 17:58:52 -0700 (Tue, 26 Apr 2011)
New Revision: 2380

Modified:
   branches/Cog/image/VMMaker-Squeak4.1.changes
   branches/Cog/image/VMMaker-Squeak4.1.image
   branches/Cog/src/vm/cointerp.c
   branches/Cog/src/vm/cointerp.h
   branches/Cog/src/vm/gcc3x-cointerp.c
Log:
Fix snafu in cloneContext:.


Modified: branches/Cog/image/VMMaker-Squeak4.1.changes
===================================================================
--- branches/Cog/image/VMMaker-Squeak4.1.changes 2011-04-26 19:24:15 UTC (rev 2379)
+++ branches/Cog/image/VMMaker-Squeak4.1.changes 2011-04-27 00:58:52 UTC (rev 2380)
@@ -178239,4 +178239,48 @@
 
 "VMMaker"!
 
-----QUIT----{26 April 2011 . 12:13:26 pm} VMMaker-Squeak4.1.image priorSource: 7348282!
\ No newline at end of file
+----QUIT----{26 April 2011 . 12:13:26 pm} VMMaker-Squeak4.1.image priorSource: 7348282!
+
+----STARTUP----{26 April 2011 . 5:47:26 pm} as /Users/eliot/Cog/oscogvm/image/VMMaker-Squeak4.1.image!
+
+!StackInterpreterPrimitives methodsFor: 'primitive support' stamp: 'eem 4/26/2011 17:45' prior: 40904700!
+cloneContext: aContext
+ | cloned spouseFP sp |
+ <var: #spouseFP type: #'char *'>
+ cloned := objectMemory clone: aContext.
+ cloned ~= 0 ifTrue:
+ [0 to: StackPointerIndex do:
+ [:i|
+ objectMemory
+ storePointerUnchecked: i
+ ofObject: cloned
+ withValue: (self externalInstVar: i ofContext: aContext)].
+ MethodIndex to: ReceiverIndex do:
+ [:i|
+ objectMemory
+ storePointerUnchecked: i
+ ofObject: cloned
+ withValue: (self fetchPointer: i ofObject: aContext)].
+ (self isStillMarriedContext: aContext)
+ ifTrue:
+ [spouseFP := self frameOfMarriedContext: aContext.
+ sp := (self stackPointerIndexForFrame: spouseFP) - 1.
+ 0 to: sp do:
+ [:i|
+ objectMemory
+ storePointerUnchecked: i + CtxtTempFrameStart
+ ofObject: cloned
+ withValue: (self temporary: i in: spouseFP)]]
+ ifFalse:
+ [sp := (self fetchStackPointerOf: aContext) - 1.
+ 0 to: sp do:
+ [:i|
+ objectMemory
+ storePointerUnchecked: i + CtxtTempFrameStart
+ ofObject: cloned
+ withValue: (self fetchPointer: i + CtxtTempFrameStart ofObject: aContext)]]].
+ ^cloned! !
+
+"VMMaker"!
+
+----QUIT----{26 April 2011 . 5:54:49 pm} VMMaker-Squeak4.1.image priorSource: 7357300!
\ No newline at end of file

Modified: branches/Cog/image/VMMaker-Squeak4.1.image
===================================================================
(Binary files differ)

Modified: branches/Cog/src/vm/cointerp.c
===================================================================
--- branches/Cog/src/vm/cointerp.c 2011-04-26 19:24:15 UTC (rev 2379)
+++ branches/Cog/src/vm/cointerp.c 2011-04-27 00:58:52 UTC (rev 2380)
@@ -1,9 +1,9 @@
 /* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430
    from
- CoInterpreter VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b
+ CoInterpreter VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1865,7 +1865,7 @@
  /* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.55]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.56]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 static volatile int sendTrace;
 
@@ -24286,12 +24286,9 @@
  else {
  sp1 = (fetchStackPointerOf(receiver)) - 1;
  for (i = 0; i <= sp1; i += 1) {
- longAtput((cloned + BaseHeaderSize) + ((i + CtxtTempFrameStart) << ShiftForWord), longAt((receiver + BaseHeaderSize) + (i << ShiftForWord)));
+ longAtput((cloned + BaseHeaderSize) + ((i + CtxtTempFrameStart) << ShiftForWord), longAt((receiver + BaseHeaderSize) + ((i + CtxtTempFrameStart) << ShiftForWord)));
  }
  }
- for (i = ((sp1 + CtxtTempFrameStart) + 1); i <= ((lengthOf(receiver)) - 1); i += 1) {
- longAtput((cloned + BaseHeaderSize) + (i << ShiftForWord), GIV(nilObj));
- }
  }
  newCopy = cloned;
  }

Modified: branches/Cog/src/vm/cointerp.h
===================================================================
--- branches/Cog/src/vm/cointerp.h 2011-04-26 19:24:15 UTC (rev 2379)
+++ branches/Cog/src/vm/cointerp.h 2011-04-27 00:58:52 UTC (rev 2380)
@@ -1,5 +1,5 @@
 /* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430
  */
 
 

Modified: branches/Cog/src/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/src/vm/gcc3x-cointerp.c 2011-04-26 19:24:15 UTC (rev 2379)
+++ branches/Cog/src/vm/gcc3x-cointerp.c 2011-04-27 00:58:52 UTC (rev 2380)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430
    from
- CoInterpreter VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b
+ CoInterpreter VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.55 uuid: 315353fc-7f75-4b5b-8a43-3a636cb1aa0b " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.56 uuid: fbf17bd2-ddbc-488f-b70d-3b9ba8906430 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1868,7 +1868,7 @@
  /* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.55]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.56]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 static volatile int sendTrace;
 
@@ -24290,12 +24290,9 @@
  else {
  sp1 = (fetchStackPointerOf(receiver)) - 1;
  for (i = 0; i <= sp1; i += 1) {
- longAtput((cloned + BaseHeaderSize) + ((i + CtxtTempFrameStart) << ShiftForWord), longAt((receiver + BaseHeaderSize) + (i << ShiftForWord)));
+ longAtput((cloned + BaseHeaderSize) + ((i + CtxtTempFrameStart) << ShiftForWord), longAt((receiver + BaseHeaderSize) + ((i + CtxtTempFrameStart) << ShiftForWord)));
  }
  }
- for (i = ((sp1 + CtxtTempFrameStart) + 1); i <= ((lengthOf(receiver)) - 1); i += 1) {
- longAtput((cloned + BaseHeaderSize) + (i << ShiftForWord), GIV(nilObj));
- }
  }
  newCopy = cloned;
  }