752
|
1 |
"{ Package: 'stx:libjava' }"
|
|
2 |
|
|
3 |
JavaClassContentRef2 subclass:#JavaFieldRef2
|
792
|
4 |
instanceVariableNames:'offset type'
|
|
5 |
classVariableNames:'T_LONG T_DOUBLE'
|
752
|
6 |
poolDictionaries:''
|
|
7 |
category:'Languages-Java-Reader-Support-new'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
792
|
11 |
!JavaFieldRef2 class methodsFor:'initialization'!
|
|
12 |
|
|
13 |
initialize
|
|
14 |
T_LONG := 1.
|
|
15 |
T_DOUBLE := 2.
|
|
16 |
|
|
17 |
"Created: / 15-05-2011 / 22:31:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
18 |
! !
|
|
19 |
|
761
|
20 |
!JavaFieldRef2 methodsFor:'accessing'!
|
|
21 |
|
|
22 |
isJavaFieldRef
|
|
23 |
^true.
|
|
24 |
|
|
25 |
"Created: / 11-04-2011 / 21:47:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
791
|
26 |
!
|
|
27 |
|
|
28 |
offset
|
|
29 |
^ offset.
|
|
30 |
|
|
31 |
"Created: / 15-05-2011 / 22:26:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
792
|
32 |
!
|
|
33 |
|
|
34 |
type
|
|
35 |
type == T_LONG ifTrue: [ ^ #long. ].
|
|
36 |
type == T_DOUBLE ifTrue: [ ^ #double ].
|
|
37 |
^ type.
|
|
38 |
|
|
39 |
"Created: / 15-05-2011 / 22:29:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
761
|
40 |
! !
|
|
41 |
|
758
|
42 |
!JavaFieldRef2 methodsFor:'private - resolving'!
|
|
43 |
|
761
|
44 |
findResolvedStaticValue
|
791
|
45 |
| class |
|
793
|
46 |
self breakPoint:#mh.
|
791
|
47 |
valueCache := JavaResolver uniqueInstance
|
761
|
48 |
resolveStaticFieldIndentifiedByRef: self.
|
792
|
49 |
class := (constantPool at: classRefIndex) resolve.
|
793
|
50 |
class ifNil: [self breakPoint:#mh].
|
791
|
51 |
class ifNotNil: [ offset := class class instVarOffsetOf: self name ].
|
793
|
52 |
self resolveType.
|
761
|
53 |
|
|
54 |
"Created: / 28-04-2011 / 22:05:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
793
|
55 |
"Modified: / 15-05-2011 / 22:51:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
761
|
56 |
!
|
|
57 |
|
758
|
58 |
findResolvedValue
|
791
|
59 |
| class |
|
758
|
60 |
|
791
|
61 |
valueCache := JavaResolver uniqueInstance
|
|
62 |
resolveFieldIndentifiedByRef: self.
|
792
|
63 |
class := (constantPool at: classRefIndex) resolve.
|
793
|
64 |
class ifNil: [self breakPoint:#mh].
|
791
|
65 |
class ifNotNil: [ offset := class instVarOffsetOf: self name ].
|
793
|
66 |
self resolveType.
|
791
|
67 |
|
793
|
68 |
"Modified: / 15-05-2011 / 22:50:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
792
|
69 |
!
|
|
70 |
|
|
71 |
resolveType
|
|
72 |
type := JavaMethod typeFromSignature:((constantPool at: nameAndTypeIndex) descriptor) in:nil.
|
|
73 |
type == #long ifTrue:[
|
|
74 |
type := T_LONG.
|
|
75 |
] ifFalse:[
|
|
76 |
type == #double ifTrue:[
|
|
77 |
type := T_DOUBLE
|
|
78 |
]
|
|
79 |
].
|
|
80 |
|
|
81 |
"Created: / 15-05-2011 / 22:29:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
758
|
82 |
! !
|
|
83 |
|
752
|
84 |
!JavaFieldRef2 class methodsFor:'documentation'!
|
|
85 |
|
|
86 |
version_SVN
|
|
87 |
^ '$Id$'
|
|
88 |
! !
|
792
|
89 |
|
|
90 |
JavaFieldRef2 initialize!
|