[commit] r2515 - CogVM source as per VMMaker.oscog-eem.139.

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

[commit] r2515 - CogVM source as per VMMaker.oscog-eem.139.

commits-3
 
Author: eliot
Date: 2011-11-18 10:13:10 -0800 (Fri, 18 Nov 2011)
New Revision: 2515

Modified:
   branches/Cog/nscogsrc/vm/cogit.c
   branches/Cog/nscogsrc/vm/cogit.h
   branches/Cog/nscogsrc/vm/cogmethod.h
   branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
   branches/Cog/src/vm/cogit.c
   branches/Cog/src/vm/cogit.h
   branches/Cog/src/vm/cogmethod.h
Log:
CogVM source as per VMMaker.oscog-eem.139.
Replace bogus fix for frameless foo: arg instVar := instVar code gen
bug (apparent failure to pop spills on frameless return), with correct
fix, which is not to flush the top of stack when pop/storing receiver
and/or temp vars.  i.e. ssFlushUpThroughReceiverVariable: &
ssFlushUpThroughTemporaryVariable: skip the entry at simStackPtr.


Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c 2011-11-18 01:18:02 UTC (rev 2514)
+++ branches/Cog/nscogsrc/vm/cogit.c 2011-11-18 18:13:10 UTC (rev 2515)
@@ -1,9 +1,9 @@
 /* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ CCodeGenerator VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
    from
- StackToRegisterMappingCogit VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ StackToRegisterMappingCogit VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -805,7 +805,6 @@
 sqInt isSendReturnPC(sqInt retpc);
 static sqInt isSmallIntegerTagNonZero(void);
 static sqInt isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch);
-static sqInt isValidFramelessRegister(sqInt reg);
 static AbstractInstruction * gJumpFPEqual(void *jumpTarget);
 static AbstractInstruction * gJumpFPGreaterOrEqual(void *jumpTarget);
 static AbstractInstruction * gJumpFPGreater(void *jumpTarget);
@@ -964,7 +963,6 @@
 static void ssFlushTo(sqInt index);
 static void ssFlushUpThroughReceiverVariable(sqInt slotIndex);
 static void ssFlushUpThroughTemporaryVariable(sqInt tempIndex);
-static void ssPopSpillsFrom(sqInt index);
 static void ssPop(sqInt n);
 static sqInt ssPushAnnotatedConstant(sqInt literal);
 static sqInt ssPushBaseoffset(sqInt reg, sqInt offset);
@@ -12495,7 +12493,6 @@
  genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord);
  }
  else {
- ssPopSpillsFrom(methodOrBlockNumArgs - 1);
  /* begin RetN: */
  offset = ((methodOrBlockNumArgs > (numRegArgs()))
  || (regArgsHaveBeenPushed)
@@ -13257,16 +13254,6 @@
 }
 
 
-/* Answer if the receiver is valid in a frameless method. */
-
-static sqInt
-isValidFramelessRegister(sqInt reg)
-{
- return (reg == ReceiverResultReg)
- || (reg == Arg0Reg);
-}
-
-
 /* Floating-point jumps are a little weird on some processors. Defer to
  the backEnd to allow it to generate any special code it may need to. */
 
@@ -16552,10 +16539,7 @@
  }
  if (simSpillBase <= index) {
  for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= index; i += 1) {
- assert(needsFrame
- || (((((simStackAt(i)->type)) == SSBaseOffset)
- || (((simStackAt(i)->type)) == SSRegister))
- && (isValidFramelessRegister((simStackAt(i)->registerr)))));
+ assert(needsFrame);
  ensureSpilledAtfrom(simStackAt(i), frameOffsetOfTemporary(i), FPReg);
  }
  simSpillBase = index + 1;
@@ -16563,8 +16547,9 @@
 }
 
 
-/* Any occurrences on the stack of the value being stored must
- be flushed, and hence any values colder than them stack. */
+/* Any occurrences on the stack of the value being stored (which is the top
+ of stack)
+ must be flushed, and hence any values colder than them stack. */
 
 static void
 ssFlushUpThroughReceiverVariable(sqInt slotIndex)
@@ -16572,7 +16557,7 @@
     CogSimStackEntry *desc;
     sqInt index;
 
- for (index = simStackPtr; index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) {
+ for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) {
  desc = simStackAt(index);
  if ((((desc->type)) == SSBaseOffset)
  && ((((desc->registerr)) == ReceiverResultReg)
@@ -16584,8 +16569,9 @@
 }
 
 
-/* Any occurrences on the stack of the value being stored must
- be flushed, and hence any values colder than them stack. */
+/* Any occurrences on the stack of the value being stored (which is the top
+ of stack)
+ must be flushed, and hence any values colder than them stack. */
 
 static void
 ssFlushUpThroughTemporaryVariable(sqInt tempIndex)
@@ -16593,7 +16579,7 @@
     CogSimStackEntry *desc;
     sqInt index;
 
- for (index = simStackPtr; index >= simSpillBase; index += -1) {
+ for (index = (simStackPtr - 1); index >= simSpillBase; index += -1) {
  desc = simStackAt(index);
  if ((((desc->type)) == SSBaseOffset)
  && ((((desc->registerr)) == FPReg)
@@ -16604,24 +16590,7 @@
  }
 }
 
-
-/* Pop any spilled items on the sim stack from index, used to balance the
- stack on return.
- */
-
 static void
-ssPopSpillsFrom(sqInt index)
-{
-    sqInt i;
-
- for (i = index; i <= simStackPtr; i += 1) {
- if ((simStackAt(i)->spilled)) {
- popToReg(ssTop(), TempReg);
- }
- }
-}
-
-static void
 ssPop(sqInt n)
 {
  assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1))

Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2011-11-18 01:18:02 UTC (rev 2514)
+++ branches/Cog/nscogsrc/vm/cogit.h 2011-11-18 18:13:10 UTC (rev 2515)
@@ -1,5 +1,5 @@
 /* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ CCodeGenerator VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
  */
 
 

Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h 2011-11-18 01:18:02 UTC (rev 2514)
+++ branches/Cog/nscogsrc/vm/cogmethod.h 2011-11-18 18:13:10 UTC (rev 2515)
@@ -1,5 +1,5 @@
 /* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ CCodeGenerator VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
  */
 
 typedef struct {


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Thu Nov 17 17:17:12 PST 2011
   + Fri Nov 18 10:11:32 PST 2011

Modified: branches/Cog/src/vm/cogit.c
===================================================================
--- branches/Cog/src/vm/cogit.c 2011-11-18 01:18:02 UTC (rev 2514)
+++ branches/Cog/src/vm/cogit.c 2011-11-18 18:13:10 UTC (rev 2515)
@@ -1,9 +1,9 @@
 /* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ CCodeGenerator VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
    from
- StackToRegisterMappingCogit VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ StackToRegisterMappingCogit VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -798,7 +798,6 @@
 sqInt isSendReturnPC(sqInt retpc);
 static sqInt isSmallIntegerTagNonZero(void);
 static sqInt isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch);
-static sqInt isValidFramelessRegister(sqInt reg);
 static AbstractInstruction * gJumpFPEqual(void *jumpTarget);
 static AbstractInstruction * gJumpFPGreaterOrEqual(void *jumpTarget);
 static AbstractInstruction * gJumpFPGreater(void *jumpTarget);
@@ -952,7 +951,6 @@
 static void ssFlushTo(sqInt index);
 static void ssFlushUpThroughReceiverVariable(sqInt slotIndex);
 static void ssFlushUpThroughTemporaryVariable(sqInt tempIndex);
-static void ssPopSpillsFrom(sqInt index);
 static void ssPop(sqInt n);
 static sqInt ssPushAnnotatedConstant(sqInt literal);
 static sqInt ssPushBaseoffset(sqInt reg, sqInt offset);
@@ -12283,7 +12281,6 @@
  genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord);
  }
  else {
- ssPopSpillsFrom(methodOrBlockNumArgs - 1);
  /* begin RetN: */
  offset = ((methodOrBlockNumArgs > (numRegArgs()))
  || (regArgsHaveBeenPushed)
@@ -13045,16 +13042,6 @@
 }
 
 
-/* Answer if the receiver is valid in a frameless method. */
-
-static sqInt
-isValidFramelessRegister(sqInt reg)
-{
- return (reg == ReceiverResultReg)
- || (reg == Arg0Reg);
-}
-
-
 /* Floating-point jumps are a little weird on some processors. Defer to
  the backEnd to allow it to generate any special code it may need to. */
 
@@ -16067,10 +16054,7 @@
  }
  if (simSpillBase <= index) {
  for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= index; i += 1) {
- assert(needsFrame
- || (((((simStackAt(i)->type)) == SSBaseOffset)
- || (((simStackAt(i)->type)) == SSRegister))
- && (isValidFramelessRegister((simStackAt(i)->registerr)))));
+ assert(needsFrame);
  ensureSpilledAtfrom(simStackAt(i), frameOffsetOfTemporary(i), FPReg);
  }
  simSpillBase = index + 1;
@@ -16078,8 +16062,9 @@
 }
 
 
-/* Any occurrences on the stack of the value being stored must
- be flushed, and hence any values colder than them stack. */
+/* Any occurrences on the stack of the value being stored (which is the top
+ of stack)
+ must be flushed, and hence any values colder than them stack. */
 
 static void
 ssFlushUpThroughReceiverVariable(sqInt slotIndex)
@@ -16087,7 +16072,7 @@
     CogSimStackEntry *desc;
     sqInt index;
 
- for (index = simStackPtr; index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) {
+ for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) {
  desc = simStackAt(index);
  if ((((desc->type)) == SSBaseOffset)
  && ((((desc->registerr)) == ReceiverResultReg)
@@ -16099,8 +16084,9 @@
 }
 
 
-/* Any occurrences on the stack of the value being stored must
- be flushed, and hence any values colder than them stack. */
+/* Any occurrences on the stack of the value being stored (which is the top
+ of stack)
+ must be flushed, and hence any values colder than them stack. */
 
 static void
 ssFlushUpThroughTemporaryVariable(sqInt tempIndex)
@@ -16108,7 +16094,7 @@
     CogSimStackEntry *desc;
     sqInt index;
 
- for (index = simStackPtr; index >= simSpillBase; index += -1) {
+ for (index = (simStackPtr - 1); index >= simSpillBase; index += -1) {
  desc = simStackAt(index);
  if ((((desc->type)) == SSBaseOffset)
  && ((((desc->registerr)) == FPReg)
@@ -16119,24 +16105,7 @@
  }
 }
 
-
-/* Pop any spilled items on the sim stack from index, used to balance the
- stack on return.
- */
-
 static void
-ssPopSpillsFrom(sqInt index)
-{
-    sqInt i;
-
- for (i = index; i <= simStackPtr; i += 1) {
- if ((simStackAt(i)->spilled)) {
- popToReg(ssTop(), TempReg);
- }
- }
-}
-
-static void
 ssPop(sqInt n)
 {
  assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1))

Modified: branches/Cog/src/vm/cogit.h
===================================================================
--- branches/Cog/src/vm/cogit.h 2011-11-18 01:18:02 UTC (rev 2514)
+++ branches/Cog/src/vm/cogit.h 2011-11-18 18:13:10 UTC (rev 2515)
@@ -1,5 +1,5 @@
 /* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ CCodeGenerator VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
  */
 
 

Modified: branches/Cog/src/vm/cogmethod.h
===================================================================
--- branches/Cog/src/vm/cogmethod.h 2011-11-18 01:18:02 UTC (rev 2514)
+++ branches/Cog/src/vm/cogmethod.h 2011-11-18 18:13:10 UTC (rev 2515)
@@ -1,5 +1,5 @@
 /* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
+ CCodeGenerator VMMaker.oscog-eem.139 uuid: c2849383-9768-4948-b9b2-a5c22d482b07
  */
 
 typedef struct {