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

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

Issue 640423002: Uses stp/ldp for frame entry/exit on arm64. (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/assembler_arm64.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) 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // | return-address | (deoptimization point) 523 // | return-address | (deoptimization point)
524 // +------------------+ 524 // +------------------+
525 // | ... | <- SP of optimized frame 525 // | ... | <- SP of optimized frame
526 // 526 //
527 // Parts of the code cannot GC, part of the code can GC. 527 // Parts of the code cannot GC, part of the code can GC.
528 static void GenerateDeoptimizationSequence(Assembler* assembler, 528 static void GenerateDeoptimizationSequence(Assembler* assembler,
529 bool preserve_result) { 529 bool preserve_result) {
530 // DeoptimizeCopyFrame expects a Dart frame, i.e. EnterDartFrame(0), but there 530 // DeoptimizeCopyFrame expects a Dart frame, i.e. EnterDartFrame(0), but there
531 // is no need to set the correct PC marker or load PP, since they get patched. 531 // is no need to set the correct PC marker or load PP, since they get patched.
532 __ EnterFrame(0); 532 __ EnterFrame(0);
533 __ Push(ZR); 533 __ TagAndPushPPAndPcMarker(ZR);
534 __ TagAndPushPP();
535 534
536 // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry 535 // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
537 // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls. 536 // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
538 const intptr_t saved_result_slot_from_fp = 537 const intptr_t saved_result_slot_from_fp =
539 kFirstLocalSlotFromFp + 1 - (kNumberOfCpuRegisters - R0); 538 kFirstLocalSlotFromFp + 1 - (kNumberOfCpuRegisters - R0);
540 // Result in R0 is preserved as part of pushing all registers below. 539 // Result in R0 is preserved as part of pushing all registers below.
541 540
542 // Push registers in their enumeration order: lowest register number at 541 // Push registers in their enumeration order: lowest register number at
543 // lowest address. 542 // lowest address.
544 for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; i--) { 543 for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; i--) {
(...skipping 16 matching lines...) Expand all
561 __ LoadFromOffset(R1, FP, saved_result_slot_from_fp * kWordSize, kNoPP); 560 __ LoadFromOffset(R1, FP, saved_result_slot_from_fp * kWordSize, kNoPP);
562 } 561 }
563 562
564 // There is a Dart Frame on the stack. We must restore PP and leave frame. 563 // There is a Dart Frame on the stack. We must restore PP and leave frame.
565 __ LeaveDartFrame(); 564 __ LeaveDartFrame();
566 __ sub(SP, FP, Operand(R0)); 565 __ sub(SP, FP, Operand(R0));
567 566
568 // DeoptimizeFillFrame expects a Dart frame, i.e. EnterDartFrame(0), but there 567 // DeoptimizeFillFrame expects a Dart frame, i.e. EnterDartFrame(0), but there
569 // is no need to set the correct PC marker or load PP, since they get patched. 568 // is no need to set the correct PC marker or load PP, since they get patched.
570 __ EnterFrame(0); 569 __ EnterFrame(0);
571 __ Push(ZR); 570 __ TagAndPushPPAndPcMarker(ZR);
572 __ TagAndPushPP();
573 571
574 if (preserve_result) { 572 if (preserve_result) {
575 __ Push(R1); // Preserve result as first local. 573 __ Push(R1); // Preserve result as first local.
576 } 574 }
577 __ ReserveAlignedFrameSpace(0); 575 __ ReserveAlignedFrameSpace(0);
578 __ mov(R0, FP); // Pass last FP as parameter in R0. 576 __ mov(R0, FP); // Pass last FP as parameter in R0.
579 __ CallRuntime(kDeoptimizeFillFrameRuntimeEntry, 1); 577 __ CallRuntime(kDeoptimizeFillFrameRuntimeEntry, 1);
580 if (preserve_result) { 578 if (preserve_result) {
581 // Restore result into R1. 579 // Restore result into R1.
582 __ LoadFromOffset(R1, FP, kFirstLocalSlotFromFp * kWordSize, kNoPP); 580 __ LoadFromOffset(R1, FP, kFirstLocalSlotFromFp * kWordSize, kNoPP);
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 const Register right = R0; 2122 const Register right = R0;
2125 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 2123 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
2126 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 2124 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
2127 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2125 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2128 __ ret(); 2126 __ ret();
2129 } 2127 }
2130 2128
2131 } // namespace dart 2129 } // namespace dart
2132 2130
2133 #endif // defined TARGET_ARCH_ARM64 2131 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698