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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.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_dbc.cc ('k') | runtime/vm/flow_graph_compiler_mips.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 11 matching lines...) Expand all
22 #include "vm/stack_frame.h" 22 #include "vm/stack_frame.h"
23 #include "vm/stub_code.h" 23 #include "vm/stub_code.h"
24 #include "vm/symbols.h" 24 #include "vm/symbols.h"
25 25
26 namespace dart { 26 namespace dart {
27 27
28 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); 28 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
29 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); 29 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic.");
30 30
31 DECLARE_FLAG(bool, enable_simd_inline); 31 DECLARE_FLAG(bool, enable_simd_inline);
32 DECLARE_FLAG(bool, use_megamorphic_stub);
33 32
34 33
35 void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { 34 void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) {
36 Assembler* assembler = compiler->assembler(); 35 Assembler* assembler = compiler->assembler();
37 #define __ assembler-> 36 #define __ assembler->
38 __ Bind(entry_label()); 37 __ Bind(entry_label());
39 __ Comment("MegamorphicSlowPath"); 38 __ Comment("MegamorphicSlowPath");
40 compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_, 39 compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_,
41 token_pos_, locs_, try_index_); 40 token_pos_, locs_, try_index_);
42 __ jmp(exit_label()); 41 __ jmp(exit_label());
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 __ CompareClassId(EBX, kOneByteStringCid, EAX); 1311 __ CompareClassId(EBX, kOneByteStringCid, EAX);
1313 __ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump); 1312 __ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump);
1314 __ movl(EAX, FieldAddress(EBX, String::hash_offset())); 1313 __ movl(EAX, FieldAddress(EBX, String::hash_offset()));
1315 __ cmpl(EAX, Immediate(0)); 1314 __ cmpl(EAX, Immediate(0));
1316 __ j(NOT_EQUAL, &done, Assembler::kNearJump); 1315 __ j(NOT_EQUAL, &done, Assembler::kNearJump);
1317 1316
1318 __ Bind(&megamorphic_call); 1317 __ Bind(&megamorphic_call);
1319 __ Comment("Slow case: megamorphic call"); 1318 __ Comment("Slow case: megamorphic call");
1320 } 1319 }
1321 __ LoadObject(ECX, cache); 1320 __ LoadObject(ECX, cache);
1322 if (FLAG_use_megamorphic_stub) { 1321 __ call(Address(THR, Thread::megamorphic_lookup_entry_point_offset()));
1323 __ call(Address(THR, Thread::megamorphic_lookup_entry_point_offset()));
1324 } else {
1325 StubCode::EmitMegamorphicLookup(assembler());
1326 }
1327 __ call(EBX); 1322 __ call(EBX);
1328 1323
1329 __ Bind(&done); 1324 __ Bind(&done);
1330 AddCurrentDescriptor(RawPcDescriptors::kOther, 1325 AddCurrentDescriptor(RawPcDescriptors::kOther,
1331 Thread::kNoDeoptId, token_pos); 1326 Thread::kNoDeoptId, token_pos);
1332 RecordSafepoint(locs, slow_path_argument_count); 1327 RecordSafepoint(locs, slow_path_argument_count);
1333 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1328 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1334 // Precompilation not implemented on ia32 platform. 1329 // Precompilation not implemented on ia32 platform.
1335 ASSERT(!FLAG_precompiled_mode); 1330 ASSERT(!FLAG_precompiled_mode);
1336 if (is_optimizing()) { 1331 if (is_optimizing()) {
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 __ movups(reg, Address(ESP, 0)); 1865 __ movups(reg, Address(ESP, 0));
1871 __ addl(ESP, Immediate(kFpuRegisterSize)); 1866 __ addl(ESP, Immediate(kFpuRegisterSize));
1872 } 1867 }
1873 1868
1874 1869
1875 #undef __ 1870 #undef __
1876 1871
1877 } // namespace dart 1872 } // namespace dart
1878 1873
1879 #endif // defined TARGET_ARCH_IA32 1874 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698