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

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

Issue 2132803002: Megamorphic code cleanup. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('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"
11 #include "vm/compiler.h" 11 #include "vm/compiler.h"
12 #include "vm/cpu.h" 12 #include "vm/cpu.h"
13 #include "vm/dart_entry.h" 13 #include "vm/dart_entry.h"
14 #include "vm/deopt_instructions.h" 14 #include "vm/deopt_instructions.h"
15 #include "vm/il_printer.h" 15 #include "vm/il_printer.h"
16 #include "vm/instructions.h" 16 #include "vm/instructions.h"
17 #include "vm/locations.h" 17 #include "vm/locations.h"
18 #include "vm/object_store.h" 18 #include "vm/object_store.h"
19 #include "vm/parser.h" 19 #include "vm/parser.h"
20 #include "vm/stack_frame.h" 20 #include "vm/stack_frame.h"
21 #include "vm/stub_code.h" 21 #include "vm/stub_code.h"
22 #include "vm/symbols.h" 22 #include "vm/symbols.h"
23 23
24 namespace dart { 24 namespace dart {
25 25
26 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); 26 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
27 DECLARE_FLAG(bool, enable_simd_inline); 27 DECLARE_FLAG(bool, enable_simd_inline);
28 DECLARE_FLAG(bool, use_megamorphic_stub);
29 28
30 29
31 void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { 30 void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
32 Assembler* assembler = compiler->assembler(); 31 Assembler* assembler = compiler->assembler();
33 #define __ assembler-> 32 #define __ assembler->
34 __ Bind(entry_label()); 33 __ Bind(entry_label());
35 __ Comment("MegamorphicSlowPath"); 34 __ Comment("MegamorphicSlowPath");
36 compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_, 35 compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
37 token_pos_, locs_, try_index_); 36 token_pos_, locs_, try_index_);
38 __ b(exit_label()); 37 __ b(exit_label());
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 __ ldr(R0, FieldAddress(R0, String::hash_offset())); 1316 __ ldr(R0, FieldAddress(R0, String::hash_offset()));
1318 __ CompareRegisters(R0, ZR); 1317 __ CompareRegisters(R0, ZR);
1319 __ b(&done, NE); 1318 __ b(&done, NE);
1320 __ mov(R0, R5); // Restore receiver in R0, 1319 __ mov(R0, R5); // Restore receiver in R0,
1321 1320
1322 __ Bind(&megamorphic_call); 1321 __ Bind(&megamorphic_call);
1323 __ Comment("Slow case: megamorphic call"); 1322 __ Comment("Slow case: megamorphic call");
1324 } 1323 }
1325 1324
1326 __ LoadObject(R5, cache); 1325 __ LoadObject(R5, cache);
1327 if (FLAG_use_megamorphic_stub) { 1326 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_entry_point_offset()));
1328 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_entry_point_offset())); 1327 __ blr(LR);
1329 __ blr(LR);
1330 } else {
1331 StubCode::EmitMegamorphicLookup(assembler());
1332 }
1333 __ blr(R1); 1328 __ blr(R1);
1334 1329
1335 __ Bind(&done); 1330 __ Bind(&done);
1336 RecordSafepoint(locs, slow_path_argument_count); 1331 RecordSafepoint(locs, slow_path_argument_count);
1337 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1332 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1338 if (FLAG_precompiled_mode) { 1333 if (FLAG_precompiled_mode) {
1339 // Megamorphic calls may occur in slow path stubs. 1334 // Megamorphic calls may occur in slow path stubs.
1340 // If valid use try_index argument. 1335 // If valid use try_index argument.
1341 if (try_index == CatchClauseNode::kInvalidTryIndex) { 1336 if (try_index == CatchClauseNode::kInvalidTryIndex) {
1342 try_index = CurrentTryIndex(); 1337 try_index = CurrentTryIndex();
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1932 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1938 __ PopDouble(reg); 1933 __ PopDouble(reg);
1939 } 1934 }
1940 1935
1941 1936
1942 #undef __ 1937 #undef __
1943 1938
1944 } // namespace dart 1939 } // namespace dart
1945 1940
1946 #endif // defined TARGET_ARCH_ARM64 1941 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698