Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 23531084: Avoid using double temp register explicitly in lithium codegen (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4510 matching lines...) Expand 10 before | Expand all | Expand 10 after
4521 __ j(above, deferred->entry()); 4521 __ j(above, deferred->entry());
4522 __ Integer32ToSmi(reg, reg); 4522 __ Integer32ToSmi(reg, reg);
4523 __ bind(deferred->exit()); 4523 __ bind(deferred->exit());
4524 } 4524 }
4525 4525
4526 4526
4527 void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) { 4527 void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) {
4528 Label slow; 4528 Label slow;
4529 Register reg = ToRegister(instr->value()); 4529 Register reg = ToRegister(instr->value());
4530 Register tmp = reg.is(rax) ? rcx : rax; 4530 Register tmp = reg.is(rax) ? rcx : rax;
4531 XMMRegister temp_xmm = ToDoubleRegister(instr->temp());
4531 4532
4532 // Preserve the value of all registers. 4533 // Preserve the value of all registers.
4533 PushSafepointRegistersScope scope(this); 4534 PushSafepointRegistersScope scope(this);
4534 4535
4535 Label done; 4536 Label done;
4536 // Load value into xmm1 which will be preserved across potential call to 4537 // Load value into temp_xmm which will be preserved across potential call to
4537 // runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable 4538 // runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable
4538 // XMM registers on x64). 4539 // XMM registers on x64).
4539 XMMRegister xmm_scratch = double_scratch0(); 4540 XMMRegister xmm_scratch = double_scratch0();
4540 __ LoadUint32(xmm1, reg, xmm_scratch); 4541 __ LoadUint32(temp_xmm, reg, xmm_scratch);
4541 4542
4542 if (FLAG_inline_new) { 4543 if (FLAG_inline_new) {
4543 __ AllocateHeapNumber(reg, tmp, &slow); 4544 __ AllocateHeapNumber(reg, tmp, &slow);
4544 __ jmp(&done, Label::kNear); 4545 __ jmp(&done, Label::kNear);
4545 } 4546 }
4546 4547
4547 // Slow case: Call the runtime system to do the number allocation. 4548 // Slow case: Call the runtime system to do the number allocation.
4548 __ bind(&slow); 4549 __ bind(&slow);
4549 4550
4550 // Put a valid pointer value in the stack slot where the result 4551 // Put a valid pointer value in the stack slot where the result
4551 // register is stored, as this register is in the pointer map, but contains an 4552 // register is stored, as this register is in the pointer map, but contains an
4552 // integer value. 4553 // integer value.
4553 __ StoreToSafepointRegisterSlot(reg, Immediate(0)); 4554 __ StoreToSafepointRegisterSlot(reg, Immediate(0));
4554 4555
4555 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); 4556 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
4556 if (!reg.is(rax)) __ movq(reg, rax); 4557 if (!reg.is(rax)) __ movq(reg, rax);
4557 4558
4558 // Done. Put the value in xmm1 into the value of the allocated heap 4559 // Done. Put the value in temp_xmm into the value of the allocated heap
4559 // number. 4560 // number.
4560 __ bind(&done); 4561 __ bind(&done);
4561 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm1); 4562 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm);
4562 __ StoreToSafepointRegisterSlot(reg, reg); 4563 __ StoreToSafepointRegisterSlot(reg, reg);
4563 } 4564 }
4564 4565
4565 4566
4566 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { 4567 void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
4567 class DeferredNumberTagD V8_FINAL : public LDeferredCode { 4568 class DeferredNumberTagD V8_FINAL : public LDeferredCode {
4568 public: 4569 public:
4569 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) 4570 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
4570 : LDeferredCode(codegen), instr_(instr) { } 4571 : LDeferredCode(codegen), instr_(instr) { }
4571 virtual void Generate() V8_OVERRIDE { 4572 virtual void Generate() V8_OVERRIDE {
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
5516 FixedArray::kHeaderSize - kPointerSize)); 5517 FixedArray::kHeaderSize - kPointerSize));
5517 __ bind(&done); 5518 __ bind(&done);
5518 } 5519 }
5519 5520
5520 5521
5521 #undef __ 5522 #undef __
5522 5523
5523 } } // namespace v8::internal 5524 } } // namespace v8::internal
5524 5525
5525 #endif // V8_TARGET_ARCH_X64 5526 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698