| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2322 break; | 2322 break; |
| 2323 } | 2323 } |
| 2324 default: | 2324 default: |
| 2325 UNREACHABLE(); | 2325 UNREACHABLE(); |
| 2326 break; | 2326 break; |
| 2327 } | 2327 } |
| 2328 } | 2328 } |
| 2329 | 2329 |
| 2330 | 2330 |
| 2331 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const { | 2331 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const { |
| 2332 ASSERT((left()->Type()->ToCid() != kDoubleCid) && | 2332 intptr_t left_cid = left()->Type()->ToCid(); |
| 2333 (right()->Type()->ToCid() != kDoubleCid)); | 2333 intptr_t right_cid = right()->Type()->ToCid(); |
| 2334 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
| 2334 const intptr_t kNumInputs = 2; | 2335 const intptr_t kNumInputs = 2; |
| 2335 const intptr_t kNumTemps = 1; | 2336 const bool need_temp = (left_cid != kSmiCid) && (right_cid != kSmiCid); |
| 2337 const intptr_t kNumTemps = need_temp ? 1 : 0; |
| 2336 LocationSummary* summary = | 2338 LocationSummary* summary = |
| 2337 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2339 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2338 summary->set_in(0, Location::RequiresRegister()); | 2340 summary->set_in(0, Location::RequiresRegister()); |
| 2339 summary->set_in(1, Location::RequiresRegister()); | 2341 summary->set_in(1, Location::RequiresRegister()); |
| 2340 summary->set_temp(0, Location::RequiresRegister()); | 2342 if (need_temp) summary->set_temp(0, Location::RequiresRegister()); |
| 2341 return summary; | 2343 return summary; |
| 2342 } | 2344 } |
| 2343 | 2345 |
| 2344 | 2346 |
| 2345 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2347 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2346 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptBinaryDoubleOp); | 2348 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptBinaryDoubleOp); |
| 2347 Register temp = locs()->temp(0).reg(); | 2349 intptr_t left_cid = left()->Type()->ToCid(); |
| 2348 __ movl(temp, locs()->in(0).reg()); | 2350 intptr_t right_cid = right()->Type()->ToCid(); |
| 2349 __ orl(temp, locs()->in(1).reg()); | 2351 Register left = locs()->in(0).reg(); |
| 2350 __ testl(temp, Immediate(kSmiTagMask)); | 2352 Register right = locs()->in(1).reg(); |
| 2353 if (left_cid == kSmiCid) { |
| 2354 __ testl(right, Immediate(kSmiTagMask)); |
| 2355 } else if (right_cid == kSmiCid) { |
| 2356 __ testl(left, Immediate(kSmiTagMask)); |
| 2357 } else { |
| 2358 Register temp = locs()->temp(0).reg(); |
| 2359 __ movl(temp, left); |
| 2360 __ orl(temp, right); |
| 2361 __ testl(temp, Immediate(kSmiTagMask)); |
| 2362 } |
| 2351 __ j(ZERO, deopt); | 2363 __ j(ZERO, deopt); |
| 2352 } | 2364 } |
| 2353 | 2365 |
| 2354 | 2366 |
| 2355 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { | 2367 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { |
| 2356 const intptr_t kNumInputs = 1; | 2368 const intptr_t kNumInputs = 1; |
| 2357 const intptr_t kNumTemps = 0; | 2369 const intptr_t kNumTemps = 0; |
| 2358 LocationSummary* summary = | 2370 LocationSummary* summary = |
| 2359 new LocationSummary(kNumInputs, | 2371 new LocationSummary(kNumInputs, |
| 2360 kNumTemps, | 2372 kNumTemps, |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3494 PcDescriptors::kOther, | 3506 PcDescriptors::kOther, |
| 3495 locs()); | 3507 locs()); |
| 3496 __ Drop(2); // Discard type arguments and receiver. | 3508 __ Drop(2); // Discard type arguments and receiver. |
| 3497 } | 3509 } |
| 3498 | 3510 |
| 3499 } // namespace dart | 3511 } // namespace dart |
| 3500 | 3512 |
| 3501 #undef __ | 3513 #undef __ |
| 3502 | 3514 |
| 3503 #endif // defined TARGET_ARCH_IA32 | 3515 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |