| 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 4569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4580 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4580 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4581 summary->set_in(0, Location::RequiresRegister()); | 4581 summary->set_in(0, Location::RequiresRegister()); |
| 4582 if (!IsNullCheck()) { | 4582 if (!IsNullCheck()) { |
| 4583 summary->AddTemp(Location::RequiresRegister()); | 4583 summary->AddTemp(Location::RequiresRegister()); |
| 4584 } | 4584 } |
| 4585 return summary; | 4585 return summary; |
| 4586 } | 4586 } |
| 4587 | 4587 |
| 4588 | 4588 |
| 4589 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4589 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4590 const DeoptReasonId deopt_reason = |
| 4591 licm_hoisted_ ? kDeoptHoistedCheckClass : kDeoptCheckClass; |
| 4590 if (IsNullCheck()) { | 4592 if (IsNullCheck()) { |
| 4591 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4593 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
| 4592 kDeoptCheckClass); | |
| 4593 __ CompareObject(locs()->in(0).reg(), | 4594 __ CompareObject(locs()->in(0).reg(), |
| 4594 Object::null_object(), PP); | 4595 Object::null_object(), PP); |
| 4595 __ j(EQUAL, deopt); | 4596 __ j(EQUAL, deopt); |
| 4596 return; | 4597 return; |
| 4597 } | 4598 } |
| 4598 | 4599 |
| 4599 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || | 4600 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || |
| 4600 (unary_checks().NumberOfChecks() > 1)); | 4601 (unary_checks().NumberOfChecks() > 1)); |
| 4601 Register value = locs()->in(0).reg(); | 4602 Register value = locs()->in(0).reg(); |
| 4602 Register temp = locs()->temp(0).reg(); | 4603 Register temp = locs()->temp(0).reg(); |
| 4603 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4604 Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
| 4604 kDeoptCheckClass); | |
| 4605 Label is_ok; | 4605 Label is_ok; |
| 4606 intptr_t cix = 0; | 4606 intptr_t cix = 0; |
| 4607 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { | 4607 if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { |
| 4608 __ testq(value, Immediate(kSmiTagMask)); | 4608 __ testq(value, Immediate(kSmiTagMask)); |
| 4609 __ j(ZERO, &is_ok); | 4609 __ j(ZERO, &is_ok); |
| 4610 cix++; // Skip first check. | 4610 cix++; // Skip first check. |
| 4611 } else { | 4611 } else { |
| 4612 __ testq(value, Immediate(kSmiTagMask)); | 4612 __ testq(value, Immediate(kSmiTagMask)); |
| 4613 __ j(ZERO, deopt); | 4613 __ j(ZERO, deopt); |
| 4614 } | 4614 } |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5046 PcDescriptors::kOther, | 5046 PcDescriptors::kOther, |
| 5047 locs()); | 5047 locs()); |
| 5048 __ Drop(2); // Discard type arguments and receiver. | 5048 __ Drop(2); // Discard type arguments and receiver. |
| 5049 } | 5049 } |
| 5050 | 5050 |
| 5051 } // namespace dart | 5051 } // namespace dart |
| 5052 | 5052 |
| 5053 #undef __ | 5053 #undef __ |
| 5054 | 5054 |
| 5055 #endif // defined TARGET_ARCH_X64 | 5055 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |