| 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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 // +------------------+ | 469 // +------------------+ |
| 470 // | PC marker | | 470 // | PC marker | |
| 471 // +------------------+ | 471 // +------------------+ |
| 472 // | ... | <- SP of optimized frame | 472 // | ... | <- SP of optimized frame |
| 473 // | 473 // |
| 474 // Parts of the code cannot GC, part of the code can GC. | 474 // Parts of the code cannot GC, part of the code can GC. |
| 475 static void GenerateDeoptimizationSequence(Assembler* assembler, | 475 static void GenerateDeoptimizationSequence(Assembler* assembler, |
| 476 bool preserve_result) { | 476 bool preserve_result) { |
| 477 // DeoptimizeCopyFrame expects a Dart frame, i.e. EnterDartFrame(0), but there | 477 // DeoptimizeCopyFrame expects a Dart frame, i.e. EnterDartFrame(0), but there |
| 478 // is no need to set the correct PC marker or load PP, since they get patched. | 478 // is no need to set the correct PC marker or load PP, since they get patched. |
| 479 __ mov(IP, Operand(LR)); | 479 |
| 480 __ mov(LR, Operand(0)); | 480 // IP has the potentially live LR value. LR was clobbered by the call with |
| 481 __ EnterFrame((1 << PP) | (1 << FP) | (1 << IP) | (1 << LR), 0); | 481 // the return address, so move it into IP to set up the Dart frame. |
| 482 __ eor(IP, IP, Operand(LR)); |
| 483 __ eor(LR, IP, Operand(LR)); |
| 484 __ eor(IP, IP, Operand(LR)); |
| 485 |
| 486 // Set up the frame manually. We can't use EnterFrame because we can't |
| 487 // clobber LR (or any other register) with 0, yet. |
| 488 __ sub(SP, SP, Operand(kWordSize)); // Make room for PC marker of 0. |
| 489 __ Push(IP); // Push return address. |
| 490 __ Push(FP); |
| 491 __ mov(FP, Operand(SP)); |
| 492 __ Push(PP); |
| 493 // Now that IP holding the return address has been written to the stack, |
| 494 // we can clobber it with 0 to write the null PC marker. |
| 495 __ mov(IP, Operand(0)); |
| 496 __ str(IP, Address(SP, +3 * kWordSize)); |
| 497 |
| 482 // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry | 498 // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry |
| 483 // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls. | 499 // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls. |
| 484 const intptr_t saved_result_slot_from_fp = | 500 const intptr_t saved_result_slot_from_fp = |
| 485 kFirstLocalSlotFromFp + 1 - (kNumberOfCpuRegisters - R0); | 501 kFirstLocalSlotFromFp + 1 - (kNumberOfCpuRegisters - R0); |
| 486 // Result in R0 is preserved as part of pushing all registers below. | 502 // Result in R0 is preserved as part of pushing all registers below. |
| 487 | 503 |
| 488 // Push registers in their enumeration order: lowest register number at | 504 // Push registers in their enumeration order: lowest register number at |
| 489 // lowest address. | 505 // lowest address. |
| 490 __ PushList(kAllCpuRegistersList); | 506 __ PushList(kAllCpuRegistersList); |
| 491 | 507 |
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 const Register right = R0; | 1990 const Register right = R0; |
| 1975 __ ldr(left, Address(SP, 1 * kWordSize)); | 1991 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 1976 __ ldr(right, Address(SP, 0 * kWordSize)); | 1992 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 1977 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1993 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1978 __ Ret(); | 1994 __ Ret(); |
| 1979 } | 1995 } |
| 1980 | 1996 |
| 1981 } // namespace dart | 1997 } // namespace dart |
| 1982 | 1998 |
| 1983 #endif // defined TARGET_ARCH_ARM | 1999 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |