| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 bool opt) const { | 289 bool opt) const { |
| 290 const intptr_t kNumInputs = 0; | 290 const intptr_t kNumInputs = 0; |
| 291 return LocationSummary::Make(isolate, | 291 return LocationSummary::Make(isolate, |
| 292 kNumInputs, | 292 kNumInputs, |
| 293 Location::RequiresFpuRegister(), | 293 Location::RequiresFpuRegister(), |
| 294 LocationSummary::kNoCall); | 294 LocationSummary::kNoCall); |
| 295 } | 295 } |
| 296 | 296 |
| 297 | 297 |
| 298 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 298 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 299 ASSERT(representation_ == kUnboxedDouble); |
| 299 if (!locs()->out(0).IsInvalid()) { | 300 if (!locs()->out(0).IsInvalid()) { |
| 300 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) { | 301 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) { |
| 301 const VRegister dst = locs()->out(0).fpu_reg(); | 302 const VRegister dst = locs()->out(0).fpu_reg(); |
| 302 __ veor(dst, dst, dst); | 303 __ veor(dst, dst, dst); |
| 303 } else { | 304 } else { |
| 304 const VRegister dst = locs()->out(0).fpu_reg(); | 305 const VRegister dst = locs()->out(0).fpu_reg(); |
| 305 __ LoadDImmediate(dst, Double::Cast(value()).value(), PP); | 306 __ LoadDImmediate(dst, Double::Cast(value()).value(), PP); |
| 306 } | 307 } |
| 307 } | 308 } |
| 308 } | 309 } |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 | 1011 |
| 1011 | 1012 |
| 1012 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, | 1013 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, |
| 1013 bool opt) const { | 1014 bool opt) const { |
| 1014 const intptr_t kNumInputs = 2; | 1015 const intptr_t kNumInputs = 2; |
| 1015 const intptr_t kNumTemps = 0; | 1016 const intptr_t kNumTemps = 0; |
| 1016 LocationSummary* locs = new(isolate) LocationSummary( | 1017 LocationSummary* locs = new(isolate) LocationSummary( |
| 1017 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1018 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1018 locs->set_in(0, Location::RequiresRegister()); | 1019 locs->set_in(0, Location::RequiresRegister()); |
| 1019 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1020 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
| 1020 locs->set_in(1, Location::Constant(index()->BoundConstant())); | 1021 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
| 1021 } else { | 1022 } else { |
| 1022 locs->set_in(1, Location::RequiresRegister()); | 1023 locs->set_in(1, Location::RequiresRegister()); |
| 1023 } | 1024 } |
| 1024 if ((representation() == kUnboxedDouble) || | 1025 if ((representation() == kUnboxedDouble) || |
| 1025 (representation() == kUnboxedFloat32x4) || | 1026 (representation() == kUnboxedFloat32x4) || |
| 1026 (representation() == kUnboxedInt32x4) || | 1027 (representation() == kUnboxedInt32x4) || |
| 1027 (representation() == kUnboxedFloat64x2)) { | 1028 (representation() == kUnboxedFloat64x2)) { |
| 1028 locs->set_out(0, Location::RequiresFpuRegister()); | 1029 locs->set_out(0, Location::RequiresFpuRegister()); |
| 1029 } else { | 1030 } else { |
| 1030 locs->set_out(0, Location::RequiresRegister()); | 1031 locs->set_out(0, Location::RequiresRegister()); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 | 1150 |
| 1150 | 1151 |
| 1151 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, | 1152 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, |
| 1152 bool opt) const { | 1153 bool opt) const { |
| 1153 const intptr_t kNumInputs = 3; | 1154 const intptr_t kNumInputs = 3; |
| 1154 const intptr_t kNumTemps = 0; | 1155 const intptr_t kNumTemps = 0; |
| 1155 LocationSummary* locs = new(isolate) LocationSummary( | 1156 LocationSummary* locs = new(isolate) LocationSummary( |
| 1156 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1157 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1157 locs->set_in(0, Location::RequiresRegister()); | 1158 locs->set_in(0, Location::RequiresRegister()); |
| 1158 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1159 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
| 1159 locs->set_in(1, Location::Constant(index()->BoundConstant())); | 1160 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
| 1160 } else { | 1161 } else { |
| 1161 locs->set_in(1, Location::WritableRegister()); | 1162 locs->set_in(1, Location::WritableRegister()); |
| 1162 } | 1163 } |
| 1163 switch (class_id()) { | 1164 switch (class_id()) { |
| 1164 case kArrayCid: | 1165 case kArrayCid: |
| 1165 locs->set_in(2, ShouldEmitStoreBarrier() | 1166 locs->set_in(2, ShouldEmitStoreBarrier() |
| 1166 ? Location::WritableRegister() | 1167 ? Location::WritableRegister() |
| 1167 : Location::RegisterOrConstant(value())); | 1168 : Location::RegisterOrConstant(value())); |
| 1168 break; | 1169 break; |
| 1169 case kExternalTypedDataUint8ArrayCid: | 1170 case kExternalTypedDataUint8ArrayCid: |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2623 const intptr_t kNumInputs = 2; | 2624 const intptr_t kNumInputs = 2; |
| 2624 const intptr_t kNumTemps = | 2625 const intptr_t kNumTemps = |
| 2625 (((op_kind() == Token::kSHL) && !IsTruncating()) || | 2626 (((op_kind() == Token::kSHL) && !IsTruncating()) || |
| 2626 (op_kind() == Token::kSHR)) ? 1 : 0; | 2627 (op_kind() == Token::kSHR)) ? 1 : 0; |
| 2627 LocationSummary* summary = new(isolate) LocationSummary( | 2628 LocationSummary* summary = new(isolate) LocationSummary( |
| 2628 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2629 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2629 if (op_kind() == Token::kTRUNCDIV) { | 2630 if (op_kind() == Token::kTRUNCDIV) { |
| 2630 summary->set_in(0, Location::RequiresRegister()); | 2631 summary->set_in(0, Location::RequiresRegister()); |
| 2631 if (RightIsPowerOfTwoConstant()) { | 2632 if (RightIsPowerOfTwoConstant()) { |
| 2632 ConstantInstr* right_constant = right()->definition()->AsConstant(); | 2633 ConstantInstr* right_constant = right()->definition()->AsConstant(); |
| 2633 summary->set_in(1, Location::Constant(right_constant->value())); | 2634 summary->set_in(1, Location::Constant(right_constant)); |
| 2634 } else { | 2635 } else { |
| 2635 summary->set_in(1, Location::RequiresRegister()); | 2636 summary->set_in(1, Location::RequiresRegister()); |
| 2636 } | 2637 } |
| 2637 summary->set_out(0, Location::RequiresRegister()); | 2638 summary->set_out(0, Location::RequiresRegister()); |
| 2638 return summary; | 2639 return summary; |
| 2639 } | 2640 } |
| 2640 if (op_kind() == Token::kMOD) { | 2641 if (op_kind() == Token::kMOD) { |
| 2641 summary->set_in(0, Location::RequiresRegister()); | 2642 summary->set_in(0, Location::RequiresRegister()); |
| 2642 summary->set_in(1, Location::RequiresRegister()); | 2643 summary->set_in(1, Location::RequiresRegister()); |
| 2643 summary->set_out(0, Location::RequiresRegister()); | 2644 summary->set_out(0, Location::RequiresRegister()); |
| (...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4397 } | 4398 } |
| 4398 | 4399 |
| 4399 | 4400 |
| 4400 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4401 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4401 const VRegister result = locs()->out(0).fpu_reg(); | 4402 const VRegister result = locs()->out(0).fpu_reg(); |
| 4402 const VRegister value = locs()->in(0).fpu_reg(); | 4403 const VRegister value = locs()->in(0).fpu_reg(); |
| 4403 __ fnegd(result, value); | 4404 __ fnegd(result, value); |
| 4404 } | 4405 } |
| 4405 | 4406 |
| 4406 | 4407 |
| 4408 DEFINE_UNIMPLEMENTED_INSTRUCTION(Int32ToDoubleInstr) |
| 4409 |
| 4410 |
| 4407 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 4411 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
| 4408 bool opt) const { | 4412 bool opt) const { |
| 4409 const intptr_t kNumInputs = 1; | 4413 const intptr_t kNumInputs = 1; |
| 4410 const intptr_t kNumTemps = 0; | 4414 const intptr_t kNumTemps = 0; |
| 4411 LocationSummary* result = new(isolate) LocationSummary( | 4415 LocationSummary* result = new(isolate) LocationSummary( |
| 4412 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4416 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4413 result->set_in(0, Location::RequiresRegister()); | 4417 result->set_in(0, Location::RequiresRegister()); |
| 4414 result->set_out(0, Location::RequiresFpuRegister()); | 4418 result->set_out(0, Location::RequiresFpuRegister()); |
| 4415 return result; | 4419 return result; |
| 4416 } | 4420 } |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5138 CompileType ShiftUint32OpInstr::ComputeType() const { | 5142 CompileType ShiftUint32OpInstr::ComputeType() const { |
| 5139 return CompileType::FromCid(kSmiCid); | 5143 return CompileType::FromCid(kSmiCid); |
| 5140 } | 5144 } |
| 5141 | 5145 |
| 5142 | 5146 |
| 5143 CompileType UnaryUint32OpInstr::ComputeType() const { | 5147 CompileType UnaryUint32OpInstr::ComputeType() const { |
| 5144 return CompileType::FromCid(kSmiCid); | 5148 return CompileType::FromCid(kSmiCid); |
| 5145 } | 5149 } |
| 5146 | 5150 |
| 5147 | 5151 |
| 5148 CompileType BoxUint32Instr::ComputeType() const { | 5152 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryUint32OpInstr) |
| 5149 return CompileType::FromCid(kSmiCid); | 5153 DEFINE_UNIMPLEMENTED_INSTRUCTION(ShiftUint32OpInstr) |
| 5150 } | 5154 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnaryUint32OpInstr) |
| 5151 | 5155 DEFINE_UNIMPLEMENTED_INSTRUCTION(BoxInt32Instr) |
| 5152 | 5156 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnboxInt32Instr) |
| 5153 CompileType UnboxUint32Instr::ComputeType() const { | 5157 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr) |
| 5154 return CompileType::FromCid(kSmiCid); | 5158 DEFINE_UNIMPLEMENTED_INSTRUCTION(BoxUint32Instr) |
| 5155 } | 5159 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnboxedIntConverterInstr) |
| 5156 | |
| 5157 | |
| 5158 LocationSummary* BinaryUint32OpInstr::MakeLocationSummary(Isolate* isolate, | |
| 5159 bool opt) const { | |
| 5160 UNIMPLEMENTED(); | |
| 5161 return NULL; | |
| 5162 } | |
| 5163 | |
| 5164 | |
| 5165 void BinaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 5166 UNIMPLEMENTED(); | |
| 5167 } | |
| 5168 | |
| 5169 | |
| 5170 LocationSummary* ShiftUint32OpInstr::MakeLocationSummary(Isolate* isolate, | |
| 5171 bool opt) const { | |
| 5172 UNIMPLEMENTED(); | |
| 5173 return NULL; | |
| 5174 } | |
| 5175 | |
| 5176 | |
| 5177 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 5178 UNIMPLEMENTED(); | |
| 5179 } | |
| 5180 | |
| 5181 | |
| 5182 LocationSummary* UnaryUint32OpInstr::MakeLocationSummary(Isolate* isolate, | |
| 5183 bool opt) const { | |
| 5184 UNIMPLEMENTED(); | |
| 5185 return NULL; | |
| 5186 } | |
| 5187 | |
| 5188 | |
| 5189 void UnaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 5190 UNIMPLEMENTED(); | |
| 5191 } | |
| 5192 | 5160 |
| 5193 | 5161 |
| 5194 LocationSummary* UnboxUint32Instr::MakeLocationSummary(Isolate* isolate, | 5162 LocationSummary* UnboxUint32Instr::MakeLocationSummary(Isolate* isolate, |
| 5195 bool opt) const { | 5163 bool opt) const { |
| 5196 const intptr_t kNumInputs = 1; | 5164 const intptr_t kNumInputs = 1; |
| 5197 const intptr_t kNumTemps = 0; | 5165 const intptr_t kNumTemps = 0; |
| 5198 LocationSummary* summary = new(isolate) LocationSummary( | 5166 LocationSummary* summary = new(isolate) LocationSummary( |
| 5199 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5167 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5200 summary->set_in(0, Location::RequiresRegister()); | 5168 summary->set_in(0, Location::RequiresRegister()); |
| 5201 summary->set_out(0, Location::SameAsFirstInput()); | 5169 summary->set_out(0, Location::SameAsFirstInput()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 5213 } else { | 5181 } else { |
| 5214 Label* deopt = compiler->AddDeoptStub(deopt_id_, | 5182 Label* deopt = compiler->AddDeoptStub(deopt_id_, |
| 5215 ICData::kDeoptUnboxInteger); | 5183 ICData::kDeoptUnboxInteger); |
| 5216 __ tsti(value, kSmiTagMask); | 5184 __ tsti(value, kSmiTagMask); |
| 5217 __ b(deopt, NE); | 5185 __ b(deopt, NE); |
| 5218 __ SmiUntag(value); | 5186 __ SmiUntag(value); |
| 5219 } | 5187 } |
| 5220 } | 5188 } |
| 5221 | 5189 |
| 5222 | 5190 |
| 5223 LocationSummary* BoxUint32Instr::MakeLocationSummary(Isolate* isolate, | |
| 5224 bool opt) const { | |
| 5225 UNIMPLEMENTED(); | |
| 5226 return NULL; | |
| 5227 } | |
| 5228 | |
| 5229 | |
| 5230 void BoxUint32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 5231 UNIMPLEMENTED(); | |
| 5232 } | |
| 5233 | |
| 5234 | |
| 5235 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Isolate* isolate, | |
| 5236 bool opt) const { | |
| 5237 UNIMPLEMENTED(); | |
| 5238 return NULL; | |
| 5239 } | |
| 5240 | |
| 5241 | |
| 5242 void UnboxedIntConverterInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 5243 UNIMPLEMENTED(); | |
| 5244 } | |
| 5245 | |
| 5246 | |
| 5247 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, | 5191 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, |
| 5248 bool opt) const { | 5192 bool opt) const { |
| 5249 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | 5193 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); |
| 5250 } | 5194 } |
| 5251 | 5195 |
| 5252 | 5196 |
| 5253 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5197 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5254 compiler->GenerateRuntimeCall(token_pos(), | 5198 compiler->GenerateRuntimeCall(token_pos(), |
| 5255 deopt_id(), | 5199 deopt_id(), |
| 5256 kThrowRuntimeEntry, | 5200 kThrowRuntimeEntry, |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5478 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 5422 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 5479 #if defined(DEBUG) | 5423 #if defined(DEBUG) |
| 5480 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 5424 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
| 5481 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 5425 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
| 5482 #endif | 5426 #endif |
| 5483 } | 5427 } |
| 5484 | 5428 |
| 5485 } // namespace dart | 5429 } // namespace dart |
| 5486 | 5430 |
| 5487 #endif // defined TARGET_ARCH_ARM64 | 5431 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |