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

Side by Side Diff: runtime/vm/flow_graph_compiler_arm.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.cc ('k') | runtime/vm/flow_graph_compiler_arm64.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) 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" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); 27 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic.");
28 DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic."); 28 DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic.");
29 DECLARE_FLAG(bool, enable_simd_inline); 29 DECLARE_FLAG(bool, enable_simd_inline);
30 DECLARE_FLAG(bool, use_megamorphic_stub);
31 30
32 31
33 void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { 32 void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
34 Assembler* assembler = compiler->assembler(); 33 Assembler* assembler = compiler->assembler();
35 #define __ assembler-> 34 #define __ assembler->
36 __ Bind(entry_label()); 35 __ Bind(entry_label());
37 __ Comment("MegamorphicSlowPath"); 36 __ Comment("MegamorphicSlowPath");
38 compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_, 37 compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
39 token_pos_, locs_, try_index_); 38 token_pos_, locs_, try_index_);
40 __ b(exit_label()); 39 __ b(exit_label());
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 ASSERT(Smi::New(0) == 0); 1334 ASSERT(Smi::New(0) == 0);
1336 __ cmp(R0, Operand(0)); 1335 __ cmp(R0, Operand(0));
1337 1336
1338 __ b(&done, NE); // Return if already computed. 1337 __ b(&done, NE); // Return if already computed.
1339 __ mov(R0, Operand(R9)); // Restore receiver in R0. 1338 __ mov(R0, Operand(R9)); // Restore receiver in R0.
1340 1339
1341 __ Bind(&megamorphic_call); 1340 __ Bind(&megamorphic_call);
1342 __ Comment("Slow case: megamorphic call"); 1341 __ Comment("Slow case: megamorphic call");
1343 } 1342 }
1344 __ LoadObject(R9, cache); 1343 __ LoadObject(R9, cache);
1345 if (FLAG_use_megamorphic_stub) { 1344 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_entry_point_offset()));
1346 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_entry_point_offset())); 1345 __ blx(LR);
1347 __ blx(LR);
1348 } else {
1349 StubCode::EmitMegamorphicLookup(assembler());
1350 }
1351 __ blx(R1); 1346 __ blx(R1);
1352 1347
1353 __ Bind(&done); 1348 __ Bind(&done);
1354 RecordSafepoint(locs, slow_path_argument_count); 1349 RecordSafepoint(locs, slow_path_argument_count);
1355 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1350 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1356 if (FLAG_precompiled_mode) { 1351 if (FLAG_precompiled_mode) {
1357 // Megamorphic calls may occur in slow path stubs. 1352 // Megamorphic calls may occur in slow path stubs.
1358 // If valid use try_index argument. 1353 // If valid use try_index argument.
1359 if (try_index == CatchClauseNode::kInvalidTryIndex) { 1354 if (try_index == CatchClauseNode::kInvalidTryIndex) {
1360 try_index = CurrentTryIndex(); 1355 try_index = CurrentTryIndex();
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 DRegister dreg = EvenDRegisterOf(reg); 1994 DRegister dreg = EvenDRegisterOf(reg);
2000 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1995 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
2001 } 1996 }
2002 1997
2003 1998
2004 #undef __ 1999 #undef __
2005 2000
2006 } // namespace dart 2001 } // namespace dart
2007 2002
2008 #endif // defined TARGET_ARCH_ARM 2003 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698