| 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 5428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5439 const intptr_t kNumTemps = 0; | 5439 const intptr_t kNumTemps = 0; |
| 5440 LocationSummary* locs = new(isolate) LocationSummary( | 5440 LocationSummary* locs = new(isolate) LocationSummary( |
| 5441 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5441 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5442 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 5442 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
| 5443 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 5443 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
| 5444 return locs; | 5444 return locs; |
| 5445 } | 5445 } |
| 5446 | 5446 |
| 5447 | 5447 |
| 5448 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5448 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5449 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; |
| 5450 flags |= licm_hoisted_ ? ICData::kHoisted : 0; |
| 5449 Label* deopt = compiler->AddDeoptStub( | 5451 Label* deopt = compiler->AddDeoptStub( |
| 5450 deopt_id(), | 5452 deopt_id(), |
| 5451 ICData::kDeoptCheckArrayBound, | 5453 ICData::kDeoptCheckArrayBound, |
| 5452 generalized_ ? ICData::kGeneralized : 0); | 5454 flags); |
| 5453 | 5455 |
| 5454 Location length_loc = locs()->in(kLengthPos); | 5456 Location length_loc = locs()->in(kLengthPos); |
| 5455 Location index_loc = locs()->in(kIndexPos); | 5457 Location index_loc = locs()->in(kIndexPos); |
| 5456 | 5458 |
| 5457 if (length_loc.IsConstant() && index_loc.IsConstant()) { | 5459 if (length_loc.IsConstant() && index_loc.IsConstant()) { |
| 5458 ASSERT((Smi::Cast(length_loc.constant()).Value() <= | 5460 ASSERT((Smi::Cast(length_loc.constant()).Value() <= |
| 5459 Smi::Cast(index_loc.constant()).Value()) || | 5461 Smi::Cast(index_loc.constant()).Value()) || |
| 5460 (Smi::Cast(index_loc.constant()).Value() < 0)); | 5462 (Smi::Cast(index_loc.constant()).Value() < 0)); |
| 5461 // Unconditionally deoptimize for constant bounds checks because they | 5463 // Unconditionally deoptimize for constant bounds checks because they |
| 5462 // only occur only when index is out-of-bounds. | 5464 // only occur only when index is out-of-bounds. |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5965 __ movq(R10, Immediate(kInvalidObjectPointer)); | 5967 __ movq(R10, Immediate(kInvalidObjectPointer)); |
| 5966 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 5968 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
| 5967 #endif | 5969 #endif |
| 5968 } | 5970 } |
| 5969 | 5971 |
| 5970 } // namespace dart | 5972 } // namespace dart |
| 5971 | 5973 |
| 5972 #undef __ | 5974 #undef __ |
| 5973 | 5975 |
| 5974 #endif // defined TARGET_ARCH_X64 | 5976 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |