src/JavaFieldRef2.st
author vranyj1
Tue, 26 Jul 2011 16:31:02 +0000
branchjk_new_structure
changeset 877 f5a5b93e1c78
parent 819 d95b67600835
child 1152 040cba55a7d2
permissions -rw-r--r--
Cleanup phase 1 - Added #copyright method to all classes - removed JavaClassReader2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     1
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     7
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
     9
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    10
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    12
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    13
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    14
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    40
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    41
"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    43
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    44
JavaClassContentRef2 subclass:#JavaFieldRef2
792
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
    45
	instanceVariableNames:'offset type'
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
    46
	classVariableNames:'T_LONG T_DOUBLE'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Reader-Support-new'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    49
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    50
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    51
!JavaFieldRef2 class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    52
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    53
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    54
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    58
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    60
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    61
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    62
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    63
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    65
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    66
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    67
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    68
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    70
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    72
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    73
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    74
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    76
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    77
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    78
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    79
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    80
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    81
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    82
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    91
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    93
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    94
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    95
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 819
diff changeset
    96
! !
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    97
792
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
    98
!JavaFieldRef2 class methodsFor:'initialization'!
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
    99
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   100
initialize
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   101
    T_LONG := 1.
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   102
    T_DOUBLE := 2.
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   103
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   104
    "Created: / 15-05-2011 / 22:31:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   105
! !
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   106
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   107
!JavaFieldRef2 methodsFor:'accessing'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   108
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   109
isJavaFieldRef
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   110
^true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   111
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   112
    "Created: / 11-04-2011 / 21:47:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
791
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   113
!
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   114
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   115
offset
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   116
    ^ offset.
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   117
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   118
    "Created: / 15-05-2011 / 22:26:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
792
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   119
!
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   120
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   121
type
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   122
    type == T_LONG ifTrue: [ ^ #long. ].
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   123
    type == T_DOUBLE ifTrue: [ ^ #double ].
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   124
    ^ type.
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   125
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   126
    "Created: / 15-05-2011 / 22:29:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   127
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   128
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   129
!JavaFieldRef2 methodsFor:'private - resolving'!
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   130
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   131
findResolvedStaticValue
791
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   132
    valueCache := JavaResolver uniqueInstance 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   133
                resolveStaticFieldIndentifiedByRef: self.
819
d95b67600835 Static field resolving fixed
vranyj1
parents: 807
diff changeset
   134
    "/Use javaClass of the field, not the class ref!!
d95b67600835 Static field resolving fixed
vranyj1
parents: 807
diff changeset
   135
    classCache := valueCache javaClass. 
794
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   136
    classCache ifNil: [ self breakPoint: #mh ].
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   137
    self resolveStaticOffset.
794
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   138
    nameAndTypeCache := (constantPool at: nameAndTypeIndex) resolve.
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   139
    self resolveType.
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   140
    nameAndTypeCache ifNil: [ self breakPoint: #mh ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   142
    "Created: / 28-04-2011 / 22:05:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
794
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   143
    "Modified: / 18-05-2011 / 12:44:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
819
d95b67600835 Static field resolving fixed
vranyj1
parents: 807
diff changeset
   144
    "Modified: / 24-05-2011 / 14:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   145
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   146
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   147
findResolvedValue
791
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   148
    valueCache := JavaResolver uniqueInstance 
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   149
                resolveFieldIndentifiedByRef: self.
794
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   150
    classCache := (constantPool at: classRefIndex) resolve.
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   151
    classCache ifNil: [ self breakPoint: #mh ].
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   152
    self resolveOffset.
794
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   153
    nameAndTypeCache := (constantPool at: nameAndTypeIndex) resolve.
793
bf00d8585c8e forgot to resolve type in JavaFieldRef2
hlopkmar
parents: 792
diff changeset
   154
    self resolveType.
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   155
    nameAndTypeCache ifNil: [ self breakPoint: #mh ].
791
46666ff1f9b6 added offset to JavaFieldRef2
hlopkmar
parents: 772
diff changeset
   156
794
9635f32d1723 implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents: 793
diff changeset
   157
    "Modified: / 18-05-2011 / 12:44:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
792
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   158
!
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   159
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   160
resolveOffset
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   161
    "fieldRef must be resolved before calling me"
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   162
    
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   163
    | currentClass |
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   164
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   165
    currentClass := classCache.
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   166
    
807
b9dde0678965 I should not be committing anything when I'm in hurry.. swapped resolveOffset and resolveStaticOffset
hlopkmar
parents: 806
diff changeset
   167
    [ offset := currentClass instVarOffsetOf: self name.
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   168
    offset isNil and: [ currentClass superclass ~= JavaObject ]. ] whileTrue: [ currentClass := currentClass superclass. ].
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   169
807
b9dde0678965 I should not be committing anything when I'm in hurry.. swapped resolveOffset and resolveStaticOffset
hlopkmar
parents: 806
diff changeset
   170
    "Modified: / 20-05-2011 / 20:36:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   171
!
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   172
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   173
resolveStaticOffset
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   174
    "fieldRef must be resolved before calling me"
807
b9dde0678965 I should not be committing anything when I'm in hurry.. swapped resolveOffset and resolveStaticOffset
hlopkmar
parents: 806
diff changeset
   175
    
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   176
    | currentClass |
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   177
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   178
    currentClass := classCache.
807
b9dde0678965 I should not be committing anything when I'm in hurry.. swapped resolveOffset and resolveStaticOffset
hlopkmar
parents: 806
diff changeset
   179
    
b9dde0678965 I should not be committing anything when I'm in hurry.. swapped resolveOffset and resolveStaticOffset
hlopkmar
parents: 806
diff changeset
   180
    [ offset := currentClass class instVarOffsetOf: self name.
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   181
    offset isNil and: [ currentClass superclass ~= JavaObject ]. ] whileTrue: [ currentClass := currentClass superclass. ].
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   182
807
b9dde0678965 I should not be committing anything when I'm in hurry.. swapped resolveOffset and resolveStaticOffset
hlopkmar
parents: 806
diff changeset
   183
    "Modified: / 20-05-2011 / 20:36:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
806
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   184
!
7d1f2ba6d2df fixed lookup of fields.. at least I hope so :)
hlopkmar
parents: 794
diff changeset
   185
792
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   186
resolveType
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   187
    type := JavaMethod typeFromSignature:((constantPool at: nameAndTypeIndex) descriptor) in:nil.
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   188
    type == #long ifTrue:[
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   189
        type := T_LONG.
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   190
    ] ifFalse:[
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   191
        type == #double ifTrue:[
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   192
            type := T_DOUBLE
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   193
        ]
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   194
    ].
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   195
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   196
    "Created: / 15-05-2011 / 22:29:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   197
! !
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   198
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   199
!JavaFieldRef2 class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   201
version_SVN
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   202
    ^ '$Id$'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   203
! !
792
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   204
14aa43c34268 fixes + added type to JavaFieldRef2
hlopkmar
parents: 791
diff changeset
   205
JavaFieldRef2 initialize!