| 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 4435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4446 const intptr_t kNumTemps = 0; | 4446 const intptr_t kNumTemps = 0; |
| 4447 LocationSummary* locs = new(isolate) LocationSummary( | 4447 LocationSummary* locs = new(isolate) LocationSummary( |
| 4448 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4448 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4449 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 4449 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
| 4450 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 4450 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
| 4451 return locs; | 4451 return locs; |
| 4452 } | 4452 } |
| 4453 | 4453 |
| 4454 | 4454 |
| 4455 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4455 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4456 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; |
| 4457 flags |= licm_hoisted_ ? ICData::kHoisted : 0; |
| 4456 Label* deopt = compiler->AddDeoptStub( | 4458 Label* deopt = compiler->AddDeoptStub( |
| 4457 deopt_id(), | 4459 deopt_id(), |
| 4458 ICData::kDeoptCheckArrayBound, | 4460 ICData::kDeoptCheckArrayBound, |
| 4459 generalized_ ? ICData::kGeneralized : 0); | 4461 flags); |
| 4460 | 4462 |
| 4461 Location length_loc = locs()->in(kLengthPos); | 4463 Location length_loc = locs()->in(kLengthPos); |
| 4462 Location index_loc = locs()->in(kIndexPos); | 4464 Location index_loc = locs()->in(kIndexPos); |
| 4463 | 4465 |
| 4464 if (length_loc.IsConstant() && index_loc.IsConstant()) { | 4466 if (length_loc.IsConstant() && index_loc.IsConstant()) { |
| 4465 ASSERT((Smi::Cast(length_loc.constant()).Value() <= | 4467 ASSERT((Smi::Cast(length_loc.constant()).Value() <= |
| 4466 Smi::Cast(index_loc.constant()).Value()) || | 4468 Smi::Cast(index_loc.constant()).Value()) || |
| 4467 (Smi::Cast(index_loc.constant()).Value() < 0)); | 4469 (Smi::Cast(index_loc.constant()).Value() < 0)); |
| 4468 // Unconditionally deoptimize for constant bounds checks because they | 4470 // Unconditionally deoptimize for constant bounds checks because they |
| 4469 // only occur only when index is out-of-bounds. | 4471 // only occur only when index is out-of-bounds. |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4946 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 4948 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 4947 #if defined(DEBUG) | 4949 #if defined(DEBUG) |
| 4948 __ LoadImmediate(S4, kInvalidObjectPointer); | 4950 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 4949 __ LoadImmediate(S5, kInvalidObjectPointer); | 4951 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 4950 #endif | 4952 #endif |
| 4951 } | 4953 } |
| 4952 | 4954 |
| 4953 } // namespace dart | 4955 } // namespace dart |
| 4954 | 4956 |
| 4955 #endif // defined TARGET_ARCH_MIPS | 4957 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |