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 4473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4484 | 4484 |
4485 DoubleRegister input_reg = ToDoubleRegister(instr->value()); | 4485 DoubleRegister input_reg = ToDoubleRegister(instr->value()); |
4486 Register scratch = scratch0(); | 4486 Register scratch = scratch0(); |
4487 Register reg = ToRegister(instr->result()); | 4487 Register reg = ToRegister(instr->result()); |
4488 Register temp1 = ToRegister(instr->temp()); | 4488 Register temp1 = ToRegister(instr->temp()); |
4489 Register temp2 = ToRegister(instr->temp2()); | 4489 Register temp2 = ToRegister(instr->temp2()); |
4490 | 4490 |
4491 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); | 4491 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
4492 if (FLAG_inline_new) { | 4492 if (FLAG_inline_new) { |
4493 __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); | 4493 __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); |
4494 __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry()); | 4494 // We want the untagged address first for performance |
| 4495 __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry(), false); |
4495 } else { | 4496 } else { |
4496 __ jmp(deferred->entry()); | 4497 __ jmp(deferred->entry()); |
4497 } | 4498 } |
4498 __ bind(deferred->exit()); | 4499 __ bind(deferred->exit()); |
4499 __ sub(ip, reg, Operand(kHeapObjectTag)); | 4500 __ vstr(input_reg, reg, HeapNumber::kValueOffset); |
4500 __ vstr(input_reg, ip, HeapNumber::kValueOffset); | 4501 // Now that we have finished with the object's real address tag it |
| 4502 __ add(reg, reg, Operand(kHeapObjectTag)); |
4501 } | 4503 } |
4502 | 4504 |
4503 | 4505 |
4504 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4506 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
4505 // TODO(3095996): Get rid of this. For now, we need to make the | 4507 // TODO(3095996): Get rid of this. For now, we need to make the |
4506 // result register contain a valid pointer because it is already | 4508 // result register contain a valid pointer because it is already |
4507 // contained in the register pointer map. | 4509 // contained in the register pointer map. |
4508 Register reg = ToRegister(instr->result()); | 4510 Register reg = ToRegister(instr->result()); |
4509 __ mov(reg, Operand(0)); | 4511 __ mov(reg, Operand(0)); |
4510 | 4512 |
4511 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 4513 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
4512 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); | 4514 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); |
| 4515 __ sub(r0, r0, Operand(kHeapObjectTag)); |
4513 __ StoreToSafepointRegisterSlot(r0, reg); | 4516 __ StoreToSafepointRegisterSlot(r0, reg); |
4514 } | 4517 } |
4515 | 4518 |
4516 | 4519 |
4517 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4520 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
4518 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); | 4521 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); |
4519 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); | 4522 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); |
4520 } | 4523 } |
4521 | 4524 |
4522 | 4525 |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5675 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5678 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5676 __ ldr(result, FieldMemOperand(scratch, | 5679 __ ldr(result, FieldMemOperand(scratch, |
5677 FixedArray::kHeaderSize - kPointerSize)); | 5680 FixedArray::kHeaderSize - kPointerSize)); |
5678 __ bind(&done); | 5681 __ bind(&done); |
5679 } | 5682 } |
5680 | 5683 |
5681 | 5684 |
5682 #undef __ | 5685 #undef __ |
5683 | 5686 |
5684 } } // namespace v8::internal | 5687 } } // namespace v8::internal |
OLD | NEW |