| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 5265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5276 __ bind(&is_smi); | 5276 __ bind(&is_smi); |
| 5277 if (!input_reg.is(result_reg)) { | 5277 if (!input_reg.is(result_reg)) { |
| 5278 __ mov(result_reg, input_reg); | 5278 __ mov(result_reg, input_reg); |
| 5279 } | 5279 } |
| 5280 __ SmiUntag(result_reg); | 5280 __ SmiUntag(result_reg); |
| 5281 __ ClampUint8(result_reg); | 5281 __ ClampUint8(result_reg); |
| 5282 __ bind(&done); | 5282 __ bind(&done); |
| 5283 } | 5283 } |
| 5284 | 5284 |
| 5285 | 5285 |
| 5286 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { | |
| 5287 X87Register value_reg = ToX87Register(instr->value()); | |
| 5288 Register result_reg = ToRegister(instr->result()); | |
| 5289 X87Fxch(value_reg); | |
| 5290 __ sub(esp, Immediate(kDoubleSize)); | |
| 5291 __ fst_d(Operand(esp, 0)); | |
| 5292 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { | |
| 5293 __ mov(result_reg, Operand(esp, kPointerSize)); | |
| 5294 } else { | |
| 5295 __ mov(result_reg, Operand(esp, 0)); | |
| 5296 } | |
| 5297 __ add(esp, Immediate(kDoubleSize)); | |
| 5298 } | |
| 5299 | |
| 5300 | |
| 5301 void LCodeGen::DoAllocate(LAllocate* instr) { | 5286 void LCodeGen::DoAllocate(LAllocate* instr) { |
| 5302 class DeferredAllocate final : public LDeferredCode { | 5287 class DeferredAllocate final : public LDeferredCode { |
| 5303 public: | 5288 public: |
| 5304 DeferredAllocate(LCodeGen* codegen, | 5289 DeferredAllocate(LCodeGen* codegen, |
| 5305 LAllocate* instr, | 5290 LAllocate* instr, |
| 5306 const X87Stack& x87_stack) | 5291 const X87Stack& x87_stack) |
| 5307 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5292 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
| 5308 void Generate() override { codegen()->DoDeferredAllocate(instr_); } | 5293 void Generate() override { codegen()->DoDeferredAllocate(instr_); } |
| 5309 LInstruction* instr() override { return instr_; } | 5294 LInstruction* instr() override { return instr_; } |
| 5310 | 5295 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5793 __ bind(deferred->exit()); | 5778 __ bind(deferred->exit()); |
| 5794 __ bind(&done); | 5779 __ bind(&done); |
| 5795 } | 5780 } |
| 5796 | 5781 |
| 5797 #undef __ | 5782 #undef __ |
| 5798 | 5783 |
| 5799 } // namespace internal | 5784 } // namespace internal |
| 5800 } // namespace v8 | 5785 } // namespace v8 |
| 5801 | 5786 |
| 5802 #endif // V8_TARGET_ARCH_X87 | 5787 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |