CompiledCode.st
branchjv
changeset 25415 4ea1fe7c363f
parent 23107 40173e082cbc
--- a/CompiledCode.st	Thu May 13 11:26:34 2021 +0100
+++ b/CompiledCode.st	Mon Aug 31 11:59:30 2020 +0100
@@ -51,7 +51,7 @@
     [Instance variables:]
 
       flags       <SmallInteger>    special flag bits coded in a number
-      byteCode    <ByteArray>       bytecode if its an interpreted codeobject
+      byteCode    <ByteArray>       bytecode if it's an interpreted codeobject
 
       The block/methods literals are stored in the indexed instance variables.
       If there is only one indexed instvar, it contains a reference to an
@@ -232,7 +232,7 @@
 !CompiledCode methodsFor:'Compatibility-ST80'!
 
 getSource
-    "return the code objects source code, nil if none is available"
+    "return the code object's source code, nil if none is available"
 
     ^ self source.
 
@@ -240,7 +240,7 @@
 !
 
 getSourceForUserIfNone:aBlock
-    "return the code objects source code.
+    "return the code object's source code.
      If none is available, return the result from evaluating aBlock."
 
     |src|
@@ -266,7 +266,7 @@
 !
 
 sourceString
-    "return the code objects source code, nil if none is available"
+    "return the code object's source code, nil if none is available"
 
     ^ self source.
 
@@ -359,7 +359,7 @@
 do:aBlock
     "same as #literalsDo:, in order to get common protocol with Array"
 
-    ^ self literalsDo:aBlock
+    self literalsDo:aBlock
 
     "Modified: 25.6.1996 / 22:16:44 / stefan"
 !
@@ -376,10 +376,12 @@
 
 homeMethod
     "for common protocol with blocks: if the receiver is a method,
-     return the receiver; otherwise, if its a block, return its home
+     return the receiver; otherwise, if it's a block, return its home
      method."
 
     ^ self
+
+    "Modified (comment): / 13-02-2017 / 19:58:51 / cg"
 !
 
 literalAt:index
@@ -669,7 +671,8 @@
 
 breakPointIf:conditionBlock
     "arrange for a breakpoint-debugger to be opened when this method
-     is invoked AND conditionBlock evaluates to true."
+     is invoked AND conditionBlock evaluates to true.
+     conditionBlock gets context and method as (optional) arguments."
 
     MessageTracer trapMethod:self if:conditionBlock
 
@@ -686,6 +689,26 @@
     "Created: / 30.1.1999 / 14:50:01 / cg"
 !
 
+breakPointInProcess:aProcess withChildProcesses:withChildProcessesBoolean
+    "arrange for a breakpoint-debugger to be opened when this method
+     is invoked from withn aProcess."
+
+    MessageTracer trapMethod:self inProcess:aProcess withChildProcesses:withChildProcessesBoolean.
+
+    "Modified: / 12.1.1998 / 18:22:39 / cg"
+    "Created: / 30.1.1999 / 14:50:01 / cg"
+!
+
+breakPointOnReturnIf:conditionBlock
+    "arrange for a breakpoint-debugger to be opened when this method
+     returns AND conditionBlock evaluates to true.
+     conditionBlock gets returnValue, context and method as (optional) arguments."
+
+    MessageTracer trapMethod:self onReturnIf:conditionBlock
+
+    "Created: / 18.8.2000 / 22:09:59 / cg"
+!
+
 clearBreakPoint
     "remove any break/trace-point on this method"
 
@@ -732,10 +755,12 @@
 !
 
 isTiming
-    "return true, if timiing statistics are being gathered on this method."
+    "return true if timing statistics are being gathered on this method."
 
     ^ MessageTracer notNil
       and:[MessageTracer isTiming:self]
+
+    "Modified (comment): / 08-06-2017 / 14:01:59 / mawalch"
 !
 
 resetCountingStatistics
@@ -775,14 +800,34 @@
     "Created: / 30.1.1999 / 14:50:27 / cg"
 !
 
-setTraceFullPoint
+setFullTracePoint
     "arrange for a full-backtrace to be sent to the standard-error stream
      when this method is invoked."
 
     MessageTracer traceMethodFull:self on:Transcript
 
-    "Modified: / 12.1.1998 / 18:23:11 / cg"
-    "Created: / 30.1.1999 / 14:50:30 / cg"
+    "Created: / 29-06-2019 / 08:51:01 / Claus Gittinger"
+!
+
+setFullTracePointInProcess:aProcess
+    "arrange for a full-backtrace to be sent to the standard-error stream
+     when this method is invoked by the given process."
+
+    MessageTracer traceMethodFull:self inProcess:aProcess on:Transcript
+
+    "Created: / 29-06-2019 / 08:52:55 / Claus Gittinger"
+!
+
+setTraceFullPoint
+    <resource: #obsolete>
+    "arrange for a full-backtrace to be sent to the standard-error stream
+     when this method is invoked."
+
+    self setFullTracePoint
+
+    "Modified: / 12-01-1998 / 18:23:11 / cg"
+    "Created: / 30-01-1999 / 14:50:30 / cg"
+    "Modified: / 29-06-2019 / 08:51:41 / Claus Gittinger"
 !
 
 setTracePoint
@@ -1037,89 +1082,117 @@
 
 !CompiledCode methodsFor:'executing'!
 
-valueWithReceiver:anObject arguments:argArray
-    "low level call of a methods code - BIG DANGER ALERT.
-     Perform the receiver-method on anObject as receiver and argArray as
-     arguments. This does NO message lookup at all and mimics a
-     traditional function call.
+valueWithReceiver:anObject
+    "low level call of a method's code - BIG DANGER ALERT.
+     Perform the receiver-method on anObject as receiver and no arguments. 
+     This does NO message lookup at all and mimics a traditional function call.
      This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
      experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its
-     superclasses and also, the number of arguments given must match the methods
+     The receiver must be a method compiled in anObject's class or one of its
+     superclasses and also, the number of arguments given must match the method's
+     expectations -
+     - otherwise strange things (and also strange crashes) can occur.
+     The system is NOT always detecting a wrong method/receiver combination.
+     YOU HAVE BEEN WARNED."
+
+    ^ self
+        valueWithReceiver:anObject
+        arguments:nil
+        selector:nil
+        search:nil
+        sender:nil
+
+    "Created: / 25-06-2019 / 09:13:02 / Claus Gittinger"
+!
+
+valueWithReceiver:anObject arguments:argArray
+    "low level call of a method's code - BIG DANGER ALERT.
+     Perform the receiver-method on anObject as receiver and argArray as arguments. 
+     This does NO message lookup at all and mimics a traditional function call.
+     This method is provided for debugging- and breakpoint-support
+     (replacing a method by a stub and recalling the original), or to implement
+     experimental MI implementations - it is not for general use.
+
+     The receiver must be a method compiled in anObject's class or one of its
+     superclasses and also, the number of arguments given must match the method's
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
      The system is NOT always detecting a wrong method/receiver combination.
      YOU HAVE BEEN WARNED."
 
     ^ self
-	valueWithReceiver:anObject
-	arguments:argArray
-	selector:nil
-	search:nil
-	sender:nil
-
-    "Modified: 4.4.1997 / 23:33:56 / cg"
-    "Created: 30.7.1997 / 12:04:52 / cg"
+        valueWithReceiver:anObject
+        arguments:argArray
+        selector:nil
+        search:nil
+        sender:nil
+
+    "Modified: / 04-04-1997 / 23:33:56 / cg"
+    "Created: / 30-07-1997 / 12:04:52 / cg"
+    "Modified (comment): / 21-11-2017 / 13:00:13 / cg"
+    "Modified (comment): / 25-06-2019 / 09:43:32 / Claus Gittinger"
 !
 
 valueWithReceiver:anObject arguments:argArray selector:aSymbol
-    "low level call of a methods code - BIG DANGER ALERT.
-     Perform the receiver-method on anObject as receiver and argArray as
-     arguments. This does NO message lookup at all and mimics a
-     traditional function call.
+    "low level call of a method's code - BIG DANGER ALERT.
+     Perform the receiver-method on anObject as receiver and argArray as arguments. 
+     This does NO message lookup at all and mimics a traditional function call.
      This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
      experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its
-     superclasses and also, the number of arguments given must match the methods
+     The receiver must be a method compiled in anObject's class or one of its
+     superclasses and also, the number of arguments given must match the method's
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
      The system is NOT always detecting a wrong method/receiver combination.
      YOU HAVE BEEN WARNED."
 
     ^ self
-	valueWithReceiver:anObject
-	arguments:argArray
-	selector:aSymbol
-	search:nil
-	sender:nil
-
-    "Modified: 4.4.1997 / 23:34:08 / cg"
-    "Created: 30.7.1997 / 12:04:49 / cg"
+        valueWithReceiver:anObject
+        arguments:argArray
+        selector:aSymbol
+        search:nil
+        sender:nil
+
+    "Modified: / 04-04-1997 / 23:34:08 / cg"
+    "Created: / 30-07-1997 / 12:04:49 / cg"
+    "Modified (comment): / 21-11-2017 / 13:00:23 / cg"
+    "Modified (comment): / 25-06-2019 / 09:43:41 / Claus Gittinger"
 !
 
 valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass
-    "low level call of a methods code - BIG DANGER ALERT.
-     Perform the receiver-method on anObject as receiver and argArray as
-     arguments. This does NO message lookup at all and mimics a
-     traditional function call.
+    "low level call of a method's code - BIG DANGER ALERT.
+     Perform the receiver-method on anObject as receiver and argArray as arguments. 
+     This does NO message lookup at all and mimics a traditional function call.
      This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
      experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its
-     superclasses and also, the number of arguments given must match the methods
+     The receiver must be a method compiled in anObject's class or one of its
+     superclasses and also, the number of arguments given must match the method's
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
      The system is NOT always detecting a wrong method/receiver combination.
      YOU HAVE BEEN WARNED."
 
     ^ self
-	valueWithReceiver:anObject
-	arguments:argArray
-	selector:aSymbol
-	search:nil
-	sender:nil
-
-    "Modified: 4.4.1997 / 23:34:19 / cg"
-    "Created: 30.7.1997 / 12:04:46 / cg"
+        valueWithReceiver:anObject
+        arguments:argArray
+        selector:aSymbol
+        search:nil
+        sender:nil
+
+    "Modified: / 04-04-1997 / 23:34:19 / cg"
+    "Created: / 30-07-1997 / 12:04:46 / cg"
+    "Modified (comment): / 21-11-2017 / 13:00:28 / cg"
+    "Modified (comment): / 25-06-2019 / 09:43:58 / Claus Gittinger"
 !
 
 valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass sender:virtualSender
-    "low level call of a methods code - BIG DANGER ALERT.
+    "low level call of a method's code - BIG DANGER ALERT.
      Perform the receiver-method on anObject as receiver and argArray as arguments.
      This does NO message lookup at all and mimics a traditional function call.
      This method is provided for debugging- and breakpoint-support
@@ -1136,24 +1209,24 @@
 %{
 #ifdef __SCHTEAM__
     {
-	int numArgs = 0;
-	STVector v = null;
-
-	if (argArray != STObject.Nil) {
-	    v = argArray.asSTVector();
-	    numArgs = v.vectorLength();
-	}
-
-	STCallable me = (STCompiledMethod)self.smalltalkCheckNumberOfArgs(1+numArgs);
-
-	__c__.push(anObject);
-	for (int i=0; i<numArgs; i++) {
-	    __c__.push( v.vectorRef(i) );
-	}
-	// the selector and searchClass args are not needed/passed
-	// the virtualSender is (currently) not supported
-	// (this is cosmetics only; therefore it's done later)
-	return __c__.TAILCALL_nPUSHED( me, 1+numArgs);
+        int numArgs = 0;
+        STVector v = null;
+
+        if (argArray != STObject.Nil) {
+            v = argArray.asSTVector();
+            numArgs = v.vectorLength();
+        }
+
+        STCallable me = (STCompiledMethod)self.smalltalkCheckNumberOfArgs(1+numArgs);
+
+        __c__.push(anObject);
+        for (int i=0; i<numArgs; i++) {
+            __c__.push( v.vectorRef(i) );
+        }
+        // the selector and searchClass args are not needed/passed
+        // the virtualSender is (currently) not supported
+        // (this is cosmetics only; therefore it's done later)
+        return __c__.TAILCALL_nPUSHED( me, 1+numArgs);
     }
     /* NOT REACHED */
 #else
@@ -1167,289 +1240,290 @@
      * args must be an array, or nil
      */
     if (__isArrayLike(argArray)) {
-	nargs = __arraySize(argArray);
-	ap = __ArrayInstPtr(argArray)->a_element;
+        nargs = __arraySize(argArray);
+        ap = __ArrayInstPtr(argArray)->a_element;
     } else {
-	if (argArray != nil) {
-	    goto badArgs;
-	}
-	nargs = 0;
-	ap = (OBJ *)0;
+        if (argArray != nil) {
+            goto badArgs;
+        }
+        nargs = 0;
+        ap = (OBJ *)0;
     }
 
 # ifdef F_NARGS
     if (((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT) == nargs)
 # endif
     {
-	code = __MethodInstPtr(self)->m_code;
-	if (aClass == nil) {
-	    searchClass = dummy.ilc_class = __Class(anObject);
-	} else {
-	    searchClass = dummy.ilc_class = aClass;
-	}
-
-	if (nargs <= 15) {
-	  OBJ rslt;
+        code = __MethodInstPtr(self)->m_code;
+        if (aClass == nil) {
+            searchClass = dummy.ilc_class = __Class(anObject);
+        } else {
+            searchClass = dummy.ilc_class = aClass;
+        }
+
+        if (nargs <= 15) {
+          OBJ rslt;
 # ifdef CONTEXT_DEBUG
-	  OBJ sav = __thisContext;
+          OBJ sav = __thisContext;
 # endif
 
-	  /*
-	   * add virtual sender (unwinding) here later,
-	   * to allow hiding contexts in lazy methods.
-	   * (this is cosmetics only; therefore its done later)
-	   */
-	  if (code) {
-	    /* compiled code */
-	    switch (nargs) {
-		case 0:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy);
-		    break;
-
-		case 1:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0]);
-		    break;
-
-		case 2:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1]);
-		    break;
-
-		case 3:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1], ap[2]);
-		    break;
-
-		case 4:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3]);
-		    break;
-
-		case 5:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4]);
-		    break;
-
-		case 6:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
-		    break;
-
-		case 7:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
-		    break;
-
-		case 8:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7]);
-		    break;
-
-		case 9:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8]);
-		    break;
-
-		case 10:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
-				 ap[9]);
-		    break;
-
-		case 11:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
-				 ap[9], ap[10]);
-		    break;
-
-		case 12:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
-				 ap[9], ap[10], ap[11]);
-		    break;
-
-		case 13:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
-				 ap[9], ap[10], ap[11], ap[12]);
-		    break;
-
-		case 14:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
-				 ap[9], ap[10], ap[11], ap[12], ap[13]);
-		    break;
-
-		case 15:
-		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
-				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
-				 ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
-		    break;
-	    }
-	  } else {
-	    /* interpreted code */
+          /*
+           * add virtual sender (unwinding) here later,
+           * to allow hiding contexts in lazy methods.
+           * (this is cosmetics only; therefore its done later)
+           */
+          if (code) {
+            /* compiled code */
+            switch (nargs) {
+                case 0:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy);
+                    break;
+
+                case 1:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0]);
+                    break;
+
+                case 2:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1]);
+                    break;
+
+                case 3:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1], ap[2]);
+                    break;
+
+                case 4:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3]);
+                    break;
+
+                case 5:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4]);
+                    break;
+
+                case 6:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
+                    break;
+
+                case 7:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
+                    break;
+
+                case 8:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7]);
+                    break;
+
+                case 9:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8]);
+                    break;
+
+                case 10:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+                                 ap[9]);
+                    break;
+
+                case 11:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+                                 ap[9], ap[10]);
+                    break;
+
+                case 12:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+                                 ap[9], ap[10], ap[11]);
+                    break;
+
+                case 13:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+                                 ap[9], ap[10], ap[11], ap[12]);
+                    break;
+
+                case 14:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+                                 ap[9], ap[10], ap[11], ap[12], ap[13]);
+                    break;
+
+                case 15:
+                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+                                 ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
+                    break;
+            }
+          } else {
+            /* interpreted code */
 # ifdef PASS_ARG_POINTER
-	    rslt = __interpret(self, nargs, anObject, aSymbol, searchClass, &dummy, ap);
+            rslt = __interpret(self, nargs, anObject, aSymbol, searchClass, &dummy, ap);
 # else
-	    switch (nargs) {
-		case 0:
-		    rslt = __interpret(self, 0, anObject, aSymbol, searchClass, &dummy);
-		    break;
-
-		case 1:
-		    rslt = __interpret(self, 1, anObject, aSymbol, searchClass, &dummy,
-				   ap[0]);
-		    break;
-
-		case 2:
-		    rslt = __interpret(self, 2, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1]);
-		    break;
-
-		case 3:
-		    rslt = __interpret(self, 3, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2]);
-		    break;
-
-		case 4:
-		    rslt = __interpret(self, 4, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3]);
-		    break;
-
-		case 5:
-		    rslt = __interpret(self, 5, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4]);
-		    break;
-
-		case 6:
-		    rslt = __interpret(self, 6, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
-		    break;
-
-		case 7:
-		    rslt = __interpret(self, 7, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
-		    break;
-
-		case 8:
-		    rslt = __interpret(self, 8, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7]);
-		    break;
-
-		case 9:
-		    rslt = __interpret(self, 9, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8]);
-		    break;
-
-		case 10:
-		    rslt = __interpret(self, 10, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8], ap[9]);
-		    break;
-
-		case 11:
-		    rslt = __interpret(self, 11, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8], ap[9], ap[10]);
-		    break;
-
-		case 12:
-		    rslt = __interpret(self, 12, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8], ap[9], ap[10], ap[11]);
-		    break;
-
-		case 13:
-		    rslt = __interpret(self, 13, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12]);
-		    break;
-
-		case 14:
-		    rslt = __interpret(self, 14, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13]);
-		    break;
-
-		case 15:
-		    rslt = __interpret(self, 15, anObject, aSymbol, searchClass, &dummy,
-				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-				   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
-		    break;
-	    }
+            switch (nargs) {
+                case 0:
+                    rslt = __interpret(self, 0, anObject, aSymbol, searchClass, &dummy);
+                    break;
+
+                case 1:
+                    rslt = __interpret(self, 1, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0]);
+                    break;
+
+                case 2:
+                    rslt = __interpret(self, 2, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1]);
+                    break;
+
+                case 3:
+                    rslt = __interpret(self, 3, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2]);
+                    break;
+
+                case 4:
+                    rslt = __interpret(self, 4, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3]);
+                    break;
+
+                case 5:
+                    rslt = __interpret(self, 5, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4]);
+                    break;
+
+                case 6:
+                    rslt = __interpret(self, 6, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
+                    break;
+
+                case 7:
+                    rslt = __interpret(self, 7, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
+                    break;
+
+                case 8:
+                    rslt = __interpret(self, 8, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7]);
+                    break;
+
+                case 9:
+                    rslt = __interpret(self, 9, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8]);
+                    break;
+
+                case 10:
+                    rslt = __interpret(self, 10, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8], ap[9]);
+                    break;
+
+                case 11:
+                    rslt = __interpret(self, 11, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8], ap[9], ap[10]);
+                    break;
+
+                case 12:
+                    rslt = __interpret(self, 12, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8], ap[9], ap[10], ap[11]);
+                    break;
+
+                case 13:
+                    rslt = __interpret(self, 13, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12]);
+                    break;
+
+                case 14:
+                    rslt = __interpret(self, 14, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13]);
+                    break;
+
+                case 15:
+                    rslt = __interpret(self, 15, anObject, aSymbol, searchClass, &dummy,
+                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
+                    break;
+            }
 # endif
-	  }
+          }
 # ifdef CONTEXT_DEBUG
-	  if (sav != __thisContext) {
-	      if (code) {
-		  printf("CONTEXT BOTCH after execution of %x\n", code);
-	      } else {
-		  printf("CONTEXT BOTCH after execution of interpreted method\n");
-		  printf("code now: %x\n", __MethodInstPtr(self)->m_code);
-	      }
-	      printf("context before:\n");
-	      __dumpObject__(sav, __LINE__);
-	      printf("context now:\n");
-	      __dumpObject__(__thisContext, __LINE__);
-	  }
+          if (sav != __thisContext) {
+              if (code) {
+                  printf("CONTEXT BOTCH after execution of %x\n", code);
+              } else {
+                  printf("CONTEXT BOTCH after execution of interpreted method\n");
+                  printf("code now: %x\n", __MethodInstPtr(self)->m_code);
+              }
+              printf("context before:\n");
+              __dumpObject__(sav, __LINE__,__FILE__);
+              printf("context now:\n");
+              __dumpObject__(__thisContext, __LINE__,__FILE__);
+          }
 # endif
-	  RETURN (rslt);
-	}
+          RETURN (rslt);
+        }
     }
     badArgs: ;
 #endif /* not SCHTEAM */
 %}.
     (argArray isArray) ifFalse:[
-	(self argumentCount ~~ 0
-	 or:[argArray notNil]) ifTrue:[
-	    "
-	     arguments must be either nil or an array
-	    "
-	    ^ self badArgumentArray:argArray
-	]
+        (self argumentCount ~~ 0
+         or:[argArray notNil]) ifTrue:[
+            "
+             arguments must be either nil or an array
+            "
+            ^ self badArgumentArray:argArray
+        ]
     ].
 
-    (argArray size ~~ self numArgs) ifTrue:[
-	"
-	 the method expects a different number of arguments
-	"
-	^ self wrongNumberOfArguments:argArray size
+    (argArray size ~~ self argumentCount) ifTrue:[
+        "
+         the method expects a different number of arguments
+        "
+        ^ self wrongNumberOfArguments:argArray size
     ].
 
     "/ if the VM only supports a limited number of arguments in sends (ST/X: 15)
     argArray size > self class maxNumberOfArguments ifTrue:[
-	^ self tooManyArguments
+        ^ self tooManyArguments
     ].
     ^ self primitiveFailed
 
     "
      (Float compiledMethodAt:#+)
-	valueWithReceiver:1.0 arguments:#(2.0)
+        valueWithReceiver:1.0 arguments:#(2.0)
 
      'the next example is a wrong one - which is detected by True's method ...'.
      (True compiledMethodAt:#printString)
-	valueWithReceiver:false arguments:nil
+        valueWithReceiver:false arguments:nil
 
      'the next example is a wrong one - it is nowhere detected
       and a wrong value returned ...'.
      (Point compiledMethodAt:#x)
-	valueWithReceiver:(1->2) arguments:nil
+        valueWithReceiver:(1->2) arguments:nil
 
      'the next example is VERY bad one - it is nowhere detected
       and may crash the system WARNING: save your work before doing this ...'.
      (Point compiledMethodAt:#x)
-	valueWithReceiver:(Object new) arguments:nil
+        valueWithReceiver:(Object new) arguments:nil
 
      'the next example is a wrong one - which is detected here ...'.
      (Object compiledMethodAt:#printOn:)
-	valueWithReceiver:false arguments:nil
+        valueWithReceiver:false arguments:nil
 
      'the next example is a wrong one - which is detected here ...'.
      (Object compiledMethodAt:#printOn:)
-	valueWithReceiver:false arguments:#()
+        valueWithReceiver:false arguments:#()
     "
 
     "Modified: / 07-10-2011 / 13:58:21 / cg"
+    "Modified: / 25-06-2019 / 09:43:54 / Claus Gittinger"
 ! !
 
 !CompiledCode methodsFor:'private-accessing'!
@@ -1815,13 +1889,14 @@
 !
 
 isUnloaded
-    "return true, if the methods machine code has been unloaded
+    "return true, if the method's machine code has been unloaded
      from the system (i.e. it is not executable)."
 
     ^ (self hasCode not and:[self byteCode isNil])
 
-    "Created: / 16.4.1996 / 17:51:47 / cg"
-    "Modified: / 13.11.1998 / 23:18:18 / cg"
+    "Created: / 16-04-1996 / 17:51:47 / cg"
+    "Modified: / 13-11-1998 / 23:18:18 / cg"
+    "Modified (comment): / 21-11-2017 / 12:59:51 / cg"
 !
 
 messages
@@ -1853,6 +1928,8 @@
 !
 
 numArgs
+    <resource: #obsolete>  "/ but left in for a while, for performance
+
     "return the number of arguments, the method expects.
      Please use argumentCount for ANSI compatibility."