author | Marcel Hlopko <marcel.hlopko@fit.cvut.cz> |
Tue, 18 Dec 2012 19:02:51 +0100 | |
branch | development |
changeset 1910 | 278ceba64f94 |
parent 1864 | 60a8dc26c8c6 |
child 2069 | 75d40b7b986f |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
15 |
||
1155 | 16 |
[1] Code written at SWING Research Group contains a signature |
17 |
of one of the above copright owners. For exact set of such code, |
|
18 |
see the differences between this version and version stx:libjava |
|
1152 | 19 |
as of 1.9.2010 |
877 | 20 |
" |
752 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
23 |
JavaClassContentRef2 subclass:#JavaMethodRef2 |
|
1728 | 24 |
instanceVariableNames:'selectorCache numArgSlotsCache returnTypeCache' |
752 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Reader-Support-new' |
|
28 |
! |
|
29 |
||
877 | 30 |
!JavaMethodRef2 class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 35 |
|
1155 | 36 |
New code and modifications done at SWING Research Group [1]: |
1152 | 37 |
|
877 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
39 |
SWING Research Group, Czech Technical University in Prague |
|
40 |
||
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
1155 | 48 |
[1] Code written at SWING Research Group contains a signature |
49 |
of one of the above copright owners. For exact set of such code, |
|
50 |
see the differences between this version and version stx:libjava |
|
1152 | 51 |
as of 1.9.2010 |
877 | 52 |
|
53 |
" |
|
54 |
! ! |
|
752 | 55 |
|
850 | 56 |
!JavaMethodRef2 methodsFor:'printing & storing'! |
57 |
||
58 |
printOn:aStream |
|
59 |
"append a printed representation if the receiver to the argument, aStream" |
|
60 |
||
61 |
super printOn:aStream. |
|
62 |
! ! |
|
63 |
||
758 | 64 |
!JavaMethodRef2 methodsFor:'private - resolving'! |
65 |
||
761 | 66 |
findResolvedStaticValue |
1238 | 67 |
<resource: #obsolete> |
68 |
"/ Logger |
|
69 |
"/ log: self printString |
|
70 |
"/ , ': findResolvedStaticValue is obsolete, call resolve its safe :)' |
|
71 |
"/ severity: #info |
|
72 |
"/ facility: #JVM. |
|
1235 | 73 |
self findResolvedValue. |
761 | 74 |
|
75 |
"Created: / 28-04-2011 / 22:45:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1235 | 76 |
"Modified: / 07-12-2011 / 15:10:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1238 | 77 |
"Modified: / 07-12-2011 / 21:07:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
761 | 78 |
! |
79 |
||
1353 | 80 |
findResolvedValue: doClassInit |
761 | 81 |
"Resolve reference and set valueCache." |
82 |
||
83 |
valueCache := JavaResolver uniqueInstance |
|
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
772
diff
changeset
|
84 |
resolveMethodIndentifiedByRef: self. |
1353 | 85 |
classCache := (constantPool at: classRefIndex) resolve: doClassInit. |
1655 | 86 |
classCache isNil ifTrue: [ self breakPoint: #mh ]. |
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
772
diff
changeset
|
87 |
nameAndTypeCache := (constantPool at: nameAndTypeIndex) resolve. |
1655 | 88 |
nameAndTypeCache isNil ifTrue: [ self breakPoint: #mh ]. |
89 |
selectorCache isNil ifTrue: [ |
|
90 |
selectorCache := (nameAndTypeCache name , nameAndTypeCache descriptor) asSymbol |
|
91 |
]. |
|
758 | 92 |
|
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
772
diff
changeset
|
93 |
"Modified: / 18-05-2011 / 12:44:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1353 | 94 |
"Created: / 09-02-2012 / 23:10:32 / mh <hlopik@gmail.com>" |
1655 | 95 |
"Modified: / 22-08-2012 / 14:53:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
761 | 96 |
! ! |
97 |
||
98 |
!JavaMethodRef2 methodsFor:'queries'! |
|
99 |
||
100 |
isJavaMethodRef |
|
101 |
^ true. |
|
102 |
||
103 |
"Created: / 11-04-2011 / 19:56:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
758 | 104 |
! ! |
105 |
||
1728 | 106 |
!JavaMethodRef2 methodsFor:'resolving'! |
107 |
||
108 |
preResolve |
|
109 |
"Fill in selectorCache and numArgSlotsCache for these are used |
|
110 |
by the JIT-compiler" |
|
111 |
||
112 |
| returnTypeChar | |
|
113 |
||
114 |
nameAndTypeCache := (constantPool at: nameAndTypeIndex) resolve. |
|
115 |
nameAndTypeCache isNil ifTrue: [ self breakPoint: #mh ]. |
|
116 |
selectorCache isNil ifTrue: [ |
|
117 |
selectorCache := (nameAndTypeCache name , nameAndTypeCache descriptor) asSymbol |
|
118 |
]. |
|
119 |
numArgSlotsCache := JavaMethod numArgsFromSignature: nameAndTypeCache descriptor. |
|
120 |
returnTypeChar := nameAndTypeCache descriptor last. |
|
121 |
returnTypeChar == $V ifTrue:[ |
|
122 |
returnTypeCache := JavaMethod r_void. |
|
123 |
] ifFalse:[ |
|
1743 | 124 |
returnTypeChar == $J ifTrue:[ |
1728 | 125 |
returnTypeCache := JavaMethod r_long. |
126 |
] ifFalse:[ |
|
127 |
returnTypeChar == $D ifTrue:[ |
|
128 |
returnTypeCache := JavaMethod r_double. |
|
129 |
] ifFalse:[ |
|
130 |
returnTypeCache := 0. |
|
131 |
] |
|
132 |
] |
|
133 |
] |
|
134 |
||
135 |
"Created: / 15-10-2012 / 23:13:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
136 |
! ! |
|
137 |
||
752 | 138 |
!JavaMethodRef2 class methodsFor:'documentation'! |
139 |
||
1864 | 140 |
version_HG |
141 |
||
142 |
^ '$Changeset: <not expanded> $' |
|
143 |
! |
|
144 |
||
752 | 145 |
version_SVN |
1864 | 146 |
^ '§Id§' |
752 | 147 |
! ! |