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 5104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5115 } else { | 5115 } else { |
5116 Register size = ToRegister(instr->size()); | 5116 Register size = ToRegister(instr->size()); |
5117 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5117 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5118 } | 5118 } |
5119 | 5119 |
5120 __ bind(deferred->exit()); | 5120 __ bind(deferred->exit()); |
5121 } | 5121 } |
5122 | 5122 |
5123 | 5123 |
5124 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 5124 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
5125 Register size = ToRegister(instr->size()); | |
5126 Register result = ToRegister(instr->result()); | 5125 Register result = ToRegister(instr->result()); |
5127 | 5126 |
5128 // TODO(3095996): Get rid of this. For now, we need to make the | 5127 // TODO(3095996): Get rid of this. For now, we need to make the |
5129 // result register contain a valid pointer because it is already | 5128 // result register contain a valid pointer because it is already |
5130 // contained in the register pointer map. | 5129 // contained in the register pointer map. |
5131 __ Set(result, 0); | 5130 __ Move(result, Smi::FromInt(0)); |
5132 | 5131 |
5133 PushSafepointRegistersScope scope(this); | 5132 PushSafepointRegistersScope scope(this); |
5134 __ Integer32ToSmi(size, size); | 5133 if (instr->size()->IsRegister()) { |
5135 __ push(size); | 5134 Register size = ToRegister(instr->size()); |
| 5135 ASSERT(!size.is(result)); |
| 5136 __ Integer32ToSmi(size, size); |
| 5137 __ push(size); |
| 5138 } else { |
| 5139 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5140 __ Push(Smi::FromInt(size)); |
| 5141 } |
| 5142 |
5136 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 5143 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
5137 CallRuntimeFromDeferred( | 5144 CallRuntimeFromDeferred( |
5138 Runtime::kAllocateInOldPointerSpace, 1, instr); | 5145 Runtime::kAllocateInOldPointerSpace, 1, instr); |
5139 } else { | 5146 } else { |
5140 CallRuntimeFromDeferred( | 5147 CallRuntimeFromDeferred( |
5141 Runtime::kAllocateInNewSpace, 1, instr); | 5148 Runtime::kAllocateInNewSpace, 1, instr); |
5142 } | 5149 } |
5143 __ StoreToSafepointRegisterSlot(result, rax); | 5150 __ StoreToSafepointRegisterSlot(result, rax); |
5144 } | 5151 } |
5145 | 5152 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5688 FixedArray::kHeaderSize - kPointerSize)); | 5695 FixedArray::kHeaderSize - kPointerSize)); |
5689 __ bind(&done); | 5696 __ bind(&done); |
5690 } | 5697 } |
5691 | 5698 |
5692 | 5699 |
5693 #undef __ | 5700 #undef __ |
5694 | 5701 |
5695 } } // namespace v8::internal | 5702 } } // namespace v8::internal |
5696 | 5703 |
5697 #endif // V8_TARGET_ARCH_X64 | 5704 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |