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

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

Issue 339183010: Specialize breakpoint stubs by set of live registers of the stubs they are intercepting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
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 27 matching lines...) Expand all
38 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { 38 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
39 const intptr_t isolate_offset = NativeArguments::isolate_offset(); 39 const intptr_t isolate_offset = NativeArguments::isolate_offset();
40 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); 40 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
41 const intptr_t argv_offset = NativeArguments::argv_offset(); 41 const intptr_t argv_offset = NativeArguments::argv_offset();
42 const intptr_t retval_offset = NativeArguments::retval_offset(); 42 const intptr_t retval_offset = NativeArguments::retval_offset();
43 const intptr_t exitframe_last_param_slot_from_fp = 1; 43 const intptr_t exitframe_last_param_slot_from_fp = 1;
44 44
45 __ SetPrologueOffset(); 45 __ SetPrologueOffset();
46 __ Comment("CallToRuntimeStub"); 46 __ Comment("CallToRuntimeStub");
47 __ EnterFrame(0); 47 __ EnterFrame(0);
48 __ SmiUntag(R4);
49 48
50 // Load current Isolate pointer from Context structure into R0. 49 // Load current Isolate pointer from Context structure into R0.
51 __ LoadFieldFromOffset(R0, CTX, Context::isolate_offset(), kNoPP); 50 __ LoadFieldFromOffset(R0, CTX, Context::isolate_offset(), kNoPP);
52 51
53 // Save exit frame information to enable stack walking as we are about 52 // Save exit frame information to enable stack walking as we are about
54 // to transition to Dart VM C++ code. 53 // to transition to Dart VM C++ code.
55 __ StoreToOffset(SP, R0, Isolate::top_exit_frame_info_offset(), kNoPP); 54 __ StoreToOffset(SP, R0, Isolate::top_exit_frame_info_offset(), kNoPP);
56 55
57 // Save current Context pointer into Isolate structure. 56 // Save current Context pointer into Isolate structure.
58 __ StoreToOffset(CTX, R0, Isolate::top_context_offset(), kNoPP); 57 __ StoreToOffset(CTX, R0, Isolate::top_context_offset(), kNoPP);
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 __ Pop(R5); // Restore IC Data. 1627 __ Pop(R5); // Restore IC Data.
1629 __ LeaveStubFrame(); 1628 __ LeaveStubFrame();
1630 1629
1631 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP); 1630 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP);
1632 __ AddImmediate( 1631 __ AddImmediate(
1633 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); 1632 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
1634 __ br(R2); 1633 __ br(R2);
1635 } 1634 }
1636 1635
1637 1636
1638 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { 1637 // R5: Contains an ICData.
1638 void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
1639 __ EnterStubFrame(); 1639 __ EnterStubFrame();
1640 __ Push(R5); // Save IC Data. 1640 __ Push(R5);
1641 __ Push(R4); // Save arg. desc.
1642 __ PushObject(Object::null_object(), PP); // Space for result. 1641 __ PushObject(Object::null_object(), PP); // Space for result.
1643 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); 1642 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
1644 __ Pop(R0); 1643 __ Pop(R0);
1644 __ Pop(R5);
1645 __ LeaveStubFrame();
1646 __ br(R0);
1647 }
1648
1649
1650 // R5: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile
1651 // stub).
1652 // R4: Contains an arguments descriptor.
1653 void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) {
1654 __ EnterStubFrame();
1655 __ Push(R5);
1656 __ Push(R4);
1657 __ PushObject(Object::null_object(), PP); // Space for result.
1658 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
1659 __ Pop(R0);
1645 __ Pop(R4); 1660 __ Pop(R4);
1646 __ Pop(R5); 1661 __ Pop(R5);
1647 __ LeaveStubFrame(); 1662 __ LeaveStubFrame();
1648 __ br(R0); 1663 __ br(R0);
1649 } 1664 }
1650 1665
1651 1666
1667 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) {
1668 __ EnterStubFrame();
1669 __ PushObject(Object::null_object(), PP); // Space for result.
1670 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
1671 __ Pop(R0);
1672 __ LeaveStubFrame();
1673 __ br(R0);
1674 }
1675
1652 // Called only from unoptimized code. All relevant registers have been saved. 1676 // Called only from unoptimized code. All relevant registers have been saved.
1653 void StubCode::GenerateDebugStepCheckStub( 1677 void StubCode::GenerateDebugStepCheckStub(
1654 Assembler* assembler) { 1678 Assembler* assembler) {
1655 if (FLAG_enable_debugger) { 1679 if (FLAG_enable_debugger) {
1656 // Check single stepping. 1680 // Check single stepping.
1657 Label not_stepping; 1681 Label not_stepping;
1658 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset(), kNoPP); 1682 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset(), kNoPP);
1659 __ LoadFromOffset( 1683 __ LoadFromOffset(
1660 R1, R1, Isolate::single_step_offset(), kNoPP, kUnsignedByte); 1684 R1, R1, Isolate::single_step_offset(), kNoPP, kUnsignedByte);
1661 __ CompareImmediate(R1, 0, kNoPP); 1685 __ CompareImmediate(R1, 0, kNoPP);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 const Register right = R0; 1955 const Register right = R0;
1932 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 1956 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
1933 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 1957 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
1934 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1958 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1935 __ ret(); 1959 __ ret();
1936 } 1960 }
1937 1961
1938 } // namespace dart 1962 } // namespace dart
1939 1963
1940 #endif // defined TARGET_ARCH_ARM64 1964 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698