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

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

Issue 274043003: Adds debugger patching to arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/debugger_test.cc ('k') | runtime/vm/instructions_arm64.h » ('j') | 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" // Needed here to get TARGET_ARCH_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 895
896 __ Bind(&wrong_num_arguments); 896 __ Bind(&wrong_num_arguments);
897 if (function.IsClosureFunction()) { 897 if (function.IsClosureFunction()) {
898 // Invoke noSuchMethod function passing "call" as the original name. 898 // Invoke noSuchMethod function passing "call" as the original name.
899 const int kNumArgsChecked = 1; 899 const int kNumArgsChecked = 1;
900 const ICData& ic_data = ICData::ZoneHandle( 900 const ICData& ic_data = ICData::ZoneHandle(
901 ICData::New(function, Symbols::Call(), Object::empty_array(), 901 ICData::New(function, Symbols::Call(), Object::empty_array(),
902 Isolate::kNoDeoptId, kNumArgsChecked)); 902 Isolate::kNoDeoptId, kNumArgsChecked));
903 __ LoadObject(R5, ic_data, PP); 903 __ LoadObject(R5, ic_data, PP);
904 __ LeaveDartFrame(); // The arguments are still on the stack. 904 __ LeaveDartFrame(); // The arguments are still on the stack.
905 __ BranchFixed(&StubCode::CallNoSuchMethodFunctionLabel()); 905 __ BranchPatchable(&StubCode::CallNoSuchMethodFunctionLabel());
906 // The noSuchMethod call may return to the caller, but not here. 906 // The noSuchMethod call may return to the caller, but not here.
907 __ hlt(0); 907 __ hlt(0);
908 } else if (check_correct_named_args) { 908 } else if (check_correct_named_args) {
909 __ Stop("Wrong arguments"); 909 __ Stop("Wrong arguments");
910 } 910 }
911 911
912 __ Bind(&all_arguments_processed); 912 __ Bind(&all_arguments_processed);
913 // Nullify originally passed arguments only after they have been copied and 913 // Nullify originally passed arguments only after they have been copied and
914 // checked, otherwise noSuchMethod would not see their original values. 914 // checked, otherwise noSuchMethod would not see their original values.
915 // This step can be skipped in case we decide that formal parameters are 915 // This step can be skipped in case we decide that formal parameters are
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 const String& name = 1070 const String& name =
1071 String::Handle(function.IsClosureFunction() 1071 String::Handle(function.IsClosureFunction()
1072 ? Symbols::Call().raw() 1072 ? Symbols::Call().raw()
1073 : function.name()); 1073 : function.name());
1074 const int kNumArgsChecked = 1; 1074 const int kNumArgsChecked = 1;
1075 const ICData& ic_data = ICData::ZoneHandle( 1075 const ICData& ic_data = ICData::ZoneHandle(
1076 ICData::New(function, name, Object::empty_array(), 1076 ICData::New(function, name, Object::empty_array(),
1077 Isolate::kNoDeoptId, kNumArgsChecked)); 1077 Isolate::kNoDeoptId, kNumArgsChecked));
1078 __ LoadObject(R5, ic_data, PP); 1078 __ LoadObject(R5, ic_data, PP);
1079 __ LeaveDartFrame(); // The arguments are still on the stack. 1079 __ LeaveDartFrame(); // The arguments are still on the stack.
1080 __ BranchFixed(&StubCode::CallNoSuchMethodFunctionLabel()); 1080 __ BranchPatchable(&StubCode::CallNoSuchMethodFunctionLabel());
1081 // The noSuchMethod call may return to the caller, but not here. 1081 // The noSuchMethod call may return to the caller, but not here.
1082 __ hlt(0); 1082 __ hlt(0);
1083 } else { 1083 } else {
1084 __ Stop("Wrong number of arguments"); 1084 __ Stop("Wrong number of arguments");
1085 } 1085 }
1086 __ Bind(&correct_num_arguments); 1086 __ Bind(&correct_num_arguments);
1087 } 1087 }
1088 } else if (!flow_graph().IsCompiledForOsr()) { 1088 } else if (!flow_graph().IsCompiledForOsr()) {
1089 CopyParameters(); 1089 CopyParameters();
1090 } 1090 }
(...skipping 12 matching lines...) Expand all
1103 1103
1104 VisitBlocks(); 1104 VisitBlocks();
1105 1105
1106 __ hlt(0); 1106 __ hlt(0);
1107 GenerateDeferredCode(); 1107 GenerateDeferredCode();
1108 // Emit function patching code. This will be swapped with the first 3 1108 // Emit function patching code. This will be swapped with the first 3
1109 // instructions at entry point. 1109 // instructions at entry point.
1110 AddCurrentDescriptor(PcDescriptors::kPatchCode, 1110 AddCurrentDescriptor(PcDescriptors::kPatchCode,
1111 Isolate::kNoDeoptId, 1111 Isolate::kNoDeoptId,
1112 0); // No token position. 1112 0); // No token position.
1113 __ BranchFixed(&StubCode::FixCallersTargetLabel()); 1113 __ BranchPatchable(&StubCode::FixCallersTargetLabel());
1114 1114
1115 AddCurrentDescriptor(PcDescriptors::kLazyDeoptJump, 1115 AddCurrentDescriptor(PcDescriptors::kLazyDeoptJump,
1116 Isolate::kNoDeoptId, 1116 Isolate::kNoDeoptId,
1117 0); // No token position. 1117 0); // No token position.
1118 // TODO(zra): Can I use a normal BranchPatchable here? Probably have to change 1118 __ BranchPatchable(&StubCode::DeoptimizeLazyLabel());
1119 // the CodePatcher.
1120 __ BranchFixed(&StubCode::DeoptimizeLazyLabel());
1121 } 1119 }
1122 1120
1123 1121
1124 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, 1122 void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
1125 const ExternalLabel* label, 1123 const ExternalLabel* label,
1126 PcDescriptors::Kind kind, 1124 PcDescriptors::Kind kind,
1127 LocationSummary* locs) { 1125 LocationSummary* locs) {
1128 __ BranchLinkPatchable(label); 1126 __ BranchLinkPatchable(label);
1129 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos); 1127 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
1130 RecordSafepoint(locs); 1128 RecordSafepoint(locs);
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1774 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1772 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1775 UNIMPLEMENTED(); 1773 UNIMPLEMENTED();
1776 } 1774 }
1777 1775
1778 1776
1779 #undef __ 1777 #undef __
1780 1778
1781 } // namespace dart 1779 } // namespace dart
1782 1780
1783 #endif // defined TARGET_ARCH_ARM64 1781 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/debugger_test.cc ('k') | runtime/vm/instructions_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698