JavaRef2.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 01 Feb 2019 22:31:35 +0000
changeset 3879 5416f5135ef2
parent 3605 da57f13e6a23
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
     2
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
     5
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
     6
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    19
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
    23
"{ NameSpace: Smalltalk }"
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
    24
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
Object subclass:#JavaRef2
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    26
	instanceVariableNames:'resolvedValue constantPool'
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
	category:'Languages-Java-Reader-Support-new'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
!JavaRef2 class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
    36
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    37
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    38
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    39
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
    40
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    50
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    51
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    52
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    53
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    56
!
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    57
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    58
documentation
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    59
"
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    60
    An abstract superclass for symbolic references in Java class files.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    61
    A reference is either ''unresolved'' (when `resolvedValue` instvar nil)
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    62
    or ''resolved'' (when ``resolvedValue`` instvar is not nil).
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    63
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    64
    IMPORTANT: The exact physical structure of (sub)instances is known
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    65
    by the VM and therefore changing number, order or meaning of individual
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    66
    instance variables would imply to change the VM accordingly.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    67
    See comments in individual subclasses which instvars are accessed by the VM.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    68
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    69
    IMPORTANT: There's a naming convention:
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    70
    Slots whose name starts with ''resolved'' are valid only after the reference
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    71
    is resolved. Otherwise, they MUST have nil value.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    72
    Other slots MUST be valid once JavaClassReader finishes reading of the 
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    73
    .class file.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    74
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    75
    [author:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    76
        Marcel Hlopko <marcel.hlopko@fit.cvut.cz>
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    77
        Jan Vrany <jan.vrany@fit.cvut.cz>
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    78
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    79
    [instance variables:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    80
      !! resolvedValue ..... resolved value whatever it is (class, method, field...).
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    81
                            It also serve as an indicator whether the reference
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    82
                            is unresolved (nil value) or resolved (non-nil value).
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    83
                            !!!!!! Used by the VM !!!!!!
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    84
        constantPool ...... a constant pool to which this reference belongs.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    85
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    86
    [class variables:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    87
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    88
    [see also:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    89
        Subclasses
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    90
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    91
"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
!JavaRef2 class methodsFor:'instance creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
    "Don't call me directly"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
    98
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
    99
    self shouldNotImplement
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   101
    "Modified: / 06-12-2011 / 17:02:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
   102
    "Modified: / 02-03-2015 / 15:55:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
!JavaRef2 methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
constantPool
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
^constantPool.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
    "Created: / 10-05-2011 / 17:16:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
constantPool: aJavaConstantPool
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
    constantPool := aJavaConstantPool.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
    "Created: / 10-05-2011 / 17:16:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
isResolved
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   120
    ^ resolvedValue notNil.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
    "Created: / 08-04-2011 / 11:36:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
    "Modified: / 08-04-2011 / 17:39:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   124
    "Modified: / 31-01-2014 / 02:30:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
name
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
^ self subclassResponsibility.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    "Created: / 08-04-2011 / 13:53:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
owner
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
    ^ constantPool owner.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
    "Modified: / 12-05-2011 / 18:31:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
owner: javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
    constantPool owner: javaClass.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
    "Modified: / 12-05-2011 / 18:32:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   145
resolvedValue
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   146
    ^ resolvedValue
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
!JavaRef2 methodsFor:'comparing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
= anotherJavaRef
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   152
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   153
    ^ self subclassResponsibility.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
    "Created: / 08-04-2011 / 12:15:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   156
    "Modified (format): / 31-01-2014 / 03:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
hash
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   161
    ^ self subclassResponsibility.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
    "Created: / 08-04-2011 / 12:15:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   164
    "Modified (format): / 31-01-2014 / 03:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
!JavaRef2 methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
initialize
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   170
    resolvedValue := nil.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
    super initialize.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
    "Modified: / 08-04-2011 / 17:39:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
!JavaRef2 methodsFor:'printing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
displayString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
    ^self subclassResponsibility
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
    "Created: / 14-08-2011 / 21:18:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
!JavaRef2 methodsFor:'private - resolving'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   187
findResolvedValue
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   188
    self findResolvedValue: true.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   190
    "Modified: / 09-02-2012 / 23:10:09 / mh <hlopik@gmail.com>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   193
findResolvedValue: doInit
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   194
    "Resolves reference. If doInit is true, then eventually
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   195
     initialize the class"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   197
    self subclassResponsibility
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   198
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   199
    "Created: / 09-02-2012 / 23:08:15 / mh <hlopik@gmail.com>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   200
    "Modified: / 10-04-2012 / 09:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
!JavaRef2 methodsFor:'queries'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
isJavaRef
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
"return true if object represents reference in java constant pool"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
^ true.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
    "Created: / 08-04-2011 / 16:15:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
3605
da57f13e6a23 Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3431
diff changeset
   212
isJavaStringRef
da57f13e6a23 Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3431
diff changeset
   213
    ^ false.
da57f13e6a23 Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3431
diff changeset
   214
da57f13e6a23 Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3431
diff changeset
   215
    "Created: / 29-07-2016 / 10:06:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
da57f13e6a23 Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3431
diff changeset
   216
!
da57f13e6a23 Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3431
diff changeset
   217
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
isNewJavaRef
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
    "only temporary, to know if ref is old (claus' version) or new (m version)"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
    ^ true.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
    "Created: / 10-05-2011 / 12:20:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
!JavaRef2 methodsFor:'resolving'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
invalidate
2976
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   229
    "Invalidate reference. Cache will be cleared and next call to resolve will 
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   230
     cause resolving from scratch. Return true if reference was resolved and
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   231
     thus invalidates or false otherwise"
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   232
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   233
    | invalidated |
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   234
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   235
    invalidated := resolvedValue notNil.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   236
    resolvedValue := nil.
2976
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   237
    ^ invalidated
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
    "Created: / 08-04-2011 / 11:42:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
    "Modified: / 08-04-2011 / 17:39:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2992
diff changeset
   241
    "Modified: / 07-08-2014 / 14:38:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2976
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   242
!
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   243
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   244
invalidateForClass: internalJavaClassName 
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   245
    "Invalidates receiver iff it refers (even indirectly)
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   246
     to a class ref that has been resolved to given class.
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   247
     Returns true, if the receiver has been invalidated,
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   248
     false otherwise"
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   249
    
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   250
    ^ self subclassResponsibility.
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   251
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   252
    "Created: / 08-04-2011 / 15:59:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2969
diff changeset
   253
    "Modified (comment): / 21-02-2012 / 10:20:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   256
preResolve
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   257
    "Pre-resolve some caches. Called when the constant pool
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   258
     is loaded. MUST NOT load new nor modify any existing class!!!!!!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   259
     Ask JV for what this is needed"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   260
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   261
    "Nothing by default"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   262
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   263
    "Created: / 15-10-2012 / 23:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   264
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   265
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
resolve
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
     Do it all method - resolves current reference and returns expected element (JavaMethod, JavaField etc.)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
     Hides implementation details of the way of dealing with invalidation etc. User should not need to call anything
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
     else."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
    
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   272
     ^ self resolve: true.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
    "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   275
    "Modified: / 23-02-2012 / 17:21:39 / Marcel Hlopko <hlopik@gmail.com>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   276
    "Modified (format): / 31-01-2014 / 09:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   279
resolve: doClassInit
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   280
    "Do it all method - resolves current reference and returns expected element (JavaMethod, JavaField etc.)
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   281
     If doClassInit is true, resolved class is initialized (if not already)
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
     Hides implementation details of the way of dealing with invalidation etc. User should not need to call anything
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
     else."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
    
2969
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   285
    self isResolved ifFalse: [
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   286
        constantPool owner synchronized:[  
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   287
            self isResolved ifFalse:[
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   288
                self findResolvedValue: doClassInit.
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   289
                JavaVM flushCachesFor: constantPool owner.
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   290
            ].
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   291
        ]
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   292
    ].
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   293
    ^ resolvedValue.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   295
    "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   296
    "Created: / 09-02-2012 / 23:08:15 / mh <hlopik@gmail.com>"
2969
38f0943c97a4 Fix in JavaRef2>>#resolve: resolving is now synchronized on class.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   297
    "Modified: / 23-12-2013 / 23:02:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
!JavaRef2 methodsFor:'testing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
isUnresolved
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   304
    ^resolvedValue isNil
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
    "Created: / 22-05-2011 / 14:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
!JavaRef2 class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
2225
e882c3b261cb added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   311
version_CVS
3431
82790b1e6d54 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3430
diff changeset
   312
    ^ '$Header: /cvs/stx/stx/libjava/JavaRef2.st,v 1.8 2015-03-20 12:08:00 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   313
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   314
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   315
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   316
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   317
    ^ '$Changeset: <not expanded> $'
2225
e882c3b261cb added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   318
!
e882c3b261cb added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   319
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
version_SVN
2731
13f5be2bf83b Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2711 2678
diff changeset
   321
    ^ 'Id'
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   322
! !
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2225
diff changeset
   323