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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 4500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4511 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4511 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4512 summary->set_in(0, Location::RequiresRegister()); | 4512 summary->set_in(0, Location::RequiresRegister()); |
4513 if (!IsNullCheck()) { | 4513 if (!IsNullCheck()) { |
4514 summary->AddTemp(Location::RequiresRegister()); | 4514 summary->AddTemp(Location::RequiresRegister()); |
4515 } | 4515 } |
4516 return summary; | 4516 return summary; |
4517 } | 4517 } |
4518 | 4518 |
4519 | 4519 |
4520 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4520 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4521 const DeoptReasonId deopt_reason = |
| 4522 licm_hoisted_ ? kDeoptHoistedCheckClass : kDeoptCheckClass; |
4521 if (IsNullCheck()) { | 4523 if (IsNullCheck()) { |
4522 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4524 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
4523 kDeoptCheckClass); | |
4524 const Immediate& raw_null = | 4525 const Immediate& raw_null = |
4525 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 4526 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
4526 __ cmpl(locs()->in(0).reg(), raw_null); | 4527 __ cmpl(locs()->in(0).reg(), raw_null); |
4527 __ j(EQUAL, deopt); | 4528 __ j(EQUAL, deopt); |
4528 return; | 4529 return; |
4529 } | 4530 } |
4530 | 4531 |
4531 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || | 4532 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || |
4532 (unary_checks().NumberOfChecks() > 1)); | 4533 (unary_checks().NumberOfChecks() > 1)); |
4533 Register value = locs()->in(0).reg(); | 4534 Register value = locs()->in(0).reg(); |
4534 Register temp = locs()->temp(0).reg(); | 4535 Register temp = locs()->temp(0).reg(); |
4535 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4536 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
4536 kDeoptCheckClass); | |
4537 Label is_ok; | 4537 Label is_ok; |
4538 intptr_t cix = 0; | 4538 intptr_t cix = 0; |
4539 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { | 4539 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { |
4540 __ testl(value, Immediate(kSmiTagMask)); | 4540 __ testl(value, Immediate(kSmiTagMask)); |
4541 __ j(ZERO, &is_ok); | 4541 __ j(ZERO, &is_ok); |
4542 cix++; // Skip first check. | 4542 cix++; // Skip first check. |
4543 } else { | 4543 } else { |
4544 __ testl(value, Immediate(kSmiTagMask)); | 4544 __ testl(value, Immediate(kSmiTagMask)); |
4545 __ j(ZERO, deopt); | 4545 __ j(ZERO, deopt); |
4546 } | 4546 } |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5335 PcDescriptors::kOther, | 5335 PcDescriptors::kOther, |
5336 locs()); | 5336 locs()); |
5337 __ Drop(2); // Discard type arguments and receiver. | 5337 __ Drop(2); // Discard type arguments and receiver. |
5338 } | 5338 } |
5339 | 5339 |
5340 } // namespace dart | 5340 } // namespace dart |
5341 | 5341 |
5342 #undef __ | 5342 #undef __ |
5343 | 5343 |
5344 #endif // defined TARGET_ARCH_IA32 | 5344 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |