OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4068 | 4068 |
4069 void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) { | 4069 void LCodeGen::DoDeferredNumberTagU(LNumberTagU* instr) { |
4070 Label slow; | 4070 Label slow; |
4071 Register reg = ToRegister(instr->InputAt(0)); | 4071 Register reg = ToRegister(instr->InputAt(0)); |
4072 Register tmp = reg.is(rax) ? rcx : rax; | 4072 Register tmp = reg.is(rax) ? rcx : rax; |
4073 | 4073 |
4074 // Preserve the value of all registers. | 4074 // Preserve the value of all registers. |
4075 PushSafepointRegistersScope scope(this); | 4075 PushSafepointRegistersScope scope(this); |
4076 | 4076 |
4077 Label done; | 4077 Label done; |
4078 __ LoadUint32(xmm0, reg, xmm1); | 4078 // Load value into xmm1 which will be preserved across potential call to |
| 4079 // runtime (MacroAssembler::EnterExitFrameEpilogue preserves only allocatable |
| 4080 // XMM registers on x64). |
| 4081 __ LoadUint32(xmm1, reg, xmm0); |
4079 | 4082 |
4080 if (FLAG_inline_new) { | 4083 if (FLAG_inline_new) { |
4081 __ AllocateHeapNumber(reg, tmp, &slow); | 4084 __ AllocateHeapNumber(reg, tmp, &slow); |
4082 __ jmp(&done, Label::kNear); | 4085 __ jmp(&done, Label::kNear); |
4083 } | 4086 } |
4084 | 4087 |
4085 // Slow case: Call the runtime system to do the number allocation. | 4088 // Slow case: Call the runtime system to do the number allocation. |
4086 __ bind(&slow); | 4089 __ bind(&slow); |
4087 | 4090 |
4088 // Put a valid pointer value in the stack slot where the result | 4091 // Put a valid pointer value in the stack slot where the result |
4089 // register is stored, as this register is in the pointer map, but contains an | 4092 // register is stored, as this register is in the pointer map, but contains an |
4090 // integer value. | 4093 // integer value. |
4091 __ StoreToSafepointRegisterSlot(reg, Immediate(0)); | 4094 __ StoreToSafepointRegisterSlot(reg, Immediate(0)); |
4092 | 4095 |
4093 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); | 4096 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); |
4094 if (!reg.is(rax)) __ movq(reg, rax); | 4097 if (!reg.is(rax)) __ movq(reg, rax); |
4095 | 4098 |
4096 // Done. Put the value in xmm0 into the value of the allocated heap | 4099 // Done. Put the value in xmm1 into the value of the allocated heap |
4097 // number. | 4100 // number. |
4098 __ bind(&done); | 4101 __ bind(&done); |
4099 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm0); | 4102 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm1); |
4100 __ StoreToSafepointRegisterSlot(reg, reg); | 4103 __ StoreToSafepointRegisterSlot(reg, reg); |
4101 } | 4104 } |
4102 | 4105 |
4103 | 4106 |
4104 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4107 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
4105 class DeferredNumberTagD: public LDeferredCode { | 4108 class DeferredNumberTagD: public LDeferredCode { |
4106 public: | 4109 public: |
4107 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4110 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
4108 : LDeferredCode(codegen), instr_(instr) { } | 4111 : LDeferredCode(codegen), instr_(instr) { } |
4109 virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); } | 4112 virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); } |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5265 FixedArray::kHeaderSize - kPointerSize)); | 5268 FixedArray::kHeaderSize - kPointerSize)); |
5266 __ bind(&done); | 5269 __ bind(&done); |
5267 } | 5270 } |
5268 | 5271 |
5269 | 5272 |
5270 #undef __ | 5273 #undef __ |
5271 | 5274 |
5272 } } // namespace v8::internal | 5275 } } // namespace v8::internal |
5273 | 5276 |
5274 #endif // V8_TARGET_ARCH_X64 | 5277 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |