Method.st
changeset 375 e5019c22f40e
parent 362 4131e87e79ec
child 379 5b5a130ccd09
--- a/Method.st	Sat Aug 05 16:05:36 1995 +0200
+++ b/Method.st	Tue Aug 08 02:49:43 1995 +0200
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.39 1995-07-22 19:23:12 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.40 1995-08-08 00:47:31 claus Exp $
 '!
 
 !Method class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.39 1995-07-22 19:23:12 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.40 1995-08-08 00:47:31 claus Exp $
 "
 !
 
@@ -877,6 +877,10 @@
     (self code notNil and:[self code = m code]) ifTrue:[^ true].
     (byteCode notNil and:[byteCode == m byteCode]) ifTrue:[^ true].
 
+    m := Method compiledMethodAt:#uncompiledCodeObject.
+    (self code notNil and:[self code = m code]) ifTrue:[^ true].
+    (byteCode notNil and:[byteCode == m byteCode]) ifTrue:[^ true].
+
     m := Metaclass compiledMethodAt:#invalidCodeObject.
     (self code notNil and:[self code = m code]) ifTrue:[^ true].
     (byteCode notNil and:[byteCode == m byteCode]) ifTrue:[^ true].
@@ -905,6 +909,21 @@
 	errorString:'invalid method - not executable'.
 !
 
+uncompiledCodeObject
+    "this method is invoked by methods which contain primitive code,
+     but have not been compiled to machine code (either due to an error
+     when compiling, or simply because no stc is available.
+     For those methods, the compiler generated a method object consisting
+     of the original source code, but with this methods machine/byte code.
+     Therefore, we patch (kludge) the lineNumber information, to show the
+     first line (instead of the real line below)"
+
+    thisContext setLineNumber:1.
+    ^ InvalidCodeSignal
+	raiseRequestWith:self
+	errorString:'invalid method - not compiled'.
+!
+ 
 wrongNumberOfArguments:numberGiven
     "this error is triggered, if a method is called with a wrong number
      of arguments. This only applies to #valueWithReceiverXXX - sends.