| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4516 __ j(above, deferred->entry()); | 4516 __ j(above, deferred->entry()); |
| 4517 __ Integer32ToSmi(reg, reg); | 4517 __ Integer32ToSmi(reg, reg); |
| 4518 __ bind(deferred->exit()); | 4518 __ bind(deferred->exit()); |
| 4519 } | 4519 } |
| 4520 | 4520 |
| 4521 | 4521 |
| 4522 void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) { | 4522 void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) { |
| 4523 Label slow; | 4523 Label slow; |
| 4524 Register reg = ToRegister(instr->value()); | 4524 Register reg = ToRegister(instr->value()); |
| 4525 Register tmp = reg.is(rax) ? rcx : rax; | 4525 Register tmp = reg.is(rax) ? rcx : rax; |
| 4526 XMMRegister temp_xmm = ToDoubleRegister(instr->temp()); |
| 4526 | 4527 |
| 4527 // Preserve the value of all registers. | 4528 // Preserve the value of all registers. |
| 4528 PushSafepointRegistersScope scope(this); | 4529 PushSafepointRegistersScope scope(this); |
| 4529 | 4530 |
| 4530 Label done; | 4531 Label done; |
| 4531 // Load value into xmm1 which will be preserved across potential call to | 4532 // Load value into temp_xmm which will be preserved across potential call to |
| 4532 // runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable | 4533 // runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable |
| 4533 // XMM registers on x64). | 4534 // XMM registers on x64). |
| 4534 XMMRegister xmm_scratch = double_scratch0(); | 4535 XMMRegister xmm_scratch = double_scratch0(); |
| 4535 __ LoadUint32(xmm1, reg, xmm_scratch); | 4536 __ LoadUint32(temp_xmm, reg, xmm_scratch); |
| 4536 | 4537 |
| 4537 if (FLAG_inline_new) { | 4538 if (FLAG_inline_new) { |
| 4538 __ AllocateHeapNumber(reg, tmp, &slow); | 4539 __ AllocateHeapNumber(reg, tmp, &slow); |
| 4539 __ jmp(&done, Label::kNear); | 4540 __ jmp(&done, Label::kNear); |
| 4540 } | 4541 } |
| 4541 | 4542 |
| 4542 // Slow case: Call the runtime system to do the number allocation. | 4543 // Slow case: Call the runtime system to do the number allocation. |
| 4543 __ bind(&slow); | 4544 __ bind(&slow); |
| 4544 | 4545 |
| 4545 // Put a valid pointer value in the stack slot where the result | 4546 // Put a valid pointer value in the stack slot where the result |
| 4546 // register is stored, as this register is in the pointer map, but contains an | 4547 // register is stored, as this register is in the pointer map, but contains an |
| 4547 // integer value. | 4548 // integer value. |
| 4548 __ StoreToSafepointRegisterSlot(reg, Immediate(0)); | 4549 __ StoreToSafepointRegisterSlot(reg, Immediate(0)); |
| 4549 | 4550 |
| 4550 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); | 4551 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); |
| 4551 if (!reg.is(rax)) __ movq(reg, rax); | 4552 if (!reg.is(rax)) __ movq(reg, rax); |
| 4552 | 4553 |
| 4553 // Done. Put the value in xmm1 into the value of the allocated heap | 4554 // Done. Put the value in temp_xmm into the value of the allocated heap |
| 4554 // number. | 4555 // number. |
| 4555 __ bind(&done); | 4556 __ bind(&done); |
| 4556 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm1); | 4557 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm); |
| 4557 __ StoreToSafepointRegisterSlot(reg, reg); | 4558 __ StoreToSafepointRegisterSlot(reg, reg); |
| 4558 } | 4559 } |
| 4559 | 4560 |
| 4560 | 4561 |
| 4561 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4562 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
| 4562 class DeferredNumberTagD V8_FINAL : public LDeferredCode { | 4563 class DeferredNumberTagD V8_FINAL : public LDeferredCode { |
| 4563 public: | 4564 public: |
| 4564 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4565 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
| 4565 : LDeferredCode(codegen), instr_(instr) { } | 4566 : LDeferredCode(codegen), instr_(instr) { } |
| 4566 virtual void Generate() V8_OVERRIDE { | 4567 virtual void Generate() V8_OVERRIDE { |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5511 FixedArray::kHeaderSize - kPointerSize)); | 5512 FixedArray::kHeaderSize - kPointerSize)); |
| 5512 __ bind(&done); | 5513 __ bind(&done); |
| 5513 } | 5514 } |
| 5514 | 5515 |
| 5515 | 5516 |
| 5516 #undef __ | 5517 #undef __ |
| 5517 | 5518 |
| 5518 } } // namespace v8::internal | 5519 } } // namespace v8::internal |
| 5519 | 5520 |
| 5520 #endif // V8_TARGET_ARCH_X64 | 5521 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |