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 5132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5143 scratch2, | 5143 scratch2, |
5144 deferred->entry(), | 5144 deferred->entry(), |
5145 flags); | 5145 flags); |
5146 } | 5146 } |
5147 | 5147 |
5148 __ bind(deferred->exit()); | 5148 __ bind(deferred->exit()); |
5149 } | 5149 } |
5150 | 5150 |
5151 | 5151 |
5152 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 5152 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
5153 Register size = ToRegister(instr->size()); | |
5154 Register result = ToRegister(instr->result()); | 5153 Register result = ToRegister(instr->result()); |
5155 | 5154 |
5156 // TODO(3095996): Get rid of this. For now, we need to make the | 5155 // TODO(3095996): Get rid of this. For now, we need to make the |
5157 // result register contain a valid pointer because it is already | 5156 // result register contain a valid pointer because it is already |
5158 // contained in the register pointer map. | 5157 // contained in the register pointer map. |
5159 __ mov(result, zero_reg); | 5158 __ mov(result, zero_reg); |
5160 | 5159 |
5161 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 5160 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
5162 __ SmiTag(size, size); | 5161 if (instr->size()->IsRegister()) { |
5163 __ push(size); | 5162 Register size = ToRegister(instr->size()); |
| 5163 ASSERT(!size.is(result)); |
| 5164 __ SmiTag(size); |
| 5165 __ push(size); |
| 5166 } else { |
| 5167 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5168 __ Push(Smi::FromInt(size)); |
| 5169 } |
| 5170 |
5164 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 5171 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
5165 CallRuntimeFromDeferred( | 5172 CallRuntimeFromDeferred( |
5166 Runtime::kAllocateInOldPointerSpace, 1, instr); | 5173 Runtime::kAllocateInOldPointerSpace, 1, instr); |
5167 } else { | 5174 } else { |
5168 CallRuntimeFromDeferred( | 5175 CallRuntimeFromDeferred( |
5169 Runtime::kAllocateInNewSpace, 1, instr); | 5176 Runtime::kAllocateInNewSpace, 1, instr); |
5170 } | 5177 } |
5171 __ StoreToSafepointRegisterSlot(v0, result); | 5178 __ StoreToSafepointRegisterSlot(v0, result); |
5172 } | 5179 } |
5173 | 5180 |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5734 __ Subu(scratch, result, scratch); | 5741 __ Subu(scratch, result, scratch); |
5735 __ lw(result, FieldMemOperand(scratch, | 5742 __ lw(result, FieldMemOperand(scratch, |
5736 FixedArray::kHeaderSize - kPointerSize)); | 5743 FixedArray::kHeaderSize - kPointerSize)); |
5737 __ bind(&done); | 5744 __ bind(&done); |
5738 } | 5745 } |
5739 | 5746 |
5740 | 5747 |
5741 #undef __ | 5748 #undef __ |
5742 | 5749 |
5743 } } // namespace v8::internal | 5750 } } // namespace v8::internal |
OLD | NEW |