| 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 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2508 XmmRegister temp = locs()->temp(0).fpu_reg(); | 2508 XmmRegister temp = locs()->temp(0).fpu_reg(); |
| 2509 __ DoubleRound(result, value, temp); | 2509 __ DoubleRound(result, value, temp); |
| 2510 break; | 2510 break; |
| 2511 } | 2511 } |
| 2512 default: | 2512 default: |
| 2513 UNREACHABLE(); | 2513 UNREACHABLE(); |
| 2514 } | 2514 } |
| 2515 } | 2515 } |
| 2516 | 2516 |
| 2517 | 2517 |
| 2518 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary() const { |
| 2519 ASSERT((InputCount() == 1) || (InputCount() == 2)); |
| 2520 const intptr_t kNumTemps = 0; |
| 2521 LocationSummary* result = |
| 2522 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall); |
| 2523 result->set_in(0, Location::FpuRegisterLocation(XMM1, Location::kDouble)); |
| 2524 if (InputCount() == 2) { |
| 2525 result->set_in(1, Location::FpuRegisterLocation(XMM2, Location::kDouble)); |
| 2526 } |
| 2527 result->set_out(Location::FpuRegisterLocation(XMM1, Location::kDouble)); |
| 2528 return result; |
| 2529 } |
| 2530 |
| 2531 |
| 2532 void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2533 __ EnterFrame(0); |
| 2534 __ ReserveAlignedFrameSpace(kDoubleSize * InputCount()); |
| 2535 for (intptr_t i = 0; i < InputCount(); i++) { |
| 2536 __ movsd(Address(ESP, kDoubleSize * i), locs()->in(i).fpu_reg()); |
| 2537 } |
| 2538 __ CallRuntime(TargetFunction()); |
| 2539 __ fstpl(Address(ESP, 0)); |
| 2540 __ movsd(locs()->out().fpu_reg(), Address(ESP, 0)); |
| 2541 __ leave(); |
| 2542 } |
| 2543 |
| 2544 |
| 2518 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { | 2545 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { |
| 2519 return MakeCallSummary(); | 2546 return MakeCallSummary(); |
| 2520 } | 2547 } |
| 2521 | 2548 |
| 2522 | 2549 |
| 2523 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2550 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2524 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | 2551 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
| 2525 kDeoptPolymorphicInstanceCallTestFail); | 2552 kDeoptPolymorphicInstanceCallTestFail); |
| 2526 if (ic_data().NumberOfChecks() == 0) { | 2553 if (ic_data().NumberOfChecks() == 0) { |
| 2527 __ jmp(deopt); | 2554 __ jmp(deopt); |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3304 PcDescriptors::kOther, | 3331 PcDescriptors::kOther, |
| 3305 locs()); | 3332 locs()); |
| 3306 __ Drop(2); // Discard type arguments and receiver. | 3333 __ Drop(2); // Discard type arguments and receiver. |
| 3307 } | 3334 } |
| 3308 | 3335 |
| 3309 } // namespace dart | 3336 } // namespace dart |
| 3310 | 3337 |
| 3311 #undef __ | 3338 #undef __ |
| 3312 | 3339 |
| 3313 #endif // defined TARGET_ARCH_IA32 | 3340 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |