OLD | NEW |
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 5435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5446 compiler->GenerateStaticCall(deopt_id(), | 5446 compiler->GenerateStaticCall(deopt_id(), |
5447 instance_call()->token_pos(), | 5447 instance_call()->token_pos(), |
5448 target, | 5448 target, |
5449 instance_call()->ArgumentCount(), | 5449 instance_call()->ArgumentCount(), |
5450 instance_call()->argument_names(), | 5450 instance_call()->argument_names(), |
5451 locs(), | 5451 locs(), |
5452 ICData::Handle()); | 5452 ICData::Handle()); |
5453 return; | 5453 return; |
5454 } | 5454 } |
5455 | 5455 |
5456 // Load receiver into RAX. | |
5457 __ movq(RAX, | |
5458 Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize)); | |
5459 | |
5460 Label* deopt = compiler->AddDeoptStub( | 5456 Label* deopt = compiler->AddDeoptStub( |
5461 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | 5457 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
5462 LoadValueCid(compiler, RDI, RAX, | 5458 Label ok; |
5463 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); | |
5464 | |
5465 compiler->EmitTestAndCall(ic_data(), | 5459 compiler->EmitTestAndCall(ic_data(), |
5466 RDI, // Class id register. | |
5467 instance_call()->ArgumentCount(), | 5460 instance_call()->ArgumentCount(), |
5468 instance_call()->argument_names(), | 5461 instance_call()->argument_names(), |
5469 deopt, | 5462 deopt, |
| 5463 &ok, |
5470 deopt_id(), | 5464 deopt_id(), |
5471 instance_call()->token_pos(), | 5465 instance_call()->token_pos(), |
5472 locs()); | 5466 locs()); |
| 5467 __ Bind(&ok); |
5473 } | 5468 } |
5474 | 5469 |
5475 | 5470 |
5476 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, | 5471 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, |
5477 bool opt) const { | 5472 bool opt) const { |
5478 comparison()->InitializeLocationSummary(zone, opt); | 5473 comparison()->InitializeLocationSummary(zone, opt); |
5479 // Branches don't produce a result. | 5474 // Branches don't produce a result. |
5480 comparison()->locs()->set_out(0, Location::NoLocation()); | 5475 comparison()->locs()->set_out(0, Location::NoLocation()); |
5481 return comparison()->locs(); | 5476 return comparison()->locs(); |
5482 } | 5477 } |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6458 __ Drop(1); | 6453 __ Drop(1); |
6459 __ popq(result); | 6454 __ popq(result); |
6460 } | 6455 } |
6461 | 6456 |
6462 | 6457 |
6463 } // namespace dart | 6458 } // namespace dart |
6464 | 6459 |
6465 #undef __ | 6460 #undef __ |
6466 | 6461 |
6467 #endif // defined TARGET_ARCH_X64 | 6462 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |