Chromium Code Reviews| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 namespace dart { | 23 namespace dart { |
| 24 | 24 |
| 25 DECLARE_FLAG(int, optimization_counter_threshold); | 25 DECLARE_FLAG(int, optimization_counter_threshold); |
| 26 DECLARE_FLAG(bool, propagate_ic_data); | 26 DECLARE_FLAG(bool, propagate_ic_data); |
| 27 DECLARE_FLAG(bool, use_osr); | 27 DECLARE_FLAG(bool, use_osr); |
| 28 | 28 |
| 29 // Generic summary for call instructions that have all arguments pushed | 29 // Generic summary for call instructions that have all arguments pushed |
| 30 // on the stack and return the result in a fixed register R0. | 30 // on the stack and return the result in a fixed register R0. |
| 31 LocationSummary* Instruction::MakeCallSummary() { | 31 LocationSummary* Instruction::MakeCallSummary() { |
| 32 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); | 32 Isolate* isolate = Isolate::Current(); |
| 33 LocationSummary* result = new(isolate) LocationSummary( | |
| 34 isolate, 0, 0, LocationSummary::kCall); | |
| 33 result->set_out(0, Location::RegisterLocation(R0)); | 35 result->set_out(0, Location::RegisterLocation(R0)); |
| 34 return result; | 36 return result; |
| 35 } | 37 } |
| 36 | 38 |
| 37 | 39 |
| 38 LocationSummary* PushArgumentInstr::MakeLocationSummary(bool opt) const { | 40 LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate, |
| 41 bool opt) const { | |
|
Ivan Posva
2014/05/23 09:19:29
Fixing the formatting of this in the file.
| |
| 39 const intptr_t kNumInputs = 1; | 42 const intptr_t kNumInputs = 1; |
| 40 const intptr_t kNumTemps= 0; | 43 const intptr_t kNumTemps= 0; |
| 41 LocationSummary* locs = | 44 LocationSummary* locs = new(isolate) LocationSummary( |
| 42 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 45 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 43 locs->set_in(0, Location::AnyOrConstant(value())); | 46 locs->set_in(0, Location::AnyOrConstant(value())); |
| 44 return locs; | 47 return locs; |
| 45 } | 48 } |
| 46 | 49 |
| 47 | 50 |
| 48 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 51 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 49 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | 52 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
| 50 // where PushArgument is handled by BindInstr::EmitNativeCode. | 53 // where PushArgument is handled by BindInstr::EmitNativeCode. |
| 51 if (compiler->is_optimizing()) { | 54 if (compiler->is_optimizing()) { |
| 52 Location value = locs()->in(0); | 55 Location value = locs()->in(0); |
| 53 if (value.IsRegister()) { | 56 if (value.IsRegister()) { |
| 54 __ Push(value.reg()); | 57 __ Push(value.reg()); |
| 55 } else if (value.IsConstant()) { | 58 } else if (value.IsConstant()) { |
| 56 __ PushObject(value.constant()); | 59 __ PushObject(value.constant()); |
| 57 } else { | 60 } else { |
| 58 ASSERT(value.IsStackSlot()); | 61 ASSERT(value.IsStackSlot()); |
| 59 const intptr_t value_offset = value.ToStackSlotOffset(); | 62 const intptr_t value_offset = value.ToStackSlotOffset(); |
| 60 __ LoadFromOffset(kWord, IP, FP, value_offset); | 63 __ LoadFromOffset(kWord, IP, FP, value_offset); |
| 61 __ Push(IP); | 64 __ Push(IP); |
| 62 } | 65 } |
| 63 } | 66 } |
| 64 } | 67 } |
| 65 | 68 |
| 66 | 69 |
| 67 LocationSummary* ReturnInstr::MakeLocationSummary(bool opt) const { | 70 LocationSummary* ReturnInstr::MakeLocationSummary(Isolate* isolate, |
| 71 bool opt) const { | |
| 68 const intptr_t kNumInputs = 1; | 72 const intptr_t kNumInputs = 1; |
| 69 const intptr_t kNumTemps = 0; | 73 const intptr_t kNumTemps = 0; |
| 70 LocationSummary* locs = | 74 LocationSummary* locs = new(isolate) LocationSummary( |
| 71 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 75 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 72 locs->set_in(0, Location::RegisterLocation(R0)); | 76 locs->set_in(0, Location::RegisterLocation(R0)); |
| 73 return locs; | 77 return locs; |
| 74 } | 78 } |
| 75 | 79 |
| 76 | 80 |
| 77 // Attempt optimized compilation at return instruction instead of at the entry. | 81 // Attempt optimized compilation at return instruction instead of at the entry. |
| 78 // The entry needs to be patchable, no inlined objects are allowed in the area | 82 // The entry needs to be patchable, no inlined objects are allowed in the area |
| 79 // that will be overwritten by the patch instructions: a branch macro sequence. | 83 // that will be overwritten by the patch instructions: a branch macro sequence. |
| 80 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 84 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 81 const Register result = locs()->in(0).reg(); | 85 const Register result = locs()->in(0).reg(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 } | 120 } |
| 117 | 121 |
| 118 | 122 |
| 119 // Detect pattern when one value is zero and another is a power of 2. | 123 // Detect pattern when one value is zero and another is a power of 2. |
| 120 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { | 124 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { |
| 121 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || | 125 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || |
| 122 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); | 126 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); |
| 123 } | 127 } |
| 124 | 128 |
| 125 | 129 |
| 126 LocationSummary* IfThenElseInstr::MakeLocationSummary(bool opt) const { | 130 LocationSummary* IfThenElseInstr::MakeLocationSummary(Isolate* isolate, |
| 127 comparison()->InitializeLocationSummary(opt); | 131 bool opt) const { |
|
Cutch
2014/05/23 09:28:36
wrong indent on bool opt
| |
| 132 comparison()->InitializeLocationSummary(isolate, opt); | |
| 128 return comparison()->locs(); | 133 return comparison()->locs(); |
| 129 } | 134 } |
| 130 | 135 |
| 131 | 136 |
| 132 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 137 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 133 const Register result = locs()->out(0).reg(); | 138 const Register result = locs()->out(0).reg(); |
| 134 | 139 |
| 135 Location left = locs()->in(0); | 140 Location left = locs()->in(0); |
| 136 Location right = locs()->in(1); | 141 Location right = locs()->in(1); |
| 137 ASSERT(!left.IsConstant() || !right.IsConstant()); | 142 ASSERT(!left.IsConstant() || !right.IsConstant()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 const int32_t val = | 180 const int32_t val = |
| 176 Smi::RawValue(true_value) - Smi::RawValue(false_value); | 181 Smi::RawValue(true_value) - Smi::RawValue(false_value); |
| 177 __ AndImmediate(result, result, val); | 182 __ AndImmediate(result, result, val); |
| 178 if (false_value != 0) { | 183 if (false_value != 0) { |
| 179 __ AddImmediate(result, Smi::RawValue(false_value)); | 184 __ AddImmediate(result, Smi::RawValue(false_value)); |
| 180 } | 185 } |
| 181 } | 186 } |
| 182 } | 187 } |
| 183 | 188 |
| 184 | 189 |
| 185 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const { | 190 LocationSummary* ClosureCallInstr::MakeLocationSummary(Isolate* isolate, |
| 191 bool opt) const { | |
|
Cutch
2014/05/23 09:28:36
here too
| |
| 186 const intptr_t kNumInputs = 1; | 192 const intptr_t kNumInputs = 1; |
| 187 const intptr_t kNumTemps = 0; | 193 const intptr_t kNumTemps = 0; |
| 188 LocationSummary* summary = | 194 LocationSummary* summary = new(isolate) LocationSummary( |
| 189 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 195 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 190 summary->set_in(0, Location::RegisterLocation(R0)); // Function. | 196 summary->set_in(0, Location::RegisterLocation(R0)); // Function. |
| 191 summary->set_out(0, Location::RegisterLocation(R0)); | 197 summary->set_out(0, Location::RegisterLocation(R0)); |
| 192 return summary; | 198 return summary; |
| 193 } | 199 } |
| 194 | 200 |
| 195 | 201 |
| 196 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 202 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 197 // Load arguments descriptor in R4. | 203 // Load arguments descriptor in R4. |
| 198 int argument_count = ArgumentCount(); | 204 int argument_count = ArgumentCount(); |
| 199 const Array& arguments_descriptor = | 205 const Array& arguments_descriptor = |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 225 // Add deoptimization continuation point after the call and before the | 231 // Add deoptimization continuation point after the call and before the |
| 226 // arguments are removed. | 232 // arguments are removed. |
| 227 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 233 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 228 deopt_id_after, | 234 deopt_id_after, |
| 229 token_pos()); | 235 token_pos()); |
| 230 } | 236 } |
| 231 __ Drop(argument_count); | 237 __ Drop(argument_count); |
| 232 } | 238 } |
| 233 | 239 |
| 234 | 240 |
| 235 LocationSummary* LoadLocalInstr::MakeLocationSummary(bool opt) const { | 241 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, |
| 242 bool opt) const { | |
| 236 return LocationSummary::Make(0, | 243 return LocationSummary::Make(0, |
| 237 Location::RequiresRegister(), | 244 Location::RequiresRegister(), |
| 238 LocationSummary::kNoCall); | 245 LocationSummary::kNoCall); |
| 239 } | 246 } |
| 240 | 247 |
| 241 | 248 |
| 242 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 249 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 243 const Register result = locs()->out(0).reg(); | 250 const Register result = locs()->out(0).reg(); |
| 244 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize); | 251 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize); |
| 245 } | 252 } |
| 246 | 253 |
| 247 | 254 |
| 248 LocationSummary* StoreLocalInstr::MakeLocationSummary(bool opt) const { | 255 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, |
| 256 bool opt) const { | |
| 249 return LocationSummary::Make(1, | 257 return LocationSummary::Make(1, |
| 250 Location::SameAsFirstInput(), | 258 Location::SameAsFirstInput(), |
| 251 LocationSummary::kNoCall); | 259 LocationSummary::kNoCall); |
| 252 } | 260 } |
| 253 | 261 |
| 254 | 262 |
| 255 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 263 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 256 const Register value = locs()->in(0).reg(); | 264 const Register value = locs()->in(0).reg(); |
| 257 const Register result = locs()->out(0).reg(); | 265 const Register result = locs()->out(0).reg(); |
| 258 ASSERT(result == value); // Assert that register assignment is correct. | 266 ASSERT(result == value); // Assert that register assignment is correct. |
| 259 __ str(value, Address(FP, local().index() * kWordSize)); | 267 __ str(value, Address(FP, local().index() * kWordSize)); |
| 260 } | 268 } |
| 261 | 269 |
| 262 | 270 |
| 263 LocationSummary* ConstantInstr::MakeLocationSummary(bool opt) const { | 271 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, |
| 272 bool opt) const { | |
| 264 return LocationSummary::Make(0, | 273 return LocationSummary::Make(0, |
| 265 Location::RequiresRegister(), | 274 Location::RequiresRegister(), |
| 266 LocationSummary::kNoCall); | 275 LocationSummary::kNoCall); |
| 267 } | 276 } |
| 268 | 277 |
| 269 | 278 |
| 270 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 279 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 271 // The register allocator drops constant definitions that have no uses. | 280 // The register allocator drops constant definitions that have no uses. |
| 272 if (!locs()->out(0).IsInvalid()) { | 281 if (!locs()->out(0).IsInvalid()) { |
| 273 const Register result = locs()->out(0).reg(); | 282 const Register result = locs()->out(0).reg(); |
| 274 __ LoadObject(result, value()); | 283 __ LoadObject(result, value()); |
| 275 } | 284 } |
| 276 } | 285 } |
| 277 | 286 |
| 278 | 287 |
| 279 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const { | 288 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, |
| 289 bool opt) const { | |
| 280 const intptr_t kNumInputs = 0; | 290 const intptr_t kNumInputs = 0; |
| 281 const intptr_t kNumTemps = 1; | 291 const intptr_t kNumTemps = 1; |
| 282 LocationSummary* locs = | 292 LocationSummary* locs = new(isolate) LocationSummary( |
| 283 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 293 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 284 locs->set_out(0, Location::RequiresFpuRegister()); | 294 locs->set_out(0, Location::RequiresFpuRegister()); |
| 285 locs->set_temp(0, Location::RequiresRegister()); | 295 locs->set_temp(0, Location::RequiresRegister()); |
| 286 return locs; | 296 return locs; |
| 287 } | 297 } |
| 288 | 298 |
| 289 | 299 |
| 290 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 300 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 291 // The register allocator drops constant definitions that have no uses. | 301 // The register allocator drops constant definitions that have no uses. |
| 292 if (!locs()->out(0).IsInvalid()) { | 302 if (!locs()->out(0).IsInvalid()) { |
| 293 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0) && | 303 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0) && |
| 294 TargetCPUFeatures::neon_supported()) { | 304 TargetCPUFeatures::neon_supported()) { |
| 295 const QRegister dst = locs()->out(0).fpu_reg(); | 305 const QRegister dst = locs()->out(0).fpu_reg(); |
| 296 __ veorq(dst, dst, dst); | 306 __ veorq(dst, dst, dst); |
| 297 } else { | 307 } else { |
| 298 const DRegister dst = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 308 const DRegister dst = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
| 299 const Register temp = locs()->temp(0).reg(); | 309 const Register temp = locs()->temp(0).reg(); |
| 300 __ LoadDImmediate(dst, Double::Cast(value()).value(), temp); | 310 __ LoadDImmediate(dst, Double::Cast(value()).value(), temp); |
| 301 } | 311 } |
| 302 } | 312 } |
| 303 } | 313 } |
| 304 | 314 |
| 305 | 315 |
| 306 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { | 316 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Isolate* isolate, |
| 317 bool opt) const { | |
| 307 const intptr_t kNumInputs = 3; | 318 const intptr_t kNumInputs = 3; |
| 308 const intptr_t kNumTemps = 0; | 319 const intptr_t kNumTemps = 0; |
| 309 LocationSummary* summary = | 320 LocationSummary* summary = new(isolate) LocationSummary( |
| 310 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 321 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 311 summary->set_in(0, Location::RegisterLocation(R0)); // Value. | 322 summary->set_in(0, Location::RegisterLocation(R0)); // Value. |
| 312 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. | 323 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. |
| 313 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. | 324 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. |
| 314 summary->set_out(0, Location::RegisterLocation(R0)); | 325 summary->set_out(0, Location::RegisterLocation(R0)); |
| 315 return summary; | 326 return summary; |
| 316 } | 327 } |
| 317 | 328 |
| 318 | 329 |
| 319 LocationSummary* AssertBooleanInstr::MakeLocationSummary(bool opt) const { | 330 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Isolate* isolate, |
| 331 bool opt) const { | |
| 320 const intptr_t kNumInputs = 1; | 332 const intptr_t kNumInputs = 1; |
| 321 const intptr_t kNumTemps = 0; | 333 const intptr_t kNumTemps = 0; |
| 322 LocationSummary* locs = | 334 LocationSummary* locs = new(isolate) LocationSummary( |
| 323 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 335 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 324 locs->set_in(0, Location::RegisterLocation(R0)); | 336 locs->set_in(0, Location::RegisterLocation(R0)); |
| 325 locs->set_out(0, Location::RegisterLocation(R0)); | 337 locs->set_out(0, Location::RegisterLocation(R0)); |
| 326 return locs; | 338 return locs; |
| 327 } | 339 } |
| 328 | 340 |
| 329 | 341 |
| 330 static void EmitAssertBoolean(Register reg, | 342 static void EmitAssertBoolean(Register reg, |
| 331 intptr_t token_pos, | 343 intptr_t token_pos, |
| 332 intptr_t deopt_id, | 344 intptr_t deopt_id, |
| 333 LocationSummary* locs, | 345 LocationSummary* locs, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 case Token::kGT: return GT; | 382 case Token::kGT: return GT; |
| 371 case Token::kLTE: return LE; | 383 case Token::kLTE: return LE; |
| 372 case Token::kGTE: return GE; | 384 case Token::kGTE: return GE; |
| 373 default: | 385 default: |
| 374 UNREACHABLE(); | 386 UNREACHABLE(); |
| 375 return VS; | 387 return VS; |
| 376 } | 388 } |
| 377 } | 389 } |
| 378 | 390 |
| 379 | 391 |
| 380 LocationSummary* EqualityCompareInstr::MakeLocationSummary(bool opt) const { | 392 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Isolate* isolate, |
| 393 bool opt) const { | |
| 381 const intptr_t kNumInputs = 2; | 394 const intptr_t kNumInputs = 2; |
| 382 if (operation_cid() == kMintCid) { | 395 if (operation_cid() == kMintCid) { |
| 383 const intptr_t kNumTemps = 0; | 396 const intptr_t kNumTemps = 0; |
| 384 LocationSummary* locs = | 397 LocationSummary* locs = new(isolate) LocationSummary( |
| 385 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 398 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 386 locs->set_in(0, Location::Pair(Location::RequiresRegister(), | 399 locs->set_in(0, Location::Pair(Location::RequiresRegister(), |
| 387 Location::RequiresRegister())); | 400 Location::RequiresRegister())); |
| 388 locs->set_in(1, Location::Pair(Location::RequiresRegister(), | 401 locs->set_in(1, Location::Pair(Location::RequiresRegister(), |
| 389 Location::RequiresRegister())); | 402 Location::RequiresRegister())); |
| 390 locs->set_out(0, Location::RequiresRegister()); | 403 locs->set_out(0, Location::RequiresRegister()); |
| 391 return locs; | 404 return locs; |
| 392 } | 405 } |
| 393 if (operation_cid() == kDoubleCid) { | 406 if (operation_cid() == kDoubleCid) { |
| 394 const intptr_t kNumTemps = 0; | 407 const intptr_t kNumTemps = 0; |
| 395 LocationSummary* locs = | 408 LocationSummary* locs = new(isolate) LocationSummary( |
| 396 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 409 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 397 locs->set_in(0, Location::RequiresFpuRegister()); | 410 locs->set_in(0, Location::RequiresFpuRegister()); |
| 398 locs->set_in(1, Location::RequiresFpuRegister()); | 411 locs->set_in(1, Location::RequiresFpuRegister()); |
| 399 locs->set_out(0, Location::RequiresRegister()); | 412 locs->set_out(0, Location::RequiresRegister()); |
| 400 return locs; | 413 return locs; |
| 401 } | 414 } |
| 402 if (operation_cid() == kSmiCid) { | 415 if (operation_cid() == kSmiCid) { |
| 403 const intptr_t kNumTemps = 0; | 416 const intptr_t kNumTemps = 0; |
| 404 LocationSummary* locs = | 417 LocationSummary* locs = new(isolate) LocationSummary( |
| 405 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 418 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 406 locs->set_in(0, Location::RegisterOrConstant(left())); | 419 locs->set_in(0, Location::RegisterOrConstant(left())); |
| 407 // Only one input can be a constant operand. The case of two constant | 420 // Only one input can be a constant operand. The case of two constant |
| 408 // operands should be handled by constant propagation. | 421 // operands should be handled by constant propagation. |
| 409 locs->set_in(1, locs->in(0).IsConstant() | 422 locs->set_in(1, locs->in(0).IsConstant() |
| 410 ? Location::RequiresRegister() | 423 ? Location::RequiresRegister() |
| 411 : Location::RegisterOrConstant(right())); | 424 : Location::RegisterOrConstant(right())); |
| 412 locs->set_out(0, Location::RequiresRegister()); | 425 locs->set_out(0, Location::RequiresRegister()); |
| 413 return locs; | 426 return locs; |
| 414 } | 427 } |
| 415 UNREACHABLE(); | 428 UNREACHABLE(); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 | 666 |
| 654 if (operation_cid() == kDoubleCid) { | 667 if (operation_cid() == kDoubleCid) { |
| 655 Label* nan_result = (true_condition == NE) ? | 668 Label* nan_result = (true_condition == NE) ? |
| 656 labels.true_label : labels.false_label; | 669 labels.true_label : labels.false_label; |
| 657 __ b(nan_result, VS); | 670 __ b(nan_result, VS); |
| 658 } | 671 } |
| 659 EmitBranchOnCondition(compiler, true_condition, labels); | 672 EmitBranchOnCondition(compiler, true_condition, labels); |
| 660 } | 673 } |
| 661 | 674 |
| 662 | 675 |
| 663 LocationSummary* TestSmiInstr::MakeLocationSummary(bool opt) const { | 676 LocationSummary* TestSmiInstr::MakeLocationSummary(Isolate* isolate, |
| 677 bool opt) const { | |
| 664 const intptr_t kNumInputs = 2; | 678 const intptr_t kNumInputs = 2; |
| 665 const intptr_t kNumTemps = 0; | 679 const intptr_t kNumTemps = 0; |
| 666 LocationSummary* locs = | 680 LocationSummary* locs = new(isolate) LocationSummary( |
| 667 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 681 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 668 locs->set_in(0, Location::RequiresRegister()); | 682 locs->set_in(0, Location::RequiresRegister()); |
| 669 // Only one input can be a constant operand. The case of two constant | 683 // Only one input can be a constant operand. The case of two constant |
| 670 // operands should be handled by constant propagation. | 684 // operands should be handled by constant propagation. |
| 671 locs->set_in(1, Location::RegisterOrConstant(right())); | 685 locs->set_in(1, Location::RegisterOrConstant(right())); |
| 672 return locs; | 686 return locs; |
| 673 } | 687 } |
| 674 | 688 |
| 675 | 689 |
| 676 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 690 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
| 677 BranchLabels labels) { | 691 BranchLabels labels) { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 697 | 711 |
| 698 | 712 |
| 699 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 713 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
| 700 BranchInstr* branch) { | 714 BranchInstr* branch) { |
| 701 BranchLabels labels = compiler->CreateBranchLabels(branch); | 715 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 702 Condition true_condition = EmitComparisonCode(compiler, labels); | 716 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 703 EmitBranchOnCondition(compiler, true_condition, labels); | 717 EmitBranchOnCondition(compiler, true_condition, labels); |
| 704 } | 718 } |
| 705 | 719 |
| 706 | 720 |
| 707 LocationSummary* TestCidsInstr::MakeLocationSummary(bool opt) const { | 721 LocationSummary* TestCidsInstr::MakeLocationSummary(Isolate* isolate, |
| 722 bool opt) const { | |
| 708 const intptr_t kNumInputs = 1; | 723 const intptr_t kNumInputs = 1; |
| 709 const intptr_t kNumTemps = 1; | 724 const intptr_t kNumTemps = 1; |
| 710 LocationSummary* locs = | 725 LocationSummary* locs = new(isolate) LocationSummary( |
| 711 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 726 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 712 locs->set_in(0, Location::RequiresRegister()); | 727 locs->set_in(0, Location::RequiresRegister()); |
| 713 locs->set_temp(0, Location::RequiresRegister()); | 728 locs->set_temp(0, Location::RequiresRegister()); |
| 714 locs->set_out(0, Location::RequiresRegister()); | 729 locs->set_out(0, Location::RequiresRegister()); |
| 715 return locs; | 730 return locs; |
| 716 } | 731 } |
| 717 | 732 |
| 718 | 733 |
| 719 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 734 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
| 720 BranchLabels labels) { | 735 BranchLabels labels) { |
| 721 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 736 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 EmitComparisonCode(compiler, labels); | 784 EmitComparisonCode(compiler, labels); |
| 770 __ Bind(&is_false); | 785 __ Bind(&is_false); |
| 771 __ LoadObject(result_reg, Bool::False()); | 786 __ LoadObject(result_reg, Bool::False()); |
| 772 __ b(&done); | 787 __ b(&done); |
| 773 __ Bind(&is_true); | 788 __ Bind(&is_true); |
| 774 __ LoadObject(result_reg, Bool::True()); | 789 __ LoadObject(result_reg, Bool::True()); |
| 775 __ Bind(&done); | 790 __ Bind(&done); |
| 776 } | 791 } |
| 777 | 792 |
| 778 | 793 |
| 779 LocationSummary* RelationalOpInstr::MakeLocationSummary(bool opt) const { | 794 LocationSummary* RelationalOpInstr::MakeLocationSummary(Isolate* isolate, |
| 795 bool opt) const { | |
| 780 const intptr_t kNumInputs = 2; | 796 const intptr_t kNumInputs = 2; |
| 781 const intptr_t kNumTemps = 0; | 797 const intptr_t kNumTemps = 0; |
| 782 if (operation_cid() == kMintCid) { | 798 if (operation_cid() == kMintCid) { |
| 783 const intptr_t kNumTemps = 1; | 799 const intptr_t kNumTemps = 1; |
| 784 LocationSummary* locs = | 800 LocationSummary* locs = new(isolate) LocationSummary( |
| 785 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 801 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 786 locs->set_in(0, Location::Pair(Location::RequiresRegister(), | 802 locs->set_in(0, Location::Pair(Location::RequiresRegister(), |
| 787 Location::RequiresRegister())); | 803 Location::RequiresRegister())); |
| 788 locs->set_in(1, Location::Pair(Location::RequiresRegister(), | 804 locs->set_in(1, Location::Pair(Location::RequiresRegister(), |
| 789 Location::RequiresRegister())); | 805 Location::RequiresRegister())); |
| 790 locs->set_temp(0, Location::RequiresRegister()); | 806 locs->set_temp(0, Location::RequiresRegister()); |
| 791 locs->set_out(0, Location::RequiresRegister()); | 807 locs->set_out(0, Location::RequiresRegister()); |
| 792 return locs; | 808 return locs; |
| 793 } | 809 } |
| 794 if (operation_cid() == kDoubleCid) { | 810 if (operation_cid() == kDoubleCid) { |
| 795 LocationSummary* summary = | 811 LocationSummary* summary = new(isolate) LocationSummary( |
| 796 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 812 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 797 summary->set_in(0, Location::RequiresFpuRegister()); | 813 summary->set_in(0, Location::RequiresFpuRegister()); |
| 798 summary->set_in(1, Location::RequiresFpuRegister()); | 814 summary->set_in(1, Location::RequiresFpuRegister()); |
| 799 summary->set_out(0, Location::RequiresRegister()); | 815 summary->set_out(0, Location::RequiresRegister()); |
| 800 return summary; | 816 return summary; |
| 801 } | 817 } |
| 802 ASSERT(operation_cid() == kSmiCid); | 818 ASSERT(operation_cid() == kSmiCid); |
| 803 LocationSummary* summary = | 819 LocationSummary* summary = new(isolate) LocationSummary( |
| 804 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 820 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 805 summary->set_in(0, Location::RegisterOrConstant(left())); | 821 summary->set_in(0, Location::RegisterOrConstant(left())); |
| 806 // Only one input can be a constant operand. The case of two constant | 822 // Only one input can be a constant operand. The case of two constant |
| 807 // operands should be handled by constant propagation. | 823 // operands should be handled by constant propagation. |
| 808 summary->set_in(1, summary->in(0).IsConstant() | 824 summary->set_in(1, summary->in(0).IsConstant() |
| 809 ? Location::RequiresRegister() | 825 ? Location::RequiresRegister() |
| 810 : Location::RegisterOrConstant(right())); | 826 : Location::RegisterOrConstant(right())); |
| 811 summary->set_out(0, Location::RequiresRegister()); | 827 summary->set_out(0, Location::RequiresRegister()); |
| 812 return summary; | 828 return summary; |
| 813 } | 829 } |
| 814 | 830 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 867 __ b(labels.false_label, NE); | 883 __ b(labels.false_label, NE); |
| 868 } else if (operation_cid() == kDoubleCid) { | 884 } else if (operation_cid() == kDoubleCid) { |
| 869 Label* nan_result = (true_condition == NE) ? | 885 Label* nan_result = (true_condition == NE) ? |
| 870 labels.true_label : labels.false_label; | 886 labels.true_label : labels.false_label; |
| 871 __ b(nan_result, VS); | 887 __ b(nan_result, VS); |
| 872 EmitBranchOnCondition(compiler, true_condition, labels); | 888 EmitBranchOnCondition(compiler, true_condition, labels); |
| 873 } | 889 } |
| 874 } | 890 } |
| 875 | 891 |
| 876 | 892 |
| 877 LocationSummary* NativeCallInstr::MakeLocationSummary(bool opt) const { | 893 LocationSummary* NativeCallInstr::MakeLocationSummary(Isolate* isolate, |
| 894 bool opt) const { | |
| 878 const intptr_t kNumInputs = 0; | 895 const intptr_t kNumInputs = 0; |
| 879 const intptr_t kNumTemps = 3; | 896 const intptr_t kNumTemps = 3; |
| 880 LocationSummary* locs = | 897 LocationSummary* locs = new(isolate) LocationSummary( |
| 881 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 898 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 882 locs->set_temp(0, Location::RegisterLocation(R1)); | 899 locs->set_temp(0, Location::RegisterLocation(R1)); |
| 883 locs->set_temp(1, Location::RegisterLocation(R2)); | 900 locs->set_temp(1, Location::RegisterLocation(R2)); |
| 884 locs->set_temp(2, Location::RegisterLocation(R5)); | 901 locs->set_temp(2, Location::RegisterLocation(R5)); |
| 885 locs->set_out(0, Location::RegisterLocation(R0)); | 902 locs->set_out(0, Location::RegisterLocation(R0)); |
| 886 return locs; | 903 return locs; |
| 887 } | 904 } |
| 888 | 905 |
| 889 | 906 |
| 890 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 907 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 891 ASSERT(locs()->temp(0).reg() == R1); | 908 ASSERT(locs()->temp(0).reg() == R1); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 __ LoadImmediate(R5, entry); | 945 __ LoadImmediate(R5, entry); |
| 929 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); | 946 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); |
| 930 compiler->GenerateCall(token_pos(), | 947 compiler->GenerateCall(token_pos(), |
| 931 stub_entry, | 948 stub_entry, |
| 932 PcDescriptors::kOther, | 949 PcDescriptors::kOther, |
| 933 locs()); | 950 locs()); |
| 934 __ Pop(result); | 951 __ Pop(result); |
| 935 } | 952 } |
| 936 | 953 |
| 937 | 954 |
| 938 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(bool opt) const { | 955 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
| 956 bool opt) const { | |
| 939 const intptr_t kNumInputs = 1; | 957 const intptr_t kNumInputs = 1; |
| 940 // TODO(fschneider): Allow immediate operands for the char code. | 958 // TODO(fschneider): Allow immediate operands for the char code. |
| 941 return LocationSummary::Make(kNumInputs, | 959 return LocationSummary::Make(kNumInputs, |
| 942 Location::RequiresRegister(), | 960 Location::RequiresRegister(), |
| 943 LocationSummary::kNoCall); | 961 LocationSummary::kNoCall); |
| 944 } | 962 } |
| 945 | 963 |
| 946 | 964 |
| 947 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 965 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 948 const Register char_code = locs()->in(0).reg(); | 966 const Register char_code = locs()->in(0).reg(); |
| 949 const Register result = locs()->out(0).reg(); | 967 const Register result = locs()->out(0).reg(); |
| 950 __ LoadImmediate(result, | 968 __ LoadImmediate(result, |
| 951 reinterpret_cast<uword>(Symbols::PredefinedAddress())); | 969 reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
| 952 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); | 970 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); |
| 953 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. | 971 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. |
| 954 } | 972 } |
| 955 | 973 |
| 956 | 974 |
| 957 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(bool opt) const { | 975 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
| 976 bool opt) const { | |
| 958 const intptr_t kNumInputs = 1; | 977 const intptr_t kNumInputs = 1; |
| 959 return LocationSummary::Make(kNumInputs, | 978 return LocationSummary::Make(kNumInputs, |
| 960 Location::RequiresRegister(), | 979 Location::RequiresRegister(), |
| 961 LocationSummary::kNoCall); | 980 LocationSummary::kNoCall); |
| 962 } | 981 } |
| 963 | 982 |
| 964 | 983 |
| 965 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 984 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 966 ASSERT(cid_ == kOneByteStringCid); | 985 ASSERT(cid_ == kOneByteStringCid); |
| 967 const Register str = locs()->in(0).reg(); | 986 const Register str = locs()->in(0).reg(); |
| 968 const Register result = locs()->out(0).reg(); | 987 const Register result = locs()->out(0).reg(); |
| 969 __ ldr(result, FieldAddress(str, String::length_offset())); | 988 __ ldr(result, FieldAddress(str, String::length_offset())); |
| 970 __ cmp(result, ShifterOperand(Smi::RawValue(1))); | 989 __ cmp(result, ShifterOperand(Smi::RawValue(1))); |
| 971 __ LoadImmediate(result, -1, NE); | 990 __ LoadImmediate(result, -1, NE); |
| 972 __ ldrb(result, FieldAddress(str, OneByteString::data_offset()), EQ); | 991 __ ldrb(result, FieldAddress(str, OneByteString::data_offset()), EQ); |
| 973 __ SmiTag(result); | 992 __ SmiTag(result); |
| 974 } | 993 } |
| 975 | 994 |
| 976 | 995 |
| 977 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { | 996 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Isolate* isolate, |
| 997 bool opt) const { | |
| 978 const intptr_t kNumInputs = 1; | 998 const intptr_t kNumInputs = 1; |
| 979 const intptr_t kNumTemps = 0; | 999 const intptr_t kNumTemps = 0; |
| 980 LocationSummary* summary = | 1000 LocationSummary* summary = new(isolate) LocationSummary( |
| 981 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1001 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 982 summary->set_in(0, Location::RegisterLocation(R0)); | 1002 summary->set_in(0, Location::RegisterLocation(R0)); |
| 983 summary->set_out(0, Location::RegisterLocation(R0)); | 1003 summary->set_out(0, Location::RegisterLocation(R0)); |
| 984 return summary; | 1004 return summary; |
| 985 } | 1005 } |
| 986 | 1006 |
| 987 | 1007 |
| 988 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1008 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 989 const Register array = locs()->in(0).reg(); | 1009 const Register array = locs()->in(0).reg(); |
| 990 __ Push(array); | 1010 __ Push(array); |
| 991 const int kNumberOfArguments = 1; | 1011 const int kNumberOfArguments = 1; |
| 992 const Array& kNoArgumentNames = Object::null_array(); | 1012 const Array& kNoArgumentNames = Object::null_array(); |
| 993 compiler->GenerateStaticCall(deopt_id(), | 1013 compiler->GenerateStaticCall(deopt_id(), |
| 994 token_pos(), | 1014 token_pos(), |
| 995 CallFunction(), | 1015 CallFunction(), |
| 996 kNumberOfArguments, | 1016 kNumberOfArguments, |
| 997 kNoArgumentNames, | 1017 kNoArgumentNames, |
| 998 locs()); | 1018 locs()); |
| 999 ASSERT(locs()->out(0).reg() == R0); | 1019 ASSERT(locs()->out(0).reg() == R0); |
| 1000 } | 1020 } |
| 1001 | 1021 |
| 1002 | 1022 |
| 1003 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(bool opt) const { | 1023 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
| 1024 bool opt) const { | |
| 1004 const intptr_t kNumInputs = 1; | 1025 const intptr_t kNumInputs = 1; |
| 1005 return LocationSummary::Make(kNumInputs, | 1026 return LocationSummary::Make(kNumInputs, |
| 1006 Location::RequiresRegister(), | 1027 Location::RequiresRegister(), |
| 1007 LocationSummary::kNoCall); | 1028 LocationSummary::kNoCall); |
| 1008 } | 1029 } |
| 1009 | 1030 |
| 1010 | 1031 |
| 1011 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1032 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1012 const Register object = locs()->in(0).reg(); | 1033 const Register object = locs()->in(0).reg(); |
| 1013 const Register result = locs()->out(0).reg(); | 1034 const Register result = locs()->out(0).reg(); |
| 1014 __ LoadFromOffset(kWord, result, object, offset() - kHeapObjectTag); | 1035 __ LoadFromOffset(kWord, result, object, offset() - kHeapObjectTag); |
| 1015 } | 1036 } |
| 1016 | 1037 |
| 1017 | 1038 |
| 1018 LocationSummary* LoadClassIdInstr::MakeLocationSummary(bool opt) const { | 1039 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
| 1040 bool opt) const { | |
| 1019 const intptr_t kNumInputs = 1; | 1041 const intptr_t kNumInputs = 1; |
| 1020 return LocationSummary::Make(kNumInputs, | 1042 return LocationSummary::Make(kNumInputs, |
| 1021 Location::RequiresRegister(), | 1043 Location::RequiresRegister(), |
| 1022 LocationSummary::kNoCall); | 1044 LocationSummary::kNoCall); |
| 1023 } | 1045 } |
| 1024 | 1046 |
| 1025 | 1047 |
| 1026 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1048 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1027 const Register object = locs()->in(0).reg(); | 1049 const Register object = locs()->in(0).reg(); |
| 1028 const Register result = locs()->out(0).reg(); | 1050 const Register result = locs()->out(0).reg(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1108 return kUnboxedFloat32x4; | 1130 return kUnboxedFloat32x4; |
| 1109 case kTypedDataFloat64x2ArrayCid: | 1131 case kTypedDataFloat64x2ArrayCid: |
| 1110 return kUnboxedFloat64x2; | 1132 return kUnboxedFloat64x2; |
| 1111 default: | 1133 default: |
| 1112 UNREACHABLE(); | 1134 UNREACHABLE(); |
| 1113 return kTagged; | 1135 return kTagged; |
| 1114 } | 1136 } |
| 1115 } | 1137 } |
| 1116 | 1138 |
| 1117 | 1139 |
| 1118 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { | 1140 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, |
| 1141 bool opt) const { | |
| 1119 const intptr_t kNumInputs = 2; | 1142 const intptr_t kNumInputs = 2; |
| 1120 const intptr_t kNumTemps = 0; | 1143 const intptr_t kNumTemps = 0; |
| 1121 LocationSummary* locs = | 1144 LocationSummary* locs = new(isolate) LocationSummary( |
| 1122 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1145 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1123 locs->set_in(0, Location::RequiresRegister()); | 1146 locs->set_in(0, Location::RequiresRegister()); |
| 1124 // The smi index is either untagged (element size == 1), or it is left smi | 1147 // The smi index is either untagged (element size == 1), or it is left smi |
| 1125 // tagged (for all element sizes > 1). | 1148 // tagged (for all element sizes > 1). |
| 1126 // TODO(regis): Revisit and see if the index can be immediate. | 1149 // TODO(regis): Revisit and see if the index can be immediate. |
| 1127 if (index_scale() == 2 && IsExternal()) { | 1150 if (index_scale() == 2 && IsExternal()) { |
| 1128 locs->set_in(1, Location::RequiresRegister()); | 1151 locs->set_in(1, Location::RequiresRegister()); |
| 1129 } else { | 1152 } else { |
| 1130 locs->set_in(1, Location::WritableRegister()); | 1153 locs->set_in(1, Location::WritableRegister()); |
| 1131 } | 1154 } |
| 1132 if ((representation() == kUnboxedDouble) || | 1155 if ((representation() == kUnboxedDouble) || |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1352 return kUnboxedInt32x4; | 1375 return kUnboxedInt32x4; |
| 1353 case kTypedDataFloat64x2ArrayCid: | 1376 case kTypedDataFloat64x2ArrayCid: |
| 1354 return kUnboxedFloat64x2; | 1377 return kUnboxedFloat64x2; |
| 1355 default: | 1378 default: |
| 1356 UNREACHABLE(); | 1379 UNREACHABLE(); |
| 1357 return kTagged; | 1380 return kTagged; |
| 1358 } | 1381 } |
| 1359 } | 1382 } |
| 1360 | 1383 |
| 1361 | 1384 |
| 1362 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { | 1385 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, |
| 1386 bool opt) const { | |
| 1363 const intptr_t kNumInputs = 3; | 1387 const intptr_t kNumInputs = 3; |
| 1364 const intptr_t kNumTemps = 0; | 1388 const intptr_t kNumTemps = 0; |
| 1365 LocationSummary* locs = | 1389 LocationSummary* locs = new(isolate) LocationSummary( |
| 1366 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1390 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1367 locs->set_in(0, Location::RequiresRegister()); | 1391 locs->set_in(0, Location::RequiresRegister()); |
| 1368 // The smi index is either untagged (element size == 1), or it is left smi | 1392 // The smi index is either untagged (element size == 1), or it is left smi |
| 1369 // tagged (for all element sizes > 1). | 1393 // tagged (for all element sizes > 1). |
| 1370 // TODO(regis): Revisit and see if the index can be immediate. | 1394 // TODO(regis): Revisit and see if the index can be immediate. |
| 1371 locs->set_in(1, Location::WritableRegister()); | 1395 locs->set_in(1, Location::WritableRegister()); |
| 1372 switch (class_id()) { | 1396 switch (class_id()) { |
| 1373 case kArrayCid: | 1397 case kArrayCid: |
| 1374 locs->set_in(2, ShouldEmitStoreBarrier() | 1398 locs->set_in(2, ShouldEmitStoreBarrier() |
| 1375 ? Location::WritableRegister() | 1399 ? Location::WritableRegister() |
| 1376 : Location::RegisterOrConstant(value())); | 1400 : Location::RegisterOrConstant(value())); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1586 __ str(value1, element_address); | 1610 __ str(value1, element_address); |
| 1587 } | 1611 } |
| 1588 break; | 1612 break; |
| 1589 } | 1613 } |
| 1590 default: | 1614 default: |
| 1591 UNREACHABLE(); | 1615 UNREACHABLE(); |
| 1592 } | 1616 } |
| 1593 } | 1617 } |
| 1594 | 1618 |
| 1595 | 1619 |
| 1596 LocationSummary* GuardFieldInstr::MakeLocationSummary(bool opt) const { | 1620 LocationSummary* GuardFieldInstr::MakeLocationSummary(Isolate* isolate, |
| 1621 bool opt) const { | |
| 1597 const intptr_t kNumInputs = 1; | 1622 const intptr_t kNumInputs = 1; |
| 1598 LocationSummary* summary = | 1623 LocationSummary* summary = new(isolate) LocationSummary( |
| 1599 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); | 1624 isolate, kNumInputs, 0, LocationSummary::kNoCall); |
| 1600 summary->set_in(0, Location::RequiresRegister()); | 1625 summary->set_in(0, Location::RequiresRegister()); |
| 1601 const bool field_has_length = field().needs_length_check(); | 1626 const bool field_has_length = field().needs_length_check(); |
| 1602 summary->AddTemp(Location::RequiresRegister()); | 1627 summary->AddTemp(Location::RequiresRegister()); |
| 1603 summary->AddTemp(Location::RequiresRegister()); | 1628 summary->AddTemp(Location::RequiresRegister()); |
| 1604 const bool need_field_temp_reg = | 1629 const bool need_field_temp_reg = |
| 1605 field_has_length || (field().guarded_cid() == kIllegalCid); | 1630 field_has_length || (field().guarded_cid() == kIllegalCid); |
| 1606 if (need_field_temp_reg) { | 1631 if (need_field_temp_reg) { |
| 1607 summary->AddTemp(Location::RequiresRegister()); | 1632 summary->AddTemp(Location::RequiresRegister()); |
| 1608 } | 1633 } |
| 1609 return summary; | 1634 return summary; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1940 | 1965 |
| 1941 __ b(exit_label()); | 1966 __ b(exit_label()); |
| 1942 } | 1967 } |
| 1943 | 1968 |
| 1944 private: | 1969 private: |
| 1945 StoreInstanceFieldInstr* instruction_; | 1970 StoreInstanceFieldInstr* instruction_; |
| 1946 const Class& cls_; | 1971 const Class& cls_; |
| 1947 }; | 1972 }; |
| 1948 | 1973 |
| 1949 | 1974 |
| 1950 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(bool opt) const { | 1975 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate, |
| 1976 bool opt) const { | |
| 1951 const intptr_t kNumInputs = 2; | 1977 const intptr_t kNumInputs = 2; |
| 1952 const intptr_t kNumTemps = 0; | 1978 const intptr_t kNumTemps = 0; |
| 1953 LocationSummary* summary = | 1979 LocationSummary* summary = new(isolate) LocationSummary( |
| 1954 new LocationSummary(kNumInputs, kNumTemps, | 1980 isolate, kNumInputs, kNumTemps, |
| 1955 !field().IsNull() && | 1981 !field().IsNull() && |
| 1956 ((field().guarded_cid() == kIllegalCid) || is_initialization_) | 1982 ((field().guarded_cid() == kIllegalCid) || is_initialization_) |
| 1957 ? LocationSummary::kCallOnSlowPath | 1983 ? LocationSummary::kCallOnSlowPath |
| 1958 : LocationSummary::kNoCall); | 1984 : LocationSummary::kNoCall); |
| 1959 | 1985 |
| 1960 summary->set_in(0, Location::RequiresRegister()); | 1986 summary->set_in(0, Location::RequiresRegister()); |
| 1961 if (IsUnboxedStore() && opt) { | 1987 if (IsUnboxedStore() && opt) { |
| 1962 summary->set_in(1, Location::RequiresFpuRegister()); | 1988 summary->set_in(1, Location::RequiresFpuRegister()); |
| 1963 summary->AddTemp(Location::RequiresRegister()); | 1989 summary->AddTemp(Location::RequiresRegister()); |
| 1964 summary->AddTemp(Location::RequiresRegister()); | 1990 summary->AddTemp(Location::RequiresRegister()); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2181 } else { | 2207 } else { |
| 2182 const Register value_reg = locs()->in(1).reg(); | 2208 const Register value_reg = locs()->in(1).reg(); |
| 2183 __ StoreIntoObjectNoBarrier(instance_reg, | 2209 __ StoreIntoObjectNoBarrier(instance_reg, |
| 2184 FieldAddress(instance_reg, offset_in_bytes_), value_reg); | 2210 FieldAddress(instance_reg, offset_in_bytes_), value_reg); |
| 2185 } | 2211 } |
| 2186 } | 2212 } |
| 2187 __ Bind(&skip_store); | 2213 __ Bind(&skip_store); |
| 2188 } | 2214 } |
| 2189 | 2215 |
| 2190 | 2216 |
| 2191 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(bool opt) const { | 2217 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate, |
| 2218 bool opt) const { | |
| 2192 const intptr_t kNumInputs = 1; | 2219 const intptr_t kNumInputs = 1; |
| 2193 const intptr_t kNumTemps = 0; | 2220 const intptr_t kNumTemps = 0; |
| 2194 LocationSummary* summary = | 2221 LocationSummary* summary = new(isolate) LocationSummary( |
| 2195 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2222 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2196 summary->set_in(0, Location::RequiresRegister()); | 2223 summary->set_in(0, Location::RequiresRegister()); |
| 2197 summary->set_out(0, Location::RequiresRegister()); | 2224 summary->set_out(0, Location::RequiresRegister()); |
| 2198 return summary; | 2225 return summary; |
| 2199 } | 2226 } |
| 2200 | 2227 |
| 2201 | 2228 |
| 2202 // When the parser is building an implicit static getter for optimization, | 2229 // When the parser is building an implicit static getter for optimization, |
| 2203 // it can generate a function body where deoptimization ids do not line up | 2230 // it can generate a function body where deoptimization ids do not line up |
| 2204 // with the unoptimized code. | 2231 // with the unoptimized code. |
| 2205 // | 2232 // |
| 2206 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 2233 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
| 2207 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2234 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2208 const Register field = locs()->in(0).reg(); | 2235 const Register field = locs()->in(0).reg(); |
| 2209 const Register result = locs()->out(0).reg(); | 2236 const Register result = locs()->out(0).reg(); |
| 2210 __ LoadFromOffset(kWord, result, | 2237 __ LoadFromOffset(kWord, result, |
| 2211 field, Field::value_offset() - kHeapObjectTag); | 2238 field, Field::value_offset() - kHeapObjectTag); |
| 2212 } | 2239 } |
| 2213 | 2240 |
| 2214 | 2241 |
| 2215 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(bool opt) const { | 2242 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Isolate* isolate, |
| 2216 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); | 2243 bool opt) const { |
| 2244 LocationSummary* locs = new(isolate) LocationSummary( | |
| 2245 isolate, 1, 1, LocationSummary::kNoCall); | |
| 2217 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 2246 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
| 2218 : Location::RequiresRegister()); | 2247 : Location::RequiresRegister()); |
| 2219 locs->set_temp(0, Location::RequiresRegister()); | 2248 locs->set_temp(0, Location::RequiresRegister()); |
| 2220 return locs; | 2249 return locs; |
| 2221 } | 2250 } |
| 2222 | 2251 |
| 2223 | 2252 |
| 2224 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2253 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2225 const Register value = locs()->in(0).reg(); | 2254 const Register value = locs()->in(0).reg(); |
| 2226 const Register temp = locs()->temp(0).reg(); | 2255 const Register temp = locs()->temp(0).reg(); |
| 2227 | 2256 |
| 2228 __ LoadObject(temp, field()); | 2257 __ LoadObject(temp, field()); |
| 2229 if (this->value()->NeedsStoreBuffer()) { | 2258 if (this->value()->NeedsStoreBuffer()) { |
| 2230 __ StoreIntoObject(temp, | 2259 __ StoreIntoObject(temp, |
| 2231 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); | 2260 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); |
| 2232 } else { | 2261 } else { |
| 2233 __ StoreIntoObjectNoBarrier( | 2262 __ StoreIntoObjectNoBarrier( |
| 2234 temp, FieldAddress(temp, Field::value_offset()), value); | 2263 temp, FieldAddress(temp, Field::value_offset()), value); |
| 2235 } | 2264 } |
| 2236 } | 2265 } |
| 2237 | 2266 |
| 2238 | 2267 |
| 2239 LocationSummary* InstanceOfInstr::MakeLocationSummary(bool opt) const { | 2268 LocationSummary* InstanceOfInstr::MakeLocationSummary(Isolate* isolate, |
| 2269 bool opt) const { | |
| 2240 const intptr_t kNumInputs = 3; | 2270 const intptr_t kNumInputs = 3; |
| 2241 const intptr_t kNumTemps = 0; | 2271 const intptr_t kNumTemps = 0; |
| 2242 LocationSummary* summary = | 2272 LocationSummary* summary = new(isolate) LocationSummary( |
| 2243 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2273 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2244 summary->set_in(0, Location::RegisterLocation(R0)); | 2274 summary->set_in(0, Location::RegisterLocation(R0)); |
| 2245 summary->set_in(1, Location::RegisterLocation(R2)); | 2275 summary->set_in(1, Location::RegisterLocation(R2)); |
| 2246 summary->set_in(2, Location::RegisterLocation(R1)); | 2276 summary->set_in(2, Location::RegisterLocation(R1)); |
| 2247 summary->set_out(0, Location::RegisterLocation(R0)); | 2277 summary->set_out(0, Location::RegisterLocation(R0)); |
| 2248 return summary; | 2278 return summary; |
| 2249 } | 2279 } |
| 2250 | 2280 |
| 2251 | 2281 |
| 2252 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2282 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2253 ASSERT(locs()->in(0).reg() == R0); // Value. | 2283 ASSERT(locs()->in(0).reg() == R0); // Value. |
| 2254 ASSERT(locs()->in(1).reg() == R2); // Instantiator. | 2284 ASSERT(locs()->in(1).reg() == R2); // Instantiator. |
| 2255 ASSERT(locs()->in(2).reg() == R1); // Instantiator type arguments. | 2285 ASSERT(locs()->in(2).reg() == R1); // Instantiator type arguments. |
| 2256 | 2286 |
| 2257 compiler->GenerateInstanceOf(token_pos(), | 2287 compiler->GenerateInstanceOf(token_pos(), |
| 2258 deopt_id(), | 2288 deopt_id(), |
| 2259 type(), | 2289 type(), |
| 2260 negate_result(), | 2290 negate_result(), |
| 2261 locs()); | 2291 locs()); |
| 2262 ASSERT(locs()->out(0).reg() == R0); | 2292 ASSERT(locs()->out(0).reg() == R0); |
| 2263 } | 2293 } |
| 2264 | 2294 |
| 2265 | 2295 |
| 2266 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { | 2296 LocationSummary* CreateArrayInstr::MakeLocationSummary(Isolate* isolate, |
| 2297 bool opt) const { | |
| 2267 const intptr_t kNumInputs = 2; | 2298 const intptr_t kNumInputs = 2; |
| 2268 const intptr_t kNumTemps = 0; | 2299 const intptr_t kNumTemps = 0; |
| 2269 LocationSummary* locs = | 2300 LocationSummary* locs = new(isolate) LocationSummary( |
| 2270 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2301 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2271 locs->set_in(kElementTypePos, Location::RegisterLocation(R1)); | 2302 locs->set_in(kElementTypePos, Location::RegisterLocation(R1)); |
| 2272 locs->set_in(kLengthPos, Location::RegisterLocation(R2)); | 2303 locs->set_in(kLengthPos, Location::RegisterLocation(R2)); |
| 2273 locs->set_out(0, Location::RegisterLocation(R0)); | 2304 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2274 return locs; | 2305 return locs; |
| 2275 } | 2306 } |
| 2276 | 2307 |
| 2277 | 2308 |
| 2278 // Inlines array allocation for known constant values. | 2309 // Inlines array allocation for known constant values. |
| 2279 static void InlineArrayAllocation(FlowGraphCompiler* compiler, | 2310 static void InlineArrayAllocation(FlowGraphCompiler* compiler, |
| 2280 intptr_t num_elements, | 2311 intptr_t num_elements, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2476 compiler->RestoreLiveRegisters(locs); | 2507 compiler->RestoreLiveRegisters(locs); |
| 2477 | 2508 |
| 2478 __ b(exit_label()); | 2509 __ b(exit_label()); |
| 2479 } | 2510 } |
| 2480 | 2511 |
| 2481 private: | 2512 private: |
| 2482 Instruction* instruction_; | 2513 Instruction* instruction_; |
| 2483 }; | 2514 }; |
| 2484 | 2515 |
| 2485 | 2516 |
| 2486 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { | 2517 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate, |
| 2518 bool opt) const { | |
| 2487 const intptr_t kNumInputs = 1; | 2519 const intptr_t kNumInputs = 1; |
| 2488 const intptr_t kNumTemps = 0; | 2520 const intptr_t kNumTemps = 0; |
| 2489 LocationSummary* locs = | 2521 LocationSummary* locs = new(isolate) LocationSummary( |
| 2490 new LocationSummary( | 2522 isolate, kNumInputs, kNumTemps, |
| 2491 kNumInputs, kNumTemps, | |
| 2492 (opt && !IsPotentialUnboxedLoad()) | 2523 (opt && !IsPotentialUnboxedLoad()) |
| 2493 ? LocationSummary::kNoCall | 2524 ? LocationSummary::kNoCall |
| 2494 : LocationSummary::kCallOnSlowPath); | 2525 : LocationSummary::kCallOnSlowPath); |
| 2495 | 2526 |
| 2496 locs->set_in(0, Location::RequiresRegister()); | 2527 locs->set_in(0, Location::RequiresRegister()); |
| 2497 | 2528 |
| 2498 if (IsUnboxedLoad() && opt) { | 2529 if (IsUnboxedLoad() && opt) { |
| 2499 locs->AddTemp(Location::RequiresRegister()); | 2530 locs->AddTemp(Location::RequiresRegister()); |
| 2500 } else if (IsPotentialUnboxedLoad()) { | 2531 } else if (IsPotentialUnboxedLoad()) { |
| 2501 locs->AddTemp(opt ? Location::RequiresFpuRegister() | 2532 locs->AddTemp(opt ? Location::RequiresFpuRegister() |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2624 } | 2655 } |
| 2625 | 2656 |
| 2626 __ Bind(&load_pointer); | 2657 __ Bind(&load_pointer); |
| 2627 } | 2658 } |
| 2628 __ LoadFromOffset(kWord, result_reg, | 2659 __ LoadFromOffset(kWord, result_reg, |
| 2629 instance_reg, offset_in_bytes() - kHeapObjectTag); | 2660 instance_reg, offset_in_bytes() - kHeapObjectTag); |
| 2630 __ Bind(&done); | 2661 __ Bind(&done); |
| 2631 } | 2662 } |
| 2632 | 2663 |
| 2633 | 2664 |
| 2634 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(bool opt) const { | 2665 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Isolate* isolate, |
| 2666 bool opt) const { | |
| 2635 const intptr_t kNumInputs = 1; | 2667 const intptr_t kNumInputs = 1; |
| 2636 const intptr_t kNumTemps = 0; | 2668 const intptr_t kNumTemps = 0; |
| 2637 LocationSummary* locs = | 2669 LocationSummary* locs = new(isolate) LocationSummary( |
| 2638 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2670 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2639 locs->set_in(0, Location::RegisterLocation(R0)); | 2671 locs->set_in(0, Location::RegisterLocation(R0)); |
| 2640 locs->set_out(0, Location::RegisterLocation(R0)); | 2672 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2641 return locs; | 2673 return locs; |
| 2642 } | 2674 } |
| 2643 | 2675 |
| 2644 | 2676 |
| 2645 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2677 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2646 const Register instantiator_reg = locs()->in(0).reg(); | 2678 const Register instantiator_reg = locs()->in(0).reg(); |
| 2647 const Register result_reg = locs()->out(0).reg(); | 2679 const Register result_reg = locs()->out(0).reg(); |
| 2648 | 2680 |
| 2649 // 'instantiator_reg' is the instantiator TypeArguments object (or null). | 2681 // 'instantiator_reg' is the instantiator TypeArguments object (or null). |
| 2650 // A runtime call to instantiate the type is required. | 2682 // A runtime call to instantiate the type is required. |
| 2651 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2683 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 2652 __ PushObject(type()); | 2684 __ PushObject(type()); |
| 2653 __ Push(instantiator_reg); // Push instantiator type arguments. | 2685 __ Push(instantiator_reg); // Push instantiator type arguments. |
| 2654 compiler->GenerateRuntimeCall(token_pos(), | 2686 compiler->GenerateRuntimeCall(token_pos(), |
| 2655 deopt_id(), | 2687 deopt_id(), |
| 2656 kInstantiateTypeRuntimeEntry, | 2688 kInstantiateTypeRuntimeEntry, |
| 2657 2, | 2689 2, |
| 2658 locs()); | 2690 locs()); |
| 2659 __ Drop(2); // Drop instantiator and uninstantiated type. | 2691 __ Drop(2); // Drop instantiator and uninstantiated type. |
| 2660 __ Pop(result_reg); // Pop instantiated type. | 2692 __ Pop(result_reg); // Pop instantiated type. |
| 2661 ASSERT(instantiator_reg == result_reg); | 2693 ASSERT(instantiator_reg == result_reg); |
| 2662 } | 2694 } |
| 2663 | 2695 |
| 2664 | 2696 |
| 2665 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( | 2697 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( |
| 2666 bool opt) const { | 2698 Isolate* isolate, bool opt) const { |
| 2667 const intptr_t kNumInputs = 1; | 2699 const intptr_t kNumInputs = 1; |
| 2668 const intptr_t kNumTemps = 0; | 2700 const intptr_t kNumTemps = 0; |
| 2669 LocationSummary* locs = | 2701 LocationSummary* locs = new(isolate) LocationSummary( |
| 2670 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2702 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2671 locs->set_in(0, Location::RegisterLocation(R0)); | 2703 locs->set_in(0, Location::RegisterLocation(R0)); |
| 2672 locs->set_out(0, Location::RegisterLocation(R0)); | 2704 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2673 return locs; | 2705 return locs; |
| 2674 } | 2706 } |
| 2675 | 2707 |
| 2676 | 2708 |
| 2677 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 2709 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
| 2678 FlowGraphCompiler* compiler) { | 2710 FlowGraphCompiler* compiler) { |
| 2679 const Register instantiator_reg = locs()->in(0).reg(); | 2711 const Register instantiator_reg = locs()->in(0).reg(); |
| 2680 const Register result_reg = locs()->out(0).reg(); | 2712 const Register result_reg = locs()->out(0).reg(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2724 deopt_id(), | 2756 deopt_id(), |
| 2725 kInstantiateTypeArgumentsRuntimeEntry, | 2757 kInstantiateTypeArgumentsRuntimeEntry, |
| 2726 2, | 2758 2, |
| 2727 locs()); | 2759 locs()); |
| 2728 __ Drop(2); // Drop instantiator and uninstantiated type arguments. | 2760 __ Drop(2); // Drop instantiator and uninstantiated type arguments. |
| 2729 __ Pop(result_reg); // Pop instantiated type arguments. | 2761 __ Pop(result_reg); // Pop instantiated type arguments. |
| 2730 __ Bind(&type_arguments_instantiated); | 2762 __ Bind(&type_arguments_instantiated); |
| 2731 } | 2763 } |
| 2732 | 2764 |
| 2733 | 2765 |
| 2734 LocationSummary* AllocateContextInstr::MakeLocationSummary(bool opt) const { | 2766 LocationSummary* AllocateContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2767 bool opt) const { | |
| 2735 const intptr_t kNumInputs = 0; | 2768 const intptr_t kNumInputs = 0; |
| 2736 const intptr_t kNumTemps = 1; | 2769 const intptr_t kNumTemps = 1; |
| 2737 LocationSummary* locs = | 2770 LocationSummary* locs = new(isolate) LocationSummary( |
| 2738 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2771 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2739 locs->set_temp(0, Location::RegisterLocation(R1)); | 2772 locs->set_temp(0, Location::RegisterLocation(R1)); |
| 2740 locs->set_out(0, Location::RegisterLocation(R0)); | 2773 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2741 return locs; | 2774 return locs; |
| 2742 } | 2775 } |
| 2743 | 2776 |
| 2744 | 2777 |
| 2745 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2778 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2746 ASSERT(locs()->temp(0).reg() == R1); | 2779 ASSERT(locs()->temp(0).reg() == R1); |
| 2747 ASSERT(locs()->out(0).reg() == R0); | 2780 ASSERT(locs()->out(0).reg() == R0); |
| 2748 | 2781 |
| 2749 __ LoadImmediate(R1, num_context_variables()); | 2782 __ LoadImmediate(R1, num_context_variables()); |
| 2750 const ExternalLabel label("alloc_context", | 2783 const ExternalLabel label("alloc_context", |
| 2751 StubCode::AllocateContextEntryPoint()); | 2784 StubCode::AllocateContextEntryPoint()); |
| 2752 compiler->GenerateCall(token_pos(), | 2785 compiler->GenerateCall(token_pos(), |
| 2753 &label, | 2786 &label, |
| 2754 PcDescriptors::kOther, | 2787 PcDescriptors::kOther, |
| 2755 locs()); | 2788 locs()); |
| 2756 } | 2789 } |
| 2757 | 2790 |
| 2758 | 2791 |
| 2759 LocationSummary* CloneContextInstr::MakeLocationSummary(bool opt) const { | 2792 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2793 bool opt) const { | |
| 2760 const intptr_t kNumInputs = 1; | 2794 const intptr_t kNumInputs = 1; |
| 2761 const intptr_t kNumTemps = 0; | 2795 const intptr_t kNumTemps = 0; |
| 2762 LocationSummary* locs = | 2796 LocationSummary* locs = new(isolate) LocationSummary( |
| 2763 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2797 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2764 locs->set_in(0, Location::RegisterLocation(R0)); | 2798 locs->set_in(0, Location::RegisterLocation(R0)); |
| 2765 locs->set_out(0, Location::RegisterLocation(R0)); | 2799 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2766 return locs; | 2800 return locs; |
| 2767 } | 2801 } |
| 2768 | 2802 |
| 2769 | 2803 |
| 2770 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2804 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2771 const Register context_value = locs()->in(0).reg(); | 2805 const Register context_value = locs()->in(0).reg(); |
| 2772 const Register result = locs()->out(0).reg(); | 2806 const Register result = locs()->out(0).reg(); |
| 2773 | 2807 |
| 2774 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2808 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 2775 __ Push(context_value); | 2809 __ Push(context_value); |
| 2776 compiler->GenerateRuntimeCall(token_pos(), | 2810 compiler->GenerateRuntimeCall(token_pos(), |
| 2777 deopt_id(), | 2811 deopt_id(), |
| 2778 kCloneContextRuntimeEntry, | 2812 kCloneContextRuntimeEntry, |
| 2779 1, | 2813 1, |
| 2780 locs()); | 2814 locs()); |
| 2781 __ Drop(1); // Remove argument. | 2815 __ Drop(1); // Remove argument. |
| 2782 __ Pop(result); // Get result (cloned context). | 2816 __ Pop(result); // Get result (cloned context). |
| 2783 } | 2817 } |
| 2784 | 2818 |
| 2785 | 2819 |
| 2786 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(bool opt) const { | 2820 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Isolate* isolate, |
| 2821 bool opt) const { | |
| 2787 UNREACHABLE(); | 2822 UNREACHABLE(); |
| 2788 return NULL; | 2823 return NULL; |
| 2789 } | 2824 } |
| 2790 | 2825 |
| 2791 | 2826 |
| 2792 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2827 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2793 __ Bind(compiler->GetJumpLabel(this)); | 2828 __ Bind(compiler->GetJumpLabel(this)); |
| 2794 compiler->AddExceptionHandler(catch_try_index(), | 2829 compiler->AddExceptionHandler(catch_try_index(), |
| 2795 try_index(), | 2830 try_index(), |
| 2796 compiler->assembler()->CodeSize(), | 2831 compiler->assembler()->CodeSize(), |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 2813 | 2848 |
| 2814 // Restore stack and initialize the two exception variables: | 2849 // Restore stack and initialize the two exception variables: |
| 2815 // exception and stack trace variables. | 2850 // exception and stack trace variables. |
| 2816 __ StoreToOffset(kWord, kExceptionObjectReg, | 2851 __ StoreToOffset(kWord, kExceptionObjectReg, |
| 2817 FP, exception_var().index() * kWordSize); | 2852 FP, exception_var().index() * kWordSize); |
| 2818 __ StoreToOffset(kWord, kStackTraceObjectReg, | 2853 __ StoreToOffset(kWord, kStackTraceObjectReg, |
| 2819 FP, stacktrace_var().index() * kWordSize); | 2854 FP, stacktrace_var().index() * kWordSize); |
| 2820 } | 2855 } |
| 2821 | 2856 |
| 2822 | 2857 |
| 2823 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(bool opt) const { | 2858 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Isolate* isolate, |
| 2859 bool opt) const { | |
| 2824 const intptr_t kNumInputs = 0; | 2860 const intptr_t kNumInputs = 0; |
| 2825 const intptr_t kNumTemps = 1; | 2861 const intptr_t kNumTemps = 1; |
| 2826 LocationSummary* summary = | 2862 LocationSummary* summary = new(isolate) LocationSummary( |
| 2827 new LocationSummary(kNumInputs, | 2863 isolate, kNumInputs, |
| 2828 kNumTemps, | 2864 kNumTemps, |
| 2829 LocationSummary::kCallOnSlowPath); | 2865 LocationSummary::kCallOnSlowPath); |
| 2830 summary->set_temp(0, Location::RequiresRegister()); | 2866 summary->set_temp(0, Location::RequiresRegister()); |
| 2831 return summary; | 2867 return summary; |
| 2832 } | 2868 } |
| 2833 | 2869 |
| 2834 | 2870 |
| 2835 class CheckStackOverflowSlowPath : public SlowPathCode { | 2871 class CheckStackOverflowSlowPath : public SlowPathCode { |
| 2836 public: | 2872 public: |
| 2837 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2873 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3015 const Register temp = locs.temp(0).reg(); | 3051 const Register temp = locs.temp(0).reg(); |
| 3016 __ Lsl(temp, left, IP); | 3052 __ Lsl(temp, left, IP); |
| 3017 __ cmp(left, ShifterOperand(temp, ASR, IP)); | 3053 __ cmp(left, ShifterOperand(temp, ASR, IP)); |
| 3018 __ b(deopt, NE); // Overflow. | 3054 __ b(deopt, NE); // Overflow. |
| 3019 // Shift for result now we know there is no overflow. | 3055 // Shift for result now we know there is no overflow. |
| 3020 __ Lsl(result, left, IP); | 3056 __ Lsl(result, left, IP); |
| 3021 } | 3057 } |
| 3022 } | 3058 } |
| 3023 | 3059 |
| 3024 | 3060 |
| 3025 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(bool opt) const { | 3061 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Isolate* isolate, |
| 3062 bool opt) const { | |
| 3026 const intptr_t kNumInputs = 2; | 3063 const intptr_t kNumInputs = 2; |
| 3027 const intptr_t kNumTemps = 0; | 3064 const intptr_t kNumTemps = 0; |
| 3028 LocationSummary* summary = | 3065 LocationSummary* summary = new(isolate) LocationSummary( |
| 3029 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3066 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3030 if (op_kind() == Token::kTRUNCDIV) { | 3067 if (op_kind() == Token::kTRUNCDIV) { |
| 3031 summary->set_in(0, Location::RequiresRegister()); | 3068 summary->set_in(0, Location::RequiresRegister()); |
| 3032 if (RightIsPowerOfTwoConstant()) { | 3069 if (RightIsPowerOfTwoConstant()) { |
| 3033 ConstantInstr* right_constant = right()->definition()->AsConstant(); | 3070 ConstantInstr* right_constant = right()->definition()->AsConstant(); |
| 3034 summary->set_in(1, Location::Constant(right_constant->value())); | 3071 summary->set_in(1, Location::Constant(right_constant->value())); |
| 3035 summary->AddTemp(Location::RequiresRegister()); | 3072 summary->AddTemp(Location::RequiresRegister()); |
| 3036 } else { | 3073 } else { |
| 3037 summary->set_in(1, Location::RequiresRegister()); | 3074 summary->set_in(1, Location::RequiresRegister()); |
| 3038 summary->AddTemp(Location::RequiresRegister()); | 3075 summary->AddTemp(Location::RequiresRegister()); |
| 3039 summary->AddTemp(Location::RequiresFpuRegister()); | 3076 summary->AddTemp(Location::RequiresFpuRegister()); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3380 UNREACHABLE(); | 3417 UNREACHABLE(); |
| 3381 break; | 3418 break; |
| 3382 } | 3419 } |
| 3383 default: | 3420 default: |
| 3384 UNREACHABLE(); | 3421 UNREACHABLE(); |
| 3385 break; | 3422 break; |
| 3386 } | 3423 } |
| 3387 } | 3424 } |
| 3388 | 3425 |
| 3389 | 3426 |
| 3390 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(bool opt) const { | 3427 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, |
| 3428 bool opt) const { | |
| 3391 intptr_t left_cid = left()->Type()->ToCid(); | 3429 intptr_t left_cid = left()->Type()->ToCid(); |
| 3392 intptr_t right_cid = right()->Type()->ToCid(); | 3430 intptr_t right_cid = right()->Type()->ToCid(); |
| 3393 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); | 3431 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
| 3394 const intptr_t kNumInputs = 2; | 3432 const intptr_t kNumInputs = 2; |
| 3395 const intptr_t kNumTemps = 0; | 3433 const intptr_t kNumTemps = 0; |
| 3396 LocationSummary* summary = | 3434 LocationSummary* summary = new(isolate) LocationSummary( |
| 3397 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3435 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3398 summary->set_in(0, Location::RequiresRegister()); | 3436 summary->set_in(0, Location::RequiresRegister()); |
| 3399 summary->set_in(1, Location::RequiresRegister()); | 3437 summary->set_in(1, Location::RequiresRegister()); |
| 3400 return summary; | 3438 return summary; |
| 3401 } | 3439 } |
| 3402 | 3440 |
| 3403 | 3441 |
| 3404 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3442 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3405 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3443 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
| 3406 ICData::kDeoptBinaryDoubleOp); | 3444 ICData::kDeoptBinaryDoubleOp); |
| 3407 intptr_t left_cid = left()->Type()->ToCid(); | 3445 intptr_t left_cid = left()->Type()->ToCid(); |
| 3408 intptr_t right_cid = right()->Type()->ToCid(); | 3446 intptr_t right_cid = right()->Type()->ToCid(); |
| 3409 const Register left = locs()->in(0).reg(); | 3447 const Register left = locs()->in(0).reg(); |
| 3410 const Register right = locs()->in(1).reg(); | 3448 const Register right = locs()->in(1).reg(); |
| 3411 if (this->left()->definition() == this->right()->definition()) { | 3449 if (this->left()->definition() == this->right()->definition()) { |
| 3412 __ tst(left, ShifterOperand(kSmiTagMask)); | 3450 __ tst(left, ShifterOperand(kSmiTagMask)); |
| 3413 } else if (left_cid == kSmiCid) { | 3451 } else if (left_cid == kSmiCid) { |
| 3414 __ tst(right, ShifterOperand(kSmiTagMask)); | 3452 __ tst(right, ShifterOperand(kSmiTagMask)); |
| 3415 } else if (right_cid == kSmiCid) { | 3453 } else if (right_cid == kSmiCid) { |
| 3416 __ tst(left, ShifterOperand(kSmiTagMask)); | 3454 __ tst(left, ShifterOperand(kSmiTagMask)); |
| 3417 } else { | 3455 } else { |
| 3418 __ orr(IP, left, ShifterOperand(right)); | 3456 __ orr(IP, left, ShifterOperand(right)); |
| 3419 __ tst(IP, ShifterOperand(kSmiTagMask)); | 3457 __ tst(IP, ShifterOperand(kSmiTagMask)); |
| 3420 } | 3458 } |
| 3421 __ b(deopt, EQ); | 3459 __ b(deopt, EQ); |
| 3422 } | 3460 } |
| 3423 | 3461 |
| 3424 | 3462 |
| 3425 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { | 3463 LocationSummary* BoxDoubleInstr::MakeLocationSummary(Isolate* isolate, |
| 3464 bool opt) const { | |
| 3426 const intptr_t kNumInputs = 1; | 3465 const intptr_t kNumInputs = 1; |
| 3427 const intptr_t kNumTemps = 1; | 3466 const intptr_t kNumTemps = 1; |
| 3428 LocationSummary* summary = | 3467 LocationSummary* summary = new(isolate) LocationSummary( |
| 3429 new LocationSummary(kNumInputs, | 3468 isolate, kNumInputs, |
| 3430 kNumTemps, | 3469 kNumTemps, |
| 3431 LocationSummary::kCallOnSlowPath); | 3470 LocationSummary::kCallOnSlowPath); |
| 3432 summary->set_in(0, Location::RequiresFpuRegister()); | 3471 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3433 summary->set_temp(0, Location::RequiresRegister()); | 3472 summary->set_temp(0, Location::RequiresRegister()); |
| 3434 summary->set_out(0, Location::RequiresRegister()); | 3473 summary->set_out(0, Location::RequiresRegister()); |
| 3435 return summary; | 3474 return summary; |
| 3436 } | 3475 } |
| 3437 | 3476 |
| 3438 | 3477 |
| 3439 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3478 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3440 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 3479 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
| 3441 compiler->AddSlowPathCode(slow_path); | 3480 compiler->AddSlowPathCode(slow_path); |
| 3442 | 3481 |
| 3443 const Register out_reg = locs()->out(0).reg(); | 3482 const Register out_reg = locs()->out(0).reg(); |
| 3444 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 3483 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 3445 | 3484 |
| 3446 __ TryAllocate(compiler->double_class(), | 3485 __ TryAllocate(compiler->double_class(), |
| 3447 slow_path->entry_label(), | 3486 slow_path->entry_label(), |
| 3448 out_reg, | 3487 out_reg, |
| 3449 locs()->temp(0).reg()); | 3488 locs()->temp(0).reg()); |
| 3450 __ Bind(slow_path->exit_label()); | 3489 __ Bind(slow_path->exit_label()); |
| 3451 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 3490 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
| 3452 } | 3491 } |
| 3453 | 3492 |
| 3454 | 3493 |
| 3455 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { | 3494 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(Isolate* isolate, |
| 3495 bool opt) const { | |
| 3456 const intptr_t kNumInputs = 1; | 3496 const intptr_t kNumInputs = 1; |
| 3457 const intptr_t value_cid = value()->Type()->ToCid(); | 3497 const intptr_t value_cid = value()->Type()->ToCid(); |
| 3458 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 3498 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
| 3459 const bool needs_writable_input = (value_cid == kSmiCid); | 3499 const bool needs_writable_input = (value_cid == kSmiCid); |
| 3460 const intptr_t kNumTemps = needs_temp ? 1 : 0; | 3500 const intptr_t kNumTemps = needs_temp ? 1 : 0; |
| 3461 LocationSummary* summary = | 3501 LocationSummary* summary = new(isolate) LocationSummary( |
| 3462 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3502 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3463 summary->set_in(0, needs_writable_input | 3503 summary->set_in(0, needs_writable_input |
| 3464 ? Location::WritableRegister() | 3504 ? Location::WritableRegister() |
| 3465 : Location::RequiresRegister()); | 3505 : Location::RequiresRegister()); |
| 3466 if (needs_temp) summary->set_temp(0, Location::RequiresRegister()); | 3506 if (needs_temp) summary->set_temp(0, Location::RequiresRegister()); |
| 3467 summary->set_out(0, Location::RequiresFpuRegister()); | 3507 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3468 return summary; | 3508 return summary; |
| 3469 } | 3509 } |
| 3470 | 3510 |
| 3471 | 3511 |
| 3472 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3512 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3505 // TODO(regis): Why do we preserve value here but not above? | 3545 // TODO(regis): Why do we preserve value here but not above? |
| 3506 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. | 3546 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. |
| 3507 __ vmovsr(STMP, IP); | 3547 __ vmovsr(STMP, IP); |
| 3508 __ vcvtdi(result, STMP); | 3548 __ vcvtdi(result, STMP); |
| 3509 __ Bind(&done); | 3549 __ Bind(&done); |
| 3510 } | 3550 } |
| 3511 } | 3551 } |
| 3512 } | 3552 } |
| 3513 | 3553 |
| 3514 | 3554 |
| 3515 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 3555 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(Isolate* isolate, |
| 3556 bool opt) const { | |
| 3516 const intptr_t kNumInputs = 1; | 3557 const intptr_t kNumInputs = 1; |
| 3517 const intptr_t kNumTemps = 1; | 3558 const intptr_t kNumTemps = 1; |
| 3518 LocationSummary* summary = | 3559 LocationSummary* summary = new(isolate) LocationSummary( |
| 3519 new LocationSummary(kNumInputs, | 3560 isolate, kNumInputs, |
| 3520 kNumTemps, | 3561 kNumTemps, |
| 3521 LocationSummary::kCallOnSlowPath); | 3562 LocationSummary::kCallOnSlowPath); |
| 3522 summary->set_in(0, Location::RequiresFpuRegister()); | 3563 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3523 summary->set_temp(0, Location::RequiresRegister()); | 3564 summary->set_temp(0, Location::RequiresRegister()); |
| 3524 summary->set_out(0, Location::RequiresRegister()); | 3565 summary->set_out(0, Location::RequiresRegister()); |
| 3525 return summary; | 3566 return summary; |
| 3526 } | 3567 } |
| 3527 | 3568 |
| 3528 | 3569 |
| 3529 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3570 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3530 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 3571 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
| 3531 compiler->AddSlowPathCode(slow_path); | 3572 compiler->AddSlowPathCode(slow_path); |
| 3532 | 3573 |
| 3533 const Register out_reg = locs()->out(0).reg(); | 3574 const Register out_reg = locs()->out(0).reg(); |
| 3534 const QRegister value = locs()->in(0).fpu_reg(); | 3575 const QRegister value = locs()->in(0).fpu_reg(); |
| 3535 const DRegister dvalue0 = EvenDRegisterOf(value); | 3576 const DRegister dvalue0 = EvenDRegisterOf(value); |
| 3536 | 3577 |
| 3537 __ TryAllocate(compiler->float32x4_class(), | 3578 __ TryAllocate(compiler->float32x4_class(), |
| 3538 slow_path->entry_label(), | 3579 slow_path->entry_label(), |
| 3539 out_reg, | 3580 out_reg, |
| 3540 locs()->temp(0).reg()); | 3581 locs()->temp(0).reg()); |
| 3541 __ Bind(slow_path->exit_label()); | 3582 __ Bind(slow_path->exit_label()); |
| 3542 | 3583 |
| 3543 __ StoreMultipleDToOffset(dvalue0, 2, out_reg, | 3584 __ StoreMultipleDToOffset(dvalue0, 2, out_reg, |
| 3544 Float32x4::value_offset() - kHeapObjectTag); | 3585 Float32x4::value_offset() - kHeapObjectTag); |
| 3545 } | 3586 } |
| 3546 | 3587 |
| 3547 | 3588 |
| 3548 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 3589 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(Isolate* isolate, |
| 3590 bool opt) const { | |
| 3549 const intptr_t value_cid = value()->Type()->ToCid(); | 3591 const intptr_t value_cid = value()->Type()->ToCid(); |
| 3550 const intptr_t kNumInputs = 1; | 3592 const intptr_t kNumInputs = 1; |
| 3551 const intptr_t kNumTemps = value_cid == kFloat32x4Cid ? 0 : 1; | 3593 const intptr_t kNumTemps = value_cid == kFloat32x4Cid ? 0 : 1; |
| 3552 LocationSummary* summary = | 3594 LocationSummary* summary = new(isolate) LocationSummary( |
| 3553 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3595 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3554 summary->set_in(0, Location::RequiresRegister()); | 3596 summary->set_in(0, Location::RequiresRegister()); |
| 3555 if (kNumTemps > 0) { | 3597 if (kNumTemps > 0) { |
| 3556 ASSERT(kNumTemps == 1); | 3598 ASSERT(kNumTemps == 1); |
| 3557 summary->set_temp(0, Location::RequiresRegister()); | 3599 summary->set_temp(0, Location::RequiresRegister()); |
| 3558 } | 3600 } |
| 3559 summary->set_out(0, Location::RequiresFpuRegister()); | 3601 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3560 return summary; | 3602 return summary; |
| 3561 } | 3603 } |
| 3562 | 3604 |
| 3563 | 3605 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 3574 __ CompareClassId(value, kFloat32x4Cid, temp); | 3616 __ CompareClassId(value, kFloat32x4Cid, temp); |
| 3575 __ b(deopt, NE); | 3617 __ b(deopt, NE); |
| 3576 } | 3618 } |
| 3577 | 3619 |
| 3578 const DRegister dresult0 = EvenDRegisterOf(result); | 3620 const DRegister dresult0 = EvenDRegisterOf(result); |
| 3579 __ LoadMultipleDFromOffset(dresult0, 2, value, | 3621 __ LoadMultipleDFromOffset(dresult0, 2, value, |
| 3580 Float32x4::value_offset() - kHeapObjectTag); | 3622 Float32x4::value_offset() - kHeapObjectTag); |
| 3581 } | 3623 } |
| 3582 | 3624 |
| 3583 | 3625 |
| 3584 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(bool opt) const { | 3626 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(Isolate* isolate, |
| 3627 bool opt) const { | |
| 3585 const intptr_t kNumInputs = 1; | 3628 const intptr_t kNumInputs = 1; |
| 3586 const intptr_t kNumTemps = 1; | 3629 const intptr_t kNumTemps = 1; |
| 3587 LocationSummary* summary = | 3630 LocationSummary* summary = new(isolate) LocationSummary( |
| 3588 new LocationSummary(kNumInputs, | 3631 isolate, kNumInputs, |
| 3589 kNumTemps, | 3632 kNumTemps, |
| 3590 LocationSummary::kCallOnSlowPath); | 3633 LocationSummary::kCallOnSlowPath); |
| 3591 summary->set_in(0, Location::RequiresFpuRegister()); | 3634 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3592 summary->set_temp(0, Location::RequiresRegister()); | 3635 summary->set_temp(0, Location::RequiresRegister()); |
| 3593 summary->set_out(0, Location::RequiresRegister()); | 3636 summary->set_out(0, Location::RequiresRegister()); |
| 3594 return summary; | 3637 return summary; |
| 3595 } | 3638 } |
| 3596 | 3639 |
| 3597 | 3640 |
| 3598 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3641 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3599 BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this); | 3642 BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this); |
| 3600 compiler->AddSlowPathCode(slow_path); | 3643 compiler->AddSlowPathCode(slow_path); |
| 3601 | 3644 |
| 3602 const Register out_reg = locs()->out(0).reg(); | 3645 const Register out_reg = locs()->out(0).reg(); |
| 3603 const QRegister value = locs()->in(0).fpu_reg(); | 3646 const QRegister value = locs()->in(0).fpu_reg(); |
| 3604 const DRegister dvalue0 = EvenDRegisterOf(value); | 3647 const DRegister dvalue0 = EvenDRegisterOf(value); |
| 3605 | 3648 |
| 3606 __ TryAllocate(compiler->float64x2_class(), | 3649 __ TryAllocate(compiler->float64x2_class(), |
| 3607 slow_path->entry_label(), | 3650 slow_path->entry_label(), |
| 3608 out_reg, | 3651 out_reg, |
| 3609 locs()->temp(0).reg()); | 3652 locs()->temp(0).reg()); |
| 3610 __ Bind(slow_path->exit_label()); | 3653 __ Bind(slow_path->exit_label()); |
| 3611 | 3654 |
| 3612 __ StoreMultipleDToOffset(dvalue0, 2, out_reg, | 3655 __ StoreMultipleDToOffset(dvalue0, 2, out_reg, |
| 3613 Float64x2::value_offset() - kHeapObjectTag); | 3656 Float64x2::value_offset() - kHeapObjectTag); |
| 3614 } | 3657 } |
| 3615 | 3658 |
| 3616 | 3659 |
| 3617 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(bool opt) const { | 3660 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(Isolate* isolate, |
| 3661 bool opt) const { | |
| 3618 const intptr_t value_cid = value()->Type()->ToCid(); | 3662 const intptr_t value_cid = value()->Type()->ToCid(); |
| 3619 const intptr_t kNumInputs = 1; | 3663 const intptr_t kNumInputs = 1; |
| 3620 const intptr_t kNumTemps = value_cid == kFloat64x2Cid ? 0 : 1; | 3664 const intptr_t kNumTemps = value_cid == kFloat64x2Cid ? 0 : 1; |
| 3621 LocationSummary* summary = | 3665 LocationSummary* summary = new(isolate) LocationSummary( |
| 3622 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3666 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3623 summary->set_in(0, Location::RequiresRegister()); | 3667 summary->set_in(0, Location::RequiresRegister()); |
| 3624 if (kNumTemps > 0) { | 3668 if (kNumTemps > 0) { |
| 3625 ASSERT(kNumTemps == 1); | 3669 ASSERT(kNumTemps == 1); |
| 3626 summary->set_temp(0, Location::RequiresRegister()); | 3670 summary->set_temp(0, Location::RequiresRegister()); |
| 3627 } | 3671 } |
| 3628 summary->set_out(0, Location::RequiresFpuRegister()); | 3672 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3629 return summary; | 3673 return summary; |
| 3630 } | 3674 } |
| 3631 | 3675 |
| 3632 | 3676 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 3643 __ CompareClassId(value, kFloat64x2Cid, temp); | 3687 __ CompareClassId(value, kFloat64x2Cid, temp); |
| 3644 __ b(deopt, NE); | 3688 __ b(deopt, NE); |
| 3645 } | 3689 } |
| 3646 | 3690 |
| 3647 const DRegister dresult0 = EvenDRegisterOf(result); | 3691 const DRegister dresult0 = EvenDRegisterOf(result); |
| 3648 __ LoadMultipleDFromOffset(dresult0, 2, value, | 3692 __ LoadMultipleDFromOffset(dresult0, 2, value, |
| 3649 Float64x2::value_offset() - kHeapObjectTag); | 3693 Float64x2::value_offset() - kHeapObjectTag); |
| 3650 } | 3694 } |
| 3651 | 3695 |
| 3652 | 3696 |
| 3653 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3697 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(Isolate* isolate, |
| 3698 bool opt) const { | |
| 3654 const intptr_t kNumInputs = 1; | 3699 const intptr_t kNumInputs = 1; |
| 3655 const intptr_t kNumTemps = 1; | 3700 const intptr_t kNumTemps = 1; |
| 3656 LocationSummary* summary = | 3701 LocationSummary* summary = new(isolate) LocationSummary( |
| 3657 new LocationSummary(kNumInputs, | 3702 isolate, kNumInputs, |
| 3658 kNumTemps, | 3703 kNumTemps, |
| 3659 LocationSummary::kCallOnSlowPath); | 3704 LocationSummary::kCallOnSlowPath); |
| 3660 summary->set_in(0, Location::RequiresFpuRegister()); | 3705 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3661 summary->set_temp(0, Location::RequiresRegister()); | 3706 summary->set_temp(0, Location::RequiresRegister()); |
| 3662 summary->set_out(0, Location::RequiresRegister()); | 3707 summary->set_out(0, Location::RequiresRegister()); |
| 3663 return summary; | 3708 return summary; |
| 3664 } | 3709 } |
| 3665 | 3710 |
| 3666 | 3711 |
| 3667 class BoxInt32x4SlowPath : public SlowPathCode { | 3712 class BoxInt32x4SlowPath : public SlowPathCode { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3707 __ TryAllocate(compiler->int32x4_class(), | 3752 __ TryAllocate(compiler->int32x4_class(), |
| 3708 slow_path->entry_label(), | 3753 slow_path->entry_label(), |
| 3709 out_reg, | 3754 out_reg, |
| 3710 locs()->temp(0).reg()); | 3755 locs()->temp(0).reg()); |
| 3711 __ Bind(slow_path->exit_label()); | 3756 __ Bind(slow_path->exit_label()); |
| 3712 __ StoreMultipleDToOffset(dvalue0, 2, out_reg, | 3757 __ StoreMultipleDToOffset(dvalue0, 2, out_reg, |
| 3713 Int32x4::value_offset() - kHeapObjectTag); | 3758 Int32x4::value_offset() - kHeapObjectTag); |
| 3714 } | 3759 } |
| 3715 | 3760 |
| 3716 | 3761 |
| 3717 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3762 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(Isolate* isolate, |
| 3763 bool opt) const { | |
| 3718 const intptr_t value_cid = value()->Type()->ToCid(); | 3764 const intptr_t value_cid = value()->Type()->ToCid(); |
| 3719 const intptr_t kNumInputs = 1; | 3765 const intptr_t kNumInputs = 1; |
| 3720 const intptr_t kNumTemps = value_cid == kInt32x4Cid ? 0 : 1; | 3766 const intptr_t kNumTemps = value_cid == kInt32x4Cid ? 0 : 1; |
| 3721 LocationSummary* summary = | 3767 LocationSummary* summary = new(isolate) LocationSummary( |
| 3722 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3768 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3723 summary->set_in(0, Location::RequiresRegister()); | 3769 summary->set_in(0, Location::RequiresRegister()); |
| 3724 if (kNumTemps > 0) { | 3770 if (kNumTemps > 0) { |
| 3725 ASSERT(kNumTemps == 1); | 3771 ASSERT(kNumTemps == 1); |
| 3726 summary->set_temp(0, Location::RequiresRegister()); | 3772 summary->set_temp(0, Location::RequiresRegister()); |
| 3727 } | 3773 } |
| 3728 summary->set_out(0, Location::RequiresFpuRegister()); | 3774 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3729 return summary; | 3775 return summary; |
| 3730 } | 3776 } |
| 3731 | 3777 |
| 3732 | 3778 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 3743 __ CompareClassId(value, kInt32x4Cid, temp); | 3789 __ CompareClassId(value, kInt32x4Cid, temp); |
| 3744 __ b(deopt, NE); | 3790 __ b(deopt, NE); |
| 3745 } | 3791 } |
| 3746 | 3792 |
| 3747 const DRegister dresult0 = EvenDRegisterOf(result); | 3793 const DRegister dresult0 = EvenDRegisterOf(result); |
| 3748 __ LoadMultipleDFromOffset(dresult0, 2, value, | 3794 __ LoadMultipleDFromOffset(dresult0, 2, value, |
| 3749 Int32x4::value_offset() - kHeapObjectTag); | 3795 Int32x4::value_offset() - kHeapObjectTag); |
| 3750 } | 3796 } |
| 3751 | 3797 |
| 3752 | 3798 |
| 3753 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(bool opt) const { | 3799 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, |
| 3800 bool opt) const { | |
| 3754 const intptr_t kNumInputs = 2; | 3801 const intptr_t kNumInputs = 2; |
| 3755 const intptr_t kNumTemps = 0; | 3802 const intptr_t kNumTemps = 0; |
| 3756 LocationSummary* summary = | 3803 LocationSummary* summary = new(isolate) LocationSummary( |
| 3757 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3804 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3758 summary->set_in(0, Location::RequiresFpuRegister()); | 3805 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3759 summary->set_in(1, Location::RequiresFpuRegister()); | 3806 summary->set_in(1, Location::RequiresFpuRegister()); |
| 3760 summary->set_out(0, Location::RequiresFpuRegister()); | 3807 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3761 return summary; | 3808 return summary; |
| 3762 } | 3809 } |
| 3763 | 3810 |
| 3764 | 3811 |
| 3765 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3812 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3766 const DRegister left = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 3813 const DRegister left = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 3767 const DRegister right = EvenDRegisterOf(locs()->in(1).fpu_reg()); | 3814 const DRegister right = EvenDRegisterOf(locs()->in(1).fpu_reg()); |
| 3768 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 3815 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
| 3769 switch (op_kind()) { | 3816 switch (op_kind()) { |
| 3770 case Token::kADD: __ vaddd(result, left, right); break; | 3817 case Token::kADD: __ vaddd(result, left, right); break; |
| 3771 case Token::kSUB: __ vsubd(result, left, right); break; | 3818 case Token::kSUB: __ vsubd(result, left, right); break; |
| 3772 case Token::kMUL: __ vmuld(result, left, right); break; | 3819 case Token::kMUL: __ vmuld(result, left, right); break; |
| 3773 case Token::kDIV: __ vdivd(result, left, right); break; | 3820 case Token::kDIV: __ vdivd(result, left, right); break; |
| 3774 default: UNREACHABLE(); | 3821 default: UNREACHABLE(); |
| 3775 } | 3822 } |
| 3776 } | 3823 } |
| 3777 | 3824 |
| 3778 | 3825 |
| 3779 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(bool opt) const { | 3826 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Isolate* isolate, |
| 3827 bool opt) const { | |
| 3780 const intptr_t kNumInputs = 2; | 3828 const intptr_t kNumInputs = 2; |
| 3781 const intptr_t kNumTemps = 0; | 3829 const intptr_t kNumTemps = 0; |
| 3782 LocationSummary* summary = | 3830 LocationSummary* summary = new(isolate) LocationSummary( |
| 3783 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3831 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3784 summary->set_in(0, Location::RequiresFpuRegister()); | 3832 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3785 summary->set_in(1, Location::RequiresFpuRegister()); | 3833 summary->set_in(1, Location::RequiresFpuRegister()); |
| 3786 summary->set_out(0, Location::RequiresFpuRegister()); | 3834 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3787 return summary; | 3835 return summary; |
| 3788 } | 3836 } |
| 3789 | 3837 |
| 3790 | 3838 |
| 3791 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3839 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3792 const QRegister left = locs()->in(0).fpu_reg(); | 3840 const QRegister left = locs()->in(0).fpu_reg(); |
| 3793 const QRegister right = locs()->in(1).fpu_reg(); | 3841 const QRegister right = locs()->in(1).fpu_reg(); |
| 3794 const QRegister result = locs()->out(0).fpu_reg(); | 3842 const QRegister result = locs()->out(0).fpu_reg(); |
| 3795 | 3843 |
| 3796 switch (op_kind()) { | 3844 switch (op_kind()) { |
| 3797 case Token::kADD: __ vaddqs(result, left, right); break; | 3845 case Token::kADD: __ vaddqs(result, left, right); break; |
| 3798 case Token::kSUB: __ vsubqs(result, left, right); break; | 3846 case Token::kSUB: __ vsubqs(result, left, right); break; |
| 3799 case Token::kMUL: __ vmulqs(result, left, right); break; | 3847 case Token::kMUL: __ vmulqs(result, left, right); break; |
| 3800 case Token::kDIV: __ Vdivqs(result, left, right); break; | 3848 case Token::kDIV: __ Vdivqs(result, left, right); break; |
| 3801 default: UNREACHABLE(); | 3849 default: UNREACHABLE(); |
| 3802 } | 3850 } |
| 3803 } | 3851 } |
| 3804 | 3852 |
| 3805 | 3853 |
| 3806 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(bool opt) const { | 3854 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Isolate* isolate, |
| 3855 bool opt) const { | |
| 3807 const intptr_t kNumInputs = 2; | 3856 const intptr_t kNumInputs = 2; |
| 3808 const intptr_t kNumTemps = 0; | 3857 const intptr_t kNumTemps = 0; |
| 3809 LocationSummary* summary = | 3858 LocationSummary* summary = new(isolate) LocationSummary( |
| 3810 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3859 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3811 summary->set_in(0, Location::RequiresFpuRegister()); | 3860 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3812 summary->set_in(1, Location::RequiresFpuRegister()); | 3861 summary->set_in(1, Location::RequiresFpuRegister()); |
| 3813 summary->set_out(0, Location::RequiresFpuRegister()); | 3862 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3814 return summary; | 3863 return summary; |
| 3815 } | 3864 } |
| 3816 | 3865 |
| 3817 | 3866 |
| 3818 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3867 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3819 const QRegister left = locs()->in(0).fpu_reg(); | 3868 const QRegister left = locs()->in(0).fpu_reg(); |
| 3820 const QRegister right = locs()->in(1).fpu_reg(); | 3869 const QRegister right = locs()->in(1).fpu_reg(); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 3844 break; | 3893 break; |
| 3845 case Token::kDIV: | 3894 case Token::kDIV: |
| 3846 __ vdivd(result0, left0, right0); | 3895 __ vdivd(result0, left0, right0); |
| 3847 __ vdivd(result1, left1, right1); | 3896 __ vdivd(result1, left1, right1); |
| 3848 break; | 3897 break; |
| 3849 default: UNREACHABLE(); | 3898 default: UNREACHABLE(); |
| 3850 } | 3899 } |
| 3851 } | 3900 } |
| 3852 | 3901 |
| 3853 | 3902 |
| 3854 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(bool opt) const { | 3903 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Isolate* isolate, |
| 3904 bool opt) const { | |
| 3855 const intptr_t kNumInputs = 1; | 3905 const intptr_t kNumInputs = 1; |
| 3856 const intptr_t kNumTemps = 0; | 3906 const intptr_t kNumTemps = 0; |
| 3857 LocationSummary* summary = | 3907 LocationSummary* summary = new(isolate) LocationSummary( |
| 3858 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3908 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3859 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. | 3909 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. |
| 3860 summary->set_in(0, Location::FpuRegisterLocation(Q5)); | 3910 summary->set_in(0, Location::FpuRegisterLocation(Q5)); |
| 3861 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 3911 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 3862 return summary; | 3912 return summary; |
| 3863 } | 3913 } |
| 3864 | 3914 |
| 3865 | 3915 |
| 3866 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3916 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3867 const QRegister value = locs()->in(0).fpu_reg(); | 3917 const QRegister value = locs()->in(0).fpu_reg(); |
| 3868 const QRegister result = locs()->out(0).fpu_reg(); | 3918 const QRegister result = locs()->out(0).fpu_reg(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3924 __ vmovs(sresult1, svalues[(mask_ >> 2) & 0x3]); | 3974 __ vmovs(sresult1, svalues[(mask_ >> 2) & 0x3]); |
| 3925 __ vmovs(sresult2, svalues[(mask_ >> 4) & 0x3]); | 3975 __ vmovs(sresult2, svalues[(mask_ >> 4) & 0x3]); |
| 3926 __ vmovs(sresult3, svalues[(mask_ >> 6) & 0x3]); | 3976 __ vmovs(sresult3, svalues[(mask_ >> 6) & 0x3]); |
| 3927 } | 3977 } |
| 3928 break; | 3978 break; |
| 3929 default: UNREACHABLE(); | 3979 default: UNREACHABLE(); |
| 3930 } | 3980 } |
| 3931 } | 3981 } |
| 3932 | 3982 |
| 3933 | 3983 |
| 3934 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(bool opt) const { | 3984 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Isolate* isolate, |
| 3985 bool opt) const { | |
| 3935 const intptr_t kNumInputs = 2; | 3986 const intptr_t kNumInputs = 2; |
| 3936 const intptr_t kNumTemps = 0; | 3987 const intptr_t kNumTemps = 0; |
| 3937 LocationSummary* summary = | 3988 LocationSummary* summary = new(isolate) LocationSummary( |
| 3938 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3989 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3939 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. | 3990 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. |
| 3940 summary->set_in(0, Location::FpuRegisterLocation(Q4)); | 3991 summary->set_in(0, Location::FpuRegisterLocation(Q4)); |
| 3941 summary->set_in(1, Location::FpuRegisterLocation(Q5)); | 3992 summary->set_in(1, Location::FpuRegisterLocation(Q5)); |
| 3942 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 3993 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 3943 return summary; | 3994 return summary; |
| 3944 } | 3995 } |
| 3945 | 3996 |
| 3946 | 3997 |
| 3947 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3998 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3948 const QRegister left = locs()->in(0).fpu_reg(); | 3999 const QRegister left = locs()->in(0).fpu_reg(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3980 __ vmovs(sresult0, left_svalues[mask_ & 0x3]); | 4031 __ vmovs(sresult0, left_svalues[mask_ & 0x3]); |
| 3981 __ vmovs(sresult1, left_svalues[(mask_ >> 2) & 0x3]); | 4032 __ vmovs(sresult1, left_svalues[(mask_ >> 2) & 0x3]); |
| 3982 __ vmovs(sresult2, right_svalues[(mask_ >> 4) & 0x3]); | 4033 __ vmovs(sresult2, right_svalues[(mask_ >> 4) & 0x3]); |
| 3983 __ vmovs(sresult3, right_svalues[(mask_ >> 6) & 0x3]); | 4034 __ vmovs(sresult3, right_svalues[(mask_ >> 6) & 0x3]); |
| 3984 break; | 4035 break; |
| 3985 default: UNREACHABLE(); | 4036 default: UNREACHABLE(); |
| 3986 } | 4037 } |
| 3987 } | 4038 } |
| 3988 | 4039 |
| 3989 | 4040 |
| 3990 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(bool opt) const { | 4041 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Isolate* isolate, |
| 4042 bool opt) const { | |
| 3991 const intptr_t kNumInputs = 1; | 4043 const intptr_t kNumInputs = 1; |
| 3992 const intptr_t kNumTemps = 1; | 4044 const intptr_t kNumTemps = 1; |
| 3993 LocationSummary* summary = | 4045 LocationSummary* summary = new(isolate) LocationSummary( |
| 3994 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4046 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3995 summary->set_in(0, Location::FpuRegisterLocation(Q5)); | 4047 summary->set_in(0, Location::FpuRegisterLocation(Q5)); |
| 3996 summary->set_temp(0, Location::RequiresRegister()); | 4048 summary->set_temp(0, Location::RequiresRegister()); |
| 3997 summary->set_out(0, Location::RequiresRegister()); | 4049 summary->set_out(0, Location::RequiresRegister()); |
| 3998 return summary; | 4050 return summary; |
| 3999 } | 4051 } |
| 4000 | 4052 |
| 4001 | 4053 |
| 4002 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4054 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4003 const QRegister value = locs()->in(0).fpu_reg(); | 4055 const QRegister value = locs()->in(0).fpu_reg(); |
| 4004 const DRegister dvalue0 = EvenDRegisterOf(value); | 4056 const DRegister dvalue0 = EvenDRegisterOf(value); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 4021 // W lane. | 4073 // W lane. |
| 4022 __ vmovrs(temp, OddSRegisterOf(dvalue1)); | 4074 __ vmovrs(temp, OddSRegisterOf(dvalue1)); |
| 4023 __ Lsr(temp, temp, 31); | 4075 __ Lsr(temp, temp, 31); |
| 4024 __ orr(out, out, ShifterOperand(temp, LSL, 3)); | 4076 __ orr(out, out, ShifterOperand(temp, LSL, 3)); |
| 4025 // Tag. | 4077 // Tag. |
| 4026 __ SmiTag(out); | 4078 __ SmiTag(out); |
| 4027 } | 4079 } |
| 4028 | 4080 |
| 4029 | 4081 |
| 4030 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( | 4082 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( |
| 4031 bool opt) const { | 4083 Isolate* isolate, bool opt) const { |
| 4032 const intptr_t kNumInputs = 4; | 4084 const intptr_t kNumInputs = 4; |
| 4033 const intptr_t kNumTemps = 0; | 4085 const intptr_t kNumTemps = 0; |
| 4034 LocationSummary* summary = | 4086 LocationSummary* summary = new(isolate) LocationSummary( |
| 4035 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4087 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4036 summary->set_in(0, Location::RequiresFpuRegister()); | 4088 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4037 summary->set_in(1, Location::RequiresFpuRegister()); | 4089 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4038 summary->set_in(2, Location::RequiresFpuRegister()); | 4090 summary->set_in(2, Location::RequiresFpuRegister()); |
| 4039 summary->set_in(3, Location::RequiresFpuRegister()); | 4091 summary->set_in(3, Location::RequiresFpuRegister()); |
| 4040 // Low (< 7) Q registers are needed for the vcvtsd instruction. | 4092 // Low (< 7) Q registers are needed for the vcvtsd instruction. |
| 4041 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4093 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 4042 return summary; | 4094 return summary; |
| 4043 } | 4095 } |
| 4044 | 4096 |
| 4045 | 4097 |
| 4046 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4098 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4047 const QRegister q0 = locs()->in(0).fpu_reg(); | 4099 const QRegister q0 = locs()->in(0).fpu_reg(); |
| 4048 const QRegister q1 = locs()->in(1).fpu_reg(); | 4100 const QRegister q1 = locs()->in(1).fpu_reg(); |
| 4049 const QRegister q2 = locs()->in(2).fpu_reg(); | 4101 const QRegister q2 = locs()->in(2).fpu_reg(); |
| 4050 const QRegister q3 = locs()->in(3).fpu_reg(); | 4102 const QRegister q3 = locs()->in(3).fpu_reg(); |
| 4051 const QRegister r = locs()->out(0).fpu_reg(); | 4103 const QRegister r = locs()->out(0).fpu_reg(); |
| 4052 | 4104 |
| 4053 const DRegister dr0 = EvenDRegisterOf(r); | 4105 const DRegister dr0 = EvenDRegisterOf(r); |
| 4054 const DRegister dr1 = OddDRegisterOf(r); | 4106 const DRegister dr1 = OddDRegisterOf(r); |
| 4055 | 4107 |
| 4056 __ vcvtsd(EvenSRegisterOf(dr0), EvenDRegisterOf(q0)); | 4108 __ vcvtsd(EvenSRegisterOf(dr0), EvenDRegisterOf(q0)); |
| 4057 __ vcvtsd(OddSRegisterOf(dr0), EvenDRegisterOf(q1)); | 4109 __ vcvtsd(OddSRegisterOf(dr0), EvenDRegisterOf(q1)); |
| 4058 __ vcvtsd(EvenSRegisterOf(dr1), EvenDRegisterOf(q2)); | 4110 __ vcvtsd(EvenSRegisterOf(dr1), EvenDRegisterOf(q2)); |
| 4059 __ vcvtsd(OddSRegisterOf(dr1), EvenDRegisterOf(q3)); | 4111 __ vcvtsd(OddSRegisterOf(dr1), EvenDRegisterOf(q3)); |
| 4060 } | 4112 } |
| 4061 | 4113 |
| 4062 | 4114 |
| 4063 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(bool opt) const { | 4115 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Isolate* isolate, |
| 4116 bool opt) const { | |
| 4064 const intptr_t kNumInputs = 0; | 4117 const intptr_t kNumInputs = 0; |
| 4065 const intptr_t kNumTemps = 0; | 4118 const intptr_t kNumTemps = 0; |
| 4066 LocationSummary* summary = | 4119 LocationSummary* summary = new(isolate) LocationSummary( |
| 4067 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4120 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4068 summary->set_out(0, Location::RequiresFpuRegister()); | 4121 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4069 return summary; | 4122 return summary; |
| 4070 } | 4123 } |
| 4071 | 4124 |
| 4072 | 4125 |
| 4073 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4126 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4074 const QRegister q = locs()->out(0).fpu_reg(); | 4127 const QRegister q = locs()->out(0).fpu_reg(); |
| 4075 __ veorq(q, q, q); | 4128 __ veorq(q, q, q); |
| 4076 } | 4129 } |
| 4077 | 4130 |
| 4078 | 4131 |
| 4079 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(bool opt) const { | 4132 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Isolate* isolate, |
| 4133 bool opt) const { | |
| 4080 const intptr_t kNumInputs = 1; | 4134 const intptr_t kNumInputs = 1; |
| 4081 const intptr_t kNumTemps = 0; | 4135 const intptr_t kNumTemps = 0; |
| 4082 LocationSummary* summary = | 4136 LocationSummary* summary = new(isolate) LocationSummary( |
| 4083 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4137 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4084 summary->set_in(0, Location::RequiresFpuRegister()); | 4138 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4085 summary->set_out(0, Location::RequiresFpuRegister()); | 4139 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4086 return summary; | 4140 return summary; |
| 4087 } | 4141 } |
| 4088 | 4142 |
| 4089 | 4143 |
| 4090 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4144 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4091 const QRegister value = locs()->in(0).fpu_reg(); | 4145 const QRegister value = locs()->in(0).fpu_reg(); |
| 4092 const QRegister result = locs()->out(0).fpu_reg(); | 4146 const QRegister result = locs()->out(0).fpu_reg(); |
| 4093 | 4147 |
| 4094 const DRegister dvalue0 = EvenDRegisterOf(value); | 4148 const DRegister dvalue0 = EvenDRegisterOf(value); |
| 4095 | 4149 |
| 4096 // Convert to Float32. | 4150 // Convert to Float32. |
| 4097 __ vcvtsd(STMP, dvalue0); | 4151 __ vcvtsd(STMP, dvalue0); |
| 4098 | 4152 |
| 4099 // Splat across all lanes. | 4153 // Splat across all lanes. |
| 4100 __ vdup(kWord, result, DTMP, 0); | 4154 __ vdup(kWord, result, DTMP, 0); |
| 4101 } | 4155 } |
| 4102 | 4156 |
| 4103 | 4157 |
| 4104 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(bool opt) const { | 4158 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Isolate* isolate, |
| 4159 bool opt) const { | |
| 4105 const intptr_t kNumInputs = 2; | 4160 const intptr_t kNumInputs = 2; |
| 4106 const intptr_t kNumTemps = 0; | 4161 const intptr_t kNumTemps = 0; |
| 4107 LocationSummary* summary = | 4162 LocationSummary* summary = new(isolate) LocationSummary( |
| 4108 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4163 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4109 summary->set_in(0, Location::RequiresFpuRegister()); | 4164 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4110 summary->set_in(1, Location::RequiresFpuRegister()); | 4165 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4111 summary->set_out(0, Location::RequiresFpuRegister()); | 4166 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4112 return summary; | 4167 return summary; |
| 4113 } | 4168 } |
| 4114 | 4169 |
| 4115 | 4170 |
| 4116 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4171 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4117 const QRegister left = locs()->in(0).fpu_reg(); | 4172 const QRegister left = locs()->in(0).fpu_reg(); |
| 4118 const QRegister right = locs()->in(1).fpu_reg(); | 4173 const QRegister right = locs()->in(1).fpu_reg(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 4138 break; | 4193 break; |
| 4139 case MethodRecognizer::kFloat32x4LessThanOrEqual: | 4194 case MethodRecognizer::kFloat32x4LessThanOrEqual: |
| 4140 __ vcgeqs(result, right, left); | 4195 __ vcgeqs(result, right, left); |
| 4141 break; | 4196 break; |
| 4142 | 4197 |
| 4143 default: UNREACHABLE(); | 4198 default: UNREACHABLE(); |
| 4144 } | 4199 } |
| 4145 } | 4200 } |
| 4146 | 4201 |
| 4147 | 4202 |
| 4148 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(bool opt) const { | 4203 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Isolate* isolate, |
| 4204 bool opt) const { | |
| 4149 const intptr_t kNumInputs = 2; | 4205 const intptr_t kNumInputs = 2; |
| 4150 const intptr_t kNumTemps = 0; | 4206 const intptr_t kNumTemps = 0; |
| 4151 LocationSummary* summary = | 4207 LocationSummary* summary = new(isolate) LocationSummary( |
| 4152 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4208 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4153 summary->set_in(0, Location::RequiresFpuRegister()); | 4209 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4154 summary->set_in(1, Location::RequiresFpuRegister()); | 4210 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4155 summary->set_out(0, Location::RequiresFpuRegister()); | 4211 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4156 return summary; | 4212 return summary; |
| 4157 } | 4213 } |
| 4158 | 4214 |
| 4159 | 4215 |
| 4160 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4216 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4161 const QRegister left = locs()->in(0).fpu_reg(); | 4217 const QRegister left = locs()->in(0).fpu_reg(); |
| 4162 const QRegister right = locs()->in(1).fpu_reg(); | 4218 const QRegister right = locs()->in(1).fpu_reg(); |
| 4163 const QRegister result = locs()->out(0).fpu_reg(); | 4219 const QRegister result = locs()->out(0).fpu_reg(); |
| 4164 | 4220 |
| 4165 switch (op_kind()) { | 4221 switch (op_kind()) { |
| 4166 case MethodRecognizer::kFloat32x4Min: | 4222 case MethodRecognizer::kFloat32x4Min: |
| 4167 __ vminqs(result, left, right); | 4223 __ vminqs(result, left, right); |
| 4168 break; | 4224 break; |
| 4169 case MethodRecognizer::kFloat32x4Max: | 4225 case MethodRecognizer::kFloat32x4Max: |
| 4170 __ vmaxqs(result, left, right); | 4226 __ vmaxqs(result, left, right); |
| 4171 break; | 4227 break; |
| 4172 default: UNREACHABLE(); | 4228 default: UNREACHABLE(); |
| 4173 } | 4229 } |
| 4174 } | 4230 } |
| 4175 | 4231 |
| 4176 | 4232 |
| 4177 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(bool opt) const { | 4233 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Isolate* isolate, |
| 4234 bool opt) const { | |
| 4178 const intptr_t kNumInputs = 1; | 4235 const intptr_t kNumInputs = 1; |
| 4179 const intptr_t kNumTemps = 1; | 4236 const intptr_t kNumTemps = 1; |
| 4180 LocationSummary* summary = | 4237 LocationSummary* summary = new(isolate) LocationSummary( |
| 4181 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4238 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4182 summary->set_in(0, Location::RequiresFpuRegister()); | 4239 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4183 summary->set_out(0, Location::RequiresFpuRegister()); | 4240 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4184 summary->set_temp(0, Location::RequiresFpuRegister()); | 4241 summary->set_temp(0, Location::RequiresFpuRegister()); |
| 4185 return summary; | 4242 return summary; |
| 4186 } | 4243 } |
| 4187 | 4244 |
| 4188 | 4245 |
| 4189 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4246 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4190 const QRegister left = locs()->in(0).fpu_reg(); | 4247 const QRegister left = locs()->in(0).fpu_reg(); |
| 4191 const QRegister result = locs()->out(0).fpu_reg(); | 4248 const QRegister result = locs()->out(0).fpu_reg(); |
| 4192 const QRegister temp = locs()->temp(0).fpu_reg(); | 4249 const QRegister temp = locs()->temp(0).fpu_reg(); |
| 4193 | 4250 |
| 4194 switch (op_kind()) { | 4251 switch (op_kind()) { |
| 4195 case MethodRecognizer::kFloat32x4Sqrt: | 4252 case MethodRecognizer::kFloat32x4Sqrt: |
| 4196 __ Vsqrtqs(result, left, temp); | 4253 __ Vsqrtqs(result, left, temp); |
| 4197 break; | 4254 break; |
| 4198 case MethodRecognizer::kFloat32x4Reciprocal: | 4255 case MethodRecognizer::kFloat32x4Reciprocal: |
| 4199 __ Vreciprocalqs(result, left); | 4256 __ Vreciprocalqs(result, left); |
| 4200 break; | 4257 break; |
| 4201 case MethodRecognizer::kFloat32x4ReciprocalSqrt: | 4258 case MethodRecognizer::kFloat32x4ReciprocalSqrt: |
| 4202 __ VreciprocalSqrtqs(result, left); | 4259 __ VreciprocalSqrtqs(result, left); |
| 4203 break; | 4260 break; |
| 4204 default: UNREACHABLE(); | 4261 default: UNREACHABLE(); |
| 4205 } | 4262 } |
| 4206 } | 4263 } |
| 4207 | 4264 |
| 4208 | 4265 |
| 4209 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(bool opt) const { | 4266 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Isolate* isolate, |
| 4267 bool opt) const { | |
| 4210 const intptr_t kNumInputs = 2; | 4268 const intptr_t kNumInputs = 2; |
| 4211 const intptr_t kNumTemps = 0; | 4269 const intptr_t kNumTemps = 0; |
| 4212 LocationSummary* summary = | 4270 LocationSummary* summary = new(isolate) LocationSummary( |
| 4213 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4271 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4214 summary->set_in(0, Location::RequiresFpuRegister()); | 4272 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4215 summary->set_in(1, Location::RequiresFpuRegister()); | 4273 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4216 summary->set_out(0, Location::RequiresFpuRegister()); | 4274 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4217 return summary; | 4275 return summary; |
| 4218 } | 4276 } |
| 4219 | 4277 |
| 4220 | 4278 |
| 4221 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4279 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4222 const QRegister left = locs()->in(0).fpu_reg(); | 4280 const QRegister left = locs()->in(0).fpu_reg(); |
| 4223 const QRegister right = locs()->in(1).fpu_reg(); | 4281 const QRegister right = locs()->in(1).fpu_reg(); |
| 4224 const QRegister result = locs()->out(0).fpu_reg(); | 4282 const QRegister result = locs()->out(0).fpu_reg(); |
| 4225 | 4283 |
| 4226 switch (op_kind()) { | 4284 switch (op_kind()) { |
| 4227 case MethodRecognizer::kFloat32x4Scale: | 4285 case MethodRecognizer::kFloat32x4Scale: |
| 4228 __ vcvtsd(STMP, EvenDRegisterOf(left)); | 4286 __ vcvtsd(STMP, EvenDRegisterOf(left)); |
| 4229 __ vdup(kWord, result, DTMP, 0); | 4287 __ vdup(kWord, result, DTMP, 0); |
| 4230 __ vmulqs(result, result, right); | 4288 __ vmulqs(result, result, right); |
| 4231 break; | 4289 break; |
| 4232 default: UNREACHABLE(); | 4290 default: UNREACHABLE(); |
| 4233 } | 4291 } |
| 4234 } | 4292 } |
| 4235 | 4293 |
| 4236 | 4294 |
| 4237 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(bool opt) const { | 4295 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Isolate* isolate, |
| 4296 bool opt) const { | |
| 4238 const intptr_t kNumInputs = 1; | 4297 const intptr_t kNumInputs = 1; |
| 4239 const intptr_t kNumTemps = 0; | 4298 const intptr_t kNumTemps = 0; |
| 4240 LocationSummary* summary = | 4299 LocationSummary* summary = new(isolate) LocationSummary( |
| 4241 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4300 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4242 summary->set_in(0, Location::RequiresFpuRegister()); | 4301 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4243 summary->set_out(0, Location::RequiresFpuRegister()); | 4302 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4244 return summary; | 4303 return summary; |
| 4245 } | 4304 } |
| 4246 | 4305 |
| 4247 | 4306 |
| 4248 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4307 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4249 const QRegister left = locs()->in(0).fpu_reg(); | 4308 const QRegister left = locs()->in(0).fpu_reg(); |
| 4250 const QRegister result = locs()->out(0).fpu_reg(); | 4309 const QRegister result = locs()->out(0).fpu_reg(); |
| 4251 | 4310 |
| 4252 switch (op_kind()) { | 4311 switch (op_kind()) { |
| 4253 case MethodRecognizer::kFloat32x4Negate: | 4312 case MethodRecognizer::kFloat32x4Negate: |
| 4254 __ vnegqs(result, left); | 4313 __ vnegqs(result, left); |
| 4255 break; | 4314 break; |
| 4256 case MethodRecognizer::kFloat32x4Absolute: | 4315 case MethodRecognizer::kFloat32x4Absolute: |
| 4257 __ vabsqs(result, left); | 4316 __ vabsqs(result, left); |
| 4258 break; | 4317 break; |
| 4259 default: UNREACHABLE(); | 4318 default: UNREACHABLE(); |
| 4260 } | 4319 } |
| 4261 } | 4320 } |
| 4262 | 4321 |
| 4263 | 4322 |
| 4264 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(bool opt) const { | 4323 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Isolate* isolate, |
| 4324 bool opt) const { | |
| 4265 const intptr_t kNumInputs = 3; | 4325 const intptr_t kNumInputs = 3; |
| 4266 const intptr_t kNumTemps = 0; | 4326 const intptr_t kNumTemps = 0; |
| 4267 LocationSummary* summary = | 4327 LocationSummary* summary = new(isolate) LocationSummary( |
| 4268 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4328 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4269 summary->set_in(0, Location::RequiresFpuRegister()); | 4329 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4270 summary->set_in(1, Location::RequiresFpuRegister()); | 4330 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4271 summary->set_in(2, Location::RequiresFpuRegister()); | 4331 summary->set_in(2, Location::RequiresFpuRegister()); |
| 4272 summary->set_out(0, Location::RequiresFpuRegister()); | 4332 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4273 return summary; | 4333 return summary; |
| 4274 } | 4334 } |
| 4275 | 4335 |
| 4276 | 4336 |
| 4277 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4337 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4278 const QRegister left = locs()->in(0).fpu_reg(); | 4338 const QRegister left = locs()->in(0).fpu_reg(); |
| 4279 const QRegister lower = locs()->in(1).fpu_reg(); | 4339 const QRegister lower = locs()->in(1).fpu_reg(); |
| 4280 const QRegister upper = locs()->in(2).fpu_reg(); | 4340 const QRegister upper = locs()->in(2).fpu_reg(); |
| 4281 const QRegister result = locs()->out(0).fpu_reg(); | 4341 const QRegister result = locs()->out(0).fpu_reg(); |
| 4282 __ vminqs(result, left, upper); | 4342 __ vminqs(result, left, upper); |
| 4283 __ vmaxqs(result, result, lower); | 4343 __ vmaxqs(result, result, lower); |
| 4284 } | 4344 } |
| 4285 | 4345 |
| 4286 | 4346 |
| 4287 LocationSummary* Float32x4WithInstr::MakeLocationSummary(bool opt) const { | 4347 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Isolate* isolate, |
| 4348 bool opt) const { | |
| 4288 const intptr_t kNumInputs = 2; | 4349 const intptr_t kNumInputs = 2; |
| 4289 const intptr_t kNumTemps = 0; | 4350 const intptr_t kNumTemps = 0; |
| 4290 LocationSummary* summary = | 4351 LocationSummary* summary = new(isolate) LocationSummary( |
| 4291 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4352 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4292 summary->set_in(0, Location::RequiresFpuRegister()); | 4353 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4293 summary->set_in(1, Location::RequiresFpuRegister()); | 4354 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4294 // Low (< 7) Q registers are needed for the vmovs instruction. | 4355 // Low (< 7) Q registers are needed for the vmovs instruction. |
| 4295 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4356 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 4296 return summary; | 4357 return summary; |
| 4297 } | 4358 } |
| 4298 | 4359 |
| 4299 | 4360 |
| 4300 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4361 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4301 const QRegister replacement = locs()->in(0).fpu_reg(); | 4362 const QRegister replacement = locs()->in(0).fpu_reg(); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 4325 __ vmovs(sresult2, STMP); | 4386 __ vmovs(sresult2, STMP); |
| 4326 break; | 4387 break; |
| 4327 case MethodRecognizer::kFloat32x4WithW: | 4388 case MethodRecognizer::kFloat32x4WithW: |
| 4328 __ vmovs(sresult3, STMP); | 4389 __ vmovs(sresult3, STMP); |
| 4329 break; | 4390 break; |
| 4330 default: UNREACHABLE(); | 4391 default: UNREACHABLE(); |
| 4331 } | 4392 } |
| 4332 } | 4393 } |
| 4333 | 4394 |
| 4334 | 4395 |
| 4335 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(bool opt) const { | 4396 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Isolate* isolate, |
| 4397 bool opt) const { | |
| 4336 const intptr_t kNumInputs = 1; | 4398 const intptr_t kNumInputs = 1; |
| 4337 const intptr_t kNumTemps = 0; | 4399 const intptr_t kNumTemps = 0; |
| 4338 LocationSummary* summary = | 4400 LocationSummary* summary = new(isolate) LocationSummary( |
| 4339 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4401 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4340 summary->set_in(0, Location::RequiresFpuRegister()); | 4402 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4341 summary->set_out(0, Location::RequiresFpuRegister()); | 4403 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4342 return summary; | 4404 return summary; |
| 4343 } | 4405 } |
| 4344 | 4406 |
| 4345 | 4407 |
| 4346 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4408 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4347 const QRegister value = locs()->in(0).fpu_reg(); | 4409 const QRegister value = locs()->in(0).fpu_reg(); |
| 4348 const QRegister result = locs()->out(0).fpu_reg(); | 4410 const QRegister result = locs()->out(0).fpu_reg(); |
| 4349 | 4411 |
| 4350 if (value != result) { | 4412 if (value != result) { |
| 4351 __ vmovq(result, value); | 4413 __ vmovq(result, value); |
| 4352 } | 4414 } |
| 4353 } | 4415 } |
| 4354 | 4416 |
| 4355 | 4417 |
| 4356 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(bool opt) const { | 4418 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Isolate* isolate, |
| 4419 bool opt) const { | |
| 4357 const intptr_t kNumInputs = 1; | 4420 const intptr_t kNumInputs = 1; |
| 4358 const intptr_t kNumTemps = 0; | 4421 const intptr_t kNumTemps = 0; |
| 4359 LocationSummary* summary = | 4422 LocationSummary* summary = new(isolate) LocationSummary( |
| 4360 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4423 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4361 summary->set_in(0, Location::RequiresFpuRegister()); | 4424 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4362 summary->set_out(0, Location::RequiresFpuRegister()); | 4425 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4363 return summary; | 4426 return summary; |
| 4364 } | 4427 } |
| 4365 | 4428 |
| 4366 | 4429 |
| 4367 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4430 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4368 const QRegister value = locs()->in(0).fpu_reg(); | 4431 const QRegister value = locs()->in(0).fpu_reg(); |
| 4369 | 4432 |
| 4370 const DRegister dvalue0 = EvenDRegisterOf(value); | 4433 const DRegister dvalue0 = EvenDRegisterOf(value); |
| 4371 const DRegister dvalue1 = OddDRegisterOf(value); | 4434 const DRegister dvalue1 = OddDRegisterOf(value); |
| 4372 | 4435 |
| 4373 const QRegister result = locs()->out(0).fpu_reg(); | 4436 const QRegister result = locs()->out(0).fpu_reg(); |
| 4374 | 4437 |
| 4375 const DRegister dresult0 = EvenDRegisterOf(result); | 4438 const DRegister dresult0 = EvenDRegisterOf(result); |
| 4376 | 4439 |
| 4377 switch (op_kind()) { | 4440 switch (op_kind()) { |
| 4378 case MethodRecognizer::kFloat64x2GetX: | 4441 case MethodRecognizer::kFloat64x2GetX: |
| 4379 __ vmovd(dresult0, dvalue0); | 4442 __ vmovd(dresult0, dvalue0); |
| 4380 break; | 4443 break; |
| 4381 case MethodRecognizer::kFloat64x2GetY: | 4444 case MethodRecognizer::kFloat64x2GetY: |
| 4382 __ vmovd(dresult0, dvalue1); | 4445 __ vmovd(dresult0, dvalue1); |
| 4383 break; | 4446 break; |
| 4384 default: UNREACHABLE(); | 4447 default: UNREACHABLE(); |
| 4385 } | 4448 } |
| 4386 } | 4449 } |
| 4387 | 4450 |
| 4388 | 4451 |
| 4389 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(bool opt) const { | 4452 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Isolate* isolate, |
| 4453 bool opt) const { | |
| 4390 const intptr_t kNumInputs = 0; | 4454 const intptr_t kNumInputs = 0; |
| 4391 const intptr_t kNumTemps = 0; | 4455 const intptr_t kNumTemps = 0; |
| 4392 LocationSummary* summary = | 4456 LocationSummary* summary = new(isolate) LocationSummary( |
| 4393 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4457 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4394 summary->set_out(0, Location::RequiresFpuRegister()); | 4458 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4395 return summary; | 4459 return summary; |
| 4396 } | 4460 } |
| 4397 | 4461 |
| 4398 | 4462 |
| 4399 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4463 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4400 const QRegister q = locs()->out(0).fpu_reg(); | 4464 const QRegister q = locs()->out(0).fpu_reg(); |
| 4401 __ veorq(q, q, q); | 4465 __ veorq(q, q, q); |
| 4402 } | 4466 } |
| 4403 | 4467 |
| 4404 | 4468 |
| 4405 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(bool opt) const { | 4469 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Isolate* isolate, |
| 4470 bool opt) const { | |
| 4406 const intptr_t kNumInputs = 1; | 4471 const intptr_t kNumInputs = 1; |
| 4407 const intptr_t kNumTemps = 0; | 4472 const intptr_t kNumTemps = 0; |
| 4408 LocationSummary* summary = | 4473 LocationSummary* summary = new(isolate) LocationSummary( |
| 4409 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4474 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4410 summary->set_in(0, Location::RequiresFpuRegister()); | 4475 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4411 summary->set_out(0, Location::RequiresFpuRegister()); | 4476 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4412 return summary; | 4477 return summary; |
| 4413 } | 4478 } |
| 4414 | 4479 |
| 4415 | 4480 |
| 4416 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4481 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4417 const QRegister value = locs()->in(0).fpu_reg(); | 4482 const QRegister value = locs()->in(0).fpu_reg(); |
| 4418 | 4483 |
| 4419 const DRegister dvalue = EvenDRegisterOf(value); | 4484 const DRegister dvalue = EvenDRegisterOf(value); |
| 4420 | 4485 |
| 4421 const QRegister result = locs()->out(0).fpu_reg(); | 4486 const QRegister result = locs()->out(0).fpu_reg(); |
| 4422 | 4487 |
| 4423 const DRegister dresult0 = EvenDRegisterOf(result); | 4488 const DRegister dresult0 = EvenDRegisterOf(result); |
| 4424 const DRegister dresult1 = OddDRegisterOf(result); | 4489 const DRegister dresult1 = OddDRegisterOf(result); |
| 4425 | 4490 |
| 4426 // Splat across all lanes. | 4491 // Splat across all lanes. |
| 4427 __ vmovd(dresult0, dvalue); | 4492 __ vmovd(dresult0, dvalue); |
| 4428 __ vmovd(dresult1, dvalue); | 4493 __ vmovd(dresult1, dvalue); |
| 4429 } | 4494 } |
| 4430 | 4495 |
| 4431 | 4496 |
| 4432 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( | 4497 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( |
| 4433 bool opt) const { | 4498 Isolate* isolate, bool opt) const { |
| 4434 const intptr_t kNumInputs = 2; | 4499 const intptr_t kNumInputs = 2; |
| 4435 const intptr_t kNumTemps = 0; | 4500 const intptr_t kNumTemps = 0; |
| 4436 LocationSummary* summary = | 4501 LocationSummary* summary = new(isolate) LocationSummary( |
| 4437 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4502 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4438 summary->set_in(0, Location::RequiresFpuRegister()); | 4503 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4439 summary->set_in(1, Location::RequiresFpuRegister()); | 4504 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4440 summary->set_out(0, Location::RequiresFpuRegister()); | 4505 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4441 return summary; | 4506 return summary; |
| 4442 } | 4507 } |
| 4443 | 4508 |
| 4444 | 4509 |
| 4445 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4510 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4446 const QRegister q0 = locs()->in(0).fpu_reg(); | 4511 const QRegister q0 = locs()->in(0).fpu_reg(); |
| 4447 const QRegister q1 = locs()->in(1).fpu_reg(); | 4512 const QRegister q1 = locs()->in(1).fpu_reg(); |
| 4448 const QRegister r = locs()->out(0).fpu_reg(); | 4513 const QRegister r = locs()->out(0).fpu_reg(); |
| 4449 | 4514 |
| 4450 const DRegister d0 = EvenDRegisterOf(q0); | 4515 const DRegister d0 = EvenDRegisterOf(q0); |
| 4451 const DRegister d1 = EvenDRegisterOf(q1); | 4516 const DRegister d1 = EvenDRegisterOf(q1); |
| 4452 | 4517 |
| 4453 const DRegister dr0 = EvenDRegisterOf(r); | 4518 const DRegister dr0 = EvenDRegisterOf(r); |
| 4454 const DRegister dr1 = OddDRegisterOf(r); | 4519 const DRegister dr1 = OddDRegisterOf(r); |
| 4455 | 4520 |
| 4456 __ vmovd(dr0, d0); | 4521 __ vmovd(dr0, d0); |
| 4457 __ vmovd(dr1, d1); | 4522 __ vmovd(dr1, d1); |
| 4458 } | 4523 } |
| 4459 | 4524 |
| 4460 | 4525 |
| 4461 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( | 4526 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( |
| 4462 bool opt) const { | 4527 Isolate* isolate, bool opt) const { |
| 4463 const intptr_t kNumInputs = 1; | 4528 const intptr_t kNumInputs = 1; |
| 4464 const intptr_t kNumTemps = 0; | 4529 const intptr_t kNumTemps = 0; |
| 4465 LocationSummary* summary = | 4530 LocationSummary* summary = new(isolate) LocationSummary( |
| 4466 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4531 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4467 summary->set_in(0, Location::RequiresFpuRegister()); | 4532 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4468 // Low (< 7) Q registers are needed for the vcvtsd instruction. | 4533 // Low (< 7) Q registers are needed for the vcvtsd instruction. |
| 4469 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4534 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 4470 return summary; | 4535 return summary; |
| 4471 } | 4536 } |
| 4472 | 4537 |
| 4473 | 4538 |
| 4474 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4539 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4475 const QRegister q = locs()->in(0).fpu_reg(); | 4540 const QRegister q = locs()->in(0).fpu_reg(); |
| 4476 const QRegister r = locs()->out(0).fpu_reg(); | 4541 const QRegister r = locs()->out(0).fpu_reg(); |
| 4477 | 4542 |
| 4478 const DRegister dq0 = EvenDRegisterOf(q); | 4543 const DRegister dq0 = EvenDRegisterOf(q); |
| 4479 const DRegister dq1 = OddDRegisterOf(q); | 4544 const DRegister dq1 = OddDRegisterOf(q); |
| 4480 | 4545 |
| 4481 const DRegister dr0 = EvenDRegisterOf(r); | 4546 const DRegister dr0 = EvenDRegisterOf(r); |
| 4482 | 4547 |
| 4483 // Zero register. | 4548 // Zero register. |
| 4484 __ veorq(r, r, r); | 4549 __ veorq(r, r, r); |
| 4485 // Set X lane. | 4550 // Set X lane. |
| 4486 __ vcvtsd(EvenSRegisterOf(dr0), dq0); | 4551 __ vcvtsd(EvenSRegisterOf(dr0), dq0); |
| 4487 // Set Y lane. | 4552 // Set Y lane. |
| 4488 __ vcvtsd(OddSRegisterOf(dr0), dq1); | 4553 __ vcvtsd(OddSRegisterOf(dr0), dq1); |
| 4489 } | 4554 } |
| 4490 | 4555 |
| 4491 | 4556 |
| 4492 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( | 4557 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( |
| 4493 bool opt) const { | 4558 Isolate* isolate, bool opt) const { |
| 4494 const intptr_t kNumInputs = 1; | 4559 const intptr_t kNumInputs = 1; |
| 4495 const intptr_t kNumTemps = 0; | 4560 const intptr_t kNumTemps = 0; |
| 4496 LocationSummary* summary = | 4561 LocationSummary* summary = new(isolate) LocationSummary( |
| 4497 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4562 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4498 summary->set_in(0, Location::RequiresFpuRegister()); | 4563 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4499 // Low (< 7) Q registers are needed for the vcvtsd instruction. | 4564 // Low (< 7) Q registers are needed for the vcvtsd instruction. |
| 4500 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4565 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 4501 return summary; | 4566 return summary; |
| 4502 } | 4567 } |
| 4503 | 4568 |
| 4504 | 4569 |
| 4505 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4570 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4506 const QRegister q = locs()->in(0).fpu_reg(); | 4571 const QRegister q = locs()->in(0).fpu_reg(); |
| 4507 const QRegister r = locs()->out(0).fpu_reg(); | 4572 const QRegister r = locs()->out(0).fpu_reg(); |
| 4508 | 4573 |
| 4509 const DRegister dq0 = EvenDRegisterOf(q); | 4574 const DRegister dq0 = EvenDRegisterOf(q); |
| 4510 | 4575 |
| 4511 const DRegister dr0 = EvenDRegisterOf(r); | 4576 const DRegister dr0 = EvenDRegisterOf(r); |
| 4512 const DRegister dr1 = OddDRegisterOf(r); | 4577 const DRegister dr1 = OddDRegisterOf(r); |
| 4513 | 4578 |
| 4514 // Set X. | 4579 // Set X. |
| 4515 __ vcvtds(dr0, EvenSRegisterOf(dq0)); | 4580 __ vcvtds(dr0, EvenSRegisterOf(dq0)); |
| 4516 // Set Y. | 4581 // Set Y. |
| 4517 __ vcvtds(dr1, OddSRegisterOf(dq0)); | 4582 __ vcvtds(dr1, OddSRegisterOf(dq0)); |
| 4518 } | 4583 } |
| 4519 | 4584 |
| 4520 | 4585 |
| 4521 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(bool opt) const { | 4586 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Isolate* isolate, |
| 4587 bool opt) const { | |
| 4522 const intptr_t kNumInputs = 1; | 4588 const intptr_t kNumInputs = 1; |
| 4523 const intptr_t kNumTemps = 0; | 4589 const intptr_t kNumTemps = 0; |
| 4524 LocationSummary* summary = | 4590 LocationSummary* summary = new(isolate) LocationSummary( |
| 4525 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4591 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4526 | 4592 |
| 4527 if (representation() == kTagged) { | 4593 if (representation() == kTagged) { |
| 4528 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); | 4594 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); |
| 4529 // Grabbing the S components means we need a low (< 7) Q. | 4595 // Grabbing the S components means we need a low (< 7) Q. |
| 4530 summary->set_in(0, Location::FpuRegisterLocation(Q6)); | 4596 summary->set_in(0, Location::FpuRegisterLocation(Q6)); |
| 4531 summary->set_out(0, Location::RequiresRegister()); | 4597 summary->set_out(0, Location::RequiresRegister()); |
| 4532 summary->AddTemp(Location::RequiresRegister()); | 4598 summary->AddTemp(Location::RequiresRegister()); |
| 4533 } else { | 4599 } else { |
| 4534 summary->set_in(0, Location::RequiresFpuRegister()); | 4600 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4535 summary->set_out(0, Location::RequiresFpuRegister()); | 4601 summary->set_out(0, Location::RequiresFpuRegister()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4578 break; | 4644 break; |
| 4579 case MethodRecognizer::kFloat64x2Sqrt: | 4645 case MethodRecognizer::kFloat64x2Sqrt: |
| 4580 __ vsqrtd(dresult0, dvalue0); | 4646 __ vsqrtd(dresult0, dvalue0); |
| 4581 __ vsqrtd(dresult1, dvalue1); | 4647 __ vsqrtd(dresult1, dvalue1); |
| 4582 break; | 4648 break; |
| 4583 default: UNREACHABLE(); | 4649 default: UNREACHABLE(); |
| 4584 } | 4650 } |
| 4585 } | 4651 } |
| 4586 | 4652 |
| 4587 | 4653 |
| 4588 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(bool opt) const { | 4654 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Isolate* isolate, |
| 4655 bool opt) const { | |
| 4589 const intptr_t kNumInputs = 2; | 4656 const intptr_t kNumInputs = 2; |
| 4590 const intptr_t kNumTemps = 0; | 4657 const intptr_t kNumTemps = 0; |
| 4591 LocationSummary* summary = | 4658 LocationSummary* summary = new(isolate) LocationSummary( |
| 4592 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4659 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4593 summary->set_in(0, Location::RequiresFpuRegister()); | 4660 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4594 summary->set_in(1, Location::RequiresFpuRegister()); | 4661 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4595 summary->set_out(0, Location::SameAsFirstInput()); | 4662 summary->set_out(0, Location::SameAsFirstInput()); |
| 4596 return summary; | 4663 return summary; |
| 4597 } | 4664 } |
| 4598 | 4665 |
| 4599 | 4666 |
| 4600 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4667 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4601 const QRegister left = locs()->in(0).fpu_reg(); | 4668 const QRegister left = locs()->in(0).fpu_reg(); |
| 4602 const DRegister left0 = EvenDRegisterOf(left); | 4669 const DRegister left0 = EvenDRegisterOf(left); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4651 __ vmovd(left1, right1); | 4718 __ vmovd(left1, right1); |
| 4652 __ Bind(&g1); | 4719 __ Bind(&g1); |
| 4653 break; | 4720 break; |
| 4654 } | 4721 } |
| 4655 default: UNREACHABLE(); | 4722 default: UNREACHABLE(); |
| 4656 } | 4723 } |
| 4657 } | 4724 } |
| 4658 | 4725 |
| 4659 | 4726 |
| 4660 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( | 4727 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
| 4661 bool opt) const { | 4728 Isolate* isolate, bool opt) const { |
| 4662 const intptr_t kNumInputs = 4; | 4729 const intptr_t kNumInputs = 4; |
| 4663 const intptr_t kNumTemps = 1; | 4730 const intptr_t kNumTemps = 1; |
| 4664 LocationSummary* summary = | 4731 LocationSummary* summary = new(isolate) LocationSummary( |
| 4665 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4732 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4666 summary->set_in(0, Location::RequiresRegister()); | 4733 summary->set_in(0, Location::RequiresRegister()); |
| 4667 summary->set_in(1, Location::RequiresRegister()); | 4734 summary->set_in(1, Location::RequiresRegister()); |
| 4668 summary->set_in(2, Location::RequiresRegister()); | 4735 summary->set_in(2, Location::RequiresRegister()); |
| 4669 summary->set_in(3, Location::RequiresRegister()); | 4736 summary->set_in(3, Location::RequiresRegister()); |
| 4670 summary->set_temp(0, Location::RequiresRegister()); | 4737 summary->set_temp(0, Location::RequiresRegister()); |
| 4671 // Low (< 7) Q register needed for the vmovsr instruction. | 4738 // Low (< 7) Q register needed for the vmovsr instruction. |
| 4672 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4739 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 4673 return summary; | 4740 return summary; |
| 4674 } | 4741 } |
| 4675 | 4742 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 4698 __ vmovsr(sresult1, temp, EQ); | 4765 __ vmovsr(sresult1, temp, EQ); |
| 4699 | 4766 |
| 4700 __ CompareObject(v2, Bool::True()); | 4767 __ CompareObject(v2, Bool::True()); |
| 4701 __ vmovsr(sresult2, temp, EQ); | 4768 __ vmovsr(sresult2, temp, EQ); |
| 4702 | 4769 |
| 4703 __ CompareObject(v3, Bool::True()); | 4770 __ CompareObject(v3, Bool::True()); |
| 4704 __ vmovsr(sresult3, temp, EQ); | 4771 __ vmovsr(sresult3, temp, EQ); |
| 4705 } | 4772 } |
| 4706 | 4773 |
| 4707 | 4774 |
| 4708 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(bool opt) const { | 4775 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Isolate* isolate, |
| 4776 bool opt) const { | |
| 4709 const intptr_t kNumInputs = 1; | 4777 const intptr_t kNumInputs = 1; |
| 4710 const intptr_t kNumTemps = 0; | 4778 const intptr_t kNumTemps = 0; |
| 4711 LocationSummary* summary = | 4779 LocationSummary* summary = new(isolate) LocationSummary( |
| 4712 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4780 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4713 // Low (< 7) Q registers are needed for the vmovrs instruction. | 4781 // Low (< 7) Q registers are needed for the vmovrs instruction. |
| 4714 summary->set_in(0, Location::FpuRegisterLocation(Q6)); | 4782 summary->set_in(0, Location::FpuRegisterLocation(Q6)); |
| 4715 summary->set_out(0, Location::RequiresRegister()); | 4783 summary->set_out(0, Location::RequiresRegister()); |
| 4716 return summary; | 4784 return summary; |
| 4717 } | 4785 } |
| 4718 | 4786 |
| 4719 | 4787 |
| 4720 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4788 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4721 const QRegister value = locs()->in(0).fpu_reg(); | 4789 const QRegister value = locs()->in(0).fpu_reg(); |
| 4722 const Register result = locs()->out(0).reg(); | 4790 const Register result = locs()->out(0).reg(); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 4743 break; | 4811 break; |
| 4744 default: UNREACHABLE(); | 4812 default: UNREACHABLE(); |
| 4745 } | 4813 } |
| 4746 | 4814 |
| 4747 __ tst(result, ShifterOperand(result)); | 4815 __ tst(result, ShifterOperand(result)); |
| 4748 __ LoadObject(result, Bool::True(), NE); | 4816 __ LoadObject(result, Bool::True(), NE); |
| 4749 __ LoadObject(result, Bool::False(), EQ); | 4817 __ LoadObject(result, Bool::False(), EQ); |
| 4750 } | 4818 } |
| 4751 | 4819 |
| 4752 | 4820 |
| 4753 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(bool opt) const { | 4821 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Isolate* isolate, |
| 4822 bool opt) const { | |
| 4754 const intptr_t kNumInputs = 3; | 4823 const intptr_t kNumInputs = 3; |
| 4755 const intptr_t kNumTemps = 1; | 4824 const intptr_t kNumTemps = 1; |
| 4756 LocationSummary* summary = | 4825 LocationSummary* summary = new(isolate) LocationSummary( |
| 4757 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4826 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4758 summary->set_in(0, Location::RequiresFpuRegister()); | 4827 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4759 summary->set_in(1, Location::RequiresFpuRegister()); | 4828 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4760 summary->set_in(2, Location::RequiresFpuRegister()); | 4829 summary->set_in(2, Location::RequiresFpuRegister()); |
| 4761 summary->set_temp(0, Location::RequiresFpuRegister()); | 4830 summary->set_temp(0, Location::RequiresFpuRegister()); |
| 4762 summary->set_out(0, Location::RequiresFpuRegister()); | 4831 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4763 return summary; | 4832 return summary; |
| 4764 } | 4833 } |
| 4765 | 4834 |
| 4766 | 4835 |
| 4767 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4836 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4768 const QRegister mask = locs()->in(0).fpu_reg(); | 4837 const QRegister mask = locs()->in(0).fpu_reg(); |
| 4769 const QRegister trueValue = locs()->in(1).fpu_reg(); | 4838 const QRegister trueValue = locs()->in(1).fpu_reg(); |
| 4770 const QRegister falseValue = locs()->in(2).fpu_reg(); | 4839 const QRegister falseValue = locs()->in(2).fpu_reg(); |
| 4771 const QRegister out = locs()->out(0).fpu_reg(); | 4840 const QRegister out = locs()->out(0).fpu_reg(); |
| 4772 const QRegister temp = locs()->temp(0).fpu_reg(); | 4841 const QRegister temp = locs()->temp(0).fpu_reg(); |
| 4773 | 4842 |
| 4774 // Copy mask. | 4843 // Copy mask. |
| 4775 __ vmovq(temp, mask); | 4844 __ vmovq(temp, mask); |
| 4776 // Invert it. | 4845 // Invert it. |
| 4777 __ vmvnq(temp, temp); | 4846 __ vmvnq(temp, temp); |
| 4778 // mask = mask & trueValue. | 4847 // mask = mask & trueValue. |
| 4779 __ vandq(mask, mask, trueValue); | 4848 __ vandq(mask, mask, trueValue); |
| 4780 // temp = temp & falseValue. | 4849 // temp = temp & falseValue. |
| 4781 __ vandq(temp, temp, falseValue); | 4850 __ vandq(temp, temp, falseValue); |
| 4782 // out = mask | temp. | 4851 // out = mask | temp. |
| 4783 __ vorrq(out, mask, temp); | 4852 __ vorrq(out, mask, temp); |
| 4784 } | 4853 } |
| 4785 | 4854 |
| 4786 | 4855 |
| 4787 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(bool opt) const { | 4856 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Isolate* isolate, |
| 4857 bool opt) const { | |
| 4788 const intptr_t kNumInputs = 2; | 4858 const intptr_t kNumInputs = 2; |
| 4789 const intptr_t kNumTemps = 0; | 4859 const intptr_t kNumTemps = 0; |
| 4790 LocationSummary* summary = | 4860 LocationSummary* summary = new(isolate) LocationSummary( |
| 4791 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4861 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4792 summary->set_in(0, Location::RequiresFpuRegister()); | 4862 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4793 summary->set_in(1, Location::RequiresRegister()); | 4863 summary->set_in(1, Location::RequiresRegister()); |
| 4794 // Low (< 7) Q register needed for the vmovsr instruction. | 4864 // Low (< 7) Q register needed for the vmovsr instruction. |
| 4795 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4865 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
| 4796 return summary; | 4866 return summary; |
| 4797 } | 4867 } |
| 4798 | 4868 |
| 4799 | 4869 |
| 4800 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4870 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4801 const QRegister mask = locs()->in(0).fpu_reg(); | 4871 const QRegister mask = locs()->in(0).fpu_reg(); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 4827 __ vmovsr(sresult2, TMP); | 4897 __ vmovsr(sresult2, TMP); |
| 4828 break; | 4898 break; |
| 4829 case MethodRecognizer::kInt32x4WithFlagW: | 4899 case MethodRecognizer::kInt32x4WithFlagW: |
| 4830 __ vmovsr(sresult3, TMP); | 4900 __ vmovsr(sresult3, TMP); |
| 4831 break; | 4901 break; |
| 4832 default: UNREACHABLE(); | 4902 default: UNREACHABLE(); |
| 4833 } | 4903 } |
| 4834 } | 4904 } |
| 4835 | 4905 |
| 4836 | 4906 |
| 4837 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(bool opt) const { | 4907 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Isolate* isolate, |
| 4908 bool opt) const { | |
| 4838 const intptr_t kNumInputs = 1; | 4909 const intptr_t kNumInputs = 1; |
| 4839 const intptr_t kNumTemps = 0; | 4910 const intptr_t kNumTemps = 0; |
| 4840 LocationSummary* summary = | 4911 LocationSummary* summary = new(isolate) LocationSummary( |
| 4841 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4912 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4842 summary->set_in(0, Location::RequiresFpuRegister()); | 4913 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4843 summary->set_out(0, Location::RequiresFpuRegister()); | 4914 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4844 return summary; | 4915 return summary; |
| 4845 } | 4916 } |
| 4846 | 4917 |
| 4847 | 4918 |
| 4848 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4919 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4849 const QRegister value = locs()->in(0).fpu_reg(); | 4920 const QRegister value = locs()->in(0).fpu_reg(); |
| 4850 const QRegister result = locs()->out(0).fpu_reg(); | 4921 const QRegister result = locs()->out(0).fpu_reg(); |
| 4851 | 4922 |
| 4852 if (value != result) { | 4923 if (value != result) { |
| 4853 __ vmovq(result, value); | 4924 __ vmovq(result, value); |
| 4854 } | 4925 } |
| 4855 } | 4926 } |
| 4856 | 4927 |
| 4857 | 4928 |
| 4858 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(bool opt) const { | 4929 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Isolate* isolate, |
| 4930 bool opt) const { | |
| 4859 const intptr_t kNumInputs = 2; | 4931 const intptr_t kNumInputs = 2; |
| 4860 const intptr_t kNumTemps = 0; | 4932 const intptr_t kNumTemps = 0; |
| 4861 LocationSummary* summary = | 4933 LocationSummary* summary = new(isolate) LocationSummary( |
| 4862 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4934 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4863 summary->set_in(0, Location::RequiresFpuRegister()); | 4935 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4864 summary->set_in(1, Location::RequiresFpuRegister()); | 4936 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4865 summary->set_out(0, Location::RequiresFpuRegister()); | 4937 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4866 return summary; | 4938 return summary; |
| 4867 } | 4939 } |
| 4868 | 4940 |
| 4869 | 4941 |
| 4870 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4942 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4871 const QRegister left = locs()->in(0).fpu_reg(); | 4943 const QRegister left = locs()->in(0).fpu_reg(); |
| 4872 const QRegister right = locs()->in(1).fpu_reg(); | 4944 const QRegister right = locs()->in(1).fpu_reg(); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 4888 __ vaddqi(kWord, result, left, right); | 4960 __ vaddqi(kWord, result, left, right); |
| 4889 break; | 4961 break; |
| 4890 case Token::kSUB: | 4962 case Token::kSUB: |
| 4891 __ vsubqi(kWord, result, left, right); | 4963 __ vsubqi(kWord, result, left, right); |
| 4892 break; | 4964 break; |
| 4893 default: UNREACHABLE(); | 4965 default: UNREACHABLE(); |
| 4894 } | 4966 } |
| 4895 } | 4967 } |
| 4896 | 4968 |
| 4897 | 4969 |
| 4898 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const { | 4970 LocationSummary* MathUnaryInstr::MakeLocationSummary(Isolate* isolate, |
| 4971 bool opt) const { | |
| 4899 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { | 4972 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { |
| 4900 const intptr_t kNumInputs = 1; | 4973 const intptr_t kNumInputs = 1; |
| 4901 const intptr_t kNumTemps = 0; | 4974 const intptr_t kNumTemps = 0; |
| 4902 LocationSummary* summary = | 4975 LocationSummary* summary = new(isolate) LocationSummary( |
| 4903 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 4976 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 4904 summary->set_in(0, Location::FpuRegisterLocation(Q0)); | 4977 summary->set_in(0, Location::FpuRegisterLocation(Q0)); |
| 4905 summary->set_out(0, Location::FpuRegisterLocation(Q0)); | 4978 summary->set_out(0, Location::FpuRegisterLocation(Q0)); |
| 4906 if (!TargetCPUFeatures::hardfp_supported()) { | 4979 if (!TargetCPUFeatures::hardfp_supported()) { |
| 4907 summary->AddTemp(Location::RegisterLocation(R0)); | 4980 summary->AddTemp(Location::RegisterLocation(R0)); |
| 4908 summary->AddTemp(Location::RegisterLocation(R1)); | 4981 summary->AddTemp(Location::RegisterLocation(R1)); |
| 4909 summary->AddTemp(Location::RegisterLocation(R2)); | 4982 summary->AddTemp(Location::RegisterLocation(R2)); |
| 4910 summary->AddTemp(Location::RegisterLocation(R3)); | 4983 summary->AddTemp(Location::RegisterLocation(R3)); |
| 4911 } | 4984 } |
| 4912 return summary; | 4985 return summary; |
| 4913 } | 4986 } |
| 4914 ASSERT((kind() == MathUnaryInstr::kSqrt) || | 4987 ASSERT((kind() == MathUnaryInstr::kSqrt) || |
| 4915 (kind() == MathUnaryInstr::kDoubleSquare)); | 4988 (kind() == MathUnaryInstr::kDoubleSquare)); |
| 4916 const intptr_t kNumInputs = 1; | 4989 const intptr_t kNumInputs = 1; |
| 4917 const intptr_t kNumTemps = 0; | 4990 const intptr_t kNumTemps = 0; |
| 4918 LocationSummary* summary = | 4991 LocationSummary* summary = new(isolate) LocationSummary( |
| 4919 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4992 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4920 summary->set_in(0, Location::RequiresFpuRegister()); | 4993 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4921 summary->set_out(0, Location::RequiresFpuRegister()); | 4994 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4922 return summary; | 4995 return summary; |
| 4923 } | 4996 } |
| 4924 | 4997 |
| 4925 | 4998 |
| 4926 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4999 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4927 if (kind() == MathUnaryInstr::kSqrt) { | 5000 if (kind() == MathUnaryInstr::kSqrt) { |
| 4928 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5001 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 4929 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5002 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 4944 __ vmovrrd(R0, R1, D0); | 5017 __ vmovrrd(R0, R1, D0); |
| 4945 __ vmovrrd(R2, R3, D1); | 5018 __ vmovrrd(R2, R3, D1); |
| 4946 __ CallRuntime(TargetFunction(), InputCount()); | 5019 __ CallRuntime(TargetFunction(), InputCount()); |
| 4947 __ vmovdrr(D0, R0, R1); | 5020 __ vmovdrr(D0, R0, R1); |
| 4948 __ vmovdrr(D1, R2, R3); | 5021 __ vmovdrr(D1, R2, R3); |
| 4949 } | 5022 } |
| 4950 } | 5023 } |
| 4951 } | 5024 } |
| 4952 | 5025 |
| 4953 | 5026 |
| 4954 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const { | 5027 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate, |
| 5028 bool opt) const { | |
| 4955 if (result_cid() == kDoubleCid) { | 5029 if (result_cid() == kDoubleCid) { |
| 4956 const intptr_t kNumInputs = 2; | 5030 const intptr_t kNumInputs = 2; |
| 4957 const intptr_t kNumTemps = 1; | 5031 const intptr_t kNumTemps = 1; |
| 4958 LocationSummary* summary = | 5032 LocationSummary* summary = new(isolate) LocationSummary( |
| 4959 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5033 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4960 summary->set_in(0, Location::RequiresFpuRegister()); | 5034 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4961 summary->set_in(1, Location::RequiresFpuRegister()); | 5035 summary->set_in(1, Location::RequiresFpuRegister()); |
| 4962 // Reuse the left register so that code can be made shorter. | 5036 // Reuse the left register so that code can be made shorter. |
| 4963 summary->set_out(0, Location::SameAsFirstInput()); | 5037 summary->set_out(0, Location::SameAsFirstInput()); |
| 4964 summary->set_temp(0, Location::RequiresRegister()); | 5038 summary->set_temp(0, Location::RequiresRegister()); |
| 4965 return summary; | 5039 return summary; |
| 4966 } | 5040 } |
| 4967 ASSERT(result_cid() == kSmiCid); | 5041 ASSERT(result_cid() == kSmiCid); |
| 4968 const intptr_t kNumInputs = 2; | 5042 const intptr_t kNumInputs = 2; |
| 4969 const intptr_t kNumTemps = 0; | 5043 const intptr_t kNumTemps = 0; |
| 4970 LocationSummary* summary = | 5044 LocationSummary* summary = new(isolate) LocationSummary( |
| 4971 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5045 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4972 summary->set_in(0, Location::RequiresRegister()); | 5046 summary->set_in(0, Location::RequiresRegister()); |
| 4973 summary->set_in(1, Location::RequiresRegister()); | 5047 summary->set_in(1, Location::RequiresRegister()); |
| 4974 // Reuse the left register so that code can be made shorter. | 5048 // Reuse the left register so that code can be made shorter. |
| 4975 summary->set_out(0, Location::SameAsFirstInput()); | 5049 summary->set_out(0, Location::SameAsFirstInput()); |
| 4976 return summary; | 5050 return summary; |
| 4977 } | 5051 } |
| 4978 | 5052 |
| 4979 | 5053 |
| 4980 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5054 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4981 ASSERT((op_kind() == MethodRecognizer::kMathMin) || | 5055 ASSERT((op_kind() == MethodRecognizer::kMathMin) || |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5029 __ cmp(left, ShifterOperand(right)); | 5103 __ cmp(left, ShifterOperand(right)); |
| 5030 ASSERT(result == left); | 5104 ASSERT(result == left); |
| 5031 if (is_min) { | 5105 if (is_min) { |
| 5032 __ mov(result, ShifterOperand(right), GT); | 5106 __ mov(result, ShifterOperand(right), GT); |
| 5033 } else { | 5107 } else { |
| 5034 __ mov(result, ShifterOperand(right), LT); | 5108 __ mov(result, ShifterOperand(right), LT); |
| 5035 } | 5109 } |
| 5036 } | 5110 } |
| 5037 | 5111 |
| 5038 | 5112 |
| 5039 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(bool opt) const { | 5113 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate, |
| 5114 bool opt) const { | |
| 5040 const intptr_t kNumInputs = 1; | 5115 const intptr_t kNumInputs = 1; |
| 5041 const intptr_t kNumTemps = 0; | 5116 const intptr_t kNumTemps = 0; |
| 5042 LocationSummary* summary = | 5117 LocationSummary* summary = new(isolate) LocationSummary( |
| 5043 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5118 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5044 summary->set_in(0, Location::RequiresRegister()); | 5119 summary->set_in(0, Location::RequiresRegister()); |
| 5045 // We make use of 3-operand instructions by not requiring result register | 5120 // We make use of 3-operand instructions by not requiring result register |
| 5046 // to be identical to first input register as on Intel. | 5121 // to be identical to first input register as on Intel. |
| 5047 summary->set_out(0, Location::RequiresRegister()); | 5122 summary->set_out(0, Location::RequiresRegister()); |
| 5048 return summary; | 5123 return summary; |
| 5049 } | 5124 } |
| 5050 | 5125 |
| 5051 | 5126 |
| 5052 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5127 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5053 const Register value = locs()->in(0).reg(); | 5128 const Register value = locs()->in(0).reg(); |
| 5054 const Register result = locs()->out(0).reg(); | 5129 const Register result = locs()->out(0).reg(); |
| 5055 switch (op_kind()) { | 5130 switch (op_kind()) { |
| 5056 case Token::kNEGATE: { | 5131 case Token::kNEGATE: { |
| 5057 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); | 5132 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); |
| 5058 __ rsbs(result, value, ShifterOperand(0)); | 5133 __ rsbs(result, value, ShifterOperand(0)); |
| 5059 __ b(deopt, VS); | 5134 __ b(deopt, VS); |
| 5060 break; | 5135 break; |
| 5061 } | 5136 } |
| 5062 case Token::kBIT_NOT: | 5137 case Token::kBIT_NOT: |
| 5063 __ mvn(result, ShifterOperand(value)); | 5138 __ mvn(result, ShifterOperand(value)); |
| 5064 // Remove inverted smi-tag. | 5139 // Remove inverted smi-tag. |
| 5065 __ bic(result, result, ShifterOperand(kSmiTagMask)); | 5140 __ bic(result, result, ShifterOperand(kSmiTagMask)); |
| 5066 break; | 5141 break; |
| 5067 default: | 5142 default: |
| 5068 UNREACHABLE(); | 5143 UNREACHABLE(); |
| 5069 } | 5144 } |
| 5070 } | 5145 } |
| 5071 | 5146 |
| 5072 | 5147 |
| 5073 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(bool opt) const { | 5148 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, |
| 5149 bool opt) const { | |
| 5074 const intptr_t kNumInputs = 1; | 5150 const intptr_t kNumInputs = 1; |
| 5075 const intptr_t kNumTemps = 0; | 5151 const intptr_t kNumTemps = 0; |
| 5076 LocationSummary* summary = | 5152 LocationSummary* summary = new(isolate) LocationSummary( |
| 5077 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5153 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5078 summary->set_in(0, Location::RequiresFpuRegister()); | 5154 summary->set_in(0, Location::RequiresFpuRegister()); |
| 5079 summary->set_out(0, Location::RequiresFpuRegister()); | 5155 summary->set_out(0, Location::RequiresFpuRegister()); |
| 5080 return summary; | 5156 return summary; |
| 5081 } | 5157 } |
| 5082 | 5158 |
| 5083 | 5159 |
| 5084 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5160 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5085 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5161 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
| 5086 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5162 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 5087 __ vnegd(result, value); | 5163 __ vnegd(result, value); |
| 5088 } | 5164 } |
| 5089 | 5165 |
| 5090 | 5166 |
| 5091 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(bool opt) const { | 5167 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
| 5168 bool opt) const { | |
| 5092 const intptr_t kNumInputs = 1; | 5169 const intptr_t kNumInputs = 1; |
| 5093 const intptr_t kNumTemps = 0; | 5170 const intptr_t kNumTemps = 0; |
| 5094 LocationSummary* result = | 5171 LocationSummary* result = new(isolate) LocationSummary( |
| 5095 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5172 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5096 result->set_in(0, Location::WritableRegister()); | 5173 result->set_in(0, Location::WritableRegister()); |
| 5097 result->set_out(0, Location::RequiresFpuRegister()); | 5174 result->set_out(0, Location::RequiresFpuRegister()); |
| 5098 return result; | 5175 return result; |
| 5099 } | 5176 } |
| 5100 | 5177 |
| 5101 | 5178 |
| 5102 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5179 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5103 const Register value = locs()->in(0).reg(); | 5180 const Register value = locs()->in(0).reg(); |
| 5104 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5181 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
| 5105 __ SmiUntag(value); | 5182 __ SmiUntag(value); |
| 5106 __ vmovsr(STMP, value); | 5183 __ vmovsr(STMP, value); |
| 5107 __ vcvtdi(result, STMP); | 5184 __ vcvtdi(result, STMP); |
| 5108 } | 5185 } |
| 5109 | 5186 |
| 5110 | 5187 |
| 5111 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(bool opt) const { | 5188 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate, |
| 5189 bool opt) const { | |
| 5112 const intptr_t kNumInputs = 1; | 5190 const intptr_t kNumInputs = 1; |
| 5113 const intptr_t kNumTemps = 0; | 5191 const intptr_t kNumTemps = 0; |
| 5114 LocationSummary* result = | 5192 LocationSummary* result = new(isolate) LocationSummary( |
| 5115 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 5193 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 5116 result->set_in(0, Location::RegisterLocation(R1)); | 5194 result->set_in(0, Location::RegisterLocation(R1)); |
| 5117 result->set_out(0, Location::RegisterLocation(R0)); | 5195 result->set_out(0, Location::RegisterLocation(R0)); |
| 5118 return result; | 5196 return result; |
| 5119 } | 5197 } |
| 5120 | 5198 |
| 5121 | 5199 |
| 5122 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5200 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5123 const Register result = locs()->out(0).reg(); | 5201 const Register result = locs()->out(0).reg(); |
| 5124 const Register value_obj = locs()->in(0).reg(); | 5202 const Register value_obj = locs()->in(0).reg(); |
| 5125 ASSERT(result == R0); | 5203 ASSERT(result == R0); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 5153 compiler->GenerateStaticCall(deopt_id(), | 5231 compiler->GenerateStaticCall(deopt_id(), |
| 5154 instance_call()->token_pos(), | 5232 instance_call()->token_pos(), |
| 5155 target, | 5233 target, |
| 5156 kNumberOfArguments, | 5234 kNumberOfArguments, |
| 5157 Object::null_array(), // No argument names., | 5235 Object::null_array(), // No argument names., |
| 5158 locs()); | 5236 locs()); |
| 5159 __ Bind(&done); | 5237 __ Bind(&done); |
| 5160 } | 5238 } |
| 5161 | 5239 |
| 5162 | 5240 |
| 5163 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(bool opt) const { | 5241 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Isolate* isolate, |
| 5242 bool opt) const { | |
| 5164 const intptr_t kNumInputs = 1; | 5243 const intptr_t kNumInputs = 1; |
| 5165 const intptr_t kNumTemps = 0; | 5244 const intptr_t kNumTemps = 0; |
| 5166 LocationSummary* result = new LocationSummary( | 5245 LocationSummary* result = new(isolate) LocationSummary( |
| 5167 kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5246 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5168 result->set_in(0, Location::RequiresFpuRegister()); | 5247 result->set_in(0, Location::RequiresFpuRegister()); |
| 5169 result->set_out(0, Location::RequiresRegister()); | 5248 result->set_out(0, Location::RequiresRegister()); |
| 5170 return result; | 5249 return result; |
| 5171 } | 5250 } |
| 5172 | 5251 |
| 5173 | 5252 |
| 5174 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5253 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5175 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); | 5254 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); |
| 5176 const Register result = locs()->out(0).reg(); | 5255 const Register result = locs()->out(0).reg(); |
| 5177 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5256 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 5178 // First check for NaN. Checking for minint after the conversion doesn't work | 5257 // First check for NaN. Checking for minint after the conversion doesn't work |
| 5179 // on ARM because vcvtid gives 0 for NaN. | 5258 // on ARM because vcvtid gives 0 for NaN. |
| 5180 __ vcmpd(value, value); | 5259 __ vcmpd(value, value); |
| 5181 __ vmstat(); | 5260 __ vmstat(); |
| 5182 __ b(deopt, VS); | 5261 __ b(deopt, VS); |
| 5183 | 5262 |
| 5184 __ vcvtid(STMP, value); | 5263 __ vcvtid(STMP, value); |
| 5185 __ vmovrs(result, STMP); | 5264 __ vmovrs(result, STMP); |
| 5186 // Check for overflow and that it fits into Smi. | 5265 // Check for overflow and that it fits into Smi. |
| 5187 __ CompareImmediate(result, 0xC0000000); | 5266 __ CompareImmediate(result, 0xC0000000); |
| 5188 __ b(deopt, MI); | 5267 __ b(deopt, MI); |
| 5189 __ SmiTag(result); | 5268 __ SmiTag(result); |
| 5190 } | 5269 } |
| 5191 | 5270 |
| 5192 | 5271 |
| 5193 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(bool opt) const { | 5272 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
| 5273 bool opt) const { | |
| 5194 UNIMPLEMENTED(); | 5274 UNIMPLEMENTED(); |
| 5195 return NULL; | 5275 return NULL; |
| 5196 } | 5276 } |
| 5197 | 5277 |
| 5198 | 5278 |
| 5199 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5279 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5200 UNIMPLEMENTED(); | 5280 UNIMPLEMENTED(); |
| 5201 } | 5281 } |
| 5202 | 5282 |
| 5203 | 5283 |
| 5204 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const { | 5284 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Isolate* isolate, |
| 5285 bool opt) const { | |
| 5205 const intptr_t kNumInputs = 1; | 5286 const intptr_t kNumInputs = 1; |
| 5206 const intptr_t kNumTemps = 0; | 5287 const intptr_t kNumTemps = 0; |
| 5207 LocationSummary* result = | 5288 LocationSummary* result = new(isolate) LocationSummary( |
| 5208 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5289 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5209 // Low (<= Q7) Q registers are needed for the conversion instructions. | 5290 // Low (<= Q7) Q registers are needed for the conversion instructions. |
| 5210 result->set_in(0, Location::RequiresFpuRegister()); | 5291 result->set_in(0, Location::RequiresFpuRegister()); |
| 5211 result->set_out(0, Location::FpuRegisterLocation(Q7)); | 5292 result->set_out(0, Location::FpuRegisterLocation(Q7)); |
| 5212 return result; | 5293 return result; |
| 5213 } | 5294 } |
| 5214 | 5295 |
| 5215 | 5296 |
| 5216 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5297 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5217 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5298 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 5218 const SRegister result = | 5299 const SRegister result = |
| 5219 EvenSRegisterOf(EvenDRegisterOf(locs()->out(0).fpu_reg())); | 5300 EvenSRegisterOf(EvenDRegisterOf(locs()->out(0).fpu_reg())); |
| 5220 __ vcvtsd(result, value); | 5301 __ vcvtsd(result, value); |
| 5221 } | 5302 } |
| 5222 | 5303 |
| 5223 | 5304 |
| 5224 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const { | 5305 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
| 5306 bool opt) const { | |
| 5225 const intptr_t kNumInputs = 1; | 5307 const intptr_t kNumInputs = 1; |
| 5226 const intptr_t kNumTemps = 0; | 5308 const intptr_t kNumTemps = 0; |
| 5227 LocationSummary* result = | 5309 LocationSummary* result = new(isolate) LocationSummary( |
| 5228 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5310 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5229 // Low (<= Q7) Q registers are needed for the conversion instructions. | 5311 // Low (<= Q7) Q registers are needed for the conversion instructions. |
| 5230 result->set_in(0, Location::FpuRegisterLocation(Q7)); | 5312 result->set_in(0, Location::FpuRegisterLocation(Q7)); |
| 5231 result->set_out(0, Location::RequiresFpuRegister()); | 5313 result->set_out(0, Location::RequiresFpuRegister()); |
| 5232 return result; | 5314 return result; |
| 5233 } | 5315 } |
| 5234 | 5316 |
| 5235 | 5317 |
| 5236 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5318 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5237 const SRegister value = | 5319 const SRegister value = |
| 5238 EvenSRegisterOf(EvenDRegisterOf(locs()->in(0).fpu_reg())); | 5320 EvenSRegisterOf(EvenDRegisterOf(locs()->in(0).fpu_reg())); |
| 5239 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5321 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
| 5240 __ vcvtds(result, value); | 5322 __ vcvtds(result, value); |
| 5241 } | 5323 } |
| 5242 | 5324 |
| 5243 | 5325 |
| 5244 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const { | 5326 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Isolate* isolate, |
| 5327 bool opt) const { | |
| 5245 ASSERT((InputCount() == 1) || (InputCount() == 2)); | 5328 ASSERT((InputCount() == 1) || (InputCount() == 2)); |
| 5246 const intptr_t kNumTemps = 0; | 5329 const intptr_t kNumTemps = 0; |
| 5247 LocationSummary* result = | 5330 LocationSummary* result = new(isolate) LocationSummary( |
| 5248 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall); | 5331 isolate, InputCount(), kNumTemps, LocationSummary::kCall); |
| 5249 result->set_in(0, Location::FpuRegisterLocation(Q0)); | 5332 result->set_in(0, Location::FpuRegisterLocation(Q0)); |
| 5250 if (InputCount() == 2) { | 5333 if (InputCount() == 2) { |
| 5251 result->set_in(1, Location::FpuRegisterLocation(Q1)); | 5334 result->set_in(1, Location::FpuRegisterLocation(Q1)); |
| 5252 } | 5335 } |
| 5253 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { | 5336 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { |
| 5254 result->AddTemp(Location::RegisterLocation(R2)); | 5337 result->AddTemp(Location::RegisterLocation(R2)); |
| 5255 } | 5338 } |
| 5256 if (!TargetCPUFeatures::hardfp_supported()) { | 5339 if (!TargetCPUFeatures::hardfp_supported()) { |
| 5257 result->AddTemp(Location::RegisterLocation(R0)); | 5340 result->AddTemp(Location::RegisterLocation(R0)); |
| 5258 result->AddTemp(Location::RegisterLocation(R1)); | 5341 result->AddTemp(Location::RegisterLocation(R1)); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5417 // registers. | 5500 // registers. |
| 5418 __ vmovrrd(R0, R1, D0); | 5501 __ vmovrrd(R0, R1, D0); |
| 5419 __ vmovrrd(R2, R3, D1); | 5502 __ vmovrrd(R2, R3, D1); |
| 5420 __ CallRuntime(TargetFunction(), InputCount()); | 5503 __ CallRuntime(TargetFunction(), InputCount()); |
| 5421 __ vmovdrr(D0, R0, R1); | 5504 __ vmovdrr(D0, R0, R1); |
| 5422 __ vmovdrr(D1, R2, R3); | 5505 __ vmovdrr(D1, R2, R3); |
| 5423 } | 5506 } |
| 5424 } | 5507 } |
| 5425 | 5508 |
| 5426 | 5509 |
| 5427 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(bool opt) const { | 5510 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Isolate* isolate, |
| 5511 bool opt) const { | |
| 5428 // Only use this instruction in optimized code. | 5512 // Only use this instruction in optimized code. |
| 5429 ASSERT(opt); | 5513 ASSERT(opt); |
| 5430 const intptr_t kNumInputs = 1; | 5514 const intptr_t kNumInputs = 1; |
| 5431 LocationSummary* summary = | 5515 LocationSummary* summary = new(isolate) LocationSummary( |
| 5432 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); | 5516 isolate, kNumInputs, 0, LocationSummary::kNoCall); |
| 5433 if (representation() == kUnboxedDouble) { | 5517 if (representation() == kUnboxedDouble) { |
| 5434 if (index() == 0) { | 5518 if (index() == 0) { |
| 5435 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), | 5519 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), |
| 5436 Location::Any())); | 5520 Location::Any())); |
| 5437 } else { | 5521 } else { |
| 5438 ASSERT(index() == 1); | 5522 ASSERT(index() == 1); |
| 5439 summary->set_in(0, Location::Pair(Location::Any(), | 5523 summary->set_in(0, Location::Pair(Location::Any(), |
| 5440 Location::RequiresFpuRegister())); | 5524 Location::RequiresFpuRegister())); |
| 5441 } | 5525 } |
| 5442 summary->set_out(0, Location::RequiresFpuRegister()); | 5526 summary->set_out(0, Location::RequiresFpuRegister()); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 5466 __ vmovq(out, in); | 5550 __ vmovq(out, in); |
| 5467 } else { | 5551 } else { |
| 5468 ASSERT(representation() == kTagged); | 5552 ASSERT(representation() == kTagged); |
| 5469 const Register out = locs()->out(0).reg(); | 5553 const Register out = locs()->out(0).reg(); |
| 5470 const Register in = in_loc.reg(); | 5554 const Register in = in_loc.reg(); |
| 5471 __ mov(out, ShifterOperand(in)); | 5555 __ mov(out, ShifterOperand(in)); |
| 5472 } | 5556 } |
| 5473 } | 5557 } |
| 5474 | 5558 |
| 5475 | 5559 |
| 5476 LocationSummary* MergedMathInstr::MakeLocationSummary(bool opt) const { | 5560 LocationSummary* MergedMathInstr::MakeLocationSummary(Isolate* isolate, |
| 5561 bool opt) const { | |
| 5477 if (kind() == MergedMathInstr::kTruncDivMod) { | 5562 if (kind() == MergedMathInstr::kTruncDivMod) { |
| 5478 const intptr_t kNumInputs = 2; | 5563 const intptr_t kNumInputs = 2; |
| 5479 const intptr_t kNumTemps = 2; | 5564 const intptr_t kNumTemps = 2; |
| 5480 LocationSummary* summary = | 5565 LocationSummary* summary = new(isolate) LocationSummary( |
| 5481 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5566 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5482 summary->set_in(0, Location::RequiresRegister()); | 5567 summary->set_in(0, Location::RequiresRegister()); |
| 5483 summary->set_in(1, Location::RequiresRegister()); | 5568 summary->set_in(1, Location::RequiresRegister()); |
| 5484 summary->set_temp(0, Location::RequiresRegister()); | 5569 summary->set_temp(0, Location::RequiresRegister()); |
| 5485 summary->set_temp(1, Location::RequiresFpuRegister()); | 5570 summary->set_temp(1, Location::RequiresFpuRegister()); |
| 5486 // Output is a pair of registers. | 5571 // Output is a pair of registers. |
| 5487 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 5572 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 5488 Location::RequiresRegister())); | 5573 Location::RequiresRegister())); |
| 5489 return summary; | 5574 return summary; |
| 5490 } | 5575 } |
| 5491 UNIMPLEMENTED(); | 5576 UNIMPLEMENTED(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5549 return; | 5634 return; |
| 5550 } | 5635 } |
| 5551 if (kind() == MergedMathInstr::kSinCos) { | 5636 if (kind() == MergedMathInstr::kSinCos) { |
| 5552 UNIMPLEMENTED(); | 5637 UNIMPLEMENTED(); |
| 5553 } | 5638 } |
| 5554 UNIMPLEMENTED(); | 5639 UNIMPLEMENTED(); |
| 5555 } | 5640 } |
| 5556 | 5641 |
| 5557 | 5642 |
| 5558 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 5643 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
| 5559 bool opt) const { | 5644 Isolate* isolate, bool opt) const { |
| 5560 return MakeCallSummary(); | 5645 return MakeCallSummary(); |
| 5561 } | 5646 } |
| 5562 | 5647 |
| 5563 | 5648 |
| 5564 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5649 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5565 Label* deopt = compiler->AddDeoptStub( | 5650 Label* deopt = compiler->AddDeoptStub( |
| 5566 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | 5651 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
| 5567 if (ic_data().NumberOfChecks() == 0) { | 5652 if (ic_data().NumberOfChecks() == 0) { |
| 5568 __ b(deopt); | 5653 __ b(deopt); |
| 5569 return; | 5654 return; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 5592 R2, // Class id register. | 5677 R2, // Class id register. |
| 5593 instance_call()->ArgumentCount(), | 5678 instance_call()->ArgumentCount(), |
| 5594 instance_call()->argument_names(), | 5679 instance_call()->argument_names(), |
| 5595 deopt, | 5680 deopt, |
| 5596 deopt_id(), | 5681 deopt_id(), |
| 5597 instance_call()->token_pos(), | 5682 instance_call()->token_pos(), |
| 5598 locs()); | 5683 locs()); |
| 5599 } | 5684 } |
| 5600 | 5685 |
| 5601 | 5686 |
| 5602 LocationSummary* BranchInstr::MakeLocationSummary(bool opt) const { | 5687 LocationSummary* BranchInstr::MakeLocationSummary(Isolate* isolate, |
| 5603 comparison()->InitializeLocationSummary(opt); | 5688 bool opt) const { |
| 5689 comparison()->InitializeLocationSummary(isolate, opt); | |
| 5604 // Branches don't produce a result. | 5690 // Branches don't produce a result. |
| 5605 comparison()->locs()->set_out(0, Location::NoLocation()); | 5691 comparison()->locs()->set_out(0, Location::NoLocation()); |
| 5606 return comparison()->locs(); | 5692 return comparison()->locs(); |
| 5607 } | 5693 } |
| 5608 | 5694 |
| 5609 | 5695 |
| 5610 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5696 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5611 comparison()->EmitBranchCode(compiler, this); | 5697 comparison()->EmitBranchCode(compiler, this); |
| 5612 } | 5698 } |
| 5613 | 5699 |
| 5614 | 5700 |
| 5615 LocationSummary* CheckClassInstr::MakeLocationSummary(bool opt) const { | 5701 LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate, |
| 5702 bool opt) const { | |
| 5616 const intptr_t kNumInputs = 1; | 5703 const intptr_t kNumInputs = 1; |
| 5617 const intptr_t kNumTemps = 0; | 5704 const intptr_t kNumTemps = 0; |
| 5618 LocationSummary* summary = | 5705 LocationSummary* summary = new(isolate) LocationSummary( |
| 5619 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5706 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5620 summary->set_in(0, Location::RequiresRegister()); | 5707 summary->set_in(0, Location::RequiresRegister()); |
| 5621 if (!IsNullCheck()) { | 5708 if (!IsNullCheck()) { |
| 5622 summary->AddTemp(Location::RequiresRegister()); | 5709 summary->AddTemp(Location::RequiresRegister()); |
| 5623 } | 5710 } |
| 5624 return summary; | 5711 return summary; |
| 5625 } | 5712 } |
| 5626 | 5713 |
| 5627 | 5714 |
| 5628 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5715 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5629 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? | 5716 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 5659 if (i == (num_checks - 1)) { | 5746 if (i == (num_checks - 1)) { |
| 5660 __ b(deopt, NE); | 5747 __ b(deopt, NE); |
| 5661 } else { | 5748 } else { |
| 5662 __ b(&is_ok, EQ); | 5749 __ b(&is_ok, EQ); |
| 5663 } | 5750 } |
| 5664 } | 5751 } |
| 5665 __ Bind(&is_ok); | 5752 __ Bind(&is_ok); |
| 5666 } | 5753 } |
| 5667 | 5754 |
| 5668 | 5755 |
| 5669 LocationSummary* CheckSmiInstr::MakeLocationSummary(bool opt) const { | 5756 LocationSummary* CheckSmiInstr::MakeLocationSummary(Isolate* isolate, |
| 5757 bool opt) const { | |
| 5670 const intptr_t kNumInputs = 1; | 5758 const intptr_t kNumInputs = 1; |
| 5671 const intptr_t kNumTemps = 0; | 5759 const intptr_t kNumTemps = 0; |
| 5672 LocationSummary* summary = | 5760 LocationSummary* summary = new(isolate) LocationSummary( |
| 5673 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5761 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5674 summary->set_in(0, Location::RequiresRegister()); | 5762 summary->set_in(0, Location::RequiresRegister()); |
| 5675 return summary; | 5763 return summary; |
| 5676 } | 5764 } |
| 5677 | 5765 |
| 5678 | 5766 |
| 5679 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5767 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5680 const Register value = locs()->in(0).reg(); | 5768 const Register value = locs()->in(0).reg(); |
| 5681 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); | 5769 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); |
| 5682 __ tst(value, ShifterOperand(kSmiTagMask)); | 5770 __ tst(value, ShifterOperand(kSmiTagMask)); |
| 5683 __ b(deopt, NE); | 5771 __ b(deopt, NE); |
| 5684 } | 5772 } |
| 5685 | 5773 |
| 5686 | 5774 |
| 5687 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { | 5775 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate, |
| 5776 bool opt) const { | |
| 5688 const intptr_t kNumInputs = 2; | 5777 const intptr_t kNumInputs = 2; |
| 5689 const intptr_t kNumTemps = 0; | 5778 const intptr_t kNumTemps = 0; |
| 5690 LocationSummary* locs = | 5779 LocationSummary* locs = new(isolate) LocationSummary( |
| 5691 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5780 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5692 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 5781 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
| 5693 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 5782 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
| 5694 return locs; | 5783 return locs; |
| 5695 } | 5784 } |
| 5696 | 5785 |
| 5697 | 5786 |
| 5698 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5787 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5699 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 5788 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
| 5700 ICData::kDeoptCheckArrayBound); | 5789 ICData::kDeoptCheckArrayBound); |
| 5701 | 5790 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5745 __ b(overflow, HI); | 5834 __ b(overflow, HI); |
| 5746 | 5835 |
| 5747 __ Bind(&check_lower); | 5836 __ Bind(&check_lower); |
| 5748 __ CompareImmediate(result_hi, -0x00200000); | 5837 __ CompareImmediate(result_hi, -0x00200000); |
| 5749 __ b(overflow, LT); | 5838 __ b(overflow, LT); |
| 5750 // Anything in the lower part would make the number bigger than the lower | 5839 // Anything in the lower part would make the number bigger than the lower |
| 5751 // bound, so we are done. | 5840 // bound, so we are done. |
| 5752 } | 5841 } |
| 5753 | 5842 |
| 5754 | 5843 |
| 5755 LocationSummary* UnboxIntegerInstr::MakeLocationSummary(bool opt) const { | 5844 LocationSummary* UnboxIntegerInstr::MakeLocationSummary(Isolate* isolate, |
| 5845 bool opt) const { | |
| 5756 const intptr_t kNumInputs = 1; | 5846 const intptr_t kNumInputs = 1; |
| 5757 const intptr_t kNumTemps = 1; | 5847 const intptr_t kNumTemps = 1; |
| 5758 LocationSummary* summary = | 5848 LocationSummary* summary = new(isolate) LocationSummary( |
| 5759 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5849 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5760 summary->set_in(0, Location::RequiresRegister()); | 5850 summary->set_in(0, Location::RequiresRegister()); |
| 5761 summary->set_temp(0, Location::RequiresRegister()); | 5851 summary->set_temp(0, Location::RequiresRegister()); |
| 5762 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 5852 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 5763 Location::RequiresRegister())); | 5853 Location::RequiresRegister())); |
| 5764 return summary; | 5854 return summary; |
| 5765 } | 5855 } |
| 5766 | 5856 |
| 5767 | 5857 |
| 5768 void UnboxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5858 void UnboxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5769 const intptr_t value_cid = value()->Type()->ToCid(); | 5859 const intptr_t value_cid = value()->Type()->ToCid(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5821 __ mov(result_lo, ShifterOperand(value)); | 5911 __ mov(result_lo, ShifterOperand(value)); |
| 5822 // Untag. | 5912 // Untag. |
| 5823 __ SmiUntag(result_lo); | 5913 __ SmiUntag(result_lo); |
| 5824 // Sign extend result_lo into result_hi. | 5914 // Sign extend result_lo into result_hi. |
| 5825 __ SignFill(result_hi, result_lo); | 5915 __ SignFill(result_hi, result_lo); |
| 5826 __ Bind(&done); | 5916 __ Bind(&done); |
| 5827 } | 5917 } |
| 5828 } | 5918 } |
| 5829 | 5919 |
| 5830 | 5920 |
| 5831 LocationSummary* BoxIntegerInstr::MakeLocationSummary(bool opt) const { | 5921 LocationSummary* BoxIntegerInstr::MakeLocationSummary(Isolate* isolate, |
| 5922 bool opt) const { | |
| 5832 const intptr_t kNumInputs = 1; | 5923 const intptr_t kNumInputs = 1; |
| 5833 const intptr_t kNumTemps = 1; | 5924 const intptr_t kNumTemps = 1; |
| 5834 LocationSummary* summary = | 5925 LocationSummary* summary = new(isolate) LocationSummary( |
| 5835 new LocationSummary(kNumInputs, | 5926 isolate, kNumInputs, |
| 5836 kNumTemps, | 5927 kNumTemps, |
| 5837 LocationSummary::kCallOnSlowPath); | 5928 LocationSummary::kCallOnSlowPath); |
| 5838 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 5929 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
| 5839 Location::RequiresRegister())); | 5930 Location::RequiresRegister())); |
| 5840 summary->set_temp(0, Location::RequiresRegister()); | 5931 summary->set_temp(0, Location::RequiresRegister()); |
| 5841 summary->set_out(0, Location::RequiresRegister()); | 5932 summary->set_out(0, Location::RequiresRegister()); |
| 5842 return summary; | 5933 return summary; |
| 5843 } | 5934 } |
| 5844 | 5935 |
| 5845 | 5936 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5927 out_reg, | 6018 out_reg, |
| 5928 Mint::value_offset() - kHeapObjectTag); | 6019 Mint::value_offset() - kHeapObjectTag); |
| 5929 __ StoreToOffset(kWord, | 6020 __ StoreToOffset(kWord, |
| 5930 value_hi, | 6021 value_hi, |
| 5931 out_reg, | 6022 out_reg, |
| 5932 Mint::value_offset() - kHeapObjectTag + kWordSize); | 6023 Mint::value_offset() - kHeapObjectTag + kWordSize); |
| 5933 __ Bind(&done); | 6024 __ Bind(&done); |
| 5934 } | 6025 } |
| 5935 | 6026 |
| 5936 | 6027 |
| 5937 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(bool opt) const { | 6028 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Isolate* isolate, |
| 6029 bool opt) const { | |
| 5938 const intptr_t kNumInputs = 2; | 6030 const intptr_t kNumInputs = 2; |
| 5939 const intptr_t kNumTemps = 0; | 6031 const intptr_t kNumTemps = 0; |
| 5940 LocationSummary* summary = | 6032 LocationSummary* summary = new(isolate) LocationSummary( |
| 5941 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6033 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5942 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6034 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
| 5943 Location::RequiresRegister())); | 6035 Location::RequiresRegister())); |
| 5944 summary->set_in(1, Location::Pair(Location::RequiresRegister(), | 6036 summary->set_in(1, Location::Pair(Location::RequiresRegister(), |
| 5945 Location::RequiresRegister())); | 6037 Location::RequiresRegister())); |
| 5946 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6038 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 5947 Location::RequiresRegister())); | 6039 Location::RequiresRegister())); |
| 5948 return summary; | 6040 return summary; |
| 5949 } | 6041 } |
| 5950 | 6042 |
| 5951 | 6043 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6000 default: | 6092 default: |
| 6001 UNREACHABLE(); | 6093 UNREACHABLE(); |
| 6002 break; | 6094 break; |
| 6003 } | 6095 } |
| 6004 if (FLAG_throw_on_javascript_int_overflow) { | 6096 if (FLAG_throw_on_javascript_int_overflow) { |
| 6005 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); | 6097 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); |
| 6006 } | 6098 } |
| 6007 } | 6099 } |
| 6008 | 6100 |
| 6009 | 6101 |
| 6010 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(bool opt) const { | 6102 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Isolate* isolate, |
| 6103 bool opt) const { | |
| 6011 const intptr_t kNumInputs = 2; | 6104 const intptr_t kNumInputs = 2; |
| 6012 const intptr_t kNumTemps = 1; | 6105 const intptr_t kNumTemps = 1; |
| 6013 LocationSummary* summary = | 6106 LocationSummary* summary = new(isolate) LocationSummary( |
| 6014 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6107 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 6015 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6108 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
| 6016 Location::RequiresRegister())); | 6109 Location::RequiresRegister())); |
| 6017 summary->set_in(1, Location::WritableRegister()); | 6110 summary->set_in(1, Location::WritableRegister()); |
| 6018 summary->set_temp(0, Location::RequiresRegister()); | 6111 summary->set_temp(0, Location::RequiresRegister()); |
| 6019 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6112 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 6020 Location::RequiresRegister())); | 6113 Location::RequiresRegister())); |
| 6021 return summary; | 6114 return summary; |
| 6022 } | 6115 } |
| 6023 | 6116 |
| 6024 | 6117 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6091 break; | 6184 break; |
| 6092 } | 6185 } |
| 6093 | 6186 |
| 6094 __ Bind(&done); | 6187 __ Bind(&done); |
| 6095 if (FLAG_throw_on_javascript_int_overflow) { | 6188 if (FLAG_throw_on_javascript_int_overflow) { |
| 6096 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); | 6189 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); |
| 6097 } | 6190 } |
| 6098 } | 6191 } |
| 6099 | 6192 |
| 6100 | 6193 |
| 6101 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(bool opt) const { | 6194 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Isolate* isolate, |
| 6195 bool opt) const { | |
| 6102 const intptr_t kNumInputs = 1; | 6196 const intptr_t kNumInputs = 1; |
| 6103 const intptr_t kNumTemps = 0; | 6197 const intptr_t kNumTemps = 0; |
| 6104 LocationSummary* summary = | 6198 LocationSummary* summary = new(isolate) LocationSummary( |
| 6105 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6199 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 6106 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6200 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
| 6107 Location::RequiresRegister())); | 6201 Location::RequiresRegister())); |
| 6108 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6202 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 6109 Location::RequiresRegister())); | 6203 Location::RequiresRegister())); |
| 6110 return summary; | 6204 return summary; |
| 6111 } | 6205 } |
| 6112 | 6206 |
| 6113 | 6207 |
| 6114 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6208 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6115 ASSERT(op_kind() == Token::kBIT_NOT); | 6209 ASSERT(op_kind() == Token::kBIT_NOT); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 6127 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryMintOp); | 6221 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryMintOp); |
| 6128 } | 6222 } |
| 6129 __ mvn(out_lo, ShifterOperand(left_lo)); | 6223 __ mvn(out_lo, ShifterOperand(left_lo)); |
| 6130 __ mvn(out_hi, ShifterOperand(left_hi)); | 6224 __ mvn(out_hi, ShifterOperand(left_hi)); |
| 6131 if (FLAG_throw_on_javascript_int_overflow) { | 6225 if (FLAG_throw_on_javascript_int_overflow) { |
| 6132 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); | 6226 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); |
| 6133 } | 6227 } |
| 6134 } | 6228 } |
| 6135 | 6229 |
| 6136 | 6230 |
| 6137 LocationSummary* ThrowInstr::MakeLocationSummary(bool opt) const { | 6231 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, |
| 6138 return new LocationSummary(0, 0, LocationSummary::kCall); | 6232 bool opt) const { |
| 6233 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | |
| 6139 } | 6234 } |
| 6140 | 6235 |
| 6141 | 6236 |
| 6142 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6237 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6143 compiler->GenerateRuntimeCall(token_pos(), | 6238 compiler->GenerateRuntimeCall(token_pos(), |
| 6144 deopt_id(), | 6239 deopt_id(), |
| 6145 kThrowRuntimeEntry, | 6240 kThrowRuntimeEntry, |
| 6146 1, | 6241 1, |
| 6147 locs()); | 6242 locs()); |
| 6148 __ bkpt(0); | 6243 __ bkpt(0); |
| 6149 } | 6244 } |
| 6150 | 6245 |
| 6151 | 6246 |
| 6152 LocationSummary* ReThrowInstr::MakeLocationSummary(bool opt) const { | 6247 LocationSummary* ReThrowInstr::MakeLocationSummary(Isolate* isolate, |
| 6153 return new LocationSummary(0, 0, LocationSummary::kCall); | 6248 bool opt) const { |
| 6249 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | |
| 6154 } | 6250 } |
| 6155 | 6251 |
| 6156 | 6252 |
| 6157 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6253 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6158 compiler->SetNeedsStacktrace(catch_try_index()); | 6254 compiler->SetNeedsStacktrace(catch_try_index()); |
| 6159 compiler->GenerateRuntimeCall(token_pos(), | 6255 compiler->GenerateRuntimeCall(token_pos(), |
| 6160 deopt_id(), | 6256 deopt_id(), |
| 6161 kReThrowRuntimeEntry, | 6257 kReThrowRuntimeEntry, |
| 6162 2, | 6258 2, |
| 6163 locs()); | 6259 locs()); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 6183 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6279 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 6184 deopt_id_, | 6280 deopt_id_, |
| 6185 Scanner::kNoSourcePos); | 6281 Scanner::kNoSourcePos); |
| 6186 } | 6282 } |
| 6187 if (HasParallelMove()) { | 6283 if (HasParallelMove()) { |
| 6188 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6284 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 6189 } | 6285 } |
| 6190 } | 6286 } |
| 6191 | 6287 |
| 6192 | 6288 |
| 6193 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { | 6289 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, |
| 6194 return new LocationSummary(0, 0, LocationSummary::kNoCall); | 6290 bool opt) const { |
| 6291 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); | |
| 6195 } | 6292 } |
| 6196 | 6293 |
| 6197 | 6294 |
| 6198 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6295 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6199 if (!compiler->is_optimizing()) { | 6296 if (!compiler->is_optimizing()) { |
| 6200 compiler->EmitEdgeCounter(); | 6297 compiler->EmitEdgeCounter(); |
| 6201 // Add a deoptimization descriptor for deoptimizing instructions that | 6298 // Add a deoptimization descriptor for deoptimizing instructions that |
| 6202 // may be inserted before this instruction. On ARM this descriptor | 6299 // may be inserted before this instruction. On ARM this descriptor |
| 6203 // points after the edge counter code so that we can reuse the same | 6300 // points after the edge counter code so that we can reuse the same |
| 6204 // pattern matching code as at call sites, which matches backwards from | 6301 // pattern matching code as at call sites, which matches backwards from |
| 6205 // the end of the pattern. | 6302 // the end of the pattern. |
| 6206 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6303 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 6207 GetDeoptId(), | 6304 GetDeoptId(), |
| 6208 Scanner::kNoSourcePos); | 6305 Scanner::kNoSourcePos); |
| 6209 } | 6306 } |
| 6210 if (HasParallelMove()) { | 6307 if (HasParallelMove()) { |
| 6211 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6308 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 6212 } | 6309 } |
| 6213 | 6310 |
| 6214 // We can fall through if the successor is the next block in the list. | 6311 // We can fall through if the successor is the next block in the list. |
| 6215 // Otherwise, we need a jump. | 6312 // Otherwise, we need a jump. |
| 6216 if (!compiler->CanFallThroughTo(successor())) { | 6313 if (!compiler->CanFallThroughTo(successor())) { |
| 6217 __ b(compiler->GetJumpLabel(successor())); | 6314 __ b(compiler->GetJumpLabel(successor())); |
| 6218 } | 6315 } |
| 6219 } | 6316 } |
| 6220 | 6317 |
| 6221 | 6318 |
| 6222 LocationSummary* CurrentContextInstr::MakeLocationSummary(bool opt) const { | 6319 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, |
| 6320 bool opt) const { | |
| 6223 return LocationSummary::Make(0, | 6321 return LocationSummary::Make(0, |
| 6224 Location::RequiresRegister(), | 6322 Location::RequiresRegister(), |
| 6225 LocationSummary::kNoCall); | 6323 LocationSummary::kNoCall); |
| 6226 } | 6324 } |
| 6227 | 6325 |
| 6228 | 6326 |
| 6229 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6327 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6230 __ mov(locs()->out(0).reg(), ShifterOperand(CTX)); | 6328 __ mov(locs()->out(0).reg(), ShifterOperand(CTX)); |
| 6231 } | 6329 } |
| 6232 | 6330 |
| 6233 | 6331 |
| 6234 LocationSummary* StrictCompareInstr::MakeLocationSummary(bool opt) const { | 6332 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate, |
| 6333 bool opt) const { | |
| 6235 const intptr_t kNumInputs = 2; | 6334 const intptr_t kNumInputs = 2; |
| 6236 const intptr_t kNumTemps = 0; | 6335 const intptr_t kNumTemps = 0; |
| 6237 if (needs_number_check()) { | 6336 if (needs_number_check()) { |
| 6238 LocationSummary* locs = | 6337 LocationSummary* locs = new(isolate) LocationSummary( |
| 6239 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 6338 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 6240 locs->set_in(0, Location::RegisterLocation(R0)); | 6339 locs->set_in(0, Location::RegisterLocation(R0)); |
| 6241 locs->set_in(1, Location::RegisterLocation(R1)); | 6340 locs->set_in(1, Location::RegisterLocation(R1)); |
| 6242 locs->set_out(0, Location::RegisterLocation(R0)); | 6341 locs->set_out(0, Location::RegisterLocation(R0)); |
| 6243 return locs; | 6342 return locs; |
| 6244 } | 6343 } |
| 6245 LocationSummary* locs = | 6344 LocationSummary* locs = new(isolate) LocationSummary( |
| 6246 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6345 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 6247 locs->set_in(0, Location::RegisterOrConstant(left())); | 6346 locs->set_in(0, Location::RegisterOrConstant(left())); |
| 6248 // Only one of the inputs can be a constant. Choose register if the first one | 6347 // Only one of the inputs can be a constant. Choose register if the first one |
| 6249 // is a constant. | 6348 // is a constant. |
| 6250 locs->set_in(1, locs->in(0).IsConstant() | 6349 locs->set_in(1, locs->in(0).IsConstant() |
| 6251 ? Location::RequiresRegister() | 6350 ? Location::RequiresRegister() |
| 6252 : Location::RegisterOrConstant(right())); | 6351 : Location::RegisterOrConstant(right())); |
| 6253 locs->set_out(0, Location::RequiresRegister()); | 6352 locs->set_out(0, Location::RequiresRegister()); |
| 6254 return locs; | 6353 return locs; |
| 6255 } | 6354 } |
| 6256 | 6355 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6297 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 6396 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
| 6298 BranchInstr* branch) { | 6397 BranchInstr* branch) { |
| 6299 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | 6398 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
| 6300 | 6399 |
| 6301 BranchLabels labels = compiler->CreateBranchLabels(branch); | 6400 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 6302 Condition true_condition = EmitComparisonCode(compiler, labels); | 6401 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 6303 EmitBranchOnCondition(compiler, true_condition, labels); | 6402 EmitBranchOnCondition(compiler, true_condition, labels); |
| 6304 } | 6403 } |
| 6305 | 6404 |
| 6306 | 6405 |
| 6307 LocationSummary* BooleanNegateInstr::MakeLocationSummary(bool opt) const { | 6406 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, |
| 6407 bool opt) const { | |
| 6308 return LocationSummary::Make(1, | 6408 return LocationSummary::Make(1, |
| 6309 Location::RequiresRegister(), | 6409 Location::RequiresRegister(), |
| 6310 LocationSummary::kNoCall); | 6410 LocationSummary::kNoCall); |
| 6311 } | 6411 } |
| 6312 | 6412 |
| 6313 | 6413 |
| 6314 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6414 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6315 const Register value = locs()->in(0).reg(); | 6415 const Register value = locs()->in(0).reg(); |
| 6316 const Register result = locs()->out(0).reg(); | 6416 const Register result = locs()->out(0).reg(); |
| 6317 | 6417 |
| 6318 __ LoadObject(result, Bool::True()); | 6418 __ LoadObject(result, Bool::True()); |
| 6319 __ cmp(result, ShifterOperand(value)); | 6419 __ cmp(result, ShifterOperand(value)); |
| 6320 __ LoadObject(result, Bool::False(), EQ); | 6420 __ LoadObject(result, Bool::False(), EQ); |
| 6321 } | 6421 } |
| 6322 | 6422 |
| 6323 | 6423 |
| 6324 LocationSummary* AllocateObjectInstr::MakeLocationSummary(bool opt) const { | 6424 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, |
| 6425 bool opt) const { | |
| 6325 return MakeCallSummary(); | 6426 return MakeCallSummary(); |
| 6326 } | 6427 } |
| 6327 | 6428 |
| 6328 | 6429 |
| 6329 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6430 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6330 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); | 6431 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); |
| 6331 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); | 6432 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); |
| 6332 compiler->GenerateCall(token_pos(), | 6433 compiler->GenerateCall(token_pos(), |
| 6333 &label, | 6434 &label, |
| 6334 PcDescriptors::kOther, | 6435 PcDescriptors::kOther, |
| 6335 locs()); | 6436 locs()); |
| 6336 __ Drop(ArgumentCount()); // Discard arguments. | 6437 __ Drop(ArgumentCount()); // Discard arguments. |
| 6337 } | 6438 } |
| 6338 | 6439 |
| 6339 } // namespace dart | 6440 } // namespace dart |
| 6340 | 6441 |
| 6341 #endif // defined TARGET_ARCH_ARM | 6442 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |