| 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 5073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5084 new(zone()) DeferredAllocate(this, instr); | 5084 new(zone()) DeferredAllocate(this, instr); |
| 5085 | 5085 |
| 5086 Register result = ToRegister(instr->result()); | 5086 Register result = ToRegister(instr->result()); |
| 5087 Register temp = ToRegister(instr->temp()); | 5087 Register temp = ToRegister(instr->temp()); |
| 5088 | 5088 |
| 5089 // Allocate memory for the object. | 5089 // Allocate memory for the object. |
| 5090 AllocationFlags flags = TAG_OBJECT; | 5090 AllocationFlags flags = TAG_OBJECT; |
| 5091 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5091 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
| 5092 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5092 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
| 5093 } | 5093 } |
| 5094 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 5094 if (instr->hydrogen()->AllocateInOldPointerSpace()) { |
| 5095 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); | 5095 ASSERT(!instr->hydrogen()->AllocateInOldDataSpace()); |
| 5096 ASSERT(!instr->hydrogen()->AllocateInNewSpace()); |
| 5096 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5097 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); |
| 5097 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { | 5098 } else if (instr->hydrogen()->AllocateInOldDataSpace()) { |
| 5099 ASSERT(!instr->hydrogen()->AllocateInNewSpace()); |
| 5098 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); | 5100 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); |
| 5099 } | 5101 } |
| 5100 | 5102 |
| 5101 if (instr->size()->IsConstantOperand()) { | 5103 if (instr->size()->IsConstantOperand()) { |
| 5102 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5104 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5103 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5105 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
| 5104 } else { | 5106 } else { |
| 5105 Register size = ToRegister(instr->size()); | 5107 Register size = ToRegister(instr->size()); |
| 5106 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5108 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
| 5107 } | 5109 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5139 if (instr->size()->IsRegister()) { | 5141 if (instr->size()->IsRegister()) { |
| 5140 Register size = ToRegister(instr->size()); | 5142 Register size = ToRegister(instr->size()); |
| 5141 ASSERT(!size.is(result)); | 5143 ASSERT(!size.is(result)); |
| 5142 __ Integer32ToSmi(size, size); | 5144 __ Integer32ToSmi(size, size); |
| 5143 __ push(size); | 5145 __ push(size); |
| 5144 } else { | 5146 } else { |
| 5145 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5147 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5146 __ Push(Smi::FromInt(size)); | 5148 __ Push(Smi::FromInt(size)); |
| 5147 } | 5149 } |
| 5148 | 5150 |
| 5149 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 5151 if (instr->hydrogen()->AllocateInOldPointerSpace()) { |
| 5150 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); | 5152 ASSERT(!instr->hydrogen()->AllocateInOldDataSpace()); |
| 5153 ASSERT(!instr->hydrogen()->AllocateInNewSpace()); |
| 5151 CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr); | 5154 CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr); |
| 5152 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { | 5155 } else if (instr->hydrogen()->AllocateInOldDataSpace()) { |
| 5156 ASSERT(!instr->hydrogen()->AllocateInNewSpace()); |
| 5153 CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr); | 5157 CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr); |
| 5154 } else { | 5158 } else { |
| 5155 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); | 5159 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); |
| 5156 } | 5160 } |
| 5157 __ StoreToSafepointRegisterSlot(result, rax); | 5161 __ StoreToSafepointRegisterSlot(result, rax); |
| 5158 } | 5162 } |
| 5159 | 5163 |
| 5160 | 5164 |
| 5161 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5165 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
| 5162 ASSERT(ToRegister(instr->value()).is(rax)); | 5166 ASSERT(ToRegister(instr->value()).is(rax)); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5574 FixedArray::kHeaderSize - kPointerSize)); | 5578 FixedArray::kHeaderSize - kPointerSize)); |
| 5575 __ bind(&done); | 5579 __ bind(&done); |
| 5576 } | 5580 } |
| 5577 | 5581 |
| 5578 | 5582 |
| 5579 #undef __ | 5583 #undef __ |
| 5580 | 5584 |
| 5581 } } // namespace v8::internal | 5585 } } // namespace v8::internal |
| 5582 | 5586 |
| 5583 #endif // V8_TARGET_ARCH_X64 | 5587 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |