Don't compile native method stub when native implementatio is not initialized.
--- a/JavaNativeMethod.st Tue Feb 26 14:10:02 2013 +0100
+++ b/JavaNativeMethod.st Mon Mar 04 18:32:26 2013 +0100
@@ -145,6 +145,13 @@
"Modified: / 24.12.1999 / 03:10:51 / cg"
! !
+!JavaNativeMethod class methodsFor:'others'!
+
+version_HG
+
+ ^ '§Changeset: <not expanded> §'
+! !
+
!JavaNativeMethod methodsFor:'accessing'!
nCalls
@@ -255,7 +262,10 @@
compileNativeImplementationStub: sel
| header |
- header := String streamContents:[:s|
+ "/No natives, no fun...
+ JavaVM natives isNil ifTrue:[ ^ self ].
+
+ header := String streamContents:[:s|
| kw |
kw := sel keywords.
@@ -277,7 +287,7 @@
self assert: (JavaVM natives respondsTo: sel).
"Created: / 01-05-2011 / 00:08:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 06-02-2013 / 21:48:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-03-2013 / 17:31:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
installTrampoline: trampoline
@@ -444,7 +454,8 @@
(MessageNode
receiver: (VariableNode globalNamed:#'JavaVM:NativeMethodsImplementation')
selector: (self searchNativeImplementation: aNumber)
- args: (Array with: (SelfNode value: #self)) , args)) }.
+ args: (Array with: (SelfNode value: #self)) , args)) };
+ yourself.
compiler := ByteCodeCompiler new.
@@ -459,7 +470,7 @@
self literals: trampoline literals.
"Created: / 31-01-2013 / 12:44:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 12-02-2013 / 15:28:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-03-2013 / 17:30:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaNativeMethod methodsFor:'private-trampolines'!
@@ -622,16 +633,11 @@
!JavaNativeMethod class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libjava/JavaNativeMethod.st,v 1.14 2013-02-25 23:30:26 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libjava/JavaNativeMethod.st,v 1.15 2013-03-04 17:32:26 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libjava/JavaNativeMethod.st,v 1.14 2013-02-25 23:30:26 cg Exp $'
-!
-
-version_HG
-
- ^ '§Changeset: <not expanded> §'
+ ^ '$Header: /cvs/stx/stx/libjava/JavaNativeMethod.st,v 1.15 2013-03-04 17:32:26 vrany Exp $'
!
version_SVN