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 6007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6018 } else { | 6018 } else { |
6019 Register size = ToRegister(instr->size()); | 6019 Register size = ToRegister(instr->size()); |
6020 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 6020 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
6021 } | 6021 } |
6022 | 6022 |
6023 __ bind(deferred->exit()); | 6023 __ bind(deferred->exit()); |
6024 } | 6024 } |
6025 | 6025 |
6026 | 6026 |
6027 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 6027 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
6028 Register size = ToRegister(instr->size()); | |
6029 Register result = ToRegister(instr->result()); | 6028 Register result = ToRegister(instr->result()); |
6030 | 6029 |
6031 __ SmiTag(size); | |
6032 PushSafepointRegistersScope scope(this); | |
6033 // TODO(3095996): Get rid of this. For now, we need to make the | 6030 // TODO(3095996): Get rid of this. For now, we need to make the |
6034 // result register contain a valid pointer because it is already | 6031 // result register contain a valid pointer because it is already |
6035 // contained in the register pointer map. | 6032 // contained in the register pointer map. |
6036 if (!size.is(result)) { | 6033 __ mov(result, Immediate(Smi::FromInt(0))); |
6037 __ StoreToSafepointRegisterSlot(result, size); | 6034 |
| 6035 PushSafepointRegistersScope scope(this); |
| 6036 if (instr->size()->IsRegister()) { |
| 6037 Register size = ToRegister(instr->size()); |
| 6038 ASSERT(!size.is(result)); |
| 6039 __ SmiTag(ToRegister(instr->size())); |
| 6040 __ push(size); |
| 6041 } else { |
| 6042 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 6043 __ push(Immediate(Smi::FromInt(size))); |
6038 } | 6044 } |
6039 __ push(size); | 6045 |
6040 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 6046 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
6041 CallRuntimeFromDeferred( | 6047 CallRuntimeFromDeferred( |
6042 Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context()); | 6048 Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context()); |
6043 } else { | 6049 } else { |
6044 CallRuntimeFromDeferred( | 6050 CallRuntimeFromDeferred( |
6045 Runtime::kAllocateInNewSpace, 1, instr, instr->context()); | 6051 Runtime::kAllocateInNewSpace, 1, instr, instr->context()); |
6046 } | 6052 } |
6047 __ StoreToSafepointRegisterSlot(result, eax); | 6053 __ StoreToSafepointRegisterSlot(result, eax); |
6048 } | 6054 } |
6049 | 6055 |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6583 FixedArray::kHeaderSize - kPointerSize)); | 6589 FixedArray::kHeaderSize - kPointerSize)); |
6584 __ bind(&done); | 6590 __ bind(&done); |
6585 } | 6591 } |
6586 | 6592 |
6587 | 6593 |
6588 #undef __ | 6594 #undef __ |
6589 | 6595 |
6590 } } // namespace v8::internal | 6596 } } // namespace v8::internal |
6591 | 6597 |
6592 #endif // V8_TARGET_ARCH_IA32 | 6598 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |