OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 __ br(R1); | 2176 __ br(R1); |
2177 | 2177 |
2178 __ Bind(&miss); | 2178 __ Bind(&miss); |
2179 __ LoadIsolate(R2); | 2179 __ LoadIsolate(R2); |
2180 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); | 2180 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); |
2181 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2181 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2182 __ br(R1); | 2182 __ br(R1); |
2183 } | 2183 } |
2184 | 2184 |
2185 | 2185 |
| 2186 // Called from switchable IC calls. |
| 2187 // R0: receiver |
| 2188 // R5: SingleTargetCache |
| 2189 // Passed to target: |
| 2190 // CODE_REG: target Code object |
| 2191 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) { |
| 2192 __ NoMonomorphicCheckedEntry(); |
| 2193 |
| 2194 Label miss; |
| 2195 |
| 2196 __ LoadClassIdMayBeSmi(R1, R0); |
| 2197 __ ldr(R2, FieldAddress(R5, SingleTargetCache::lower_limit_offset()), |
| 2198 kUnsignedWord); |
| 2199 __ ldr(R3, FieldAddress(R5, SingleTargetCache::upper_limit_offset()), |
| 2200 kUnsignedWord); |
| 2201 |
| 2202 __ cmp(R1, Operand(R2)); |
| 2203 __ b(&miss, LT); |
| 2204 __ cmp(R1, Operand(R3)); |
| 2205 __ b(&miss, GT); |
| 2206 |
| 2207 __ ldr(R1, FieldAddress(R5, SingleTargetCache::entry_point_offset())); |
| 2208 __ ldr(CODE_REG, FieldAddress(R5, SingleTargetCache::target_offset())); |
| 2209 __ br(R1); |
| 2210 |
| 2211 __ Bind(&miss); |
| 2212 __ EnterStubFrame(); |
| 2213 __ Push(R0); // Preserve receiver. |
| 2214 |
| 2215 __ PushObject(Object::null_object()); // Result. |
| 2216 __ Push(R0); // Arg0: Receiver |
| 2217 __ CallRuntime(kSingleTargetMissRuntimeEntry, 1); |
| 2218 __ Drop(1); |
| 2219 __ Pop(R5); // result = IC |
| 2220 |
| 2221 __ Pop(R0); // Restore receiver. |
| 2222 __ LeaveStubFrame(); |
| 2223 |
| 2224 __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); |
| 2225 __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
| 2226 __ br(R1); |
| 2227 } |
| 2228 |
| 2229 |
2186 // Called from the monomorphic checked entry. | 2230 // Called from the monomorphic checked entry. |
2187 // R0: receiver | 2231 // R0: receiver |
2188 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { | 2232 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { |
2189 __ EnterStubFrame(); | 2233 __ EnterStubFrame(); |
2190 __ Push(R0); // Preserve receiver. | 2234 __ Push(R0); // Preserve receiver. |
2191 | 2235 |
2192 __ PushObject(Object::null_object()); // Result. | 2236 __ PushObject(Object::null_object()); // Result. |
2193 __ Push(R0); // Arg0: Receiver | 2237 __ Push(R0); // Arg0: Receiver |
2194 __ CallRuntime(kMonomorphicMissRuntimeEntry, 1); | 2238 __ CallRuntime(kMonomorphicMissRuntimeEntry, 1); |
2195 __ Drop(1); | 2239 __ Drop(1); |
2196 __ Pop(R5); // result = IC | 2240 __ Pop(R5); // result = IC |
2197 | 2241 |
2198 __ Pop(R0); // Restore receiver. | 2242 __ Pop(R0); // Restore receiver. |
2199 __ LeaveStubFrame(); | 2243 __ LeaveStubFrame(); |
2200 | 2244 |
2201 __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); | 2245 __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); |
2202 __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); | 2246 __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
2203 __ br(R1); | 2247 __ br(R1); |
2204 } | 2248 } |
2205 | 2249 |
2206 | 2250 |
2207 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2251 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2208 __ brk(0); | 2252 __ brk(0); |
2209 } | 2253 } |
2210 | 2254 |
2211 } // namespace dart | 2255 } // namespace dart |
2212 | 2256 |
2213 #endif // defined TARGET_ARCH_ARM64 | 2257 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |