| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 4217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4228 } | 4228 } |
| 4229 | 4229 |
| 4230 | 4230 |
| 4231 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 4231 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
| 4232 Isolate* isolate, bool opt) const { | 4232 Isolate* isolate, bool opt) const { |
| 4233 return MakeCallSummary(); | 4233 return MakeCallSummary(); |
| 4234 } | 4234 } |
| 4235 | 4235 |
| 4236 | 4236 |
| 4237 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4237 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4238 Label* deopt = compiler->AddDeoptStub( | |
| 4239 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | |
| 4240 __ TraceSimMsg("PolymorphicInstanceCallInstr"); | 4238 __ TraceSimMsg("PolymorphicInstanceCallInstr"); |
| 4241 if (ic_data().NumberOfChecks() == 0) { | |
| 4242 __ b(deopt); | |
| 4243 return; | |
| 4244 } | |
| 4245 ASSERT(ic_data().NumArgsTested() == 1); | 4239 ASSERT(ic_data().NumArgsTested() == 1); |
| 4246 if (!with_checks()) { | 4240 if (!with_checks()) { |
| 4247 ASSERT(ic_data().HasOneTarget()); | 4241 ASSERT(ic_data().HasOneTarget()); |
| 4248 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 4242 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
| 4249 compiler->GenerateStaticCall(deopt_id(), | 4243 compiler->GenerateStaticCall(deopt_id(), |
| 4250 instance_call()->token_pos(), | 4244 instance_call()->token_pos(), |
| 4251 target, | 4245 target, |
| 4252 instance_call()->ArgumentCount(), | 4246 instance_call()->ArgumentCount(), |
| 4253 instance_call()->argument_names(), | 4247 instance_call()->argument_names(), |
| 4254 locs(), | 4248 locs(), |
| 4255 ICData::Handle()); | 4249 ICData::Handle()); |
| 4256 return; | 4250 return; |
| 4257 } | 4251 } |
| 4258 | 4252 |
| 4259 // Load receiver into T0. | 4253 // Load receiver into T0. |
| 4260 __ lw(T0, Address(SP, (instance_call()->ArgumentCount() - 1) * kWordSize)); | 4254 __ lw(T0, Address(SP, (instance_call()->ArgumentCount() - 1) * kWordSize)); |
| 4261 | 4255 |
| 4256 Label* deopt = compiler->AddDeoptStub( |
| 4257 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
| 4262 LoadValueCid(compiler, T2, T0, | 4258 LoadValueCid(compiler, T2, T0, |
| 4263 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); | 4259 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); |
| 4264 | 4260 |
| 4265 compiler->EmitTestAndCall(ic_data(), | 4261 compiler->EmitTestAndCall(ic_data(), |
| 4266 T2, // Class id register. | 4262 T2, // Class id register. |
| 4267 instance_call()->ArgumentCount(), | 4263 instance_call()->ArgumentCount(), |
| 4268 instance_call()->argument_names(), | 4264 instance_call()->argument_names(), |
| 4269 deopt, | 4265 deopt, |
| 4270 deopt_id(), | 4266 deopt_id(), |
| 4271 instance_call()->token_pos(), | 4267 instance_call()->token_pos(), |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4918 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 4914 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 4919 #if defined(DEBUG) | 4915 #if defined(DEBUG) |
| 4920 __ LoadImmediate(S4, kInvalidObjectPointer); | 4916 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 4921 __ LoadImmediate(S5, kInvalidObjectPointer); | 4917 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 4922 #endif | 4918 #endif |
| 4923 } | 4919 } |
| 4924 | 4920 |
| 4925 } // namespace dart | 4921 } // namespace dart |
| 4926 | 4922 |
| 4927 #endif // defined TARGET_ARCH_MIPS | 4923 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |