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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 4528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4539 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4539 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4540 summary->set_in(0, Location::RequiresRegister()); | 4540 summary->set_in(0, Location::RequiresRegister()); |
4541 if (!IsNullCheck()) { | 4541 if (!IsNullCheck()) { |
4542 summary->AddTemp(Location::RequiresRegister()); | 4542 summary->AddTemp(Location::RequiresRegister()); |
4543 } | 4543 } |
4544 return summary; | 4544 return summary; |
4545 } | 4545 } |
4546 | 4546 |
4547 | 4547 |
4548 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4548 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4549 const DeoptReasonId deopt_reason = |
| 4550 licm_hoisted_ ? kDeoptHoistedCheckClass : kDeoptCheckClass; |
4549 if (IsNullCheck()) { | 4551 if (IsNullCheck()) { |
4550 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4552 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
4551 kDeoptCheckClass); | |
4552 __ CompareImmediate(locs()->in(0).reg(), | 4553 __ CompareImmediate(locs()->in(0).reg(), |
4553 reinterpret_cast<intptr_t>(Object::null())); | 4554 reinterpret_cast<intptr_t>(Object::null())); |
4554 __ b(deopt, EQ); | 4555 __ b(deopt, EQ); |
4555 return; | 4556 return; |
4556 } | 4557 } |
4557 | 4558 |
4558 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || | 4559 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || |
4559 (unary_checks().NumberOfChecks() > 1)); | 4560 (unary_checks().NumberOfChecks() > 1)); |
4560 Register value = locs()->in(0).reg(); | 4561 Register value = locs()->in(0).reg(); |
4561 Register temp = locs()->temp(0).reg(); | 4562 Register temp = locs()->temp(0).reg(); |
4562 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4563 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
4563 kDeoptCheckClass); | |
4564 Label is_ok; | 4564 Label is_ok; |
4565 intptr_t cix = 0; | 4565 intptr_t cix = 0; |
4566 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { | 4566 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { |
4567 __ tst(value, ShifterOperand(kSmiTagMask)); | 4567 __ tst(value, ShifterOperand(kSmiTagMask)); |
4568 __ b(&is_ok, EQ); | 4568 __ b(&is_ok, EQ); |
4569 cix++; // Skip first check. | 4569 cix++; // Skip first check. |
4570 } else { | 4570 } else { |
4571 __ tst(value, ShifterOperand(kSmiTagMask)); | 4571 __ tst(value, ShifterOperand(kSmiTagMask)); |
4572 __ b(deopt, EQ); | 4572 __ b(deopt, EQ); |
4573 } | 4573 } |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4956 compiler->GenerateCall(token_pos(), | 4956 compiler->GenerateCall(token_pos(), |
4957 &label, | 4957 &label, |
4958 PcDescriptors::kOther, | 4958 PcDescriptors::kOther, |
4959 locs()); | 4959 locs()); |
4960 __ Drop(2); // Discard type arguments and receiver. | 4960 __ Drop(2); // Discard type arguments and receiver. |
4961 } | 4961 } |
4962 | 4962 |
4963 } // namespace dart | 4963 } // namespace dart |
4964 | 4964 |
4965 #endif // defined TARGET_ARCH_ARM | 4965 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |