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 3788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3799 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3799 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3800 summary->set_in(0, Location::RequiresRegister()); | 3800 summary->set_in(0, Location::RequiresRegister()); |
3801 if (!IsNullCheck()) { | 3801 if (!IsNullCheck()) { |
3802 summary->AddTemp(Location::RequiresRegister()); | 3802 summary->AddTemp(Location::RequiresRegister()); |
3803 } | 3803 } |
3804 return summary; | 3804 return summary; |
3805 } | 3805 } |
3806 | 3806 |
3807 | 3807 |
3808 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3808 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3809 const DeoptReasonId deopt_reason = |
| 3810 licm_hoisted_ ? kDeoptHoistedCheckClass : kDeoptCheckClass; |
3809 if (IsNullCheck()) { | 3811 if (IsNullCheck()) { |
3810 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3812 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
3811 kDeoptCheckClass); | |
3812 __ BranchEqual(locs()->in(0).reg(), | 3813 __ BranchEqual(locs()->in(0).reg(), |
3813 reinterpret_cast<int32_t>(Object::null()), deopt); | 3814 reinterpret_cast<int32_t>(Object::null()), deopt); |
3814 return; | 3815 return; |
3815 } | 3816 } |
3816 | 3817 |
3817 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || | 3818 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || |
3818 (unary_checks().NumberOfChecks() > 1)); | 3819 (unary_checks().NumberOfChecks() > 1)); |
3819 Register value = locs()->in(0).reg(); | 3820 Register value = locs()->in(0).reg(); |
3820 Register temp = locs()->temp(0).reg(); | 3821 Register temp = locs()->temp(0).reg(); |
3821 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3822 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
3822 kDeoptCheckClass); | |
3823 Label is_ok; | 3823 Label is_ok; |
3824 intptr_t cix = 0; | 3824 intptr_t cix = 0; |
3825 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { | 3825 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { |
3826 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); | 3826 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); |
3827 __ beq(CMPRES1, ZR, &is_ok); | 3827 __ beq(CMPRES1, ZR, &is_ok); |
3828 cix++; // Skip first check. | 3828 cix++; // Skip first check. |
3829 } else { | 3829 } else { |
3830 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); | 3830 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); |
3831 __ beq(CMPRES1, ZR, deopt); | 3831 __ beq(CMPRES1, ZR, deopt); |
3832 } | 3832 } |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4230 compiler->GenerateCall(token_pos(), | 4230 compiler->GenerateCall(token_pos(), |
4231 &label, | 4231 &label, |
4232 PcDescriptors::kOther, | 4232 PcDescriptors::kOther, |
4233 locs()); | 4233 locs()); |
4234 __ Drop(2); // Discard type arguments and receiver. | 4234 __ Drop(2); // Discard type arguments and receiver. |
4235 } | 4235 } |
4236 | 4236 |
4237 } // namespace dart | 4237 } // namespace dart |
4238 | 4238 |
4239 #endif // defined TARGET_ARCH_MIPS | 4239 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |