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/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 5152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5163 __ BranchIfNotSmi(value, deopt); | 5163 __ BranchIfNotSmi(value, deopt); |
5164 } | 5164 } |
5165 | 5165 |
5166 | 5166 |
5167 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, | 5167 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, |
5168 bool opt) const { | 5168 bool opt) const { |
5169 const intptr_t kNumInputs = 1; | 5169 const intptr_t kNumInputs = 1; |
5170 const intptr_t kNumTemps = 0; | 5170 const intptr_t kNumTemps = 0; |
5171 LocationSummary* summary = new (zone) | 5171 LocationSummary* summary = new (zone) |
5172 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5172 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5173 summary->set_in(0, Location::RequiresRegister()); | 5173 summary->set_in(0, cids_.IsSingleCid() ? Location::RequiresRegister() |
| 5174 : Location::WritableRegister()); |
| 5175 |
5174 return summary; | 5176 return summary; |
5175 } | 5177 } |
5176 | 5178 |
5177 | 5179 |
5178 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5180 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5179 Register value = locs()->in(0).reg(); | 5181 Register value = locs()->in(0).reg(); |
5180 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); | 5182 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); |
5181 __ BranchNotEqual(value, Immediate(Smi::RawValue(cid_)), deopt); | 5183 if (cids_.IsSingleCid()) { |
| 5184 __ BranchNotEqual(value, Immediate(Smi::RawValue(cids_.cid_start)), deopt); |
| 5185 } else { |
| 5186 __ AddImmediate(value, value, -Smi::RawValue(cids_.cid_start)); |
| 5187 // TODO(erikcorry): We should use sltiu instead of the temporary TMP if |
| 5188 // the range is small enough. |
| 5189 __ LoadImmediate(TMP, cids_.Extent()); |
| 5190 // Reverse comparison so we get 1 if biased_cid > tmp ie cid is out of |
| 5191 // range. |
| 5192 __ sltu(TMP, TMP, value); |
| 5193 __ bne(TMP, ZR, deopt); |
| 5194 } |
5182 } | 5195 } |
5183 | 5196 |
5184 | 5197 |
5185 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone, | 5198 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone, |
5186 bool opt) const { | 5199 bool opt) const { |
5187 const intptr_t kNumInputs = 2; | 5200 const intptr_t kNumInputs = 2; |
5188 const intptr_t kNumTemps = 0; | 5201 const intptr_t kNumTemps = 0; |
5189 LocationSummary* locs = new (zone) LocationSummary( | 5202 LocationSummary* locs = new (zone) LocationSummary( |
5190 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 5203 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
5191 locs->set_in(kLengthPos, Location::RequiresRegister()); | 5204 locs->set_in(kLengthPos, Location::RequiresRegister()); |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6088 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6101 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
6089 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6102 kGrowRegExpStackRuntimeEntry, 1, locs()); |
6090 __ lw(result, Address(SP, 1 * kWordSize)); | 6103 __ lw(result, Address(SP, 1 * kWordSize)); |
6091 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 6104 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
6092 } | 6105 } |
6093 | 6106 |
6094 | 6107 |
6095 } // namespace dart | 6108 } // namespace dart |
6096 | 6109 |
6097 #endif // defined TARGET_ARCH_MIPS | 6110 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |