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

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

Issue 1190473004: Add flag polymorphic_with_deopt (default true) and handle case when false: use megamorphic instead … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: g Created 5 years, 6 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/intermediate_language_mips.cc ('k') | no next file » | 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 5423 matching lines...) Expand 10 before | Expand all | Expand 10 after
5434 UNIMPLEMENTED(); 5434 UNIMPLEMENTED();
5435 } 5435 }
5436 5436
5437 5437
5438 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( 5438 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
5439 Zone* zone, bool opt) const { 5439 Zone* zone, bool opt) const {
5440 return MakeCallSummary(zone); 5440 return MakeCallSummary(zone);
5441 } 5441 }
5442 5442
5443 5443
5444 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5445 ASSERT(ic_data().NumArgsTested() == 1);
5446 if (!with_checks()) {
5447 ASSERT(ic_data().HasOneTarget());
5448 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
5449 compiler->GenerateStaticCall(deopt_id(),
5450 instance_call()->token_pos(),
5451 target,
5452 instance_call()->ArgumentCount(),
5453 instance_call()->argument_names(),
5454 locs(),
5455 ICData::Handle());
5456 return;
5457 }
5458
5459 Label* deopt = compiler->AddDeoptStub(
5460 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail);
5461 Label ok;
5462 compiler->EmitTestAndCall(ic_data(),
5463 instance_call()->ArgumentCount(),
5464 instance_call()->argument_names(),
5465 deopt,
5466 &ok,
5467 deopt_id(),
5468 instance_call()->token_pos(),
5469 locs());
5470 __ Bind(&ok);
5471 }
5472
5473
5474 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, 5444 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
5475 bool opt) const { 5445 bool opt) const {
5476 comparison()->InitializeLocationSummary(zone, opt); 5446 comparison()->InitializeLocationSummary(zone, opt);
5477 // Branches don't produce a result. 5447 // Branches don't produce a result.
5478 comparison()->locs()->set_out(0, Location::NoLocation()); 5448 comparison()->locs()->set_out(0, Location::NoLocation());
5479 return comparison()->locs(); 5449 return comparison()->locs();
5480 } 5450 }
5481 5451
5482 5452
5483 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5453 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
6456 __ Drop(1); 6426 __ Drop(1);
6457 __ popq(result); 6427 __ popq(result);
6458 } 6428 }
6459 6429
6460 6430
6461 } // namespace dart 6431 } // namespace dart
6462 6432
6463 #undef __ 6433 #undef __
6464 6434
6465 #endif // defined TARGET_ARCH_X64 6435 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698