src/JavaNativeMethod.st
branchjk_new_structure
changeset 1748 ff89096bf12f
parent 1213 fc90769151e8
child 1749 2a942f354a94
--- a/src/JavaNativeMethod.st	Sat Oct 27 14:15:25 2012 +0000
+++ b/src/JavaNativeMethod.st	Sat Oct 27 15:25:16 2012 +0000
@@ -247,14 +247,30 @@
 
 nativeMethodInvokation
     "Called by the VM when a native method is
-     to be executed"
+     to be executed - old (slow) implementation"
+
+    ^self nativeMethodInvokation: thisContext sender.    
+
+    "
+     JavaNativeMethod flushAllCachedNativeMethods"
+
+    "Modified: / 27-01-2000 / 13:34:53 / cg"
+    "Modified: / 03-11-2011 / 10:47:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 27-10-2012 / 15:15:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+nativeMethodInvokation: context
+    "Called by the VM when a native method is
+     to be executed. 
+
+     'context' is the context of being-invoked native method"
     
     | sel  mthd  sender |
     (mthd := nativeImplementation) isNil ifTrue: [
         sel := self searchNativeImplementation.
         mthd := (JavaVM class compiledMethodAt: sel).
         (mthd isNil or: [ mthd isLazyMethod ]) ifTrue: [
-            sender := thisContext sender.
+            sender := context.
             sender sender selector == #noByteCode ifTrue: [
                 sender := sender sender.
                 sender := sender sender.
@@ -267,7 +283,7 @@
     Verbose ifTrue: [Logger log: 'Native method invokation: ' , sel severity: #debug facility: #JVM].
     ^ mthd 
         valueWithReceiver: JavaVM
-        arguments: (Array with: thisContext sender)
+        arguments: (Array with: context)
         selector: selector
         search: JavaVM class
         sender: nil
@@ -275,9 +291,7 @@
     "
      JavaNativeMethod flushAllCachedNativeMethods"
 
-    "Modified: / 27-01-2000 / 13:34:53 / cg"
-    "Modified: / 30-04-2011 / 23:52:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 03-11-2011 / 10:47:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Created: / 27-10-2012 / 15:13:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaNativeMethod class methodsFor:'documentation'!