| 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 5186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5197 } | 5197 } |
| 5198 | 5198 |
| 5199 | 5199 |
| 5200 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 5200 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
| 5201 Isolate* isolate, bool opt) const { | 5201 Isolate* isolate, bool opt) const { |
| 5202 return MakeCallSummary(); | 5202 return MakeCallSummary(); |
| 5203 } | 5203 } |
| 5204 | 5204 |
| 5205 | 5205 |
| 5206 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5206 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5207 Label* deopt = compiler->AddDeoptStub( | |
| 5208 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | |
| 5209 if (ic_data().NumberOfChecks() == 0) { | |
| 5210 __ jmp(deopt); | |
| 5211 return; | |
| 5212 } | |
| 5213 ASSERT(ic_data().NumArgsTested() == 1); | 5207 ASSERT(ic_data().NumArgsTested() == 1); |
| 5214 if (!with_checks()) { | 5208 if (!with_checks()) { |
| 5215 ASSERT(ic_data().HasOneTarget()); | 5209 ASSERT(ic_data().HasOneTarget()); |
| 5216 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 5210 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
| 5217 compiler->GenerateStaticCall(deopt_id(), | 5211 compiler->GenerateStaticCall(deopt_id(), |
| 5218 instance_call()->token_pos(), | 5212 instance_call()->token_pos(), |
| 5219 target, | 5213 target, |
| 5220 instance_call()->ArgumentCount(), | 5214 instance_call()->ArgumentCount(), |
| 5221 instance_call()->argument_names(), | 5215 instance_call()->argument_names(), |
| 5222 locs(), | 5216 locs(), |
| 5223 ICData::Handle()); | 5217 ICData::Handle()); |
| 5224 return; | 5218 return; |
| 5225 } | 5219 } |
| 5226 | 5220 |
| 5227 // Load receiver into RAX. | 5221 // Load receiver into RAX. |
| 5228 __ movq(RAX, | 5222 __ movq(RAX, |
| 5229 Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize)); | 5223 Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize)); |
| 5224 |
| 5225 Label* deopt = compiler->AddDeoptStub( |
| 5226 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
| 5230 LoadValueCid(compiler, RDI, RAX, | 5227 LoadValueCid(compiler, RDI, RAX, |
| 5231 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); | 5228 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); |
| 5229 |
| 5232 compiler->EmitTestAndCall(ic_data(), | 5230 compiler->EmitTestAndCall(ic_data(), |
| 5233 RDI, // Class id register. | 5231 RDI, // Class id register. |
| 5234 instance_call()->ArgumentCount(), | 5232 instance_call()->ArgumentCount(), |
| 5235 instance_call()->argument_names(), | 5233 instance_call()->argument_names(), |
| 5236 deopt, | 5234 deopt, |
| 5237 deopt_id(), | 5235 deopt_id(), |
| 5238 instance_call()->token_pos(), | 5236 instance_call()->token_pos(), |
| 5239 locs()); | 5237 locs()); |
| 5240 } | 5238 } |
| 5241 | 5239 |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5912 __ movq(R10, Immediate(kInvalidObjectPointer)); | 5910 __ movq(R10, Immediate(kInvalidObjectPointer)); |
| 5913 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 5911 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
| 5914 #endif | 5912 #endif |
| 5915 } | 5913 } |
| 5916 | 5914 |
| 5917 } // namespace dart | 5915 } // namespace dart |
| 5918 | 5916 |
| 5919 #undef __ | 5917 #undef __ |
| 5920 | 5918 |
| 5921 #endif // defined TARGET_ARCH_X64 | 5919 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |