JavaMethod.st
author cg
Thu, 22 Oct 1998 16:32:38 +0000
changeset 404 ae9fdf1d8d58
parent 402 39eaf0d70bf8
child 412 50a70b900259
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
91843ac44d2f intitial checkin
cg
parents:
diff changeset
     1
CompiledCode subclass:#JavaMethod
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
     2
	instanceVariableNames:'accessFlags selector javaClass signature lineNumberTable
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
     3
		localVariableTable'
277
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
     4
	classVariableNames:'AbstractMethodInvokationSignal SignatureTypeCodes
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
     5
		ForceByteCodeDisplay A_PUBLIC A_PRIVATE A_PROTECTED A_STATIC
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
     6
		A_FINAL A_SYNCHRONIZED A_ABSTRACT A_NATIVE A_BREAKPOINT R_VOID
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
     7
		R_LONG R_DOUBLE A_HASHANDLER'
2
91843ac44d2f intitial checkin
cg
parents:
diff changeset
     8
	poolDictionaries:''
91843ac44d2f intitial checkin
cg
parents:
diff changeset
     9
	category:'Java-Classes'
91843ac44d2f intitial checkin
cg
parents:
diff changeset
    10
!
91843ac44d2f intitial checkin
cg
parents:
diff changeset
    11
91843ac44d2f intitial checkin
cg
parents:
diff changeset
    12
129
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
    13
!JavaMethod class methodsFor:'initialization'!
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    14
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    15
initialize
277
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    16
    AbstractMethodInvokationSignal isNil ifTrue:[
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    17
        AbstractMethodInvokationSignal := ExecutionErrorSignal newSignalMayProceed:true.
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    18
        AbstractMethodInvokationSignal nameClass:self message:#abstractMethodInvokationSignal.
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    19
        AbstractMethodInvokationSignal notifierString:'attempt to execute abstract method'.
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    20
    ].
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    21
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    22
    A_PUBLIC       := 16r0001.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    23
    A_PRIVATE      := 16r0002.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    24
    A_PROTECTED    := 16r0004.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    25
    A_STATIC       := 16r0008.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    26
    A_FINAL        := 16r0010.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    27
    A_SYNCHRONIZED := 16r0020.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    28
    A_NATIVE       := 16r0100.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    29
    A_ABSTRACT     := 16r0400.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    30
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    31
    R_VOID         := 16r100000.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    32
    R_LONG         := 16r200000.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    33
    R_DOUBLE       := 16r300000.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
    34
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
    35
    A_BREAKPOINT   := 16r0800000.
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    36
    A_HASHANDLER   := 16r1000000.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
    37
173
10513c48882f checkin from browser
cg
parents: 169
diff changeset
    38
    self flags:(self flags bitOr:Behavior flagJavaMethod).
10513c48882f checkin from browser
cg
parents: 169
diff changeset
    39
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    40
    SignatureTypeCodes := IdentityDictionary new.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    41
    SignatureTypeCodes at:$B put:#byte.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    42
    SignatureTypeCodes at:$C put:#char.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    43
    SignatureTypeCodes at:$D put:#double.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    44
    SignatureTypeCodes at:$F put:#float.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    45
    SignatureTypeCodes at:$I put:#int.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    46
    SignatureTypeCodes at:$J put:#long.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    47
    SignatureTypeCodes at:$S put:#'unsigned short'.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    48
    SignatureTypeCodes at:$Z put:#boolean.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    49
    SignatureTypeCodes at:$L put:#object.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    50
    SignatureTypeCodes at:$[ put:#array.
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    51
207
dfbd9b69a64e checkin from browser
cg
parents: 189
diff changeset
    52
    ForceByteCodeDisplay := false.
dfbd9b69a64e checkin from browser
cg
parents: 189
diff changeset
    53
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    54
    "
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    55
     JavaMethod initialize.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    56
     JavaMethodWithHandler initialize.
209
9e4b45da1117 checkin from browser
cg
parents: 207
diff changeset
    57
     ForceByteCodeDisplay := true.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
    58
     ForceByteCodeDisplay := false.
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    59
    "
173
10513c48882f checkin from browser
cg
parents: 169
diff changeset
    60
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    61
    "Modified: / 16.10.1998 / 01:29:48 / cg"
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    62
! !
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    63
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    64
!JavaMethod class methodsFor:'instance creation'!
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    65
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    66
fromMethod:aJavaMethod
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    67
    "create a new javaMethod, copying values from another javaMethod"
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    68
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    69
    ^ self new fromMethod:aJavaMethod
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    70
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    71
    "Created: / 16.10.1998 / 01:25:12 / cg"
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    72
!
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    73
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    74
new
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    75
    "create a new javaMethod.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    76
     Redefined, since constants are NOT stored in a literalArray,
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    77
     but my classes constantTable instead."
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    78
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    79
    ^ self basicNew:0.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    80
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
    81
    "Created: / 16.10.1998 / 01:13:02 / cg"
277
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    82
! !
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    83
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    84
!JavaMethod class methodsFor:'Signal constants'!
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    85
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    86
abstractMethodInvokationSignal
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    87
    "return the signal raised when an abstract method is invoked"
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    88
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    89
    ^ AbstractMethodInvokationSignal
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    90
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
    91
    "Created: / 27.1.1998 / 21:50:05 / cg"
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    92
! !
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
    93
357
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
    94
!JavaMethod class methodsFor:'constants'!
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
    95
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
    96
A_NATIVE
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
    97
    ^ JavaClass A_NATIVE
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
    98
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
    99
    "Created: / 16.5.1998 / 01:18:24 / cg"
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   100
!
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   101
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   102
A_PUBLIC
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   103
    ^ JavaClass A_PUBLIC
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   104
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   105
    "Created: / 16.5.1998 / 00:01:10 / cg"
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   106
!
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   107
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   108
A_STATIC
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   109
    ^ JavaClass A_STATIC
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   110
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   111
    "Created: / 16.5.1998 / 00:01:17 / cg"
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   112
! !
90d866d87398 more st-class reading
cg
parents: 334
diff changeset
   113
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   114
!JavaMethod class methodsFor:'misc'!
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   115
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   116
forceByteCodeDisplay
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   117
    ^ ForceByteCodeDisplay
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   118
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   119
    "Created: 7.4.1997 / 20:11:39 / cg"
309
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   120
!
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   121
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   122
forceByteCodeDisplay:aBoolean
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   123
    ForceByteCodeDisplay := aBoolean
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   124
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   125
    "
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   126
     self forceByteCodeDisplay:true
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   127
     self forceByteCodeDisplay:false
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   128
    "
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   129
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
   130
    "Created: / 4.2.1998 / 00:22:54 / cg"
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   131
! !
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   132
129
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
   133
!JavaMethod class methodsFor:'signature parsing'!
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   134
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   135
argSigArrayFromSignature:aSignature
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   136
    "given a signature, return a specArray for the arguments"
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   137
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   138
    |s|
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   139
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   140
    s := aSignature readStream.
237
4c9ca89313d4 *** empty log message ***
cg
parents: 220
diff changeset
   141
    s next ~~ $( ifTrue:[self halt].
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   142
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   143
    ^ self argSigArrayFromStream:s.
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   144
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   145
    "
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   146
     JavaMethod argSigArrayFromSignature:'(LObject;)V'
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   147
     JavaMethod argSigArrayFromSignature:'(BB)S'      
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   148
     JavaMethod argSigArrayFromSignature:'(LObject;LObject;II)V'      
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   149
    "
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   150
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   151
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   152
argSigArrayFromStream:s
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   153
    "parse an argSpec, return an array of specs - see java doc"
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   154
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   155
    |argSpec spec|
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   156
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   157
    spec := #().
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   158
    [s atEnd or:[s peek == $)]] whileFalse:[
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   159
"/        s peek == Character space ifTrue:[
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   160
"/            s next
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   161
"/        ] ifFalse:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   162
            argSpec := self fieldTypeFromStream:s in:nil.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   163
            spec := spec copyWith:argSpec.
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   164
"/        ]
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   165
    ].
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   166
    ^ spec
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   167
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   168
    "Modified: / 8.1.1998 / 19:10:20 / cg"
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   169
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   170
321
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   171
argSignatureFromArgTypeArray:arr
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   172
    |sig|
321
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   173
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   174
    sig := ''.
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   175
    arr do:[:el |
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   176
        |jCLass|
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   177
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   178
        jCLass := el.
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   179
        jCLass isJavaClass ifFalse:[
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   180
            jCLass := JavaVM classForJavaClassObject:el
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   181
        ].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   182
        jCLass isJavaClass ifTrue:[
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   183
            sig := sig , jCLass typeName.
321
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   184
            sig := sig, ';'
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   185
        ] ifFalse:[
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   186
            self halt.
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   187
        ]
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   188
    ].
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   189
    ^ sig
321
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   190
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   191
    "
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   192
     self argSignatureFromArgTypeArray:
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   193
        (Array 
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   194
            with:(JavaVM javaClassObjectForClass:(Java at:'com.sun.java.swing.JComponent')))
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   195
    "
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   196
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   197
    "Modified: / 13.2.1998 / 14:57:58 / cg"
321
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   198
!
1fc4570fb914 preps for getMethod nativeCall
cg
parents: 309
diff changeset
   199
113
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   200
argSpecFromSignature:aSignature withName:name
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   201
    "given a signature, return a spec"
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   202
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   203
    |s argSpec|
113
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   204
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   205
    s := aSignature readStream.
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   206
    s next ~~ $( ifTrue:[self halt. ^ name].
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   207
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   208
    argSpec := self argSpecFromStream:s in:nil.
113
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   209
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   210
    s next ~~ $) ifTrue:[self halt. ^ name].
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   211
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   212
    ^ name , ' (' , argSpec , ')'
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   213
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   214
    "
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   215
     JavaMethod argSpecFromSignature:'(LObject;)V' withName:'foo' 
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   216
     JavaMethod argSpecFromSignature:'(BB)S'       withName:'foo' 
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   217
    "
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
   218
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   219
    "Modified: / 8.1.1998 / 19:05:36 / cg"
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   220
!
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   221
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   222
argSpecFromStream:s in:aPackage
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   223
    "parse an argSpec - see java doc"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   224
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   225
    |argSpec spec|
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   226
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   227
    spec := ''.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   228
    [s atEnd or:[s peek == $)]] whileFalse:[
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   229
"/        s peek == Character space ifTrue:[
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   230
"/            s next
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   231
"/        ] ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   232
	    argSpec := self fieldTypeFromStream:s in:aPackage.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   233
	    spec size ~~ 0 ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   234
		spec := spec , ' '
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   235
	    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   236
	    spec := spec , argSpec.
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   237
"/        ]
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   238
    ].
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   239
    ^ spec
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   240
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   241
    "Created: 18.3.1997 / 11:06:44 / cg"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   242
!
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   243
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   244
argSpecWithArgsFromStream:s in:aPackage
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   245
    "parse an argSpec - see java doc"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   246
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   247
    ^ self argSpecWithArgsFromStream:s in:aPackage argNames:nil
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   248
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   249
    "Modified: / 8.1.1998 / 19:21:00 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   250
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   251
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   252
argSpecWithArgsFromStream:s in:aPackage argNames:argNames
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   253
    "parse an argSpec - see java doc"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   254
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   255
    |argSpec spec argNr nm|
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   256
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   257
    argNr := 1.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   258
    spec := ''.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   259
    [s atEnd or:[s peek == $)]] whileFalse:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   260
        argSpec := self fieldTypeFromStream:s in:aPackage.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   261
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   262
        (argNames notNil
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   263
        and:[argNames size >= argNr
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   264
        and:[(nm := argNames at:argNr) notNil]]) ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   265
            nm := 'arg' , argNr printString.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   266
        ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   267
        argSpec := argSpec , ' ' , nm.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   268
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   269
        spec size ~~ 0 ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   270
            spec := spec , ', '
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   271
        ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   272
        spec := spec , argSpec.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   273
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   274
        argNr := argNr + 1.
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   275
    ].
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   276
    ^ spec
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   277
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   278
    "Created: / 8.1.1998 / 19:20:36 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   279
    "Modified: / 8.1.1998 / 21:14:33 / cg"
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
   280
!
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
   281
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   282
fieldTypeFromStream:s in:aPackage
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   283
    "parse a fieldTypeSpec - see java doc"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   284
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   285
    |typeChar typeSym elType size className nm|
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   286
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   287
    typeChar := s next.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   288
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   289
    typeSym := SignatureTypeCodes at:typeChar ifAbsent:#unknown.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   290
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   291
    typeSym == #unknown ifTrue:[
360
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   292
        ^ typeSym
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   293
    ].
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   294
    typeSym == #object ifTrue:[
360
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   295
        className := s upTo:$;.
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   296
        "/ strip off default
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   297
360
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   298
        nm := className.
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   299
        aPackage notNil ifTrue:[
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   300
            (nm startsWith:aPackage) ifTrue:[
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   301
                nm := nm copyFrom:(aPackage size + 2).
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   302
            ].
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   303
        ].
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   304
        
360
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   305
        nm := nm copyReplaceAll:$/ with:$..
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   306
        ^ nm
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   307
    ].
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   308
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   309
    typeSym == #array ifTrue:[
360
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   310
        s peek isDigit ifTrue:[
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   311
            size := Integer readFrom:s.
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   312
            elType := self fieldTypeFromStream:s in:aPackage.
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   313
            ^ elType , '[' , size printString , ']'
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   314
        ].
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   315
        elType := self fieldTypeFromStream:s in:aPackage.
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   316
        ^ elType , '[]'
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   317
    ].
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   318
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   319
    ^ typeSym
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   320
360
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   321
    "Created: / 18.3.1997 / 11:07:56 / cg"
e3df9401df00 use #copyReplaceAll:with:
cg
parents: 357
diff changeset
   322
    "Modified: / 18.7.1998 / 22:57:06 / cg"
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   323
!
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   324
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   325
numArgsFromSignature:aSignature
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   326
    "given a signature, return the number of args"
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   327
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   328
    |s|
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   329
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   330
    s := aSignature readStream.
237
4c9ca89313d4 *** empty log message ***
cg
parents: 220
diff changeset
   331
    s next ~~ $( ifTrue:[self halt].
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   332
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   333
    ^ self numArgsFromStream:s.
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   334
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   335
    "
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   336
     JavaMethod numArgsFromSignature:'(LObject;)V'
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   337
     JavaMethod numArgsFromSignature:'(BB)S'      
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   338
     JavaMethod numArgsFromSignature:'()V'      
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   339
    "
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   340
!
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   341
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   342
numArgsFromStream:s
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   343
    "parse an argSpec - see java doc"
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   344
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   345
    |n t|
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   346
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   347
    n := 0.
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   348
    [s atEnd or:[s peek == $)]] whileFalse:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   349
        t := self fieldTypeFromStream:s in:nil.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   350
        "/
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   351
        "/ some args count as 2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   352
        "/
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   353
        t == #long ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   354
            n := n + 2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   355
        ] ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   356
            t == #double ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   357
                n := n + 2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   358
            ] ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   359
                n := n + 1.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   360
            ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   361
        ]
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   362
    ].
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   363
    ^ n
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   364
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   365
    "Modified: / 8.1.1998 / 19:10:25 / cg"
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   366
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   367
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   368
retValSpecFromSignature:aSignature in:aPackage
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   369
    "given a signature, return a spec"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   370
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   371
    |s argSpec retvalSpec|
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   372
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   373
    s := aSignature readStream.
237
4c9ca89313d4 *** empty log message ***
cg
parents: 220
diff changeset
   374
    s next ~~ $( ifTrue:[self halt].
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   375
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   376
    argSpec := self argSpecFromStream:s in:aPackage.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   377
237
4c9ca89313d4 *** empty log message ***
cg
parents: 220
diff changeset
   378
    s next ~~ $) ifTrue:[self halt].
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   379
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   380
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   381
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   382
    ^ retvalSpec 
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   383
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   384
    "
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   385
     JavaMethod retValSpecFromSignature:'(LObject;)V'
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   386
     JavaMethod retValSpecFromSignature:'(BB)S'      
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   387
    "
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   388
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   389
    "Created: 18.3.1997 / 11:11:50 / cg"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   390
!
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   391
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   392
returnTypeFromSignature:aSignature in:aPackage
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   393
    "given a signature, return its type as a string"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   394
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   395
    |s c|
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   396
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   397
    s := aSignature readStream.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   398
    (c := s peek) ~~ $( ifTrue:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   399
        c == $' ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   400
           [s peek ~= $'] whileTrue:[s next].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   401
           s next.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   402
           ^ (self retvalSpecFromStream:s in:aPackage)
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   403
        ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   404
        ^ (self retvalSpecFromStream:s in:aPackage)
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   405
    ].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   406
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   407
    s next.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   408
    self argSpecFromStream:s in:aPackage.
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   409
    s next ~~ $) ifTrue:[self halt. ^ nil].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   410
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   411
    ^ (self retvalSpecFromStream:s in:aPackage)
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   412
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   413
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   414
     JavaMethod returnTypeFromSignature:'(LObject;)V' 
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   415
     JavaMethod returnTypeFromSignature:'(BB)S'       
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   416
     JavaMethod returnTypeFromSignature:'()J'       
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   417
     JavaMethod returnTypeFromSignature:'''first''J'       
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   418
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   419
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   420
    "Created: / 1.8.1997 / 10:54:31 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   421
    "Modified: / 8.1.1998 / 19:09:06 / cg"
72
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   422
!
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   423
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   424
returnsVoidFromSignature:aSignature
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   425
    "given a signature, return true if it returns void, false if not"
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   426
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   427
    ^ (self typeFromSignature:aSignature in:nil) = 'void'
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   428
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   429
    "
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   430
     JavaMethod returnsVoidFromSignature:'(LObject;)V' 
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   431
     JavaMethod returnsVoidFromSignature:'(BB)S'       
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   432
    "
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   433
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   434
    "Modified: / 8.1.1998 / 19:13:53 / cg"
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   435
!
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   436
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   437
retvalSpecFromStream:s in:aPackage
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   438
    "parse a retvalSpec - see java doc"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   439
332
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   440
    |spec|
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   441
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   442
    s atEnd ifTrue:[self halt. ^ #void].
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   443
    s peek == $V ifTrue:[^ #void].
332
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   444
    spec := self fieldTypeFromStream:s in:aPackage.
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   445
    spec knownAsSymbol ifTrue:[
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   446
        ^ spec asSymbol
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   447
    ].
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   448
    ^ spec
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   449
332
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   450
    "Created: / 18.3.1997 / 11:12:19 / cg"
2cb9ceae74d3 checkin from browser
cg
parents: 323
diff changeset
   451
    "Modified: / 7.4.1998 / 22:28:27 / cg"
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   452
!
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   453
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   454
specComponentsWithArgsFromSignature:aSignature withName:name in:aPackage
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   455
    "given a signature, return a spec"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   456
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   457
    |s argSpec retvalSpec|
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   458
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   459
    s := aSignature readStream.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   460
    s next ~~ $( ifTrue:[self halt. ^ name].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   461
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   462
    argSpec := self argSpecWithArgsFromStream:s in:aPackage.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   463
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   464
    s next ~~ $) ifTrue:[self halt. ^ name].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   465
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   466
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   467
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   468
    ^ Array with:retvalSpec with:name with:argSpec
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   469
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   470
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   471
     JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil    
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   472
     JavaMethod specComponentsWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil  
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   473
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   474
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   475
    "Created: 18.3.1997 / 11:06:22 / cg"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   476
    "Modified: 1.8.1997 / 11:03:50 / cg"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   477
!
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   478
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   479
specFromSignature:aSignature withName:name argNames:argNames in:aPackage
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   480
    "given a signature, return a spec"
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   481
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   482
    |s argSpec retvalSpec|
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   483
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   484
    s := aSignature readStream.
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   485
    s next ~~ $( ifTrue:[self halt. ^ name].
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   486
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   487
    argSpec := self argSpecWithArgsFromStream:s in:aPackage argNames:argNames.
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   488
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   489
    s next ~~ $) ifTrue:[self halt. ^ name].
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   490
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   491
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   492
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   493
    ^ retvalSpec , ' ' , name , ' (' , argSpec , ')'
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   494
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   495
    "
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   496
     JavaMethod specFromSignature:'(LObject;)V' withName:'foo' argNames:#('a') in:nil 
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   497
     JavaMethod specFromSignature:'(BB)S'       withName:'foo' argNames:#('a' 'b') in:nil
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   498
    "
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   499
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   500
    "Created: / 18.3.1997 / 11:06:22 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   501
    "Modified: / 8.1.1998 / 21:14:43 / cg"
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   502
!
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   503
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   504
specFromSignature:aSignature withName:name in:aPackage
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   505
    "given a signature, return a spec"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   506
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   507
    |s argSpec retvalSpec|
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   508
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   509
    s := aSignature readStream.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   510
    s next ~~ $( ifTrue:[self halt. ^ name].
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   511
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   512
    argSpec := self argSpecFromStream:s in:aPackage.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   513
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   514
    s next ~~ $) ifTrue:[self halt. ^ name].
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   515
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   516
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   517
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   518
    ^ retvalSpec , ' ' , name , ' (' , argSpec , ')'
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   519
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   520
    "
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   521
     JavaMethod specFromSignature:'(LObject;)V' withName:'foo' in:nil
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   522
     JavaMethod specFromSignature:'(BB)S'       withName:'foo' in:nil
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   523
    "
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   524
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   525
    "Created: / 18.3.1997 / 11:06:22 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   526
    "Modified: / 8.1.1998 / 21:06:32 / cg"
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   527
!
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
   528
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   529
specTextFromSignature:aSignature withName:name
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   530
    "given a signature, return a spec as boldified text"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   531
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   532
    |s argSpec retvalSpec|
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   533
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   534
    s := aSignature readStream.
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   535
    s next ~~ $( ifTrue:[self halt. ^ name].
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   536
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   537
    argSpec := self argSpecFromStream:s in:nil.
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   538
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   539
    s next ~~ $) ifTrue:[self halt. ^ name].
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   540
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   541
    retvalSpec := self retvalSpecFromStream:s in:nil.
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   542
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   543
    ^ retvalSpec , ' ' , (name asText allBold) , ' (' , argSpec , ')'
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   544
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   545
    "
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   546
     JavaMethod specTextFromSignature:'(LObject;)V' withName:'foo' 
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   547
     JavaMethod specTextFromSignature:'(BB)S'       withName:'foo' 
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   548
    "
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   549
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   550
    "Modified: / 8.1.1998 / 19:11:20 / cg"
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   551
!
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   552
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   553
specTextWithArgsFromSignature:aSignature withName:name in:aPackage
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   554
    "given a signature, return a spec"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   555
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   556
    |s argSpec retvalSpec|
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   557
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   558
    s := aSignature readStream.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   559
    s next ~~ $( ifTrue:[self halt. ^ name].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   560
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   561
    argSpec := self argSpecWithArgsFromStream:s in:aPackage.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   562
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   563
    s next ~~ $) ifTrue:[self halt. ^ name].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   564
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   565
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   566
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   567
    ^ retvalSpec , ' ' , (name asText allBold) , ' (' , argSpec , ')'
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   568
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   569
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   570
     JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil 
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   571
     JavaMethod specWithArgsFromSignature:'(BB)S'       withName:'foo' in:nil  
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   572
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   573
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   574
    "Modified: 20.3.1997 / 12:50:10 / cg"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   575
    "Created: 1.8.1997 / 10:43:57 / cg"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   576
!
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   577
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   578
specWithArgsFromSignature:aSignature withName:name in:aPackage
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   579
    "given a signature, return a spec"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   580
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   581
    |s argSpec retvalSpec|
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   582
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   583
    s := aSignature readStream.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   584
    s next ~~ $( ifTrue:[self halt. ^ name].
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   585
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   586
    argSpec := self argSpecWithArgsFromStream:s in:aPackage.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   587
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   588
    s next ~~ $) ifTrue:[self halt. ^ name].
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   589
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   590
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   591
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   592
    ^ retvalSpec , ' ' , name , ' (' , argSpec , ')'
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   593
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   594
    "
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   595
     JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil 
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   596
     JavaMethod specWithArgsFromSignature:'(BB)S'       withName:'foo' in:nil  
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   597
    "
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   598
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   599
    "Created: 18.3.1997 / 11:06:22 / cg"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   600
    "Modified: 20.3.1997 / 12:50:10 / cg"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   601
!
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
   602
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   603
typeFromSignature:aSignature in:package
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   604
    "given a signature, return its type as a string"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   605
238
18c543cfe8ef *** empty log message ***
cg
parents: 237
diff changeset
   606
    |s c|
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   607
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   608
    s := aSignature readStream.
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   609
    (c := s peek) ~~ $( ifTrue:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   610
        c == $' ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   611
           s next.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   612
           [s peek ~= $'] whileTrue:[s next].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   613
           s next.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   614
           ^ (self retvalSpecFromStream:s in:package)
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   615
        ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   616
        ^ (self retvalSpecFromStream:s in:package)
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   617
    ].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   618
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   619
    s next.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   620
    self argSpecFromStream:s in:nil.
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   621
    s next ~~ $) ifTrue:[self halt. ^ nil].
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   622
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   623
    ^ (self retvalSpecFromStream:s in:package)
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   624
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   625
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   626
     JavaMethod typeFromSignature:'(LObject;)Ljava/lang/Object'               
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   627
     JavaMethod typeFromSignature:'(LObject;)Ljava/lang/Object' in:'java.lang'  
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   628
    "
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
   629
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   630
    "Created: / 1.8.1997 / 10:50:38 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   631
    "Modified: / 8.1.1998 / 19:09:31 / cg"
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   632
! !
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   633
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   634
!JavaMethod methodsFor:'accessing'!
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   635
334
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   636
accessFlags
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   637
    "java calls this the modifiers"
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   638
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   639
    ^ accessFlags
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   640
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   641
    "Created: / 9.4.1998 / 17:49:44 / cg"
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   642
!
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   643
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   644
argSignature
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   645
    ^ self class argSigArrayFromSignature:signature
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   646
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   647
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   648
constantPool
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   649
    ^ javaClass constantPool
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   650
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   651
    "Modified: 16.4.1996 / 12:36:27 / cg"
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   652
    "Created: 16.4.1996 / 15:28:50 / cg"
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   653
!
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   654
129
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
   655
containingClass
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
   656
    ^ javaClass
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
   657
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
   658
!
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
   659
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   660
decompiledBytecode
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   661
    |s|
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   662
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   663
    s := '' writeStream.
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   664
    JavaDecompiler decompile:self to:s.
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   665
    ^ s contents
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   666
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   667
    "Created: 7.4.1997 / 20:10:37 / cg"
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   668
!
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
   669
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   670
decompiledSource
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   671
    |s|
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   672
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   673
    s := '' writeStream.
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   674
    self decompileSourceTo:s.
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   675
    ^ s contents
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   676
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   677
    "Modified: 30.7.1997 / 16:27:55 / cg"
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   678
!
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
   679
135
098936234135 *** empty log message ***
cg
parents: 129
diff changeset
   680
exceptionHandlerTable
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   681
    ^ nil
135
098936234135 *** empty log message ***
cg
parents: 129
diff changeset
   682
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   683
    "Created: / 16.10.1998 / 01:50:51 / cg"
135
098936234135 *** empty log message ***
cg
parents: 129
diff changeset
   684
!
098936234135 *** empty log message ***
cg
parents: 129
diff changeset
   685
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   686
exceptionTable
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   687
    ^ nil
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   688
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   689
    "Created: / 16.10.1998 / 01:51:04 / cg"
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   690
!
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   691
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   692
hasLineNumberInformation
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   693
    ^ lineNumberTable notNil
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   694
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   695
    "Created: 16.4.1996 / 12:34:04 / cg"
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   696
    "Modified: 16.4.1996 / 12:49:06 / cg"
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   697
!
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   698
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   699
javaByteCode
184
f65eb9c4ba6e checkin from browser
cg
parents: 175
diff changeset
   700
"/    ^ javaByteCode
f65eb9c4ba6e checkin from browser
cg
parents: 175
diff changeset
   701
    ^ byteCode
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   702
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
   703
    "Created: 16.4.1996 / 14:55:44 / cg"
184
f65eb9c4ba6e checkin from browser
cg
parents: 175
diff changeset
   704
    "Modified: 1.8.1997 / 00:08:45 / cg"
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
   705
!
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
   706
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   707
javaClass
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   708
    ^ javaClass
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   709
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   710
    "Modified: 16.4.1996 / 12:36:27 / cg"
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   711
    "Created: 16.4.1996 / 14:55:44 / cg"
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   712
!
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   713
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   714
lineNumber
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   715
    lineNumberTable isNil ifTrue:[^ nil].
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   716
    ^ lineNumberTable at:2
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   717
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   718
    "Created: 16.4.1996 / 12:34:04 / cg"
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   719
    "Modified: 16.4.1996 / 12:49:06 / cg"
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   720
!
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   721
50
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   722
lineNumberTable
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   723
    ^ lineNumberTable
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   724
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   725
    "Created: 16.4.1996 / 12:34:04 / cg"
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   726
    "Modified: 16.4.1996 / 12:49:06 / cg"
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   727
!
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   728
85
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   729
localVariableTable
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   730
    ^ localVariableTable
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   731
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   732
    "
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   733
     JavaMethod allInstancesDo:[:m| m localVariableTable notNil ifTrue:[self halt]]
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   734
    "
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   735
!
888c37bbe4bb checkin from browser
cg
parents: 83
diff changeset
   736
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   737
methodArgAndVarNames
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   738
    ^ ((1 to:self numArgs) collect:[:i | 'arg' , i printString])
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   739
      ,
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   740
      ((1 to:self numVars) collect:[:i | 'local' , i printString])
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   741
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   742
!
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   743
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   744
methodArgNames
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   745
    |nA|
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   746
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   747
    nA := self numArgs.
102
de5ab089cf47 checkin from browser
cg
parents: 90
diff changeset
   748
    localVariableTable notNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   749
	^ (1 to:nA) collect:
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   750
	    [:argIndex | 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   751
		|slot name|
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   752
		"/ search for an entry with that index (slot),
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   753
		"/ which has is valid at PC 0
102
de5ab089cf47 checkin from browser
cg
parents: 90
diff changeset
   754
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   755
		self isStatic ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   756
		    slot := argIndex
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   757
		] ifFalse:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   758
		    slot := argIndex + 1
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   759
		].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   760
		name := localVariableTable nameForSlot:slot atPC:0.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   761
		name isNil ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   762
		    'arg' , argIndex printString
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   763
		] ifFalse:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   764
		    name
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   765
		].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   766
	    ]
102
de5ab089cf47 checkin from browser
cg
parents: 90
diff changeset
   767
    ].
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   768
    ^ (1 to:nA) collect:[:i | 'arg' , i printString]
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   769
!
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
   770
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   771
name
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   772
    ^ (selector copyWithoutLast:signature size) asSymbol
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   773
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   774
    "Created: 16.4.1996 / 11:34:22 / cg"
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   775
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   776
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   777
numLocals
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   778
    ^super numVars.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   779
"/    numLocals isNil ifTrue:[^ 0].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   780
"/    ^ numLocals
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   781
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   782
    "Modified: / 3.1.1998 / 21:15:38 / cg"
118
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
   783
!
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
   784
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   785
numVars
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   786
    |n|
118
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
   787
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   788
    "/ a Java-stackframe includes the args in the locals
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   789
    n := self numLocals - self numArgs.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   790
    ^ n
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   791
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
   792
    "Modified: / 13.1.1998 / 17:34:37 / cg"
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   793
!
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   794
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   795
previousVersion
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   796
    ^ nil
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   797
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   798
    "Created: 30.7.1997 / 15:56:18 / cg"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   799
!
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
   800
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   801
retValSignature
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   802
    ^ self class retValSpecFromSignature:signature in:nil
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   803
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   804
    "Modified: / 8.1.1998 / 19:06:40 / cg"
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   805
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   806
123
4a5d4ac95782 checkin from browser
cg
parents: 118
diff changeset
   807
returnType
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   808
    "/ ^ returnType
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   809
    ^ self class typeFromSignature:signature in:nil.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   810
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   811
    "Modified: / 16.10.1998 / 00:17:43 / cg"
123
4a5d4ac95782 checkin from browser
cg
parents: 118
diff changeset
   812
!
4a5d4ac95782 checkin from browser
cg
parents: 118
diff changeset
   813
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   814
returnTypeClass
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   815
    |cls returnType|
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   816
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   817
    (returnType := self returnType) isNil ifTrue:[
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   818
        self halt.
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   819
    ].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   820
    cls := Java at:returnType.
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   821
    cls notNil ifTrue:[^ cls].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   822
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   823
    returnType == #void ifTrue:[
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   824
        ^ nil
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   825
    ].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   826
    returnType == #double ifTrue:[
334
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   827
        'warning: no returnTypeClass for double' printCR.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   828
"/        self halt:'no returnTypeClass for double'.
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   829
        ^ nil
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   830
    ].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   831
    returnType == #float ifTrue:[
334
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   832
        'warning: no returnTypeClass for float' printCR.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   833
"/        self halt:'no returnTypeClass for float'.
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   834
        ^ nil
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   835
    ].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   836
    returnType == #long ifTrue:[
334
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   837
        'warning: no returnTypeClass for long' printCR.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   838
"/        self halt:'no returnTypeClass for long'.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   839
        ^ nil
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   840
    ].
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   841
    returnType == #int ifTrue:[
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   842
        'warning: no returnTypeClass for int' printCR.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   843
"/        self halt:'no returnTypeClass for int'.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   844
        ^ nil
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   845
    ].
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   846
    returnType == #boolean ifTrue:[
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   847
        'warning: no returnTypeClass for boolean' printCR.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
   848
"/        self halt:'no returnTypeClass for boolean'.
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   849
        ^ nil
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   850
    ].
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   851
    self halt.
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   852
    ^ nil
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   853
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   854
    "Created: / 13.2.1998 / 15:08:26 / cg"
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   855
    "Modified: / 16.10.1998 / 00:16:07 / cg"
322
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   856
!
567088a5a1b0 partial support for getMethod0 & invokeMethod.
cg
parents: 321
diff changeset
   857
116
7d612d4450c0 *** empty log message ***
cg
parents: 113
diff changeset
   858
returnsDouble
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   859
    ^ self returnType == #double
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   860
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   861
    "Modified: / 16.10.1998 / 00:18:24 / cg"
116
7d612d4450c0 *** empty log message ***
cg
parents: 113
diff changeset
   862
!
7d612d4450c0 *** empty log message ***
cg
parents: 113
diff changeset
   863
72
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   864
returnsLong
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   865
    ^ self returnType == #long
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   866
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   867
    "Modified: / 16.10.1998 / 00:18:41 / cg"
72
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   868
!
9427aa6a8528 *** empty log message ***
cg
parents: 64
diff changeset
   869
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   870
returnsVoid
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   871
    ^ self returnType == #void
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   872
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   873
    "Modified: / 16.10.1998 / 00:18:53 / cg"
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   874
!
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   875
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   876
selector
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   877
    "/ could theoretically be extracted from my classes
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   878
    "/ methodDictionary via:
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   879
    "/  ^ javaClass methodDictionary keyAtValue:self ifAbsent:nil.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   880
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   881
    ^ selector
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   882
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   883
    "Created: / 7.1.1998 / 14:05:11 / cg"
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   884
    "Modified: / 16.10.1998 / 13:41:06 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   885
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   886
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   887
setAccessFlags:flags
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   888
    accessFlags := flags.
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   889
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   890
    "Created: 16.4.1996 / 11:34:14 / cg"
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   891
!
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   892
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   893
setCode:codeBytes maxStack:max_stack maxLocals:max_locals u1:unknown1 u2:unknown2
184
f65eb9c4ba6e checkin from browser
cg
parents: 175
diff changeset
   894
"/    javaByteCode := codeBytes.
f65eb9c4ba6e checkin from browser
cg
parents: 175
diff changeset
   895
    byteCode := codeBytes.
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   896
    "/ numStack := max_stack.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   897
    "/ numLocals := max_locals.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   898
    super numberOfVars:max_locals.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   899
    super stackSize:max_stack.
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   900
43
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
   901
"/    self displayString printNL.
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
   902
"/    '   nStack: ' print. numStack print. 
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
   903
"/    ' nLocal: ' print. numLocals print. 
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
   904
"/    ' u1: ' print. unknown1 print.
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
   905
"/    ' u2: ' print. unknown2 printNL.
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   906
184
f65eb9c4ba6e checkin from browser
cg
parents: 175
diff changeset
   907
    "Modified: 1.8.1997 / 00:08:32 / cg"
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   908
!
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   909
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   910
setJavaClass:aJavaClass
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   911
    javaClass := aJavaClass
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   912
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   913
    "Modified: 16.4.1996 / 12:36:27 / cg"
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   914
    "Created: 16.4.1996 / 15:28:15 / cg"
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   915
!
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   916
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   917
setLineNumberTable:anArrayOfPCtoLineAssociations
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   918
    "since this uses up lots of memory, compress it"
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   919
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   920
    |allBytes allWords idx|
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   921
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   922
    allBytes := allWords := true.
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   923
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   924
    anArrayOfPCtoLineAssociations do:[:assoc |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   925
	assoc key > 255 ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   926
	    allBytes := false.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   927
	    assoc key > 16rFFFF ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   928
		allWords := false.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   929
	    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   930
	].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   931
	assoc value > 255 ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   932
	    allBytes := false.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   933
	    assoc value > 16rFFFF ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   934
		allWords := false
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   935
	    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   936
	].
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   937
    ].
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   938
    allBytes ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   939
	lineNumberTable := ByteArray new:(anArrayOfPCtoLineAssociations size * 2).
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   940
    ] ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   941
	allWords ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   942
	    lineNumberTable := WordArray new:(anArrayOfPCtoLineAssociations size * 2).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   943
	] ifFalse:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   944
	    lineNumberTable := Array new:(anArrayOfPCtoLineAssociations size * 2).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   945
	]
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   946
    ].
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   947
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   948
    idx := 1.
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   949
    anArrayOfPCtoLineAssociations do:[:assoc |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   950
	lineNumberTable at:idx   put:assoc key.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   951
	lineNumberTable at:idx+1 put:assoc value.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   952
	idx := idx + 2.
90
918e2740098c resolve rewritten
cg
parents: 85
diff changeset
   953
    ].
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   954
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   955
    "Created: 16.4.1996 / 12:34:04 / cg"
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   956
    "Modified: 16.4.1996 / 12:49:06 / cg"
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   957
!
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   958
50
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   959
setLocalVariableTable:anArray
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   960
     localVariableTable := anArray.
50
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   961
!
458467ce0e15 checkin from browser
cg
parents: 48
diff changeset
   962
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   963
setName:nameString signature:signatureString
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   964
    selector := (nameString , signatureString) asSymbol.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   965
    self setSignature:signatureString
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   966
!
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   967
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
   968
setSignature:aString
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
   969
    |numArgs tooManyArgs returnType|
275
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   970
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   971
    signature := aString asSymbol.
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
   972
275
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   973
    numArgs := self class numArgsFromSignature:aString.
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   974
    (tooManyArgs := (numArgs > self class maxNumberOfArguments)) ifTrue:[
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   975
        numArgs := 0.
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   976
    ].
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   977
    self numberOfArgs:numArgs.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   978
    returnType := self class typeFromSignature:aString in:nil.
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
   979
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   980
    "/ for the convenience of the VM, also mirror the return type in
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   981
    "/ the flags ...
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   982
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   983
    returnType == #void ifTrue:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   984
        accessFlags := accessFlags bitOr:R_VOID
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   985
    ] ifFalse:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   986
        returnType == #long ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   987
            accessFlags := accessFlags bitOr:R_LONG
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   988
        ] ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   989
            returnType == #double ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   990
                accessFlags := accessFlags bitOr:R_DOUBLE
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   991
            ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   992
        ]
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   993
    ].
275
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   994
    tooManyArgs ifTrue:[
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   995
        ^ ArgumentSignal
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   996
            raiseRequestWith:self
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   997
            errorString:'too many args in method'
92b7ebb0b54c *** empty log message ***
cg
parents: 271
diff changeset
   998
    ].
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
   999
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1000
    "Created: / 16.4.1996 / 11:34:29 / cg"
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1001
    "Modified: / 16.10.1998 / 00:17:12 / cg"
27
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
  1002
!
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
  1003
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
  1004
signature
4560bb77bb36 checkin from browser
cg
parents: 19
diff changeset
  1005
    ^ signature 
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
  1006
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
  1007
    "Created: 16.4.1996 / 11:34:29 / cg"
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1008
!
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1009
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1010
source
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
  1011
    |classSource|
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1012
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1013
"/    self isNative ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1014
"/        ^ 'native method'
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1015
"/    ].
220
70b887df44a4 checkin from browser
cg
parents: 209
diff changeset
  1016
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
  1017
    ForceByteCodeDisplay == true ifTrue:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1018
	^ self decompiledBytecode
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
  1019
    ].
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
  1020
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
  1021
    lineNumberTable notNil ifTrue:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1022
	classSource := javaClass source.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1023
	classSource notNil ifTrue:[^ classSource].
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
  1024
    ].
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
  1025
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
  1026
    ^ self decompiledSource
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
  1027
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1028
    "Modified: / 4.1.1998 / 13:48:35 / cg"
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1029
!
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1030
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1031
sourceFilename
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1032
    ^ javaClass sourceFile
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1033
!
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1034
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1035
sourceLineNumber
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1036
    ForceByteCodeDisplay == true ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1037
	^ 1
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1038
    ].
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1039
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1040
    lineNumberTable notNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1041
	^ lineNumberTable at:2
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1042
    ].
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1043
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1044
    ^ 1
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1045
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1046
    "Created: 30.7.1997 / 15:40:45 / cg"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1047
    "Modified: 30.7.1997 / 15:46:12 / cg"
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1048
! !
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1049
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1050
!JavaMethod methodsFor:'debugging'!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1051
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1052
breakPoint
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1053
    Debugger enter:thisContext sender withMessage:'breakpoint'
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1054
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1055
    "Modified: / 9.1.1998 / 23:01:17 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1056
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1057
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1058
clearBreakPoint
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1059
    accessFlags := (accessFlags bitClear:A_BREAKPOINT)
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1060
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1061
257
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1062
isCounting
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1063
    ^ false.
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1064
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1065
    "Created: / 12.1.1998 / 20:02:23 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1066
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1067
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1068
isCountingMemoryUsage
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1069
    ^ false.
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1070
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1071
    "Created: / 12.1.1998 / 20:03:22 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1072
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1073
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1074
setBreakPoint
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1075
    accessFlags := (accessFlags bitOr:A_BREAKPOINT)
257
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1076
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1077
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1078
setTraceFullPoint
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1079
    "not yet implemented"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1080
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1081
    "Modified: / 9.1.1998 / 23:01:17 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1082
    "Created: / 12.1.1998 / 20:04:45 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1083
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1084
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1085
setTracePoint
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1086
    "not yet implemented"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1087
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1088
    "Modified: / 9.1.1998 / 23:01:17 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1089
    "Created: / 12.1.1998 / 20:04:02 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1090
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1091
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1092
setTraceSenderPoint
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1093
    "not yet implemented"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1094
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1095
    "Modified: / 9.1.1998 / 23:01:17 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1096
    "Created: / 12.1.1998 / 20:04:35 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1097
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1098
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1099
startCounting
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1100
    "not yet implemented"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1101
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1102
    "Modified: / 9.1.1998 / 23:01:17 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1103
    "Created: / 12.1.1998 / 20:05:01 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1104
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1105
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1106
startCountingMemoryUsage
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1107
    "not yet implemented"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1108
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1109
    "Modified: / 9.1.1998 / 23:01:17 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1110
    "Created: / 12.1.1998 / 20:05:04 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1111
!
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1112
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1113
startTiming
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1114
    "not yet implemented"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1115
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1116
    "Modified: / 9.1.1998 / 23:01:17 / cg"
f0d546da7ac3 checkin from browser
cg
parents: 256
diff changeset
  1117
    "Created: / 12.1.1998 / 20:04:57 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1118
! !
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1119
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1120
!JavaMethod methodsFor:'decompiling'!
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1121
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1122
decompileSourceTo:aStream
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1123
"/    self isNative ifFalse:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1124
"/        self isAbstract ifFalse:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1125
            aStream nextPutAll:'// '; cr.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1126
            aStream nextPutAll:'// decompiled source'; cr.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1127
            aStream nextPutAll:'// '; cr.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1128
            aStream cr.
155
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1129
            SignalSet anySignal handle:[:ex |
387
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1130
                ex signal == Object haltSignal ifTrue:[ex reject].
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1131
                ex signal == MessageTracer breakpointSignal ifTrue:[ex reject].
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1132
                ex signal == Signal noHandlerSignal ifTrue:[ex reject].
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1133
155
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1134
                aStream nextPutAll:'error while decompiling:'.
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1135
                aStream cr; cr; spaces:4.
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1136
                aStream nextPutAll:ex errorString.
402
39eaf0d70bf8 checkin from browser
cg
parents: 387
diff changeset
  1137
                aStream cr.
39eaf0d70bf8 checkin from browser
cg
parents: 387
diff changeset
  1138
                aStream nextPutAll:ex suspendedContext printString.
39eaf0d70bf8 checkin from browser
cg
parents: 387
diff changeset
  1139
                aStream cr.
39eaf0d70bf8 checkin from browser
cg
parents: 387
diff changeset
  1140
                aStream nextPutAll:ex suspendedContext sender printString.
39eaf0d70bf8 checkin from browser
cg
parents: 387
diff changeset
  1141
                aStream cr.
404
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1142
                aStream nextPutAll:ex suspendedContext sender sender printString.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1143
                aStream cr.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1144
                aStream nextPutAll:ex suspendedContext sender sender sender printString.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1145
                aStream cr.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1146
                aStream nextPutAll:ex suspendedContext sender sender sender sender printString.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1147
                aStream cr.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1148
                aStream nextPutAll:ex suspendedContext sender sender sender sender sender printString.
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1149
                aStream cr.
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1150
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1151
                JavaDecompiler decompile:self to:aStream.
155
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1152
                ex return
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1153
            ] do:[
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1154
                aStream nextPutAll:(JavaDeparser decompile:self).
2c5558dd2b29 checkin from browser
cg
parents: 154
diff changeset
  1155
            ].
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1156
"/        ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1157
"/    ].
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1158
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1159
    "Created: / 30.7.1997 / 16:28:09 / cg"
404
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1160
    "Modified: / 20.10.1998 / 10:01:08 / cg"
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1161
!
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1162
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1163
decompiler
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1164
    ^ JavaDecompiler
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1165
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1166
    "Created: 30.7.1997 / 16:36:48 / cg"
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1167
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1168
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1169
originalMethod
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1170
    ^ self
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1171
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1172
    "Created: / 13.1.1998 / 15:03:05 / cg"
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1173
! !
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1174
277
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1175
!JavaMethod methodsFor:'error handling'!
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1176
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1177
invalidByteCode
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1178
    self isAbstract ifTrue:[
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1179
        ^ AbstractMethodInvokationSignal raise.
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1180
    ].
309
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
  1181
    ((self class numArgsFromSignature:signature) > self class maxNumberOfArguments) ifTrue:[
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
  1182
	^ self error:'method cannot be executed - too many args'
e1bfd26cadae *** empty log message ***
cg
parents: 277
diff changeset
  1183
    ].
277
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1184
    ^ super invalidByteCode
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1185
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1186
    "Created: / 27.1.1998 / 21:48:01 / cg"
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1187
    "Modified: / 27.1.1998 / 21:50:19 / cg"
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1188
!
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1189
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1190
invalidMethodRef
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1191
    self halt.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1192
    ^ nil.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1193
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1194
    "Modified: / 27.1.1998 / 21:50:19 / cg"
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1195
    "Created: / 16.10.1998 / 11:27:21 / cg"
277
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1196
! !
511c3bb153b7 jdk1.2 stuff.
cg
parents: 275
diff changeset
  1197
118
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1198
!JavaMethod methodsFor:'methodref interchangability'!
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1199
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1200
method
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1201
    ^ self
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1202
! !
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1203
148
db560ebab8b5 *** empty log message ***
cg
parents: 143
diff changeset
  1204
!JavaMethod methodsFor:'misc'!
db560ebab8b5 *** empty log message ***
cg
parents: 143
diff changeset
  1205
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1206
fromMethod:aJavaMethod
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1207
    "copy values from another javaMethod"
149
d6fe26e9af47 *** empty log message ***
cg
parents: 148
diff changeset
  1208
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1209
    flags := aJavaMethod flags.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1210
    byteCode := aJavaMethod byteCode.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1211
    accessFlags := aJavaMethod accessFlags.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1212
    selector := aJavaMethod selector.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1213
    javaClass := aJavaMethod javaClass.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1214
    signature := aJavaMethod signature.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1215
    lineNumberTable := aJavaMethod lineNumberTable.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1216
    localVariableTable := aJavaMethod localVariableTable.
148
db560ebab8b5 *** empty log message ***
cg
parents: 143
diff changeset
  1217
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1218
    "Modified: / 16.10.1998 / 01:27:19 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1219
!
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1220
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1221
updateClassRefsFrom:oldClass to:newClass
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1222
    javaClass == oldClass ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1223
        "/ invalidate
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1224
        byteCode := nil.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1225
    ]
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1226
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1227
    "Created: / 6.1.1998 / 18:19:48 / cg"
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1228
! !
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1229
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1230
!JavaMethod methodsFor:'printing & storing'!
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1231
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
  1232
displayString
168
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1233
    javaClass isNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1234
	^ 'JavaMethod(???)'
168
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1235
    ].
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
  1236
    ^ 'JavaMethod(' , javaClass name , '::' , self signatureName , ')'
168
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1237
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1238
    "Modified: 7.4.1997 / 15:54:10 / cg"
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
  1239
!
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
  1240
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1241
printStringForBrowserWithSelector:dummySelector
43
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
  1242
"/    self isStatic ifTrue:[
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
  1243
"/        ^ 'static ' , self signatureName
2c4ca2eb8d07 checkin from browser
cg
parents: 31
diff changeset
  1244
"/    ].
168
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1245
"/    self isBreakpointed ifTrue:[
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1246
"/        ^ (LabelAndIcon '!! ' , self signatureName
90e39cb3fa04 *** empty log message ***
cg
parents: 166
diff changeset
  1247
"/    ].
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1248
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1249
    self name = #'<init>' ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1250
	^ self class specTextFromSignature:signature withName:(javaClass name).
166
3bb2f7fbd489 checkin from browser
cg
parents: 164
diff changeset
  1251
    ].
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1252
    ^ self signatureNameText
166
3bb2f7fbd489 checkin from browser
cg
parents: 164
diff changeset
  1253
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1254
    "Modified: 30.7.1997 / 14:40:42 / cg"
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
  1255
!
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
  1256
118
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1257
shortDisplayString
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1258
    ^ javaClass name , '::' , self signatureNameWithoutReturnType
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1259
!
c1f888534eed fixed numVar/numLocal & numStacl stuff
cg
parents: 116
diff changeset
  1260
10
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
  1261
signatureName
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
  1262
    "return a string to be used when browsing"
1f803ce6d3fc better signature code
cg
parents: 8
diff changeset
  1263
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1264
    ^ self class specFromSignature:signature withName:(self name) in:nil
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1265
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1266
    "Modified: / 8.1.1998 / 19:15:33 / cg"
113
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
  1267
!
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
  1268
164
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1269
signatureNameFor:name withArgsIn:aPackage
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1270
    "return a string to be used when decompiling"
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1271
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1272
    ^ self class specWithArgsFromSignature:signature withName:name in:aPackage
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1273
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1274
    "Created: 25.3.1997 / 18:49:45 / cg"
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1275
!
724c443e6f79 *** empty log message ***
cg
parents: 156
diff changeset
  1276
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1277
signatureNameIn:aPackage
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1278
    "return a string to be used when browsing"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1279
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1280
    ^ self class specFromSignature:signature withName:(self name) in:aPackage
142
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1281
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1282
    "Created: 18.3.1997 / 11:11:01 / cg"
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1283
!
1cc00567fb75 *** empty log message ***
cg
parents: 141
diff changeset
  1284
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1285
signatureNameText
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1286
    "return a text to be used when browsing"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1287
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1288
    ^ self class specTextFromSignature:signature withName:(self name)
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1289
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1290
    "Created: 30.7.1997 / 14:40:29 / cg"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1291
!
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1292
189
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1293
signatureNameTextFor:name withArgsIn:aPackage
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1294
    "return a text to be used when decompiling"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1295
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1296
    ^ self class specTextWithArgsFromSignature:signature withName:name in:aPackage
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1297
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1298
    "Created: 25.3.1997 / 18:49:45 / cg"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1299
    "Modified: 1.8.1997 / 10:44:28 / cg"
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1300
!
babfb18fc67b signature parsing
cg
parents: 184
diff changeset
  1301
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1302
signatureNameWithArgNames:argNames
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1303
    "return a string to be used when browsing"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1304
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1305
    |myName|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1306
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1307
    myName := self name.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1308
    myName = '<init>' ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1309
        myName := javaClass name
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1310
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1311
    ^ self class specFromSignature:signature withName:myName argNames:argNames in:nil
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1312
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1313
    "Created: / 8.1.1998 / 21:04:03 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1314
    "Modified: / 8.1.1998 / 21:22:38 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1315
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1316
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1317
signatureNameWithArgNames:argNames in:package
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1318
    "return a string to be used when browsing"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1319
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1320
    |myName|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1321
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1322
    myName := self name.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1323
    myName = '<init>' ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1324
        myName := javaClass name
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1325
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1326
    ^ self class specFromSignature:signature withName:myName argNames:argNames in:package
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1327
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1328
    "Modified: / 8.1.1998 / 21:05:52 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1329
    "Created: / 8.1.1998 / 21:23:03 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1330
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1331
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1332
signatureNameWithArgsIn:aPackage
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1333
    "return a string to be used when browsing"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1334
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1335
    ^ self class specWithArgsFromSignature:signature withName:(self name) in:aPackage
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1336
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1337
    "Created: 20.3.1997 / 12:44:17 / cg"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1338
!
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1339
113
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
  1340
signatureNameWithoutReturnType
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
  1341
    "return a string to be used when browsing"
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
  1342
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1343
    ^ self class argSpecFromSignature:signature withName:(self name)
113
481bf55e161e *** empty log message ***
cg
parents: 111
diff changeset
  1344
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1345
! !
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1346
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1347
!JavaMethod methodsFor:'queries'!
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1348
111
23243f9273fa *** empty log message ***
cg
parents: 102
diff changeset
  1349
handlerFor:anException at:pc
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1350
    ^ nil
48
1e12f315ed97 checkin from browser
cg
parents: 46
diff changeset
  1351
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1352
    "Created: / 16.10.1998 / 02:06:11 / cg"
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1353
!
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1354
127
96f1bf74011f *** empty log message ***
cg
parents: 123
diff changeset
  1355
hasResource
96f1bf74011f *** empty log message ***
cg
parents: 123
diff changeset
  1356
    ^ false
96f1bf74011f *** empty log message ***
cg
parents: 123
diff changeset
  1357
!
96f1bf74011f *** empty log message ***
cg
parents: 123
diff changeset
  1358
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1359
isAbstract
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1360
    ^ (accessFlags bitAnd:A_ABSTRACT) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1361
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1362
80
f08d2cab0b55 *** empty log message ***
cg
parents: 75
diff changeset
  1363
isBreakpointed
256
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1364
    ^ (accessFlags bitAnd:A_BREAKPOINT) ~~ 0
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1365
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1366
    "Modified: / 11.1.1998 / 13:28:43 / cg"
80
f08d2cab0b55 *** empty log message ***
cg
parents: 75
diff changeset
  1367
!
f08d2cab0b55 *** empty log message ***
cg
parents: 75
diff changeset
  1368
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1369
isFinal
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1370
    ^ (accessFlags bitAnd:A_FINAL) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1371
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1372
175
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1373
isIgnored
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1374
    "not really a java attribute;
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1375
     added to allow browsing"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1376
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1377
    ^ false.
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1378
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1379
    "Created: 30.7.1997 / 15:34:33 / cg"
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1380
!
68da52e100ab *** empty log message ***
cg
parents: 174
diff changeset
  1381
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1382
isNative
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1383
    ^ (accessFlags bitAnd:A_NATIVE) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1384
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1385
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1386
isPrivate
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1387
    ^ (accessFlags bitAnd:A_PRIVATE) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1388
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1389
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1390
isProtected
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1391
    ^ (accessFlags bitAnd:A_PROTECTED) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1392
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1393
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1394
isPublic
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1395
    ^ (accessFlags bitAnd:A_PUBLIC) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1396
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1397
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1398
isStatic
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1399
    ^ (accessFlags bitAnd:A_STATIC) ~~ 0
19
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1400
!
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1401
512a19e2d46f checkin from browser
cg
parents: 18
diff changeset
  1402
isSynchronized
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1403
    ^ (accessFlags bitAnd:A_SYNCHRONIZED) ~~ 0
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1404
!
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1405
256
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1406
isTraced
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1407
    ^ false
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1408
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1409
    "Modified: / 11.1.1998 / 13:28:43 / cg"
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1410
    "Created: / 11.1.1998 / 13:38:11 / cg"
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1411
!
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1412
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1413
isUnloaded
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1414
    ^ false
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1415
!
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1416
256
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1417
isWrapped
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1418
    ^ self isBreakpointed
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1419
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1420
    "Modified: / 11.1.1998 / 13:28:43 / cg"
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1421
    "Created: / 11.1.1998 / 13:38:04 / cg"
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1422
!
2cbf20ad74b2 checkin from browser
cg
parents: 255
diff changeset
  1423
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1424
lineNumberForPC:pc
75
9816a04c8b21 checkin from browser
cg
parents: 72
diff changeset
  1425
    |last num text classSource|
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1426
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1427
    num := nil.
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1428
207
dfbd9b69a64e checkin from browser
cg
parents: 189
diff changeset
  1429
    ForceByteCodeDisplay == true ifFalse:[
169
269f334e9f34 *** empty log message ***
cg
parents: 168
diff changeset
  1430
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1431
        lineNumberTable notNil ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1432
            classSource := javaClass source.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1433
            classSource notNil ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1434
                lineNumberTable pairWiseDo:[:lPc :lNr |
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1435
                    lPc >= pc ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1436
                        lPc == pc ifTrue:[^ lNr].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1437
                        last isNil ifTrue:[^ lNr].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1438
                        ^ last.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1439
                    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1440
                    last := lNr.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1441
                ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1442
                last notNil ifTrue:[        
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1443
                    ^ last
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1444
                ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1445
                ^ lineNumberTable at:2
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1446
            ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1447
        ].
46
db9b84631d43 checkin from browser
cg
parents: 43
diff changeset
  1448
    ].
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1449
46
db9b84631d43 checkin from browser
cg
parents: 43
diff changeset
  1450
    "/ decompile and look which line the pc falls into
209
9e4b45da1117 checkin from browser
cg
parents: 207
diff changeset
  1451
9e4b45da1117 checkin from browser
cg
parents: 207
diff changeset
  1452
    ForceByteCodeDisplay == true ifTrue:[
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1453
        text := self decompiledBytecode asCollectionOfLines.
209
9e4b45da1117 checkin from browser
cg
parents: 207
diff changeset
  1454
    ] ifFalse:[
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1455
        text := self decompiledSource asCollectionOfLines.
209
9e4b45da1117 checkin from browser
cg
parents: 207
diff changeset
  1456
    ].
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1457
46
db9b84631d43 checkin from browser
cg
parents: 43
diff changeset
  1458
    text keysAndValuesDo:[:lineNr :line |
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1459
        |nr|
46
db9b84631d43 checkin from browser
cg
parents: 43
diff changeset
  1460
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1461
        (line startsWith:'    ') ifFalse:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1462
            nr := Integer readFrom:line onError:0.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1463
            nr >= pc ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1464
                ^ lineNr
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1465
            ]
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1466
        ]
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1467
    ].
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1468
    ^ num
141
0baa4706b898 checkin from browser
cg
parents: 135
diff changeset
  1469
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1470
    "Modified: / 14.1.1998 / 13:30:54 / cg"
31
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1471
!
644123641e2c java exceptions (java handlers not yet implemented)
cg
parents: 29
diff changeset
  1472
156
fee47d32724d *** empty log message ***
cg
parents: 155
diff changeset
  1473
package
fee47d32724d *** empty log message ***
cg
parents: 155
diff changeset
  1474
    ^ 'none'
fee47d32724d *** empty log message ***
cg
parents: 155
diff changeset
  1475
fee47d32724d *** empty log message ***
cg
parents: 155
diff changeset
  1476
    "Created: 5.2.1997 / 11:31:26 / cg"
fee47d32724d *** empty log message ***
cg
parents: 155
diff changeset
  1477
!
fee47d32724d *** empty log message ***
cg
parents: 155
diff changeset
  1478
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1479
who
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1480
    "return the class and selector of where I am defined in."
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1481
64
2e4b425dc40c changes for new methodDict
cg
parents: 55
diff changeset
  1482
    |sel|
18
6c07dc4b1118 checkin from browser
cg
parents: 10
diff changeset
  1483
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1484
    javaClass isNil ifTrue:[^ nil].
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1485
    sel := selector.
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1486
    "/ sel := javaClass methodDictionary keyAtValue:self ifAbsent:nil.
64
2e4b425dc40c changes for new methodDict
cg
parents: 55
diff changeset
  1487
    sel isNil ifTrue:[^ nil].
129
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
  1488
    ^ Method::MethodWhoInfo class:javaClass selector:sel.
378
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1489
a4701f1e93ba splitted - JavaMethodWithHandler used for those with an
cg
parents: 360
diff changeset
  1490
    "Modified: / 16.10.1998 / 13:42:10 / cg"
5
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
  1491
! !
f026f5d20c15 checkin from browser
cg
parents: 2
diff changeset
  1492
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1493
!JavaMethod methodsFor:'signature parsing'!
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1494
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1495
XXXspecWithArgsFromSignature:aSignature withName:name in:aPackage
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1496
    "given a signature, return a spec with args"
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1497
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1498
    |s argSpec retvalSpec|
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1499
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1500
    s := aSignature readStream.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1501
    s next ~~ $( ifTrue:[self halt. ^ name].
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1502
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1503
    argSpec := self argSpecWithArgsFromStream:s in:aPackage.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1504
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1505
    s next ~~ $) ifTrue:[self halt. ^ name].
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1506
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1507
    retvalSpec := self retvalSpecFromStream:s in:aPackage.
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1508
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1509
    ^ retvalSpec , ' ' , name , ' (' , argSpec , ')'
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1510
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1511
    "
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1512
     JavaMethod specFromSignature:'(LObject;)V' withName:'foo' 
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1513
     JavaMethod specFromSignature:'(BB)S'       withName:'foo' 
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1514
    "
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1515
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1516
    "Created: / 8.1.1998 / 19:17:58 / cg"
154
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1517
! !
d51e897b4b5f checkin from browser
cg
parents: 149
diff changeset
  1518
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1519
!JavaMethod methodsFor:'vm support'!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1520
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1521
_aaload:arr _:index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1522
    "this is only invoked, if aaload encounters either a bad index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1523
     or an unknown array-class."
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1524
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1525
    |i|
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1526
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1527
    i := index + 1.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1528
    (i between:1 and:arr size) ifFalse:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1529
        JavaVM throwArrayIndexOutOfBoundsException:index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1530
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1531
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1532
    'Java: warning bad array in aaload' errorPrintCR.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1533
    ^ arr at:i
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1534
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1535
    "Modified: / 14.1.1998 / 23:19:59 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1536
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1537
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1538
_aastore:arr _:index _:num
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1539
    "this is only invoked, if aastore encounters either a bad index,
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1540
     or an unknown array-class."
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1541
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1542
    |i|
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1543
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1544
    i := index + 1.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1545
    (i between:1 and:arr size) ifFalse:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1546
        JavaVM throwArrayIndexOutOfBoundsException:index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1547
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1548
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1549
    'Java: warning bad array in aastore' errorPrintCR.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1550
    arr at:i put:num
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1551
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1552
    "Modified: / 14.1.1998 / 23:19:42 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1553
    "Created: / 14.1.1998 / 23:22:01 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1554
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1555
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1556
_arrayLength:arr
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1557
    ^ arr size
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1558
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1559
    "Created: / 5.1.1998 / 02:40:01 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1560
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1561
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1562
_athrow:aJavaException
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1563
    JavaVM throwException:aJavaException.
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1564
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1565
    "Created: / 4.1.1998 / 14:37:04 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1566
    "Modified: / 9.1.1998 / 02:26:50 / cg"
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1567
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1568
334
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1569
_caload:arr _:index
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1570
    "this is only invoked, if caload encounters either a bad index
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1571
     or a non-string-receiver."
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1572
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1573
    |i|
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1574
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1575
    i := index + 1.
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1576
    (i between:1 and:arr size) ifFalse:[
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1577
        JavaVM throwArrayIndexOutOfBoundsException:index
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1578
    ].
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1579
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1580
    ^ arr at:i
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1581
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1582
    "Modified: / 14.1.1998 / 23:19:59 / cg"
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1583
    "Created: / 9.4.1998 / 17:51:42 / cg"
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1584
!
638045537cf7 *** empty log message ***
cg
parents: 332
diff changeset
  1585
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1586
_checkCast:anObject class:aClassOrInterface
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1587
    "trampouline for unhandled cases ..."
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1588
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1589
    aClassOrInterface isBehavior ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1590
        aClassOrInterface isInterface ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1591
            (anObject class hasInterface:aClassOrInterface) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1592
                ^ true
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1593
            ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1594
        ].
271
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1595
        ^ (anObject isKindOf:aClassOrInterface)
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1596
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1597
    (aClassOrInterface isMemberOf:JavaClassPointerRef) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1598
        "/ must be a pointer to an array of that class
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1599
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1600
        ^ anObject isArray 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1601
    ].
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1602
    (aClassOrInterface isMemberOf:JavaBuiltInClassPointerRef) ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1603
        aClassOrInterface arrayClass == anObject class ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1604
            ^ true
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1605
        ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1606
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1607
271
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1608
    (anObject isMemberOf:Array) ifTrue:[
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1609
        anObject size == 0 ifTrue:[
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1610
            ^ true
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1611
        ].
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1612
        ^ self _checkCast:(anObject at:1) class:(aClassOrInterface deref).
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1613
    ].
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1614
    self halt.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1615
    ^ false.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1616
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1617
    "Created: / 4.1.1998 / 16:44:59 / cg"
271
a69c9491d69b checkin from browser
cg
parents: 264
diff changeset
  1618
    "Modified: / 25.1.1998 / 18:25:03 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1619
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1620
387
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1621
_d2l:op1
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1622
    |v|
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1623
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1624
    v := op1 asInteger.
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1625
    v > 16r7FFFFFFFFFFFFFFF ifTrue:[
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1626
        self halt.
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1627
        v := 16r7FFFFFFFFFFFFFFF
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1628
    ] ifFalse:[
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1629
        v < 16r8000000000000000 negated ifTrue:[
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1630
            self halt.
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1631
            v := 16r8000000000000000 negated
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1632
        ]
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1633
    ].
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1634
    ^ v
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1635
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1636
    "Created: / 7.1.1998 / 00:23:28 / cg"
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1637
    "Modified: / 17.10.1998 / 21:55:49 / cg"
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1638
!
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1639
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1640
_ddiv:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1641
    |quo|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1642
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1643
    quo := op1 / op2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1644
    ^ quo asFloat
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1645
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1646
    "Modified: / 7.1.1998 / 00:55:35 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1647
    "Created: / 8.1.1998 / 00:39:23 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1648
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1649
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1650
_iaload:arr _:index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1651
    "this is only invoked, if iaload encounters either a bad index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1652
     or an unknown array-class."
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1653
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1654
    |i|
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1655
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1656
    i := index + 1.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1657
    (i between:1 and:arr size) ifFalse:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1658
        JavaVM throwArrayIndexOutOfBoundsException:index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1659
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1660
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1661
    'Java: warning bad array in iaload' errorPrintCR.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1662
    ^ (arr at:i) asInteger
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1663
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1664
    "Modified: / 14.1.1998 / 23:19:42 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1665
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1666
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1667
_iastore:arr _:index _:num
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1668
    "this is only invoked, if iastore encounters either a bad index,
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1669
     bad number to store, or an unknown array-class."
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1670
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1671
    |i|
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1672
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1673
    i := index + 1.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1674
    (i between:1 and:arr size) ifFalse:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1675
        JavaVM throwArrayIndexOutOfBoundsException:index
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1676
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1677
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1678
    'Java: warning bad array in iastore' errorPrintCR.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1679
    arr at:i put:num
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1680
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1681
    "Modified: / 14.1.1998 / 23:19:42 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1682
    "Created: / 14.1.1998 / 23:21:38 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1683
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1684
323
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1685
_instanceof:anObject _:aClassOrInterface
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1686
    "trampouline for unhandled cases ..."
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1687
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1688
"/    aClassOrInterface isInterface ifTrue:[
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1689
"/        (anObject class hasInterface:aClassOrInterface) ifTrue:[
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1690
"/(aClassOrInterface name includesString:'LightweightPeer') ifTrue:[self halt].
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1691
"/            ^ 1
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1692
"/        ].
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1693
"/    ].
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1694
"/ (aClassOrInterface name includesString:'LightweightPeer') ifTrue:[self halt].
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1695
    ^ 0.
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1696
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1697
    "Created: / 13.2.1998 / 17:42:38 / cg"
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1698
    "Modified: / 13.2.1998 / 18:03:03 / cg"
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1699
!
97a1281ec215 checkin from browser
cg
parents: 322
diff changeset
  1700
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1701
_l2d:op1
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1702
    ^ op1 asFloat
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1703
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1704
    "Created: / 7.1.1998 / 00:23:28 / cg"
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1705
    "Modified: / 13.1.1998 / 14:31:59 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1706
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1707
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1708
_ladd:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1709
    |sum|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1710
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1711
    sum := (op1 + op2) bitAnd:16rFFFFFFFFFFFFFFFF.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1712
    ^ sum
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1713
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1714
    "Created: / 6.1.1998 / 21:06:34 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1715
    "Modified: / 9.1.1998 / 03:05:28 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1716
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1717
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1718
_land:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1719
    |rslt|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1720
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1721
    (op1 < 0 or:[op2 < 0]) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1722
        self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1723
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1724
    rslt := op1 bitAnd: op2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1725
    ^ rslt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1726
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1727
    "Created: / 7.1.1998 / 16:46:50 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1728
    "Modified: / 7.1.1998 / 21:21:53 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1729
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1730
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1731
_ldiv:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1732
    |quo|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1733
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1734
    quo := op1 quo: op2.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1735
    ^ quo
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1736
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1737
    "Created: / 7.1.1998 / 00:17:23 / cg"
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1738
    "Modified: / 14.1.1998 / 13:38:38 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1739
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1740
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1741
_lmul:op1 _:op2
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1742
    |prod o1 o2 sign|
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1743
387
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1744
"/ self halt.
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1745
    "/ ST's largeIntegers compute a correct result;
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1746
    "/ but here, we want the overflow to flow into the
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1747
    "/ sign bit ... (sigh)
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1748
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1749
    sign := 1.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1750
    (o1 := op1) < 0 ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1751
        sign := -1.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1752
        o1 := o1 negated.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1753
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1754
    (o2 := op2) < 0 ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1755
        sign := sign negated.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1756
        o2 := o2 negated.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1757
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1758
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1759
    prod := (o1 * o2) bitAnd:16rFFFFFFFFFFFFFFFF.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1760
    (prod bitAnd:16r8000000000000000) ~~ 0 ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1761
    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1762
    sign == -1 ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1763
        prod := prod negated
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1764
    ].
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1765
    ^ prod
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1766
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1767
    "Created: / 7.1.1998 / 00:17:34 / cg"
387
a1dd166ff2ec added d2l support.
cg
parents: 378
diff changeset
  1768
    "Modified: / 17.10.1998 / 21:56:52 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1769
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1770
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1771
_lor:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1772
    |rslt|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1773
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1774
    (op1 < 0 or:[op2 < 0]) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1775
        self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1776
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1777
    rslt := op1 bitOr: op2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1778
    ^ rslt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1779
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1780
    "Created: / 7.1.1998 / 21:21:42 / cg"
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1781
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1782
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1783
_lrem:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1784
    |rem|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1785
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1786
    rem := op1 rem: op2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1787
    ^ rem
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1788
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1789
    "Modified: / 7.1.1998 / 00:23:11 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1790
    "Created: / 7.1.1998 / 00:55:26 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1791
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1792
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1793
_lshl:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1794
    |rslt|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1795
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1796
    op1 < 0 ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1797
        self halt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1798
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1799
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1800
    (op1 < 0) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1801
        self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1802
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1803
    rslt := (op1 bitShift:op2) bitAnd:16rFFFFFFFFFFFFFFFF.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1804
    ^ rslt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1805
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1806
    "Created: / 7.1.1998 / 16:49:47 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1807
    "Modified: / 7.1.1998 / 21:22:32 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1808
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1809
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1810
_lshr:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1811
    |rslt|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1812
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1813
    op1 < 0 ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1814
        self halt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1815
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1816
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1817
    (op1 < 0) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1818
        self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1819
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1820
    rslt := (op1 bitShift:op2 negated) bitAnd:16rFFFFFFFFFFFFFFFF.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1821
    ^ rslt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1822
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1823
    "Created: / 7.1.1998 / 16:49:29 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1824
    "Modified: / 7.1.1998 / 21:22:25 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1825
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1826
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1827
_lsub:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1828
    |diff|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1829
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1830
    diff := (op1 - op2) bitAnd:16rFFFFFFFFFFFFFFFF.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1831
    ^ diff
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1832
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1833
    "Created: / 6.1.1998 / 21:12:35 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1834
    "Modified: / 9.1.1998 / 03:05:12 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1835
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1836
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1837
_lushr:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1838
    |rslt|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1839
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1840
    op1 < 0 ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1841
        self halt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1842
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1843
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1844
    (op1 < 0) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1845
        self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1846
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1847
    rslt := (op1 bitShift:op2 negated) bitAnd:16rFFFFFFFFFFFFFFFF.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1848
    ^ rslt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1849
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1850
    "Created: / 7.1.1998 / 16:49:07 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1851
    "Modified: / 7.1.1998 / 21:22:17 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1852
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1853
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1854
_lxor:op1 _:op2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1855
    |rslt|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1856
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1857
    (op1 < 0 or:[op2 < 0]) ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1858
        self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1859
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1860
    rslt := op1 bitXor: op2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1861
    ^ rslt
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1862
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1863
    "Created: / 7.1.1998 / 16:40:04 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1864
    "Modified: / 7.1.1998 / 21:22:00 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1865
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1866
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1867
_multiNew:typeRef _:dim1 
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1868
    |clsRef cls arr elType elSizes|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1869
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1870
    clsRef := typeRef asClassPointerRef.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1871
    cls := clsRef arrayClass.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1872
    arr := cls new:dim1.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1873
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1874
    ^ arr
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1875
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1876
    "Modified: / 7.4.1997 / 13:45:19 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1877
    "Created: / 6.1.1998 / 23:15:38 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1878
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1879
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1880
_multiNew:typeRef _:dim1 _:dim2
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1881
    |clsRef cls arr elType elSizes|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1882
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1883
    clsRef := typeRef asClassPointerRef.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1884
    cls := clsRef arrayClass.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1885
    arr := cls new:dim2.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1886
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1887
    elType := typeRef deref.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1888
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1889
    1 to:dim2 do:[:idx |
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1890
        arr at:idx put:(self _multiNew:elType _:dim1)
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1891
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1892
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1893
    ^ arr
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1894
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1895
    "Created: / 6.1.1998 / 23:15:47 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1896
    "Modified: / 6.1.1998 / 23:34:28 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1897
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1898
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1899
_multiNew:typeRef _:dim1 _:dim2 _:dim3
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1900
    |clsRef cls arr elType elSizes|
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1901
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1902
    clsRef := typeRef asClassPointerRef.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1903
    cls := clsRef arrayClass.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1904
    arr := cls new:dim3.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1905
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1906
    elType := typeRef deref.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1907
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1908
    1 to:dim3 do:[:idx |
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1909
        arr at:idx put:(self _multiNew:elType _:dim1 _:dim2)
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1910
    ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1911
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1912
"/ self halt.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1913
    ^ arr
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1914
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1915
    "Created: / 6.1.1998 / 23:15:53 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1916
    "Modified: / 6.1.1998 / 23:34:35 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1917
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1918
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1919
_saload:arr at:index 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1920
    ^ arr at:index+1
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1921
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1922
    "Created: / 5.1.1998 / 02:44:40 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1923
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1924
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1925
_sastore:arr at:index put:val
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1926
    arr at:index+1 put:val
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1927
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1928
    "Created: / 5.1.1998 / 02:35:52 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1929
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1930
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1931
divisionByZero
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1932
    JavaVM 
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1933
        throwExceptionClassName:'java.lang.ArithmeticException'
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1934
        withMessage:'/ by zero'
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1935
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1936
    "Created: / 15.1.1998 / 02:27:23 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1937
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1938
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1939
enterSynchronized
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1940
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1941
    "Created: / 9.1.1998 / 10:53:10 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1942
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1943
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1944
monitorEnter:someObject
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1945
    ^ JavaVM monitorEnter:someObject
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1946
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1947
    "Modified: / 2.1.1998 / 23:45:36 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1948
    "Created: / 14.1.1998 / 20:58:43 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1949
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1950
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1951
monitorExit:someObject
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1952
    ^ JavaVM monitorExit:someObject
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1953
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1954
    "Created: / 14.1.1998 / 20:58:48 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1955
!
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1956
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1957
nativeMethodInvokation
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1958
    |sel|
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1959
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1960
    sel := ('_' , javaClass name , '_' , self name , ':') asSymbol.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1961
"/    (JavaVM respondsTo:sel) ifTrue:[
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1962
        ^ JavaVM 
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1963
            perform:sel
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1964
            with:thisContext sender.
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1965
"/    ].
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1966
"/
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1967
"/    self error:('unimplemented nativeMethod: ' , javaClass name , ' ' , self name).
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1968
    ^ nil
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1969
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1970
    "Created: / 1.1.1998 / 15:16:14 / cg"
261
d95d5a3cc475 lots of new stuff
cg
parents: 257
diff changeset
  1971
    "Modified: / 15.1.1998 / 01:51:03 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1972
!
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1973
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1974
nullPointerException
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1975
    JavaVM throwNullPointerException.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1976
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1977
    "Created: / 9.1.1998 / 02:25:02 / cg"
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
  1978
    "Modified: / 9.1.1998 / 02:26:56 / cg"
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1979
! !
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 238
diff changeset
  1980
129
f40775af59a5 checkin from browser
cg
parents: 127
diff changeset
  1981
!JavaMethod class methodsFor:'documentation'!
2
91843ac44d2f intitial checkin
cg
parents:
diff changeset
  1982
91843ac44d2f intitial checkin
cg
parents:
diff changeset
  1983
version
404
ae9fdf1d8d58 checkin from browser
cg
parents: 402
diff changeset
  1984
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaMethod.st,v 1.73 1998/10/22 16:32:38 cg Exp $'
2
91843ac44d2f intitial checkin
cg
parents:
diff changeset
  1985
! !
8
4df3a66460a3 can now read (undoc) 3.45 format
cg
parents: 5
diff changeset
  1986
JavaMethod initialize!