Object.st
branchjv
changeset 18261 22bdfc405bca
parent 18259 e8ad15456505
parent 18254 aba026de53b8
child 18274 042d13555f1f
--- a/Object.st	Tue Apr 21 17:27:23 2015 +0100
+++ b/Object.st	Wed Apr 22 07:33:07 2015 +0100
@@ -808,7 +808,7 @@
      This method should NOT be redefined in any subclass (except with great care, for tuning)"
 
 %{  /* NOCONTEXT */
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
     {
 	int idx1Based = context.stArg(0).intValue();   // st index is 1 based
 	return context.RETURN( self.basicAt( idx1Based ));
@@ -1071,7 +1071,7 @@
 		break;
 	}
     }
-#endif /* ! __JAVA__ */
+#endif /* ! __SCHTEAM__ */
 %}.
     ^ self indexNotIntegerOrOutOfBounds:index
 !
@@ -1084,7 +1084,7 @@
      This method should NOT be redefined in any subclass (except with great care, for tuning)"
 
 %{  /* NOCONTEXT */
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
     {
 	int idx1Based = context.stArg(0).intValue();   // st index is 1 based
 	STObject val = context.stArg(1);
@@ -1367,7 +1367,7 @@
 		break;
 	}
     }
-#endif /* ! JAVA */
+#endif /* ! __SCHTEAM__ */
 %}.
     index isInteger ifFalse:[
 	"
@@ -1548,7 +1548,9 @@
      - use with care (needed for copy, inspector etc.)"
 
 %{  /* NOCONTEXT */
-
+#ifdef __SCHTEAM__
+    return context._RETURN( self.instVarAt(index.intValue()-1) );
+#else
     OBJ myClass;
     int idx, ninstvars;
 
@@ -1570,6 +1572,7 @@
 	    RETURN ( __InstPtr(self)->i_instvars[idx] );
 	}
     }
+#endif /* not SCHTEAM */
 %}.
     ^ self indexNotIntegerOrOutOfBounds:index
 !
@@ -1580,7 +1583,10 @@
      - use with care (needed for copy, inspector etc.)"
 
 %{  /* NOCONTEXT */
-
+#ifdef __SCHTEAM__
+    self.instVarAt_put(index.intValue()-1, value);
+    return context._RETURN( value );
+#else
     OBJ myClass;
     int idx, ninstvars;
 
@@ -1604,6 +1610,7 @@
 	    RETURN ( value );
 	}
     }
+#endif /* not SCHTEAM */
 %}.
     ^ self indexNotIntegerOrOutOfBounds:index
 !
@@ -1715,7 +1722,9 @@
 !
 
 nilAllInstvars
-    "overwrite all inst vars of the object with nil."
+    "overwrite all inst vars of the object with nil.
+     Used by the crypto package to clear objects with
+     keys when no longer in use."
 
 %{  /* NOCONTEXT */
     int flags;
@@ -2067,7 +2076,7 @@
 	- redefining it may not work as expected."
 
 %{  /* NOCONTEXT */
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
     return context._RETURN( (self == context.stArg(0)) ? STObject.True : STObject.False );
 #else
     RETURN ( (self == anObject) ? true : false );
@@ -2294,7 +2303,7 @@
 	- redefining it may not work as expected."
 
 %{  /* NOCONTEXT */
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
     return context._RETURN( (self == context.stArg(0)) ? STObject.False : STObject.True );
 #else
     RETURN ( (self == anObject) ? false : true );
@@ -5490,7 +5499,8 @@
     <resource: #skipInDebuggersWalkBack>
 
 %{
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
+    return context.PERFORM(self, aSelector);
 #else
     REGISTER OBJ sel = aSelector;
     int hash0;
@@ -5562,7 +5572,7 @@
 	static struct inlineCache ilc0 = __DUMMYILCSELF0(@line+1);
 	RETURN (_SEND0(self, aSelector, nil, &ilc0));
     }
-#endif /* not JAVA */
+#endif /* not __SCHTEAM__ */
 %}.
     ^ self perform:aSelector withArguments:#()
 !
@@ -5592,7 +5602,7 @@
 	^ nil
     ].
 %{
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
 #else
     REGISTER OBJ *argP;
     int nargs, i;
@@ -5763,7 +5773,7 @@
 
     }
 bad:;
-#endif /* not JAVA */
+#endif /* not __SCHTEAM__ */
 %}.
     "/ arrive here, if bad number of arguments (too many)
     "/ ST/X (currently) only allows up to 15 method arguments
@@ -5775,7 +5785,8 @@
     "send the one-arg-message aSelector to the receiver"
 
 %{
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
+    return context.PERFORM_WITH(self, aSelector, arg);
 #else
     REGISTER OBJ sel = aSelector;
     int hash0;
@@ -5849,7 +5860,7 @@
 	static struct inlineCache ilc1 = __DUMMYILCSELF1(@line+1);
 	RETURN (_SEND1(self, aSelector, nil, &ilc1, arg));
     }
-#endif /* not JAVA */
+#endif /* not __SCHTEAM__ */
 %}.
     ^ self perform:aSelector withArguments:(Array with:arg)
 !
@@ -5858,8 +5869,6 @@
     "send the two-arg-message aSelector to the receiver"
 
 %{
-#ifndef __JAVA__
-#else
     REGISTER OBJ sel = aSelector;
     struct inlineCache *pIlc;
     int hash0;
@@ -5932,7 +5941,6 @@
 	static struct inlineCache ilc2 = __DUMMYILCSELF2(@line+1);
 	RETURN (_SEND2(self, aSelector, nil, &ilc2, arg1, arg2));
     }
-#endif /* not JAVA */
 %}.
     ^ self perform:aSelector withArguments:(Array with:arg1 with:arg2)
 !
@@ -5941,8 +5949,6 @@
     "send the three-arg-message aSelector to the receiver"
 
 %{
-#ifndef __JAVA__
-#else
     struct inlineCache *pIlc;
     static struct inlineCache ilc_0 = __ILCPERF3(@line);
     static struct inlineCache ilc_1 = __ILCPERF3(@line);
@@ -5978,7 +5984,6 @@
 	static struct inlineCache ilc3 = __DUMMYILCSELF3(@line+1);
 	RETURN (_SEND3(self, aSelector, nil, &ilc3, arg1, arg2, arg3));
     }
-#endif
 %}.
     ^ self perform:aSelector withArguments:(Array with:arg1 with:arg2 with:arg3)
 
@@ -6132,6 +6137,9 @@
     |numberOfArgs a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15|
 
 %{
+#ifdef __SCHTEAM__
+    return context.PERFORM_WITH_ARGUMENTS(self, aSelector, argArray);
+#else
     REGISTER OBJ *argP;
     int nargs;
     OBJ l;
@@ -6531,6 +6539,7 @@
 	    }
     }
 bad:;
+#endif
 %}.
 
     "/ arrive here, if bad number of arguments (too many)
@@ -7732,7 +7741,7 @@
      This method should NOT be redefined in any subclass (except with great care, for tuning)"
 
 %{  /* NOCONTEXT */
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
     return context.RETURN( STInteger._new( self.basicSize() ) );
 #else
     REGISTER INT nbytes;
@@ -7787,7 +7796,7 @@
 	    nbytes -= nInstBytes;
 	    RETURN ( __mkSmallInteger(nbytes>>3) ); /* notice the hardcoded 8 here - not sizeof(long long) */
     }
-#endif /* not JAVA */
+#endif /* not __SCHTEAM__ */
 %}.
     ^ 0
 !
@@ -7851,7 +7860,7 @@
     "return the receivers class"
 
 %{  /* NOCONTEXT */
-#ifdef __JAVA__
+#ifdef __SCHTEAM__
     return context._RETURN(self.clazz());
 #else
     RETURN ( __Class(self) );
@@ -10259,11 +10268,11 @@
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.797 2015-04-19 13:55:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.800 2015-04-21 19:40:51 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.797 2015-04-19 13:55:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.800 2015-04-21 19:40:51 cg Exp $'
 !
 
 version_HG