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

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

Issue 1184093004: Faster checks in polymorphic instance calls if Smi-s are involved (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: m 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 5438 matching lines...) Expand 10 before | Expand all | Expand 10 after
5449 compiler->GenerateStaticCall(deopt_id(), 5449 compiler->GenerateStaticCall(deopt_id(),
5450 instance_call()->token_pos(), 5450 instance_call()->token_pos(),
5451 target, 5451 target,
5452 instance_call()->ArgumentCount(), 5452 instance_call()->ArgumentCount(),
5453 instance_call()->argument_names(), 5453 instance_call()->argument_names(),
5454 locs(), 5454 locs(),
5455 ICData::Handle()); 5455 ICData::Handle());
5456 return; 5456 return;
5457 } 5457 }
5458 5458
5459 // Load receiver into RAX.
5460 __ movq(RAX,
5461 Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize));
5462
5463 Label* deopt = compiler->AddDeoptStub( 5459 Label* deopt = compiler->AddDeoptStub(
5464 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); 5460 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail);
5465 LoadValueCid(compiler, RDI, RAX, 5461 Label ok;
5466 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt);
5467
5468 compiler->EmitTestAndCall(ic_data(), 5462 compiler->EmitTestAndCall(ic_data(),
5469 RDI, // Class id register.
5470 instance_call()->ArgumentCount(), 5463 instance_call()->ArgumentCount(),
5471 instance_call()->argument_names(), 5464 instance_call()->argument_names(),
5472 deopt, 5465 deopt,
5466 &ok,
5473 deopt_id(), 5467 deopt_id(),
5474 instance_call()->token_pos(), 5468 instance_call()->token_pos(),
5475 locs()); 5469 locs());
5470 __ Bind(&ok);
5476 } 5471 }
5477 5472
5478 5473
5479 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, 5474 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
5480 bool opt) const { 5475 bool opt) const {
5481 comparison()->InitializeLocationSummary(zone, opt); 5476 comparison()->InitializeLocationSummary(zone, opt);
5482 // Branches don't produce a result. 5477 // Branches don't produce a result.
5483 comparison()->locs()->set_out(0, Location::NoLocation()); 5478 comparison()->locs()->set_out(0, Location::NoLocation());
5484 return comparison()->locs(); 5479 return comparison()->locs();
5485 } 5480 }
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
6461 __ Drop(1); 6456 __ Drop(1);
6462 __ popq(result); 6457 __ popq(result);
6463 } 6458 }
6464 6459
6465 6460
6466 } // namespace dart 6461 } // namespace dart
6467 6462
6468 #undef __ 6463 #undef __
6469 6464
6470 #endif // defined TARGET_ARCH_X64 6465 #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