OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 5258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5269 | 5269 |
5270 if (instr->size()->IsConstantOperand()) { | 5270 if (instr->size()->IsConstantOperand()) { |
5271 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5271 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5272 if (size <= Page::kMaxRegularHeapObjectSize) { | 5272 if (size <= Page::kMaxRegularHeapObjectSize) { |
5273 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5273 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5274 } else { | 5274 } else { |
5275 __ jmp(deferred->entry()); | 5275 __ jmp(deferred->entry()); |
5276 } | 5276 } |
5277 } else { | 5277 } else { |
5278 Register size = ToRegister(instr->size()); | 5278 Register size = ToRegister(instr->size()); |
5279 __ Allocate(size, | 5279 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5280 result, | |
5281 scratch, | |
5282 scratch2, | |
5283 deferred->entry(), | |
5284 flags); | |
5285 } | 5280 } |
5286 | 5281 |
5287 __ bind(deferred->exit()); | 5282 __ bind(deferred->exit()); |
5288 | 5283 |
5289 if (instr->hydrogen()->MustPrefillWithFiller()) { | 5284 if (instr->hydrogen()->MustPrefillWithFiller()) { |
| 5285 STATIC_ASSERT(kHeapObjectTag == 1); |
5290 if (instr->size()->IsConstantOperand()) { | 5286 if (instr->size()->IsConstantOperand()) { |
5291 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5287 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5292 __ mov(scratch, Operand(size)); | 5288 __ mov(scratch, Operand(size - kHeapObjectTag)); |
5293 } else { | 5289 } else { |
5294 scratch = ToRegister(instr->size()); | 5290 __ sub(scratch, ToRegister(instr->size()), Operand(kHeapObjectTag)); |
5295 } | 5291 } |
5296 __ sub(scratch, scratch, Operand(kPointerSize)); | 5292 __ mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
5297 __ sub(result, result, Operand(kHeapObjectTag)); | |
5298 Label loop; | 5293 Label loop; |
5299 __ bind(&loop); | 5294 __ bind(&loop); |
5300 __ mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 5295 __ sub(scratch, scratch, Operand(kPointerSize), SetCC); |
5301 __ str(scratch2, MemOperand(result, scratch)); | 5296 __ str(scratch2, MemOperand(result, scratch)); |
5302 __ sub(scratch, scratch, Operand(kPointerSize)); | |
5303 __ cmp(scratch, Operand(0)); | |
5304 __ b(ge, &loop); | 5297 __ b(ge, &loop); |
5305 __ add(result, result, Operand(kHeapObjectTag)); | |
5306 } | 5298 } |
5307 } | 5299 } |
5308 | 5300 |
5309 | 5301 |
5310 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 5302 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
5311 Register result = ToRegister(instr->result()); | 5303 Register result = ToRegister(instr->result()); |
5312 | 5304 |
5313 // TODO(3095996): Get rid of this. For now, we need to make the | 5305 // TODO(3095996): Get rid of this. For now, we need to make the |
5314 // result register contain a valid pointer because it is already | 5306 // result register contain a valid pointer because it is already |
5315 // contained in the register pointer map. | 5307 // contained in the register pointer map. |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5833 __ Push(scope_info); | 5825 __ Push(scope_info); |
5834 __ push(ToRegister(instr->function())); | 5826 __ push(ToRegister(instr->function())); |
5835 CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr); | 5827 CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr); |
5836 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5828 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5837 } | 5829 } |
5838 | 5830 |
5839 | 5831 |
5840 #undef __ | 5832 #undef __ |
5841 | 5833 |
5842 } } // namespace v8::internal | 5834 } } // namespace v8::internal |
OLD | NEW |