OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 __ Bind(&loop); | 240 __ Bind(&loop); |
241 __ subs(R2, R2, ShifterOperand(Smi::RawValue(1))); // R2 is Smi. | 241 __ subs(R2, R2, ShifterOperand(Smi::RawValue(1))); // R2 is Smi. |
242 __ ldr(IP, Address(R1, 0), PL); | 242 __ ldr(IP, Address(R1, 0), PL); |
243 __ str(IP, Address(R3, 0), PL); | 243 __ str(IP, Address(R3, 0), PL); |
244 __ AddImmediate(R1, -kWordSize, PL); | 244 __ AddImmediate(R1, -kWordSize, PL); |
245 __ AddImmediate(R3, kWordSize, PL); | 245 __ AddImmediate(R3, kWordSize, PL); |
246 __ b(&loop, PL); | 246 __ b(&loop, PL); |
247 } | 247 } |
248 | 248 |
249 | 249 |
| 250 // Input parameters: |
| 251 // R5: ic-data. |
| 252 // R4: arguments descriptor array. |
| 253 // Note: The receiver object is the first argument to the function being |
| 254 // called, the stub accesses the receiver from this location directly |
| 255 // when trying to resolve the call. |
250 void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) { | 256 void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) { |
251 __ Unimplemented("InstanceFunctionLookup stub"); | 257 __ EnterStubFrame(); |
| 258 |
| 259 // Load the receiver. |
| 260 __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset())); |
| 261 __ add(IP, FP, ShifterOperand(R2, LSL, 1)); // R2 is Smi. |
| 262 __ ldr(R6, Address(IP, (kLastParamSlotIndex - 1) * kWordSize)); |
| 263 |
| 264 // Push space for the return value. |
| 265 // Push the receiver. |
| 266 // Push IC data object. |
| 267 // Push arguments descriptor array. |
| 268 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); |
| 269 __ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP)); |
| 270 |
| 271 // R2: Smi-tagged arguments array length. |
| 272 PushArgumentsArray(assembler); |
| 273 |
| 274 // Stack: |
| 275 // TOS + 0: argument array. |
| 276 // TOS + 1: arguments descriptor array. |
| 277 // TOS + 2: IC data object. |
| 278 // TOS + 3: Receiver. |
| 279 // TOS + 4: place for result from the call. |
| 280 // TOS + 5: saved FP of previous frame. |
| 281 // TOS + 6: dart code return address |
| 282 // TOS + 7: pc marker (0 for stub). |
| 283 // TOS + 8: last argument of caller. |
| 284 // .... |
| 285 __ CallRuntime(kInstanceFunctionLookupRuntimeEntry); |
| 286 // Remove arguments. |
| 287 __ Drop(4); |
| 288 __ Pop(R0); // Get result into R0. |
| 289 __ LeaveStubFrame(); |
| 290 __ Ret(); |
252 } | 291 } |
253 | 292 |
254 | 293 |
255 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) { | 294 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) { |
256 __ Unimplemented("DeoptimizeLazy stub"); | 295 __ Unimplemented("DeoptimizeLazy stub"); |
257 } | 296 } |
258 | 297 |
259 | 298 |
260 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 299 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
261 __ Unimplemented("Deoptimize stub"); | 300 __ Unimplemented("Deoptimize stub"); |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 __ Bind(&reference_compare); | 1640 __ Bind(&reference_compare); |
1602 __ cmp(left, ShifterOperand(right)); | 1641 __ cmp(left, ShifterOperand(right)); |
1603 __ Bind(&done); | 1642 __ Bind(&done); |
1604 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); | 1643 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); |
1605 __ Ret(); | 1644 __ Ret(); |
1606 } | 1645 } |
1607 | 1646 |
1608 } // namespace dart | 1647 } // namespace dart |
1609 | 1648 |
1610 #endif // defined TARGET_ARCH_ARM | 1649 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |