JavaFieldref.st
author cg
Mon, 05 Jan 1998 18:49:32 +0000
changeset 252 04b330744577
parent 243 d580e27e1b66
child 255 2d8b3948a08a
permissions -rw-r--r--
new javaVM stuff & back to pre-stefans changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
     1
'From Smalltalk/X, Version:3.3.1 on 2-jan-1998 at 6:37:23 pm'                   !
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
     2
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     3
JavaRef subclass:#JavaFieldref
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
     4
	instanceVariableNames:'offset type'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     5
	classVariableNames:''
083530508d9c intitial checkin
cg
parents:
diff changeset
     6
	poolDictionaries:''
4
07264ed96b97 checkin from browser
cg
parents: 1
diff changeset
     7
	category:'Java-Reader-Support'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
     8
!
083530508d9c intitial checkin
cg
parents:
diff changeset
     9
083530508d9c intitial checkin
cg
parents:
diff changeset
    10
243
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    11
!JavaFieldref methodsFor:'accessing'!
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    12
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    13
nameandType
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    14
    ^ nameandType
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    15
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    16
    "Created: 19.8.1997 / 13:54:35 / cg"
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    17
!
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    18
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    19
nameandType:aJavaNameandType
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    20
    nameandType := aJavaNameandType
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    21
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    22
    "Created: 19.8.1997 / 14:01:27 / cg"
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    23
! !
d580e27e1b66 added support to compress constantPool data
cg
parents: 135
diff changeset
    24
41
eb7974d88088 checkin from browser
cg
parents: 27
diff changeset
    25
!JavaFieldref methodsFor:'printing & storing'!
eb7974d88088 checkin from browser
cg
parents: 27
diff changeset
    26
eb7974d88088 checkin from browser
cg
parents: 27
diff changeset
    27
displayString
87
e9d58a151a63 *** empty log message ***
cg
parents: 83
diff changeset
    28
    class isNil ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    29
	^ 'JavaFieldRef ( ** unknown class ** ''' , nameandType displayString , ''')'
87
e9d58a151a63 *** empty log message ***
cg
parents: 83
diff changeset
    30
    ].
41
eb7974d88088 checkin from browser
cg
parents: 27
diff changeset
    31
    ^ 'JavaFieldRef (' , class fullName , ' ' 
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    32
			, '''' , nameandType name , '''' , nameandType signature , ')'
41
eb7974d88088 checkin from browser
cg
parents: 27
diff changeset
    33
! !
eb7974d88088 checkin from browser
cg
parents: 27
diff changeset
    34
27
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
    35
!JavaFieldref methodsFor:'resolving'!
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
    36
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
    37
isDouble
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
    38
    ^ (JavaMethod typeFromSignature:nameandType signature) == #double
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
    39
!
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
    40
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
    41
isLong
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
    42
    ^ (JavaMethod typeFromSignature:nameandType signature) == #long
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
    43
!
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
    44
54
f37bcefb7091 avoid loading classes twice
cg
parents: 43
diff changeset
    45
name
f37bcefb7091 avoid loading classes twice
cg
parents: 43
diff changeset
    46
    ^ nameandType name
f37bcefb7091 avoid loading classes twice
cg
parents: 43
diff changeset
    47
!
f37bcefb7091 avoid loading classes twice
cg
parents: 43
diff changeset
    48
27
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
    49
offset
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    50
    offset notNil ifTrue:[^ offset].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    51
    self resolve.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    52
    ^ offset.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    53
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    54
    "Modified: / 1.1.1998 / 19:20:23 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    55
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    56
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    57
resolve
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    58
    |nm sig cls|
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    59
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    60
    class isUnresolved ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    61
	self halt:'unresolved class'.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    62
    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    63
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    64
    nm := nameandType name asSymbol.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    65
    sig := nameandType signature.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    66
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    67
    type := JavaMethod typeFromSignature:sig.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    68
    offset := class instVarOffsetOf:nm.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    69
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    70
    "Modified: / 1.1.1998 / 19:19:52 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    71
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    72
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    73
resolveStatic
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    74
    |nm sig mthd cls|
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    75
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    76
    cls := class javaClass.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    77
    cls ~~ class ifTrue:[
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    78
        class := cls.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    79
    ].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    80
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    81
    nm := nameandType name asSymbol.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    82
    sig := nameandType signature.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    83
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    84
    type := JavaMethod typeFromSignature:sig.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    85
    offset := class class instVarOffsetOf:nm.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    86
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    87
    "Created: / 2.1.1998 / 17:16:55 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    88
    "Modified: / 2.1.1998 / 17:17:22 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    89
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    90
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    91
staticOffset
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    92
    offset notNil ifTrue:[^ offset].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    93
    self resolveStatic.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    94
    ^ offset.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    95
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    96
    "Modified: / 2.1.1998 / 17:17:47 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    97
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    98
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
    99
type
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   100
    type notNil ifTrue:[^ type].
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   101
    self resolve.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   102
    ^ type.
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   103
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   104
    "Modified: / 1.1.1998 / 19:20:37 / cg"
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   105
!
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   106
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   107
xxoffset
87
e9d58a151a63 *** empty log message ***
cg
parents: 83
diff changeset
   108
    |nm sig cls|
27
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   109
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   110
    offset notNil ifTrue:[^ offset].
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   111
90
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   112
"/    class := class resolveClass.
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   113
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   114
"/    (class isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   115
"/        cls := class resolve.
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   116
"/        cls notNil ifTrue:[
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   117
"/            class := cls
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   118
"/        ].
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   119
"/    ].
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   120
    class isUnresolved ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   121
	self halt:'unresolved class'.
27
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   122
    ].
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   123
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   124
    nm := nameandType name asSymbol.
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   125
    sig := nameandType signature.
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   126
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   127
    type := JavaMethod typeFromSignature:sig.
27
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   128
    offset := class instVarOffsetOf:nm.
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   129
    ^ offset.
43
2c4ca2eb8d07 checkin from browser
cg
parents: 41
diff changeset
   130
!
2c4ca2eb8d07 checkin from browser
cg
parents: 41
diff changeset
   131
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   132
xxtype
87
e9d58a151a63 *** empty log message ***
cg
parents: 83
diff changeset
   133
    |sig cls|
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   134
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   135
    type notNil ifTrue:[^ type].
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   136
90
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   137
"/    class := class resolveClass.
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   138
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   139
"/    (class isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   140
"/        cls := class resolve.
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   141
"/        cls notNil ifTrue:[
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   142
"/            class := cls
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   143
"/        ]
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   144
"/    ].
918e2740098c resolve rewritten
cg
parents: 87
diff changeset
   145
    class isUnresolved ifTrue:[
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   146
	self halt:'unresolved class'.
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   147
    ].
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   148
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   149
    sig := nameandType signature.
83
2d61ef3579e4 *** empty log message ***
cg
parents: 80
diff changeset
   150
    type := JavaMethod typeFromSignature:sig.
80
f08d2cab0b55 *** empty log message ***
cg
parents: 54
diff changeset
   151
    ^ type.
27
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   152
! !
4560bb77bb36 checkin from browser
cg
parents: 13
diff changeset
   153
135
098936234135 *** empty log message ***
cg
parents: 90
diff changeset
   154
!JavaFieldref class methodsFor:'documentation'!
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   155
083530508d9c intitial checkin
cg
parents:
diff changeset
   156
version
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 243
diff changeset
   157
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaFieldref.st,v 1.15 1998/01/05 18:47:25 cg Exp $'
1
083530508d9c intitial checkin
cg
parents:
diff changeset
   158
! !