JavaClassReader.st
author cg
Tue, 27 Jan 1998 16:54:39 +0000
changeset 275 92b7ebb0b54c
parent 273 bcbea5ac4860
child 278 9d0ed6e743da
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     1
Object subclass:#JavaClassReader
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
     2
	instanceVariableNames:'inStream msb constants majorVsn minorVsn constNeeds2Slots
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
     3
		constSlot'
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
     4
	classVariableNames:'Verbose Silent AbsolutelySilent LazyClassLoading
275
92b7ebb0b54c *** empty log message ***
cg
parents: 273
diff changeset
     5
		InvalidClassFormatSignal ClassLoaderQuerySignal'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     6
	poolDictionaries:''
083530508d9c intitial checkin
cg
parents:
diff changeset
     7
	category:'Java-Support'
083530508d9c intitial checkin
cg
parents:
diff changeset
     8
!
083530508d9c intitial checkin
cg
parents:
diff changeset
     9
083530508d9c intitial checkin
cg
parents:
diff changeset
    10
135
098936234135 *** empty log message ***
cg
parents: 128
diff changeset
    11
!JavaClassReader class methodsFor:'initialization'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    12
083530508d9c intitial checkin
cg
parents:
diff changeset
    13
initialize
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    14
    InvalidClassFormatSignal := Signal new mayProceed:true.
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    15
    InvalidClassFormatSignal notifierString:'class load failure'.
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    16
    InvalidClassFormatSignal nameClass:self message:#invalidClassFormatSignal.
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    17
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
    18
    Verbose := false. 
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
    19
    Silent := true.
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
    20
    AbsolutelySilent := false.
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
    21
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
    22
    LazyClassLoading := false. "/ true.
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    23
    ClassLoaderQuerySignal := QuerySignal new
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
    24
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
    25
    "
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
    26
     JavaClassReader initialize
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
    27
    "
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
    28
275
92b7ebb0b54c *** empty log message ***
cg
parents: 273
diff changeset
    29
    "Modified: / 27.1.1998 / 17:54:23 / cg"
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    30
! !
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    31
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    32
!JavaClassReader class methodsFor:'Signal constants'!
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    33
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    34
classLoaderQuerySignal
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    35
    ^ ClassLoaderQuerySignal
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    36
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    37
    "Created: 14.8.1997 / 19:56:03 / cg"
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    38
!
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    39
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    40
invalidClassFormatSignal
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    41
    ^ InvalidClassFormatSignal
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    42
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
    43
    "Created: 3.8.1997 / 18:17:21 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    44
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
    45
135
098936234135 *** empty log message ***
cg
parents: 128
diff changeset
    46
!JavaClassReader class methodsFor:'debugging'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    47
083530508d9c intitial checkin
cg
parents:
diff changeset
    48
verbose:aBoolean
083530508d9c intitial checkin
cg
parents:
diff changeset
    49
    Verbose := aBoolean
083530508d9c intitial checkin
cg
parents:
diff changeset
    50
083530508d9c intitial checkin
cg
parents:
diff changeset
    51
    "
67
a72c949d86dd *** empty log message ***
cg
parents: 62
diff changeset
    52
     Java flushClasses.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    53
     JavaClassReader verbose:true
083530508d9c intitial checkin
cg
parents:
diff changeset
    54
     JavaClassReader verbose:false
083530508d9c intitial checkin
cg
parents:
diff changeset
    55
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
    56
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
    57
135
098936234135 *** empty log message ***
cg
parents: 128
diff changeset
    58
!JavaClassReader class methodsFor:'file reading'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
    59
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    60
loadClass:aClassName
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    61
    "reads a class, installs and returns it.
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    62
     The classes string constants are resolved & <clinit> is called,
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    63
     if it implements it."
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    64
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    65
    |rslt loader|
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    66
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    67
    loader := ClassLoaderQuerySignal raise.
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    68
    loader isNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
    69
	rslt := self loadClassLazy:aClassName ignoring:(Set new).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
    70
	rslt notNil ifTrue:[self postLoadActions].
40
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
    71
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
    72
	^ rslt
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    73
    ].
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    74
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
    75
    ^ loader loadClass:aClassName
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    76
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    77
    "
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    78
     JavaClassReader loadClass:'awt/Component'
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    79
     JavaClassReader loadClass:'awt/Button'
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    80
     JavaClassReader loadClass:'browser/AddButton'
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    81
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    82
     JavaClassReader loadClass:'java/lang/Object'
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    83
     JavaClassReader loadClass:'java/lang/AbstractMethodError'
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    84
     JavaClassReader loadClass:'java/lang/Thread'
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    85
    "
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    86
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
    87
    "Created: / 15.4.1996 / 14:58:53 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
    88
    "Modified: / 3.1.1998 / 22:36:13 / cg"
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    89
!
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
    90
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
    91
loadClassLazy:aClassName ignoring:classesBeingLoaded
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
    92
    "private helper:
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
    93
      reads a class, installs and returns it.
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
    94
      The class is searched along the ClassPath.
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    95
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    96
     This is a partial load (to load other classes):
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    97
     - The classes stringConstants are not fixed to be JavaStrings 
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
    98
       (i.e they are still ST-Strings).
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
    99
     - The class is NOT initialized."
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   100
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   101
    |rslt clsName cls loadedClass|
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
   102
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   103
    (aClassName endsWith:';') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   104
	('oops - loading of ' , aClassName , ' attempted') printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   105
	self halt:'should not happen'.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   106
	^ nil
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   107
    ].
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   108
    (aClassName endsWith:'[]') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   109
	('oops - loading of ' , aClassName , ' attempted') printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   110
	self halt:'should not happen'.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   111
	^ nil
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   112
    ].
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   113
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
   114
    clsName := aClassName.
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
   115
    (clsName includes:$.) ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   116
	clsName := clsName asString copy replaceAll:$. with:$/
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
   117
    ].
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   118
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   119
    (classesBeingLoaded notNil and:[classesBeingLoaded includes:clsName]) ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   120
	('oops - recursive load of ' , clsName , ' attempted') printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   121
	self halt:'should not happen'.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   122
	^ JavaUnresolvedClassConstant fullName:clsName
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   123
    ].
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   124
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   125
    (cls := Java at:clsName) notNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   126
	('oops - ' , clsName , ' is already loaded') printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   127
	self halt:clsName , ' is already loaded - should not happen'.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   128
	^ cls
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   129
    ].
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   130
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   131
    classesBeingLoaded isNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   132
	loadedClass := Set with:clsName
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   133
    ] ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   134
	loadedClass := Set withAll:classesBeingLoaded.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   135
	loadedClass add:clsName.
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   136
    ].
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   137
135
098936234135 *** empty log message ***
cg
parents: 128
diff changeset
   138
    Java classPath do:[:path |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   139
	|nm p|
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   140
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   141
	p := path.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   142
	(p endsWith:Filename separator) ifFalse:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   143
	    p := p , (Filename separator asString)
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   144
	].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   145
	(Array 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   146
	    with:clsName
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   147
	    with:clsName asLowercase
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   148
	    with:clsName asUppercase) 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   149
	do:[:tryName |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   150
	    (nm := p , tryName , '.class') asFilename exists ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   151
		rslt := self loadFileLazy:nm ignoring:loadedClass.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   152
		rslt notNil ifTrue:[^ rslt].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   153
	    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   154
	]
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   155
    ].
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   156
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   157
    ('JAVA: no file found for: ' , clsName) infoPrintCR.
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   158
    ^ nil
135
098936234135 *** empty log message ***
cg
parents: 128
diff changeset
   159
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   160
    "Modified: / 14.8.1997 / 11:38:42 / stefan"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   161
    "Modified: / 3.1.1998 / 22:28:37 / cg"
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   162
!
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   163
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   164
loadFile:aFilename
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   165
    "reads a class from aFilename, installs and returns it.
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   166
     The classes strings are fixed and its class-init function is called."
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   167
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   168
    self loadFileLazy:aFilename ignoring:(Set new).
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   169
    self postLoadActions
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   170
!
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   171
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   172
loadFileLazy:aFilename ignoring:classesBeingLoaded
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   173
    "reads a class from aFilename, installs and returns it.
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   174
     Strings are fixed and classrefs are fixed, 
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   175
     but NO no class-init functions are called."
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   176
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   177
    |javaClass pool|
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   178
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   179
    javaClass := self readFile:aFilename ignoring:classesBeingLoaded.
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   180
    javaClass notNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   181
	Java at:(javaClass fullName asSymbol) put:javaClass.
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   182
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   183
	classesBeingLoaded remove:javaClass fullName ifAbsent:nil.
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   184
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   185
	JavaUnresolvedConstant resolveFor:javaClass.
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   186
    ].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   187
    ^ javaClass
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   188
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   189
    "
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   190
     JavaClassReader loadFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   191
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   192
     '/phys/ibm3/java/lib/java/lang' asFilename
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   193
	directoryContents do:[:nm |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   194
	    (nm endsWith:'.class') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   195
		('/phys/ibm3/java/lib/java/lang/' , nm) printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   196
		JavaClassReader loadFile:'/phys/ibm3/java/lib/java/lang/' , nm
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   197
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   198
	].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   199
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   200
     '/phys/ibm3/java/lib/java/io' asFilename
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   201
	directoryContents do:[:nm |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   202
	    (nm endsWith:'.class') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   203
		('/phys/ibm3/java/lib/java/io/' , nm) printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   204
		JavaClassReader loadFile:'/phys/ibm3/java/lib/java/io/' , nm
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   205
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   206
	].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   207
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   208
     '/phys/ibm3/java/lib/java/net' asFilename
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   209
	directoryContents do:[:nm |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   210
	    (nm endsWith:'.class') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   211
		('/phys/ibm3/java/lib/java/net/' , nm) printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   212
		JavaClassReader loadFile:'/phys/ibm3/java/lib/java/net/' , nm
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   213
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   214
	].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   215
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   216
     '/phys/ibm3/java/lib/java/util' asFilename
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   217
	directoryContents do:[:nm |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   218
	    (nm endsWith:'.class') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   219
		('/phys/ibm3/java/lib/java/util/' , nm) printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   220
		JavaClassReader loadFile:'/phys/ibm3/java/lib/java/util/' , nm
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   221
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   222
	].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   223
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   224
     '/phys/ibm3/java/lib/java/awt' asFilename
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   225
	directoryContents do:[:nm |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   226
	    (nm endsWith:'.class') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   227
		('/phys/ibm3/java/lib/java/awt/' , nm) printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   228
		JavaClassReader loadFile:'/phys/ibm3/java/lib/java/awt/' , nm
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   229
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   230
	].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   231
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   232
     '/phys/ibm3/java/lib/java/applet' asFilename
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   233
	directoryContents do:[:nm |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   234
	    (nm endsWith:'.class') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   235
		('/phys/ibm3/java/lib/java/applet/' , nm) printNL.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   236
		JavaClassReader loadFile:'/phys/ibm3/java/lib/java/applet/' , nm
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   237
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   238
	].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   239
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   240
     JavaClassReader loadFile:'/phys/ibm3/java/lib/java/lang/AbstractMethodError.class'
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   241
     JavaClassReader loadFile:'/phys/ibm3/java/lib/java/lang/Thread.class'
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   242
    "
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   243
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   244
    "Created: 15.4.1996 / 14:58:53 / cg"
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   245
!
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   246
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   247
postLoadActions
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   248
    "Resolve all classes' string constants.
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   249
     Perform all class initialization functions (of those which are not
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   250
     yet initialized)."
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   251
225
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   252
    ^ self postLoadActions:true
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   253
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   254
    "Modified: 15.8.1997 / 01:02:17 / cg"
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   255
!
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   256
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   257
postLoadActions:loadUnresolved
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   258
    "Resolve all classes' string constants.
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   259
     Perform all class initialization functions 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   260
     (of those which are not yet initialized)."
225
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   261
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   262
    |classes prevUnresolved newUnresolved loader|
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   263
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   264
    "/ need at least java.lang.String, for valid constants
167
77dcbc4b2201 *** empty log message ***
cg
parents: 135
diff changeset
   265
    Java java_lang_String isNil ifTrue:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   266
        self loadClassLazy:'java.lang.String' ignoring:(Set new).
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   267
    ].
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   268
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   269
    LazyClassLoading ifFalse:[
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   270
        loader := ClassLoaderQuerySignal raise.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   271
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   272
        prevUnresolved := nil.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   273
        newUnresolved := JavaUnresolvedConstant unresolvedClassNames asArray.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   274
        loadUnresolved ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   275
            [prevUnresolved ~= newUnresolved] whileTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   276
                newUnresolved do:[:nextUnresolved |
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   277
                    |classURL|
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   278
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   279
                    (Java at:nextUnresolved) isNil ifTrue:[ "/ could have been loaded in the meantime
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   280
                        Silent ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   281
                            'loading unresolved: ' print. nextUnresolved printCR.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   282
                        ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   283
                        loader isNil ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   284
                            self
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   285
                                loadClassLazy:nextUnresolved
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   286
                                ignoring:(Set new).
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   287
                        ] ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   288
                            "/
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   289
                            "/ the aquired loader is a javaClassLoader
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   290
                            "/ which expects an URL as arg.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   291
                            "/
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   292
                            "/ classURL := Java as_URL:('file:' , nextUnresolved asString , '.class').
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   293
                            "/ loader loadClass:classURL
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   294
                            loader
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   295
                                perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;'
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   296
                                with:(Java as_String:(nextUnresolved asString)).
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   297
                        ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   298
                    ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   299
                ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   300
                prevUnresolved := newUnresolved.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   301
                newUnresolved := JavaUnresolvedConstant unresolvedClassNames asArray.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   302
            ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   303
        ].
229
b91c9462ac83 *** empty log message ***
cg
parents: 225
diff changeset
   304
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   305
        newUnresolved size == 0 ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   306
            "/ nothing unresolved
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   307
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   308
            (classes := Java allClasses) notNil ifTrue:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   309
                "/ init all new classes
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   310
                "/ fetch again - there could be new ones ...
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   311
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   312
                classes := Java allClasses.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   313
                classes do:[:aJavaClass |
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   314
                    aJavaClass isInitialized ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   315
                        Silent ifFalse:[
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   316
                            'performing class initialization of ' print. aJavaClass fullName printCR.
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   317
                        ].
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   318
                        aJavaClass classInit
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   319
                    ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   320
                ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   321
            ]
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   322
        ].
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   323
    ]
167
77dcbc4b2201 *** empty log message ***
cg
parents: 135
diff changeset
   324
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   325
    "Created: / 15.8.1997 / 01:01:44 / cg"
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
   326
    "Modified: / 7.1.1998 / 14:13:55 / cg"
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   327
!
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   328
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   329
readFile:aFilename ignoring:classesBeingLoaded
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   330
    "reads a class from aFilename and returns it.
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   331
     The JavaClass is NOT installed as global and unresolved
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   332
     refs are NOT patched."
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   333
73
a1268823f1a4 *** empty log message ***
cg
parents: 72
diff changeset
   334
    |inStream javaClass|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   335
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   336
    Silent ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   337
	'reading ' print. aFilename print. ' ...' printNL.
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   338
    ].
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   339
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   340
    inStream := aFilename asFilename readStream.
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   341
    inStream isNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   342
	('no file: ' , aFilename) printCR.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   343
	self halt.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   344
	^ nil
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   345
    ].
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   346
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   347
    javaClass := self new readStream:inStream ignoring:classesBeingLoaded.
73
a1268823f1a4 *** empty log message ***
cg
parents: 72
diff changeset
   348
    javaClass notNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   349
	javaClass setBinaryFilePath:(inStream pathName).
73
a1268823f1a4 *** empty log message ***
cg
parents: 72
diff changeset
   350
    ].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   351
    inStream close.
27
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
   352
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   353
    AbsolutelySilent ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   354
	'  ... loaded ' print. javaClass displayString printNL.
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
   355
    ].
27
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
   356
73
a1268823f1a4 *** empty log message ***
cg
parents: 72
diff changeset
   357
    ^ javaClass
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   358
083530508d9c intitial checkin
cg
parents:
diff changeset
   359
    "Created: 15.4.1996 / 14:58:53 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   360
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   361
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
   362
readStream:aStream
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
   363
    "reads a class from aStream and returns it.
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   364
     The JavaClass is installed as global.
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   365
     If new classes are required to be loaded, a new standard loader
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   366
     is created."
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
   367
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   368
    ^ self readStream:aStream loader:nil
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
   369
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   370
    "Modified: 14.8.1997 / 19:51:50 / cg"
198
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
   371
!
5543d1079a4a *** empty log message ***
cg
parents: 193
diff changeset
   372
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   373
readStream:aStream ignoring:classesBeingLoaded
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   374
    "reads a class from aStream and returns it.
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   375
     The JavaClass is not installed as global"
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   376
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   377
    ^ self new readStream:aStream ignoring:classesBeingLoaded
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   378
083530508d9c intitial checkin
cg
parents:
diff changeset
   379
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   380
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   381
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   382
083530508d9c intitial checkin
cg
parents:
diff changeset
   383
    "Modified: 15.4.1996 / 15:01:30 / cg"
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   384
!
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   385
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   386
readStream:aStream loader:aClassLoader
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   387
    "reads a class from aStream and returns it.
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   388
     The JavaClass is installed as global.
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   389
     If new classes are required to be loaded, aClassLoader is
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   390
     asked to do it. If aClassLoader is nil, a new standard loader
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   391
     is created."
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   392
225
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   393
    ^ self
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   394
	readStream:aStream 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   395
	loader:aClassLoader 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   396
	loadUnresolved:true
225
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   397
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   398
    "Modified: 15.8.1997 / 01:00:35 / cg"
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   399
!
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   400
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   401
readStream:aStream loader:aClassLoader loadUnresolved:loadUnresolved
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   402
    "reads a class from aStream and returns it.
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   403
     The JavaClass is installed as global.
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   404
     If new classes are required to be loaded, aClassLoader is
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   405
     asked to do it. If aClassLoader is nil, a new standard loader
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   406
     is created."
b11dde7c1df2 more classLoader hooks
cg
parents: 223
diff changeset
   407
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   408
    |javaClass|
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   409
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   410
    ClassLoaderQuerySignal answer:aClassLoader
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   411
    do:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   412
        javaClass := self readStream:aStream ignoring:(Set new).
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   413
        javaClass notNil ifTrue:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   414
            self postLoadActions:loadUnresolved.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   415
            Java at:(javaClass fullName asSymbol) put:javaClass.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   416
            JavaUnresolvedConstant resolveFor:javaClass.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   417
        ].
223
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   418
    ].
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   419
    ^ javaClass
4dd38bd4f6b2 allow trampoulining back into java for sub-loads
cg
parents: 219
diff changeset
   420
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   421
    "Created: / 15.8.1997 / 00:59:24 / cg"
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   422
    "Modified: / 23.1.1998 / 17:14:09 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   423
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
   424
083530508d9c intitial checkin
cg
parents:
diff changeset
   425
!JavaClassReader methodsFor:'file reading'!
083530508d9c intitial checkin
cg
parents:
diff changeset
   426
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   427
readClassFileIgnoring:classesbeingLoaded
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   428
    "reads a class from inStream and returns it.
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   429
     The JavaClass is not installed as global and its constants
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   430
     (especially strings) may not be fully resolved."
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   431
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   432
    |magic 
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   433
     access_flags this_class this_class_index super_class super_class_index
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   434
     realSuperClass this_class_ref existingSuperClass
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   435
     fields interfaces staticFields nStatic
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   436
     jSuperClass loader|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   437
083530508d9c intitial checkin
cg
parents:
diff changeset
   438
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   439
    "/ read magic, determine byte order
083530508d9c intitial checkin
cg
parents:
diff changeset
   440
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   441
    msb := true.
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   442
    magic := inStream nextUnsignedLongMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   443
    magic = 16rCAFEBABE ifFalse:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   444
        magic = 16rBEBAFECA ifFalse:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   445
            InvalidClassFormatSignal raiseErrorString:'not a java class file'.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   446
            ^ nil
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   447
        ].
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   448
        msb := false.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   449
        Verbose ifTrue:[Transcript showCR:'file is lsb'].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   450
    ] ifTrue:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   451
        Verbose ifTrue:[Transcript showCR:'file is msb'].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   452
    ].
083530508d9c intitial checkin
cg
parents:
diff changeset
   453
083530508d9c intitial checkin
cg
parents:
diff changeset
   454
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   455
    "/ get version
083530508d9c intitial checkin
cg
parents:
diff changeset
   456
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   457
    minorVsn := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   458
    majorVsn := inStream nextUnsignedShortMSB:msb.
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   459
99
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
   460
    (majorVsn ~~ 45 or:[minorVsn ~~ 3]) ifTrue:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   461
        Transcript show:'warning this file has version '; show:majorVsn; show:'.'; showCR:minorVsn. 
99
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
   462
    ].
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
   463
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
   464
    Verbose ifTrue:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   465
        Transcript show:'version = '; 
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   466
                   show:(majorVsn printString); 
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   467
                   show:'.';
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   468
                   showCR:(minorVsn printString).
99
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
   469
    ].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   470
083530508d9c intitial checkin
cg
parents:
diff changeset
   471
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   472
    "/ get constant pool
083530508d9c intitial checkin
cg
parents:
diff changeset
   473
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   474
    self readConstantPool.
083530508d9c intitial checkin
cg
parents:
diff changeset
   475
083530508d9c intitial checkin
cg
parents:
diff changeset
   476
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   477
    "/ access flags
083530508d9c intitial checkin
cg
parents:
diff changeset
   478
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   479
    access_flags := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   480
    this_class_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   481
    super_class_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   482
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   483
    super_class_index == 0 ifTrue:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   484
        super_class := nil
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   485
    ] ifFalse:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   486
        super_class := constants at:super_class_index.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   487
        existingSuperClass := Java classNamed:super_class fullName.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   488
        existingSuperClass notNil ifTrue:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   489
            super_class := existingSuperClass
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   490
        ] ifFalse:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   491
            (super_class isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   492
                Silent ifFalse:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   493
                    'load superClass: ' print. super_class fullName printCR.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   494
                ].
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   495
                loader := ClassLoaderQuerySignal raise.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   496
                loader isNil ifTrue:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   497
                    existingSuperClass := self class 
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   498
                                        loadClassLazy:(super_class fullName)
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   499
                                        ignoring:classesbeingLoaded.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   500
                ] ifFalse:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   501
                    jSuperClass := loader
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   502
                                perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;'
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   503
                                with:(Java as_String:(super_class fullName)).
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   504
                    existingSuperClass := JavaVM classForJavaClassObject:jSuperClass.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   505
                ].
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   506
                existingSuperClass isNil ifTrue:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   507
                    self halt:('cannot find superclass: ' , super_class fullName).
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   508
                ].
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   509
                super_class := existingSuperClass
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   510
            ] ifFalse:[
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   511
                self halt:'oops - superclass ?'
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   512
            ]
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   513
        ].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   514
    ].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   515
083530508d9c intitial checkin
cg
parents:
diff changeset
   516
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   517
    "/ get interfaces
083530508d9c intitial checkin
cg
parents:
diff changeset
   518
    "/
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   519
    interfaces := self readInterfaces.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   520
083530508d9c intitial checkin
cg
parents:
diff changeset
   521
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   522
    "/ get fields
083530508d9c intitial checkin
cg
parents:
diff changeset
   523
    "/
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   524
    fields := self readFieldInfofields.
40
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   525
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   526
    "/
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   527
    "/ create the fields as instVars
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   528
    "/ static fields are created as class-InstVars
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   529
    "/
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   530
    staticFields := fields select:[:f | f isStatic].
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   531
    nStatic := staticFields size.
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   532
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   533
    this_class_ref := constants at:this_class_index.
182
5f85fd0fec56 checkin from browser
cg
parents: 177
diff changeset
   534
    this_class := JavaClass fullName:(this_class_ref fullName) numStatic:nStatic.
5f85fd0fec56 checkin from browser
cg
parents: 177
diff changeset
   535
40
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   536
    nStatic ~~ 0 ifTrue:[
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   537
        fields := fields select:[:f | f isStatic not].
40
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   538
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   539
        JavaClass setInstanceVariableStringFromFields:staticFields in:this_class class.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   540
        this_class setStaticFields:staticFields.
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   541
        this_class initializeStaticFields.
40
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   542
    ].
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   543
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   544
    this_class setAccessFlags:access_flags.
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   545
    this_class setSuperclass:super_class.
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   546
    this_class setConstantPool:constants.
7f332a95e015 checkin from browser
cg
parents: 39
diff changeset
   547
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   548
    this_class setFields:fields.
110
dfb03e2ea321 *** empty log message ***
cg
parents: 104
diff changeset
   549
    this_class setInterfaces:interfaces.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   550
083530508d9c intitial checkin
cg
parents:
diff changeset
   551
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   552
    "/ get methods
083530508d9c intitial checkin
cg
parents:
diff changeset
   553
    "/
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   554
    self readMethodsFor:this_class.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   555
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   556
    self readAttributesFor:this_class.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   557
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   558
    constants owner:this_class.
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   559
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   560
    ^ this_class
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   561
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   562
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   563
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   564
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   565
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   566
     JavaClassReader verbose:true.
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   567
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/java/lang/ArithmeticException.class'
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   568
     JavaClassReader readFile:'/phys/ibm3/java/lib/java/lang/ArithmeticException.class'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   569
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   570
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   571
    "Created: / 15.4.1996 / 15:02:47 / cg"
269
5a946303d451 use a helper to associate java.lang.class insts to javaClasses
cg
parents: 264
diff changeset
   572
    "Modified: / 23.1.1998 / 17:44:55 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   573
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   574
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   575
readSourceFileAttributeFor:aJavaClass
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   576
    |attribute_length sourceFile_index sourceFile|
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   577
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   578
    attribute_length := inStream nextUnsignedLongMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   579
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   580
    sourceFile_index := inStream nextUnsignedShortMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   581
    sourceFile := constants at:sourceFile_index.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   582
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   583
    aJavaClass setSourceFile:sourceFile.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   584
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   585
    Verbose ifTrue:[Transcript show:'sourceFile: '; showCR:sourceFile].
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   586
    ^ true
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   587
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   588
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   589
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   590
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   591
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   592
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   593
    "Modified: 15.4.1996 / 15:33:28 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   594
    "Created: 15.4.1996 / 15:40:17 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   595
!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   596
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   597
readStream:aStream ignoring:classesBeingLoaded
7
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   598
    "reads a class from aStream and returns it.
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   599
     The JavaClass is not installed as global"
de8ce26e1f2c checkin from browser
cg
parents: 5
diff changeset
   600
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   601
    inStream := aStream.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   602
    inStream binary.
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
   603
54
f37bcefb7091 avoid loading classes twice
cg
parents: 52
diff changeset
   604
    ^ self readClassFileIgnoring:classesBeingLoaded
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   605
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   606
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   607
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   608
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   609
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   610
    "Created: 15.4.1996 / 15:00:55 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   611
    "Modified: 15.4.1996 / 15:06:18 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   612
! !
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   613
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   614
!JavaClassReader methodsFor:'file reading - attributes'!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   615
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   616
readAttribute:attributeName for:something
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
   617
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   618
    (attributeName = 'Code') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   619
	self readCodeAttributeFor:something.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   620
	^ true.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   621
    ].
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
   622
    (attributeName = 'Exceptions') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   623
	self readExceptionsAttributeFor:something.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   624
	^ true.
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
   625
    ].
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   626
    (attributeName = 'LineNumberTable') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   627
	self readLineNumberTableAttributeFor:something.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   628
	^ true.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   629
    ].
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   630
    (attributeName = 'LocalVariableTable') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   631
	self readLocalVariableTableAttributeFor:something.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   632
	^ true.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   633
    ].
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   634
    (attributeName = 'ConstantValue') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   635
	self readConstantValueAttributeFor:something.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   636
	^ true.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   637
    ].
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   638
    (attributeName = 'SourceFile') ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   639
	self readSourceFileAttributeFor:something.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   640
	^ true.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   641
    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   642
    (attributeName = 'Deprecated') ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   643
	^ false.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   644
    ].
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
   645
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
   646
    ('JAVA: unrecognized attribute: ' , attributeName) infoPrintCR.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   647
    ^ false
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   648
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   649
    "Modified: 15.4.1996 / 15:33:28 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   650
    "Created: 15.4.1996 / 15:40:17 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   651
!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   652
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   653
readAttributeFor:something
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   654
    |attribute_name_index attribute_name attribute_length attribute_info|
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   655
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   656
    Verbose ifTrue:[Transcript show:'attrib at pos: '; showCR:inStream position].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   657
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   658
    attribute_name_index := inStream nextUnsignedShortMSB:msb.
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   659
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   660
    "/
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   661
    "/ UNDOC feature ?
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   662
    "/
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   663
    attribute_name_index > constants size ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   664
	attribute_name_index == 16rb700 ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   665
	    self halt.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   666
	]
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   667
    ].
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   668
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   669
    attribute_name := constants at:attribute_name_index.
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   670
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   671
    Verbose ifTrue:[Transcript show:'attrib name: '; showCR:attribute_name].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
   672
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   673
    (self readAttribute:attribute_name for:something) ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   674
	attribute_length := inStream nextUnsignedLongMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   675
	attribute_info := ByteArray new:(attribute_length).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   676
	inStream nextBytes:attribute_length into:attribute_info startingAt:1.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   677
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   678
	Verbose ifTrue:[Transcript show:'skipped '; show:attribute_name; showCR:'-attribute'].
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   679
    ].
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   680
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   681
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   682
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   683
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   684
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   685
    "Modified: 15.4.1996 / 15:33:28 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   686
    "Created: 15.4.1996 / 15:40:17 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   687
!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   688
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   689
readAttributesFor:something
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   690
    |attributes_count|
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   691
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   692
    attributes_count := inStream nextUnsignedShortMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   693
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   694
    1 to:attributes_count do:[:i |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   695
	self readAttributeFor:something.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   696
    ].
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   697
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   698
    "Modified: 15.4.1996 / 15:33:28 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   699
    "Created: 15.4.1996 / 15:40:17 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   700
! !
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   701
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   702
!JavaClassReader methodsFor:'file reading - constants'!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
   703
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   704
readConstant
083530508d9c intitial checkin
cg
parents:
diff changeset
   705
    |tag constReader const|
083530508d9c intitial checkin
cg
parents:
diff changeset
   706
083530508d9c intitial checkin
cg
parents:
diff changeset
   707
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   708
    constNeeds2Slots := false.
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   709
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   710
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   711
    "/ get tag
083530508d9c intitial checkin
cg
parents:
diff changeset
   712
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   713
    tag := inStream nextByte.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   714
    Verbose ifTrue:[Transcript show:'tag = '; showCR:tag].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   715
083530508d9c intitial checkin
cg
parents:
diff changeset
   716
    constReader := #(
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   717
			readConstant_Asciz              "/ 1  - now called Utf8
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   718
			readConstant_Unicode            "/ 2
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   719
			readConstant_Integer            "/ 3
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   720
			readConstant_Float              "/ 4
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   721
			readConstant_Long               "/ 5
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   722
			readConstant_Double             "/ 6
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   723
			readConstant_Class              "/ 7
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   724
			readConstant_String             "/ 8
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   725
			readConstant_Fieldref           "/ 9
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   726
			readConstant_Methodref          "/ 10
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   727
			readConstant_InterfaceMethodref "/ 11
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   728
			readConstant_NameAndType        "/ 12
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   729
		    ) at:tag ifAbsent:[#readConstant_Undef].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   730
083530508d9c intitial checkin
cg
parents:
diff changeset
   731
    ^ self perform:constReader.
083530508d9c intitial checkin
cg
parents:
diff changeset
   732
083530508d9c intitial checkin
cg
parents:
diff changeset
   733
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   734
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   735
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   736
083530508d9c intitial checkin
cg
parents:
diff changeset
   737
    "Created: 15.4.1996 / 15:46:32 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   738
    "Modified: 15.4.1996 / 15:47:00 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   739
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   740
083530508d9c intitial checkin
cg
parents:
diff changeset
   741
readConstantPool
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   742
    |constantPoolCount const i|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   743
083530508d9c intitial checkin
cg
parents:
diff changeset
   744
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
   745
    "/ get constant pool
083530508d9c intitial checkin
cg
parents:
diff changeset
   746
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   747
    constantPoolCount := inStream nextUnsignedShortMSB:msb.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   748
    Verbose ifTrue:[Transcript show:'constantPoolCount = '; showCR:constantPoolCount].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   749
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   750
    constants := JavaConstantPool "Array" new:constantPoolCount-1.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   751
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   752
    constSlot := 1.
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   753
    [constSlot < constantPoolCount] whileTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   754
	Verbose ifTrue:[Transcript show:'const: '; showCR:constSlot].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   755
	const := self readConstant.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   756
	constants at:constSlot put:const.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   757
	constNeeds2Slots ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   758
	    constSlot := constSlot + 1.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   759
	].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   760
	constSlot := constSlot + 1.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   761
    ].
083530508d9c intitial checkin
cg
parents:
diff changeset
   762
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   763
    constSlot := -1.
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   764
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   765
    "/ preresolve what can be (especially, strings are resolved here)
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   766
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   767
    1 to:constantPoolCount-1 do:[:i |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   768
	|const value|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   769
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   770
	const := constants at:i.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   771
	const notNil ifTrue:[   "/ kludge for 2-slot constants (which only take 1 slot in ST/X)
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   772
	    (const isKindOf:JavaUnresolvedConstant) ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   773
		value := const preResolve.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   774
		value ~~ const ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   775
		    constants at:i put:value.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   776
		]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   777
	    ]
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   778
	]
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   779
    ].
083530508d9c intitial checkin
cg
parents:
diff changeset
   780
083530508d9c intitial checkin
cg
parents:
diff changeset
   781
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   782
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   783
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   784
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   785
083530508d9c intitial checkin
cg
parents:
diff changeset
   786
    "Created: 15.4.1996 / 15:14:11 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   787
    "Modified: 15.4.1996 / 16:41:57 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   788
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   789
083530508d9c intitial checkin
cg
parents:
diff changeset
   790
readConstant_Asciz
083530508d9c intitial checkin
cg
parents:
diff changeset
   791
    |len string|
083530508d9c intitial checkin
cg
parents:
diff changeset
   792
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   793
    len := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   794
    string := String new:len.
083530508d9c intitial checkin
cg
parents:
diff changeset
   795
    inStream nextBytes:len into:string startingAt:1.
083530508d9c intitial checkin
cg
parents:
diff changeset
   796
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   797
    Verbose ifTrue:[Transcript show:'asciz; string= ';     showCR:string].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   798
083530508d9c intitial checkin
cg
parents:
diff changeset
   799
    ^ string
083530508d9c intitial checkin
cg
parents:
diff changeset
   800
083530508d9c intitial checkin
cg
parents:
diff changeset
   801
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   802
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   803
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   804
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   805
083530508d9c intitial checkin
cg
parents:
diff changeset
   806
    "Created: 15.4.1996 / 15:15:35 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   807
    "Modified: 15.4.1996 / 16:33:45 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   808
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   809
083530508d9c intitial checkin
cg
parents:
diff changeset
   810
readConstant_Class
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   811
    |name_index name|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   812
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   813
    name_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   814
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   815
    Verbose ifTrue:[Transcript show:'class; index= '; showCR:name_index].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   816
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   817
    name := constants at:name_index.
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   818
    name notNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   819
	Verbose ifTrue:[Transcript showCR:'name in constant_class already resolved'].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   820
	"/ self halt
52
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   821
    ].
1dc41619b6f8 checkin from browser
cg
parents: 50
diff changeset
   822
21
b9dd73f299dd checkin from browser
cg
parents: 14
diff changeset
   823
    ^ JavaUnresolvedClassConstant 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   824
	pool:constants
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   825
	poolIndex:constSlot
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   826
	nameIndex:name_index
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   827
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   828
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   829
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   830
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   831
083530508d9c intitial checkin
cg
parents:
diff changeset
   832
    "Created: 15.4.1996 / 15:21:13 / cg"
193
859177de4b04 *** empty log message ***
cg
parents: 182
diff changeset
   833
    "Modified: 1.8.1997 / 21:27:28 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   834
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   835
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   836
readConstant_Double
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   837
    |high low aFloat|
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   838
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   839
    high := inStream nextUnsignedLongMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   840
    low := inStream nextUnsignedLongMSB:msb.
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   841
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   842
    aFloat := Float new.
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   843
    UninterpretedBytes isBigEndian ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   844
	aFloat basicAt:1 put:((high bitShift:-24) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   845
	aFloat basicAt:2 put:((high bitShift:-16) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   846
	aFloat basicAt:3 put:((high bitShift:-8) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   847
	aFloat basicAt:4 put:(high bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   848
	aFloat basicAt:5 put:((low bitShift:-24) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   849
	aFloat basicAt:6 put:((low bitShift:-16) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   850
	aFloat basicAt:7 put:((low bitShift:-8) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   851
	aFloat basicAt:8 put:(low bitAnd:16rFF).
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   852
    ] ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   853
	aFloat basicAt:1 put:(low bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   854
	aFloat basicAt:2 put:((low bitShift:-8) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   855
	aFloat basicAt:3 put:((low bitShift:-16) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   856
	aFloat basicAt:4 put:((low bitShift:-24) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   857
	aFloat basicAt:5 put:(high bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   858
	aFloat basicAt:6 put:((high bitShift:-8) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   859
	aFloat basicAt:7 put:((high bitShift:-16) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   860
	aFloat basicAt:8 put:((high bitShift:-24) bitAnd:16rFF).
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   861
    ].
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   862
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   863
    constNeeds2Slots := true.
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   864
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   865
    Verbose ifTrue:[Transcript show:'double; value= ';     showCR:aFloat].
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   866
    ^ aFloat
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   867
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   868
    "
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   869
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   870
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   871
    "
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   872
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   873
    "Modified: 15.4.1996 / 15:42:16 / cg"
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   874
    "Created: 15.4.1996 / 16:34:42 / cg"
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   875
!
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   876
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   877
readConstant_Fieldref
083530508d9c intitial checkin
cg
parents:
diff changeset
   878
    |class_index name_and_type_index|
083530508d9c intitial checkin
cg
parents:
diff changeset
   879
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   880
    class_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   881
    name_and_type_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   882
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   883
    Verbose ifTrue:[Transcript show:'fieldref; classindex= ';     showCR:class_index].
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   884
    Verbose ifTrue:[Transcript show:'fieldref; name&typeindex= '; showCR:name_and_type_index].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   885
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
   886
    ^ JavaUnresolvedFieldrefConstant
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   887
		pool:constants
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   888
		poolIndex:constSlot
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   889
		classIndex:class_index
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   890
		nameandTypeIndex:name_and_type_index
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   891
083530508d9c intitial checkin
cg
parents:
diff changeset
   892
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   893
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   894
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   895
083530508d9c intitial checkin
cg
parents:
diff changeset
   896
    "Created: 15.4.1996 / 15:22:18 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   897
    "Modified: 15.4.1996 / 16:07:01 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   898
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   899
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   900
readConstant_Float
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   901
    |high aFloat|
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   902
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   903
    high := inStream nextUnsignedLongMSB:msb.
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   904
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   905
    aFloat := ShortFloat basicNew.
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   906
    UninterpretedBytes isBigEndian ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   907
	aFloat basicAt:1 put:((high bitShift:-24) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   908
	aFloat basicAt:2 put:((high bitShift:-16) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   909
	aFloat basicAt:3 put:((high bitShift:-8) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   910
	aFloat basicAt:4 put:(high bitAnd:16rFF).
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   911
    ] ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   912
	aFloat basicAt:1 put:(high bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   913
	aFloat basicAt:2 put:((high bitShift:-8) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   914
	aFloat basicAt:3 put:((high bitShift:-16) bitAnd:16rFF).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   915
	aFloat basicAt:4 put:((high bitShift:-24) bitAnd:16rFF).
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   916
    ].
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   917
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   918
    Verbose ifTrue:[Transcript show:'float; value= ';     showCR:aFloat].
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   919
    ^ aFloat
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   920
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   921
    "
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   922
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   923
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   924
    "
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   925
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   926
    "Modified: 15.4.1996 / 15:42:16 / cg"
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   927
    "Created: 15.4.1996 / 16:34:42 / cg"
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   928
!
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   929
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   930
readConstant_Integer
083530508d9c intitial checkin
cg
parents:
diff changeset
   931
    |value|
083530508d9c intitial checkin
cg
parents:
diff changeset
   932
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   933
    value := inStream nextLongMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   934
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   935
    Verbose ifTrue:[Transcript show:'integer; value= ';     showCR:value].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   936
083530508d9c intitial checkin
cg
parents:
diff changeset
   937
    ^ value
083530508d9c intitial checkin
cg
parents:
diff changeset
   938
083530508d9c intitial checkin
cg
parents:
diff changeset
   939
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   940
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   941
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
   942
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
   943
083530508d9c intitial checkin
cg
parents:
diff changeset
   944
    "Modified: 15.4.1996 / 15:42:16 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   945
    "Created: 15.4.1996 / 16:34:42 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
   946
!
083530508d9c intitial checkin
cg
parents:
diff changeset
   947
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   948
readConstant_InterfaceMethodref
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   949
    |class_index name_and_type_index|
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   950
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   951
    class_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   952
    name_and_type_index := inStream nextUnsignedShortMSB:msb.
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   953
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   954
    Verbose ifTrue:[Transcript show:'methodref; classindex= ';     showCR:class_index].
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   955
    Verbose ifTrue:[Transcript show:'methodref; name&typeindex= '; showCR:name_and_type_index].
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   956
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   957
    ^ JavaUnresolvedInterfaceMethodrefConstant 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   958
		pool:constants
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   959
		poolIndex:constSlot
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   960
		classIndex:class_index
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   961
		nameandTypeIndex:name_and_type_index
14
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   962
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   963
    "
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   964
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   965
    "
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   966
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   967
    "Created: 15.4.1996 / 15:22:37 / cg"
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   968
    "Modified: 15.4.1996 / 16:07:19 / cg"
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   969
!
c1d9f60eb650 can now load all java.class files (see JavaClassReader>>loadFile:)
cg
parents: 11
diff changeset
   970
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   971
readConstant_Long
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   972
    |high low value|
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   973
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   974
    high := inStream nextUnsignedLongMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   975
    low := inStream nextUnsignedLongMSB:msb.
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   976
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   977
    value := (high bitShift:32) bitOr:low.
60
a763b1780ec0 checkin from browser
cg
parents: 59
diff changeset
   978
    (high bitTest:16r80000000) ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
   979
	value := value - 16r10000000000000000.
60
a763b1780ec0 checkin from browser
cg
parents: 59
diff changeset
   980
    ].
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   981
    constNeeds2Slots := true.
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   982
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
   983
    Verbose ifTrue:[Transcript show:'long; value= ';     showCR:value].
11
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   984
    ^ value
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   985
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   986
    "
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   987
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   988
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   989
    "
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   990
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   991
    "Modified: 15.4.1996 / 15:42:16 / cg"
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   992
    "Created: 15.4.1996 / 16:34:42 / cg"
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   993
!
30997f6943a4 checkin from browser
cg
parents: 9
diff changeset
   994
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   995
readConstant_Methodref
083530508d9c intitial checkin
cg
parents:
diff changeset
   996
    |class_index name_and_type_index|
083530508d9c intitial checkin
cg
parents:
diff changeset
   997
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   998
    class_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
   999
    name_and_type_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1000
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1001
    Verbose ifTrue:[Transcript show:'methodref; classindex= ';     showCR:class_index].
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1002
    Verbose ifTrue:[Transcript show:'methodref; name&typeindex= '; showCR:name_and_type_index].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1003
083530508d9c intitial checkin
cg
parents:
diff changeset
  1004
    ^ JavaUnresolvedMethodrefConstant 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1005
		pool:constants
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1006
		poolIndex:constSlot
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1007
		classIndex:class_index
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1008
		nameandTypeIndex:name_and_type_index
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1009
083530508d9c intitial checkin
cg
parents:
diff changeset
  1010
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1011
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
  1012
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1013
083530508d9c intitial checkin
cg
parents:
diff changeset
  1014
    "Created: 15.4.1996 / 15:22:37 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1015
    "Modified: 15.4.1996 / 16:07:19 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1016
!
083530508d9c intitial checkin
cg
parents:
diff changeset
  1017
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
  1018
readConstant_NameAndType
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1019
    |name_index signature_index|
083530508d9c intitial checkin
cg
parents:
diff changeset
  1020
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1021
    name_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1022
    signature_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1023
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1024
    Verbose ifTrue:[Transcript show:'methodref; nameindex= ';     showCR:name_index].
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1025
    Verbose ifTrue:[Transcript show:'methodref; signatureindex= '; showCR:signature_index].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1026
083530508d9c intitial checkin
cg
parents:
diff changeset
  1027
    ^ JavaUnresolvedNameandTypeConstant 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1028
		pool:constants
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1029
		poolIndex:constSlot
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1030
		nameIndex:name_index
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1031
		signatureIndex:signature_index  
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1032
083530508d9c intitial checkin
cg
parents:
diff changeset
  1033
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1034
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
  1035
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1036
083530508d9c intitial checkin
cg
parents:
diff changeset
  1037
    "Created: 15.4.1996 / 15:23:43 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1038
    "Modified: 15.4.1996 / 16:17:16 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1039
!
083530508d9c intitial checkin
cg
parents:
diff changeset
  1040
083530508d9c intitial checkin
cg
parents:
diff changeset
  1041
readConstant_String
083530508d9c intitial checkin
cg
parents:
diff changeset
  1042
    |tag string_index|
083530508d9c intitial checkin
cg
parents:
diff changeset
  1043
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1044
    string_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1045
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1046
    Verbose ifTrue:[Transcript show:'string; index= '; showCR:string_index].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1047
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 86
diff changeset
  1048
    ^ JavaUnresolvedStringConstant 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1049
	pool:constants 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1050
	poolIndex:constSlot
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1051
	stringIndex:string_index
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1052
083530508d9c intitial checkin
cg
parents:
diff changeset
  1053
    "
43
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
  1054
     Verbose := true.
2c4ca2eb8d07 checkin from browser
cg
parents: 40
diff changeset
  1055
     JavaClassReader readFile:'/phys/ibm3/java/lib/java/lang/System.class'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1056
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1057
083530508d9c intitial checkin
cg
parents:
diff changeset
  1058
    "Created: 15.4.1996 / 15:20:33 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1059
    "Modified: 15.4.1996 / 16:01:37 / cg"
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1060
! !
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1061
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1062
!JavaClassReader methodsFor:'file reading - fields'!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1063
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1064
readConstantValueAttributeFor:aField
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1065
    |attribute_length constantvalue_index constantValue|
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1066
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1067
    attribute_length := inStream nextUnsignedLongMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1068
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1069
    constantvalue_index := inStream nextUnsignedShortMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1070
    constantValue := constants at:constantvalue_index.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1071
59
38114c3e3e77 checkin from browser
cg
parents: 54
diff changeset
  1072
    aField constantValue:constantValue.
38114c3e3e77 checkin from browser
cg
parents: 54
diff changeset
  1073
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1074
    Verbose ifTrue:[Transcript show:'constantValue: '; showCR:constantValue].
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1075
    ^ true
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1076
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1077
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1078
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1079
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1080
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1081
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1082
    "Modified: 15.4.1996 / 15:33:28 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1083
    "Created: 15.4.1996 / 15:40:17 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1084
!
083530508d9c intitial checkin
cg
parents:
diff changeset
  1085
083530508d9c intitial checkin
cg
parents:
diff changeset
  1086
readFieldInfofield
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1087
    |access_flags name_index signature_index attributes_count field|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1088
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1089
    access_flags := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1090
    name_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1091
    signature_index := inStream nextUnsignedShortMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1092
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1093
    field := JavaField new.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1094
    field setAccessFlags:access_flags.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1095
    field setName:(constants at:name_index).
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1096
    field setSignature:(constants at:signature_index).
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1097
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1098
    attributes_count := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1099
99
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
  1100
    Verbose ifTrue:[Transcript show:'  field name: '; show:(constants at:name_index);
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1101
			       show:' access: '; show:access_flags;
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1102
			       show:' attrib_cnt: '; showCR:attributes_count].
99
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
  1103
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1104
    1 to:attributes_count do:[:i |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1105
	self readAttributeFor:field.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1106
    ].
083530508d9c intitial checkin
cg
parents:
diff changeset
  1107
27
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
  1108
    ^ field
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
  1109
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1110
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1111
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
  1112
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1113
083530508d9c intitial checkin
cg
parents:
diff changeset
  1114
    "Modified: 15.4.1996 / 15:33:28 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1115
    "Created: 15.4.1996 / 15:38:43 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1116
!
083530508d9c intitial checkin
cg
parents:
diff changeset
  1117
083530508d9c intitial checkin
cg
parents:
diff changeset
  1118
readFieldInfofields
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1119
    |nFields fields|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1120
083530508d9c intitial checkin
cg
parents:
diff changeset
  1121
    "/
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1122
    "/ get fieldInfos
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1123
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1124
    nFields := inStream nextUnsignedShortMSB:msb.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1125
    Verbose ifTrue:[Transcript show:'fieldsCount = '; showCR:nFields].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1126
27
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
  1127
    fields := Array new:nFields.
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
  1128
4560bb77bb36 checkin from browser
cg
parents: 21
diff changeset
  1129
    1 to:nFields do:[:i |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1130
	Verbose ifTrue:[Transcript show:'field: '; showCR:i].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1131
	fields at:i put:(self readFieldInfofield)
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1132
    ].
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1133
    ^ fields
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1134
083530508d9c intitial checkin
cg
parents:
diff changeset
  1135
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1136
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
  1137
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1138
083530508d9c intitial checkin
cg
parents:
diff changeset
  1139
    "Created: 15.4.1996 / 15:34:41 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1140
    "Modified: 15.4.1996 / 15:35:28 / cg"
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1141
! !
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1142
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1143
!JavaClassReader methodsFor:'file reading - interfaces'!
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1144
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1145
readInterfaces
110
dfb03e2ea321 *** empty log message ***
cg
parents: 104
diff changeset
  1146
    |interfacesCount interface_index interface interfaces|
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1147
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1148
    "/
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1149
    "/ get interfaces
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1150
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1151
    interfacesCount := inStream nextUnsignedShortMSB:msb.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1152
    Verbose ifTrue:[Transcript show:'interfacesCount = '; showCR:interfacesCount].
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1153
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1154
    interfaces := Array new:interfacesCount.
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1155
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1156
    1 to:interfacesCount do:[:i |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1157
	Verbose ifTrue:[Transcript show:'interface: '; showCR:i].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1158
	interface_index := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1159
	interface := constants at:interface_index.
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1160
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1161
	interfaces at:i put:interface.
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1162
    ].
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1163
    ^ interfaces
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1164
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1165
    "
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1166
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1167
    "
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1168
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1169
    "Created: 15.4.1996 / 15:31:59 / cg"
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1170
    "Modified: 15.4.1996 / 15:33:28 / cg"
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1171
! !
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1172
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1173
!JavaClassReader methodsFor:'file reading - methods'!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1174
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1175
readCodeAttributeFor:aJavaMethod
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1176
    |attribute_length max_stack max_locals code_length code
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1177
     exception_table_length exception_table unknown1 unknown2|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1178
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1179
    attribute_length := inStream nextUnsignedLongMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1180
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1181
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1182
    Verbose ifTrue:[Transcript show:'attribute_length: 0x'; showCR:(attribute_length printStringRadix:16)].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1183
99
d1248315f589 support vsn 45.2 AND 45.3 classFile formats
cg
parents: 97
diff changeset
  1184
    minorVsn > 2 ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1185
	unknown1 := inStream nextByte.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1186
	max_stack := inStream nextByte.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1187
	max_locals := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1188
	unknown2 := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1189
	Verbose ifTrue:[Transcript show:'?1: '; showCR:unknown1].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1190
	Verbose ifTrue:[Transcript show:'?2: '; showCR:unknown2].
39
20fa5af3b873 checkin from browser
cg
parents: 38
diff changeset
  1191
    ] ifFalse:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1192
	max_stack := inStream nextByte.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1193
	max_locals := inStream nextByte.
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1194
    ].
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1195
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1196
    code_length := inStream nextUnsignedShortMSB:msb.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1197
    Verbose ifTrue:[Transcript show:'code_length: '; showCR:(code_length printStringRadix:16)].
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1198
    Verbose ifTrue:[Transcript show:'code at pos: '; showCR:inStream position].
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1199
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1200
    code := ByteArray new:code_length.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1201
    inStream nextBytes:code_length into:code startingAt:1.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1202
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1203
    Verbose ifTrue:[Transcript show:'method code:'; showCR:code.].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1204
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1205
    exception_table_length := inStream nextUnsignedShortMSB:msb.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1206
    Verbose ifTrue:[Transcript show:'exception_table_length: '; showCR:(exception_table_length printStringRadix:16)].
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1207
    exception_table_length ~~ 0 ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1208
	Verbose ifTrue:[Transcript show:'exceptionTable length:'; showCR:exception_table_length.].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1209
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1210
	exception_table := Array new:exception_table_length.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1211
	1 to:exception_table_length do:[:i |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1212
	    |start_pc end_pc handler_pc catch_type|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1213
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1214
	    start_pc := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1215
	    end_pc := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1216
	    handler_pc := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1217
	    catch_type := constants at:(inStream nextUnsignedShortMSB:msb).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1218
	    exception_table at:i put:(JavaExceptionTableEntry
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1219
					    startPC:start_pc
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1220
					    endPC:end_pc
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1221
					    handlerPC:handler_pc
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1222
					    catchType:catch_type).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1223
	].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1224
	aJavaMethod setExceptionHandlerTable:exception_table.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1225
    ].
083530508d9c intitial checkin
cg
parents:
diff changeset
  1226
29
eb3367f8fb9b checkin from browser
cg
parents: 27
diff changeset
  1227
    aJavaMethod 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1228
	setCode:code 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1229
	maxStack:max_stack 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1230
	maxLocals:max_locals 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1231
	u1:unknown1 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1232
	u2:unknown2.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1233
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1234
    self readAttributesFor:aJavaMethod.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1235
    ^ true
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1236
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1237
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1238
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1239
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1240
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1241
083530508d9c intitial checkin
cg
parents:
diff changeset
  1242
    "Modified: 15.4.1996 / 15:33:28 / cg"
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1243
    "Created: 15.4.1996 / 15:40:17 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1244
!
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1245
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1246
readExceptionsAttributeFor:aJavaMethod
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1247
    |attribute_length exception_table_length exception_table|
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1248
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1249
    attribute_length := inStream nextUnsignedLongMSB:msb.
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1250
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1251
    exception_table_length := inStream nextUnsignedShortMSB:msb.
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1252
    exception_table_length ~~ 0 ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1253
	exception_table := Array new:exception_table_length.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1254
	1 to:exception_table_length do:[:i |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1255
	    |idx ex|
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1256
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1257
	    idx := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1258
	    ex := constants at:idx.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1259
	    exception_table at:i put:ex.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1260
	].
83
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1261
    ].
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1262
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1263
    Verbose ifTrue:[Transcript showCR:'method has an exceptionTable'].
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1264
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1265
    aJavaMethod setExceptionTable:exception_table.
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1266
    ^ true
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1267
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1268
    "Modified: 15.4.1996 / 15:33:28 / cg"
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1269
    "Created: 15.4.1996 / 15:40:17 / cg"
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1270
!
2d61ef3579e4 *** empty log message ***
cg
parents: 73
diff changeset
  1271
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1272
readLineNumberTableAttributeFor:aJavaMethod
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1273
    |attribute_length line_number_table_length line_number_table|
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1274
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1275
    attribute_length := inStream nextUnsignedLongMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1276
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1277
    line_number_table_length := inStream nextUnsignedShortMSB:msb.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1278
    line_number_table_length ~~ 0 ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1279
	line_number_table := Array new:line_number_table_length.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1280
	1 to:line_number_table_length do:[:i |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1281
	    |start_pc line_number|
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1282
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1283
	    start_pc := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1284
	    line_number := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1285
	    line_number_table at:i put:(start_pc -> line_number).
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1286
	].
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1287
    ].
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1288
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1289
    Verbose ifTrue:[Transcript showCR:'method has a lineNumberTable'].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1290
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1291
    aJavaMethod setLineNumberTable:line_number_table.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1292
    ^ true
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1293
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1294
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1295
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1296
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/java/lang/Boolean.class'
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1297
    "
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1298
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1299
    "Modified: 15.4.1996 / 15:33:28 / cg"
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1300
    "Created: 15.4.1996 / 15:40:17 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1301
!
083530508d9c intitial checkin
cg
parents:
diff changeset
  1302
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1303
readLocalVariableTableAttributeFor:aJavaMethod
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1304
    |attribute_length local_variable_table_length local_variable_table|
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1305
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1306
    attribute_length := inStream nextUnsignedLongMSB:msb.
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1307
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1308
    local_variable_table_length := inStream nextUnsignedShortMSB:msb.
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1309
    local_variable_table_length ~~ 0 ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1310
	local_variable_table := JavaLocalVariableTable new:local_variable_table_length.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1311
	1 to:local_variable_table_length do:[:i |
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1312
	    |start_pc length name_index sig_index slot name signature|
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1313
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1314
	    start_pc := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1315
	    length := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1316
	    name_index := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1317
	    name := constants at:name_index.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1318
	    sig_index := inStream nextUnsignedShortMSB:msb.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1319
	    signature := constants at:sig_index.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1320
	    slot := inStream nextUnsignedShortMSB:msb.
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1321
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1322
	    local_variable_table at:i put:(JavaLocalVariableTableEntry new 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1323
						startPC:start_pc 
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1324
						length:length
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1325
						name:name
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1326
						signature:signature
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1327
						slot:slot)
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1328
	].
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1329
    ].
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1330
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1331
    Verbose ifTrue:[Transcript showCR:'method has a localvariableTable'].
50
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1332
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1333
    aJavaMethod setLocalVariableTable:local_variable_table.
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1334
    ^ true
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1335
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1336
    "
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1337
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1338
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/java/lang/Boolean.class'
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1339
    "
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1340
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1341
    "Modified: 15.4.1996 / 15:33:28 / cg"
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1342
    "Created: 15.4.1996 / 15:40:17 / cg"
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1343
!
458467ce0e15 checkin from browser
cg
parents: 43
diff changeset
  1344
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1345
readMethodFor:aJavaClass
273
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1346
    |m access_flags name_index name signature_index signature
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1347
     tooManyArgs|
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1348
083530508d9c intitial checkin
cg
parents:
diff changeset
  1349
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
  1350
    "/ get a method
083530508d9c intitial checkin
cg
parents:
diff changeset
  1351
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1352
    access_flags := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1353
    name_index := inStream nextUnsignedShortMSB:msb.
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1354
    signature_index := inStream nextUnsignedShortMSB:msb.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1355
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1356
    name := constants at:name_index.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1357
    signature := constants at:signature_index.
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1358
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1359
    Verbose ifTrue:[Transcript show:'method name:'; showCR:name.
273
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1360
                    Transcript show:'signature:'; showCR:signature.].
9
bc65152d7610 can no read (undoc) 3.45 format
cg
parents: 7
diff changeset
  1361
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1362
    m := JavaMethod new.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1363
    m setAccessFlags:access_flags.
273
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1364
    tooManyArgs := false.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1365
    Method argumentSignal handle:[:ex |
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1366
        'JAVA: ***** java method has too many arguments - will fail to execute' infoPrintCR.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1367
        tooManyArgs := true.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1368
        ex proceed.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1369
    ] do:[
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1370
        m setName:name signature:signature.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1371
    ].
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1372
    m setJavaClass:aJavaClass.
5
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1373
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1374
    self readAttributesFor:m.
f026f5d20c15 checkin from browser
cg
parents: 3
diff changeset
  1375
273
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1376
    tooManyArgs ifTrue:[
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1377
        m code:nil.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1378
        m byteCode:nil.
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1379
    ].
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1380
    aJavaClass addMethod:m name:name signature:signature.
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1381
083530508d9c intitial checkin
cg
parents:
diff changeset
  1382
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1383
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
  1384
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1385
273
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1386
    "Created: / 15.4.1996 / 16:48:49 / cg"
bcbea5ac4860 checkin from browser
cg
parents: 269
diff changeset
  1387
    "Modified: / 27.1.1998 / 17:46:53 / cg"
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1388
!
083530508d9c intitial checkin
cg
parents:
diff changeset
  1389
38
3f1b61722466 checkin from browser
cg
parents: 32
diff changeset
  1390
readMethodsFor:aJavaClass
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1391
    |methodsCount method|
083530508d9c intitial checkin
cg
parents:
diff changeset
  1392
083530508d9c intitial checkin
cg
parents:
diff changeset
  1393
083530508d9c intitial checkin
cg
parents:
diff changeset
  1394
    "/
083530508d9c intitial checkin
cg
parents:
diff changeset
  1395
    "/ get methods
083530508d9c intitial checkin
cg
parents:
diff changeset
  1396
    "/
128
acc4e8e77092 *** empty log message ***
cg
parents: 122
diff changeset
  1397
    methodsCount := inStream nextUnsignedShortMSB:msb.
61
ff1579eb825f showCr: -> showCR:
cg
parents: 60
diff changeset
  1398
    Verbose ifTrue:[Transcript show:'methodsCount = '; showCR:methodsCount].
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1399
083530508d9c intitial checkin
cg
parents:
diff changeset
  1400
    1 to:methodsCount do:[:i |
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1401
	Verbose ifTrue:[Transcript show:'method: '; showCR:i].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 229
diff changeset
  1402
	method := self readMethodFor:aJavaClass
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1403
    ].
083530508d9c intitial checkin
cg
parents:
diff changeset
  1404
083530508d9c intitial checkin
cg
parents:
diff changeset
  1405
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1406
     JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
083530508d9c intitial checkin
cg
parents:
diff changeset
  1407
    "
083530508d9c intitial checkin
cg
parents:
diff changeset
  1408
083530508d9c intitial checkin
cg
parents:
diff changeset
  1409
    "Modified: 15.4.1996 / 15:33:28 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1410
    "Created: 15.4.1996 / 16:46:30 / cg"
083530508d9c intitial checkin
cg
parents:
diff changeset
  1411
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
  1412
135
098936234135 *** empty log message ***
cg
parents: 128
diff changeset
  1413
!JavaClassReader class methodsFor:'documentation'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1414
083530508d9c intitial checkin
cg
parents:
diff changeset
  1415
version
275
92b7ebb0b54c *** empty log message ***
cg
parents: 273
diff changeset
  1416
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaClassReader.st,v 1.54 1998/01/27 16:54:39 cg Exp $'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
  1417
! !
083530508d9c intitial checkin
cg
parents:
diff changeset
  1418
JavaClassReader initialize!