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