Debian Codegraph @

runtime/interpreter/mterp/x86ng/object.S

raw
1 %def op_check_cast():
2 % slow_path = add_slow_path(op_check_cast_slow_path)
3 // Fast-path which gets the class from thread-local cache.
4 % fetch_from_thread_cache("%ecx", miss_label="3f")
5 1:
6 GET_VREG %eax, rINST
7 testl %eax, %eax
8 je .L${opcode}_resume
9 // Fast path without read barriers.
10 cmpl MIRROR_OBJECT_CLASS_OFFSET(%eax), %ecx
11 jne ${slow_path}
12 .L${opcode}_resume:
13 ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
14 3:
15 EXPORT_PC
16 movl rSELF:THREAD_SELF_OFFSET, ARG0
17 movl 0(%esp), ARG1
18 movl rPC, ARG2
19 call nterp_get_class
20 movl %eax, %ecx
21 jmp 1b
22
23 %def op_check_cast_slow_path():
24 cmpl $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
25 jne 2f
26 1:
27 EXPORT_PC
28 call art_quick_check_instance_of
29 RESTORE_IBASE
30 jmp .L${opcode}_resume
31 2:
32 // 01 is %ecx
33 call art_quick_read_barrier_mark_reg01
34 jmp 1b
35
36 %def op_instance_of():
37 % slow_path = add_slow_path(op_instance_of_slow_path)
38 /* instance-of vA, vB, class@CCCC */
39 // Fast-path which gets the class from thread-local cache.
40 % fetch_from_thread_cache("%ecx", miss_label="2f")
41 1:
42 movzbl rINSTbl, %eax
43 sarl $$4,%eax # eax<- B
44 GET_VREG %eax %eax # eax<- vB (object)
45 testl %eax, %eax
46 je .L${opcode}_resume
47 // Fast path without read barriers.
48 cmpl MIRROR_OBJECT_CLASS_OFFSET(%eax), %ecx
49 jne ${slow_path}
50 .L${opcode}_set_one:
51 movl $$1, %eax
52 .L${opcode}_resume:
53 andb $$0xf,rINSTbl # rINST<- A
54 SET_VREG %eax, rINST # fp[A] <- value
55 ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
56 2:
57 EXPORT_PC
58 movl rSELF:THREAD_SELF_OFFSET, ARG0
59 movl 0(%esp), ARG1
60 movl rPC, ARG2
61 call nterp_get_class
62 movl %eax, %ecx
63 jmp 1b
64
65 %def op_instance_of_slow_path():
66 cmpl $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
67 jne 2f
68 testl $$MIRROR_CLASS_IS_INTERFACE_FLAG, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(%ecx)
69 jne 3f
70 cmpl $$0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%ecx)
71 jne 3f
72 movl MIRROR_OBJECT_CLASS_OFFSET(%eax), %eax
73 1:
74 movl MIRROR_CLASS_SUPER_CLASS_OFFSET(%eax), %eax
75 cmpl %eax, %ecx
76 je .L${opcode}_set_one
77 testl %eax, %eax
78 jne 1b
79 jmp .L${opcode}_resume
80 2:
81 // 01 is %ecx
82 call art_quick_read_barrier_mark_reg01
83 3:
84 EXPORT_PC
85 call art_quick_instance_of
86 RESTORE_IBASE
87 FETCH_INST_CLEAR_OPCODE
88 jmp .L${opcode}_resume
89
90 %def op_iget_boolean():
91 jmp NterpGetBooleanInstanceField
92
93 %def op_iget_byte():
94 jmp NterpGetByteInstanceField
95
96 %def op_iget_char():
97 jmp NterpGetCharInstanceField
98
99 %def op_iget_object():
100 jmp NterpGetObjectInstanceField
101
102 %def op_iget_short():
103 jmp NterpGetShortInstanceField
104
105 %def op_iget_wide():
106 jmp NterpGetWideInstanceField
107
108 %def op_iget():
109 jmp NterpGetInstanceField
110
111 %def op_iput():
112 jmp NterpPutInstanceField
113
114 %def op_iput_boolean():
115 jmp NterpPutBooleanInstanceField
116
117 %def op_iput_byte():
118 jmp NterpPutByteInstanceField
119
120 %def op_iput_char():
121 jmp NterpPutCharInstanceField
122
123 %def op_iput_object():
124 jmp NterpPutObjectInstanceField
125
126 %def op_iput_short():
127 jmp NterpPutShortInstanceField
128
129 %def op_iput_wide():
130 jmp NterpPutWideInstanceField
131
132 %def op_sget(load="movl", wide="0"):
133 jmp NterpGetIntStaticField
134
135 %def op_sget_boolean():
136 jmp NterpGetBooleanStaticField
137
138 %def op_sget_byte():
139 jmp NterpGetByteStaticField
140
141 %def op_sget_char():
142 jmp NterpGetCharStaticField
143
144 %def op_sget_object():
145 jmp NterpGetObjectStaticField
146
147 %def op_sget_short():
148 jmp NterpGetShortStaticField
149
150 %def op_sget_wide():
151 jmp NterpGetWideStaticField
152
153 %def op_sput():
154 jmp NterpPutStaticField
155
156 %def op_sput_boolean():
157 jmp NterpPutBooleanStaticField
158
159 %def op_sput_byte():
160 jmp NterpPutByteStaticField
161
162 %def op_sput_char():
163 jmp NterpPutCharStaticField
164
165 %def op_sput_object():
166 jmp NterpPutObjectStaticField
167
168 %def op_sput_short():
169 jmp NterpPutShortStaticField
170
171 %def op_sput_wide():
172 jmp NterpPutWideStaticField
173
174 %def op_new_instance():
175 // The routine is too big to fit in a handler, so jump to it.
176 jmp NterpNewInstance