--- a/JavaConstantPool.st Fri Aug 08 10:23:05 1997 +0000
+++ b/JavaConstantPool.st Fri Aug 08 11:34:22 1997 +0000
@@ -96,19 +96,32 @@
!JavaConstantPool methodsFor:'special'!
updateClassRefsFrom:oldClass to:newClass
+owner == oldClass ifTrue:[
+ self halt.
+ ^ self
+].
+
self keysAndValuesDo:[:index :constItem |
constItem == oldClass ifTrue:[
self at:index put:newClass
] ifFalse:[
- constItem isNumber ifFalse:[
+ (constItem isNil
+ or:[constItem isNumber]) ifFalse:[
constItem isString ifTrue:[
"/ nothing done ...
] ifFalse:[
(constItem isMemberOf:(Java java_lang_String)) ifTrue:[
"/ nothing done ...
] ifFalse:[
- constItem isJavaClass ifFalse:[
+ constItem isBehavior ifFalse:[
constItem updateClassRefsFrom:oldClass to:newClass
+ ] ifTrue:[
+ constItem isJavaClass ifTrue:[
+ constItem fullName = oldClass fullName ifTrue:[
+ 'JAVA: class update by name [in pool].' infoPrintCR.
+ self at:index put:newClass
+ ]
+ ]
]
]
]
@@ -116,11 +129,11 @@
]
]
- "Modified: 7.8.1997 / 15:00:10 / cg"
+ "Modified: 7.8.1997 / 19:17:38 / cg"
! !
!JavaConstantPool class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaConstantPool.st,v 1.4 1997/08/07 13:19:09 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaConstantPool.st,v 1.5 1997/08/08 11:33:21 cg Exp $'
! !
--- a/JavaObject.st Fri Aug 08 10:23:05 1997 +0000
+++ b/JavaObject.st Fri Aug 08 11:34:22 1997 +0000
@@ -18,6 +18,7 @@
convertJavaObject:val signature:retValSignature
^ val.
+
retValSignature = 'void' ifTrue:[
^ #void
].
@@ -50,45 +51,31 @@
].
retValSignature = 'String' ifTrue:[
- ^ self stringFromJavaString:val
+ ^ Java as_ST_String:val
].
'no conversion for: ' print. val class name print. ' to: ' print. retValSignature printNL.
^ val.
-
+ "Modified: 8.8.1997 / 12:07:23 / cg"
!
javaStringFrom:aString
"hard-coding internas of java.lang.String here is bad ..."
- |s|
+ self halt.
+ ^ Java as_String:aString
- s := Java java_lang_String basicNew.
- s instVarNamed:'value' put: aString.
- s instVarNamed:'offset' put: 0.
- s instVarNamed:'count' put: aString size.
- ^ s
-
- "Modified: 26.3.1997 / 13:43:54 / cg"
+ "Modified: 7.8.1997 / 21:17:32 / cg"
!
stringFromJavaString:aJavaString
"hard-coding internas of java.lang.String here is bad ..."
- |start stop|
-
- "/ start := (aJavaString instVarNamed:'offset') + 1.
- start := (aJavaString instVarAt:(JavaSlotIndexCache string_slot_offset)) + 1.
+ self halt.
+ ^ Java as_ST_String:aJavaString
- "/ stop := start + (aJavaString instVarNamed:'count') - 1.
- stop := start + (aJavaString instVarAt:(JavaSlotIndexCache string_slot_count)) - 1.
-
- "/ ^ ((aJavaString instVarNamed:'value') copyFrom:start to:stop) asString
- ^ ((aJavaString instVarAt:(JavaSlotIndexCache string_slot_value))
- copyFrom:start to:stop) asString
-
- "Modified: 8.2.1997 / 13:46:22 / cg"
+ "Modified: 8.8.1997 / 12:07:29 / cg"
! !
!JavaObject methodsFor:'initialization'!
@@ -329,6 +316,31 @@
"Modified: 3.8.1997 / 20:31:03 / cg"
!
+invoke:selector interpreter:i sender:aContext with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6
+ "send a message, with 6 arguments.
+ TEMPORARY: This method needs more work."
+
+ |sel method cls argClass jSel|
+
+ sel := selector asSymbolIfInterned.
+ sel notNil ifTrue:[
+ method := self lookupMethod:sel numArgs:6.
+ method notNil ifTrue:[
+ ^ self
+ invokeJavaMethod:method
+ interpreter:i
+ sender:aContext
+ selector:selector
+ with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6
+ ].
+ ].
+
+ ^ super doesNotUnderstand:(Message selector:selector)
+
+ "Modified: 3.8.1997 / 20:31:03 / cg"
+ "Created: 7.8.1997 / 20:57:12 / cg"
+!
+
invoke:selector interpreter:i sender:aContext withAll:arguments
"send a message, with arguments.
TEMPORARY: This method needs more work."
@@ -519,6 +531,38 @@
"Created: 3.8.1997 / 20:32:03 / cg"
!
+invokeJavaMethod:aJavaMethod interpreter:i sender:s selector:sel with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6
+ "invoke a java method, with 6 arguments.
+ CAVEAT: these cannot be long or doubles currently."
+
+ |val|
+
+ aJavaMethod numArgs ~~ 6 ifTrue:[
+ self halt:'argument count'
+ ].
+ aJavaMethod isStatic ifTrue:[
+ self halt:'static function'
+ ].
+
+ val := aJavaMethod valueWithReceiver:self arguments:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6) selector:sel.
+ val notNil ifTrue:[^ val].
+
+ i push:self.
+ i push:arg1.
+ i push:arg2.
+ i push:arg3.
+ i push:arg4.
+ i push:arg5.
+ i push:arg6.
+
+ val := i interpret:aJavaMethod sender:s.
+
+ ^ JavaObject convertJavaObject:val signature:(aJavaMethod retValSignature)
+
+ "Modified: 30.7.1997 / 13:20:35 / cg"
+ "Created: 7.8.1997 / 20:57:55 / cg"
+!
+
invokeJavaMethod:aJavaMethod interpreter:i sender:s with:arg1 with:arg2
"invoke a java method, with two arguments.
CAVEAT: these cannot be long or doubles currently."
@@ -649,7 +693,7 @@
displayString
self class == Java java_lang_String ifTrue:[
- ^ '''' , (JavaObject stringFromJavaString:self) , ''''
+ ^ '''' , (Java as_ST_String:self) , ''''
].
^ super displayString.
@@ -657,24 +701,25 @@
Object errorSignal handle:[:ex |
^ super displayString.
] do:[
- ^ JavaObject stringFromJavaString:(self invoke:#toString).
+ ^ Java as_ST_String:(self invoke:#toString).
].
^ super displayString. "/ ^ 'a JavaObject(' , self class name , ')'
- "Modified: 26.3.1997 / 13:44:04 / cg"
+ "Modified: 8.8.1997 / 12:07:36 / cg"
!
javaDisplayString
Object errorSignal handle:[:ex |
ex return.
] do:[
- ^ JavaObject stringFromJavaString:(self invoke:#toString).
+ ^ Java as_ST_String:(self invoke:#toString).
].
^ super displayString.
"Created: 7.4.1997 / 17:38:13 / cg"
+ "Modified: 8.8.1997 / 12:07:39 / cg"
! !
!JavaObject methodsFor:'queries'!
@@ -823,6 +868,25 @@
"Created: 3.8.1997 / 20:30:22 / cg"
!
+invoke:selector with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6
+ "send a message, with 6 argument.
+ TEMPORARY: This method needs more work."
+
+ ^ self
+ invoke:selector
+ interpreter:JavaInterpreter new
+ sender:thisContext sender
+ with:arg1
+ with:arg2
+ with:arg3
+ with:arg4
+ with:arg5
+ with:arg6
+
+ "Modified: 30.7.1997 / 13:44:58 / cg"
+ "Created: 7.8.1997 / 20:56:49 / cg"
+!
+
invoke:selector withAll:args
"send a message, with anumber of arguments.
TEMPORARY: This method needs more work."
@@ -895,5 +959,5 @@
!JavaObject class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaObject.st,v 1.31 1997/08/06 00:52:47 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaObject.st,v 1.32 1997/08/08 11:34:22 cg Exp $'
! !
--- a/JavaProcess.st Fri Aug 08 10:23:05 1997 +0000
+++ b/JavaProcess.st Fri Aug 08 11:34:22 1997 +0000
@@ -9,13 +9,13 @@
!JavaProcess methodsFor:'accessing'!
suspendedContext
-^ super suspendedContext.
+"/ ^ super suspendedContext.
suspendedContext isNil ifTrue:[^ super suspendedContext].
^ suspendedContext
"Created: 7.5.1996 / 09:02:03 / cg"
- "Modified: 4.8.1997 / 01:52:13 / cg"
+ "Modified: 8.8.1997 / 00:39:10 / cg"
!
suspendedContext:aContext
@@ -27,5 +27,5 @@
!JavaProcess class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaProcess.st,v 1.6 1997/08/05 15:03:16 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaProcess.st,v 1.7 1997/08/08 11:34:15 cg Exp $'
! !
--- a/JavaRef.st Fri Aug 08 10:23:05 1997 +0000
+++ b/JavaRef.st Fri Aug 08 11:34:22 1997 +0000
@@ -74,9 +74,17 @@
updateClassRefsFrom:oldClass to:newClass
class == oldClass ifTrue:[
class := newClass
+ ] ifFalse:[
+ class isJavaClass ifTrue:[
+ class fullName = oldClass fullName ifTrue:[
+ 'JAVA: class update by name.' infoPrintCR.
+ class := newClass
+ ]
+ ]
]
"Created: 7.8.1997 / 15:01:09 / cg"
+ "Modified: 7.8.1997 / 18:58:18 / cg"
! !
!JavaRef methodsFor:'validation'!
@@ -100,5 +108,5 @@
!JavaRef class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaRef.st,v 1.11 1997/08/07 13:19:07 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaRef.st,v 1.12 1997/08/08 11:33:30 cg Exp $'
! !
--- a/JavaUnresolvedConstant.st Fri Aug 08 10:23:05 1997 +0000
+++ b/JavaUnresolvedConstant.st Fri Aug 08 11:34:22 1997 +0000
@@ -162,8 +162,15 @@
! !
+!JavaUnresolvedConstant methodsFor:'special'!
+
+updateClassRefsFrom:oldClass to:newClass
+
+ "Created: 7.8.1997 / 18:21:19 / cg"
+! !
+
!JavaUnresolvedConstant class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedConstant.st,v 1.6 1997/04/07 17:26:33 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedConstant.st,v 1.7 1997/08/08 11:33:24 cg Exp $'
! !
--- a/JavaUnresolvedStringConstant.st Fri Aug 08 10:23:05 1997 +0000
+++ b/JavaUnresolvedStringConstant.st Fri Aug 08 11:34:22 1997 +0000
@@ -34,7 +34,7 @@
chars isString ifFalse:[
self halt:'should not happen'
].
- jString := JavaObject javaStringFrom:chars.
+ jString := Java as_String:chars.
"/constantPool owner == (Java at:'java/awt/Container') ifTrue:[
"/self halt
@@ -47,11 +47,11 @@
self rememberForResolveWith:'java/lang/String'.
^ self
- "Modified: 26.3.1997 / 13:44:12 / cg"
+ "Modified: 7.8.1997 / 21:17:23 / cg"
! !
!JavaUnresolvedStringConstant class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedStringConstant.st,v 1.5 1997/03/26 17:24:11 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedStringConstant.st,v 1.6 1997/08/08 11:33:17 cg Exp $'
! !