--- a/JavaNativeMethod.st Thu Dec 23 17:40:41 1999 +0000
+++ b/JavaNativeMethod.st Thu Dec 23 17:46:10 1999 +0000
@@ -1,5 +1,3 @@
-'From Smalltalk/X, Version:3.5.4 on 25-sep-1999 at 11:12:45 pm' !
-
JavaMethodWithHandler variableSubclass:#JavaNativeMethod
instanceVariableNames:'nativeImplementation'
classVariableNames:''
@@ -7,13 +5,13 @@
category:'Java-Classes'
!
+
!JavaNativeMethod class methodsFor:'initialization'!
initialize
self flags:(self flags bitOr:Behavior flagJavaMethod).
! !
-
!JavaNativeMethod methodsFor:'accessing'!
nativeImplementation
@@ -35,26 +33,27 @@
!JavaNativeMethod methodsFor:'vm support'!
nativeMethodInvokation
- |nm sel|
+ |nm sel mthd|
- nativeImplementation isNil ifTrue:[
- nm := selector copyWithoutLast:signature size.
- sel := ('_' , javaClass lastName , '_' , nm , ':') asSymbol.
+ (mthd := nativeImplementation) isNil ifTrue:[
+ nm := selector copyWithoutLast:signature size.
+ sel := ('_' , javaClass lastName , '_' , nm , ':') asSymbol.
- nativeImplementation := (JavaVM class compiledMethodAt:sel).
- nativeImplementation isNil ifTrue:[
- ^ JavaVM
- perform:sel
- with:thisContext sender.
- ].
+ mthd := (JavaVM class compiledMethodAt:sel).
+ (mthd isNil or:[mthd isLazyMethod]) ifTrue:[
+ ^ JavaVM
+ perform:sel
+ with:thisContext sender.
+ ].
+ nativeImplementation := mthd.
].
- ^ nativeImplementation
- valueWithReceiver:JavaVM
- arguments:(Array with:thisContext sender)
- selector:selector
- search:JavaVM class
- sender:nil
+ ^ mthd
+ valueWithReceiver:JavaVM
+ arguments:(Array with:thisContext sender)
+ selector:selector
+ search:JavaVM class
+ sender:nil
"Modified: / 25.9.1999 / 23:10:29 / cg"
! !
@@ -62,5 +61,6 @@
!JavaNativeMethod class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaNativeMethod.st,v 1.2 1999/11/09 09:24:33 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaNativeMethod.st,v 1.3 1999/12/23 17:46:10 cg Exp $'
! !
+JavaNativeMethod initialize!