| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 // Overflow is signalled with minint. | 2226 // Overflow is signalled with minint. |
| 2227 Label do_call, done; | 2227 Label do_call, done; |
| 2228 // Check for overflow and that it fits into Smi. | 2228 // Check for overflow and that it fits into Smi. |
| 2229 __ movq(temp, result); | 2229 __ movq(temp, result); |
| 2230 __ shlq(temp, Immediate(1)); | 2230 __ shlq(temp, Immediate(1)); |
| 2231 __ j(OVERFLOW, deopt); | 2231 __ j(OVERFLOW, deopt); |
| 2232 __ SmiTag(result); | 2232 __ SmiTag(result); |
| 2233 } | 2233 } |
| 2234 | 2234 |
| 2235 | 2235 |
| 2236 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const { |
| 2237 const intptr_t kNumInputs = 1; |
| 2238 const intptr_t kNumTemps = |
| 2239 (recognized_kind() == MethodRecognizer::kDoubleRound) ? 1 : 0; |
| 2240 LocationSummary* result = |
| 2241 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2242 result->set_in(0, Location::RequiresXmmRegister()); |
| 2243 result->set_out(Location::RequiresXmmRegister()); |
| 2244 if (recognized_kind() == MethodRecognizer::kDoubleRound) { |
| 2245 result->set_temp(0, Location::RequiresXmmRegister()); |
| 2246 } |
| 2247 return result; |
| 2248 } |
| 2249 |
| 2250 |
| 2251 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2252 XmmRegister value = locs()->in(0).xmm_reg(); |
| 2253 XmmRegister result = locs()->out().xmm_reg(); |
| 2254 if (recognized_kind() == MethodRecognizer::kDoubleTruncate) { |
| 2255 __ roundsd(result, value, Assembler::kRoundToZero); |
| 2256 } else { |
| 2257 XmmRegister temp = locs()->temp(0).xmm_reg(); |
| 2258 __ DoubleRound(result, value, temp); |
| 2259 } |
| 2260 } |
| 2261 |
| 2262 |
| 2236 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { | 2263 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { |
| 2237 return MakeCallSummary(); | 2264 return MakeCallSummary(); |
| 2238 } | 2265 } |
| 2239 | 2266 |
| 2240 | 2267 |
| 2241 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2268 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2242 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | 2269 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
| 2243 kDeoptPolymorphicInstanceCallTestFail); | 2270 kDeoptPolymorphicInstanceCallTestFail); |
| 2244 if (ic_data().NumberOfChecks() == 0) { | 2271 if (ic_data().NumberOfChecks() == 0) { |
| 2245 __ jmp(deopt); | 2272 __ jmp(deopt); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2464 | 2491 |
| 2465 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2492 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2466 UNIMPLEMENTED(); | 2493 UNIMPLEMENTED(); |
| 2467 } | 2494 } |
| 2468 | 2495 |
| 2469 } // namespace dart | 2496 } // namespace dart |
| 2470 | 2497 |
| 2471 #undef __ | 2498 #undef __ |
| 2472 | 2499 |
| 2473 #endif // defined TARGET_ARCH_X64 | 2500 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |