| 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 5572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5583 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 5583 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
| 5584 } else { | 5584 } else { |
| 5585 locs->set_in(kLengthPos, Location::PrefersRegister()); | 5585 locs->set_in(kLengthPos, Location::PrefersRegister()); |
| 5586 } | 5586 } |
| 5587 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 5587 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
| 5588 return locs; | 5588 return locs; |
| 5589 } | 5589 } |
| 5590 | 5590 |
| 5591 | 5591 |
| 5592 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5592 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5593 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; |
| 5594 flags |= licm_hoisted_ ? ICData::kHoisted : 0; |
| 5593 Label* deopt = compiler->AddDeoptStub( | 5595 Label* deopt = compiler->AddDeoptStub( |
| 5594 deopt_id(), | 5596 deopt_id(), |
| 5595 ICData::kDeoptCheckArrayBound, | 5597 ICData::kDeoptCheckArrayBound, |
| 5596 generalized_ ? ICData::kGeneralized : 0); | 5598 flags); |
| 5597 | 5599 |
| 5598 Location length_loc = locs()->in(kLengthPos); | 5600 Location length_loc = locs()->in(kLengthPos); |
| 5599 Location index_loc = locs()->in(kIndexPos); | 5601 Location index_loc = locs()->in(kIndexPos); |
| 5600 | 5602 |
| 5601 if (length_loc.IsConstant() && index_loc.IsConstant()) { | 5603 if (length_loc.IsConstant() && index_loc.IsConstant()) { |
| 5602 ASSERT((Smi::Cast(length_loc.constant()).Value() <= | 5604 ASSERT((Smi::Cast(length_loc.constant()).Value() <= |
| 5603 Smi::Cast(index_loc.constant()).Value()) || | 5605 Smi::Cast(index_loc.constant()).Value()) || |
| 5604 (Smi::Cast(index_loc.constant()).Value() < 0)); | 5606 (Smi::Cast(index_loc.constant()).Value() < 0)); |
| 5605 // Unconditionally deoptimize for constant bounds checks because they | 5607 // Unconditionally deoptimize for constant bounds checks because they |
| 5606 // only occur only when index is out-of-bounds. | 5608 // only occur only when index is out-of-bounds. |
| (...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6784 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6786 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6785 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6787 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6786 #endif | 6788 #endif |
| 6787 } | 6789 } |
| 6788 | 6790 |
| 6789 } // namespace dart | 6791 } // namespace dart |
| 6790 | 6792 |
| 6791 #undef __ | 6793 #undef __ |
| 6792 | 6794 |
| 6793 #endif // defined TARGET_ARCH_IA32 | 6795 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |