Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: runtime/vm/stub_code_arm.cc

Issue 602993002: Frees up LR on arm for use by the register allocator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
494 // Now that IP holding the return address has been written to the stack,
495 // we can clobber it with 0 to write the null PC marker.
496 __ mov(IP, Operand(0));
497 __ str(IP, Address(SP, +3 * kWordSize));
498
482 // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry 499 // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
483 // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls. 500 // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
484 const intptr_t saved_result_slot_from_fp = 501 const intptr_t saved_result_slot_from_fp =
485 kFirstLocalSlotFromFp + 1 - (kNumberOfCpuRegisters - R0); 502 kFirstLocalSlotFromFp + 1 - (kNumberOfCpuRegisters - R0);
486 // Result in R0 is preserved as part of pushing all registers below. 503 // Result in R0 is preserved as part of pushing all registers below.
487 504
488 // Push registers in their enumeration order: lowest register number at 505 // Push registers in their enumeration order: lowest register number at
489 // lowest address. 506 // lowest address.
490 __ PushList(kAllCpuRegistersList); 507 __ PushList(kAllCpuRegistersList);
491 508
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 const Register right = R0; 1991 const Register right = R0;
1975 __ ldr(left, Address(SP, 1 * kWordSize)); 1992 __ ldr(left, Address(SP, 1 * kWordSize));
1976 __ ldr(right, Address(SP, 0 * kWordSize)); 1993 __ ldr(right, Address(SP, 0 * kWordSize));
1977 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1994 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1978 __ Ret(); 1995 __ Ret();
1979 } 1996 }
1980 1997
1981 } // namespace dart 1998 } // namespace dart
1982 1999
1983 #endif // defined TARGET_ARCH_ARM 2000 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698