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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 5438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5449 } | 5449 } |
5450 Label loop; | 5450 Label loop; |
5451 __ bind(&loop); | 5451 __ bind(&loop); |
5452 __ mov(FieldOperand(result, temp, times_pointer_size, 0), | 5452 __ mov(FieldOperand(result, temp, times_pointer_size, 0), |
5453 isolate()->factory()->one_pointer_filler_map()); | 5453 isolate()->factory()->one_pointer_filler_map()); |
5454 __ dec(temp); | 5454 __ dec(temp); |
5455 __ j(not_zero, &loop); | 5455 __ j(not_zero, &loop); |
5456 } | 5456 } |
5457 } | 5457 } |
5458 | 5458 |
5459 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | |
Hannes Payer (out of office)
2016/05/11 07:44:41
Why do you move that piece of code? I would like t
| |
5460 DCHECK(instr->hydrogen()->IsAllocationFolded()); | |
5461 Register result = ToRegister(instr->result()); | |
5462 Register temp = ToRegister(instr->temp()); | |
5463 | |
5464 AllocationFlags flags = NO_ALLOCATION_FLAGS; | |
5465 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | |
5466 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | |
5467 } | |
5468 if (instr->hydrogen()->IsOldSpaceAllocation()) { | |
5469 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5470 flags = static_cast<AllocationFlags>(flags | PRETENURE); | |
5471 } | |
5472 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | |
5473 if (instr->size()->IsConstantOperand()) { | |
5474 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | |
5475 CHECK(size <= Page::kMaxRegularHeapObjectSize); | |
5476 __ FastAllocate(size, result, temp, flags); | |
5477 } else { | |
5478 Register size = ToRegister(instr->size()); | |
5479 __ FastAllocate(size, result, temp, flags); | |
5480 } | |
5481 } | |
5482 } | |
5459 | 5483 |
5460 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 5484 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
5461 Register result = ToRegister(instr->result()); | 5485 Register result = ToRegister(instr->result()); |
5462 | 5486 |
5463 // TODO(3095996): Get rid of this. For now, we need to make the | 5487 // TODO(3095996): Get rid of this. For now, we need to make the |
5464 // result register contain a valid pointer because it is already | 5488 // result register contain a valid pointer because it is already |
5465 // contained in the register pointer map. | 5489 // contained in the register pointer map. |
5466 __ Move(result, Immediate(Smi::FromInt(0))); | 5490 __ Move(result, Immediate(Smi::FromInt(0))); |
5467 | 5491 |
5468 PushSafepointRegistersScope scope(this); | 5492 PushSafepointRegistersScope scope(this); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5506 // happend in the runtime. We have to reset the top pointer to virtually | 5530 // happend in the runtime. We have to reset the top pointer to virtually |
5507 // undo the allocation. | 5531 // undo the allocation. |
5508 ExternalReference allocation_top = | 5532 ExternalReference allocation_top = |
5509 AllocationUtils::GetAllocationTopReference(isolate(), allocation_flags); | 5533 AllocationUtils::GetAllocationTopReference(isolate(), allocation_flags); |
5510 __ sub(eax, Immediate(kHeapObjectTag)); | 5534 __ sub(eax, Immediate(kHeapObjectTag)); |
5511 __ mov(Operand::StaticVariable(allocation_top), eax); | 5535 __ mov(Operand::StaticVariable(allocation_top), eax); |
5512 __ add(eax, Immediate(kHeapObjectTag)); | 5536 __ add(eax, Immediate(kHeapObjectTag)); |
5513 } | 5537 } |
5514 } | 5538 } |
5515 | 5539 |
5516 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | |
5517 DCHECK(instr->hydrogen()->IsAllocationFolded()); | |
5518 Register result = ToRegister(instr->result()); | |
5519 Register temp = ToRegister(instr->temp()); | |
5520 | |
5521 AllocationFlags flags = NO_ALLOCATION_FLAGS; | |
5522 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | |
5523 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | |
5524 } | |
5525 if (instr->hydrogen()->IsOldSpaceAllocation()) { | |
5526 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5527 flags = static_cast<AllocationFlags>(flags | PRETENURE); | |
5528 } | |
5529 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | |
5530 if (instr->size()->IsConstantOperand()) { | |
5531 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | |
5532 CHECK(size <= Page::kMaxRegularHeapObjectSize); | |
5533 __ FastAllocate(size, result, temp, flags); | |
5534 } else { | |
5535 Register size = ToRegister(instr->size()); | |
5536 __ FastAllocate(size, result, temp, flags); | |
5537 } | |
5538 } | |
5539 } | |
5540 | |
5541 | 5540 |
5542 void LCodeGen::DoTypeof(LTypeof* instr) { | 5541 void LCodeGen::DoTypeof(LTypeof* instr) { |
5543 DCHECK(ToRegister(instr->context()).is(esi)); | 5542 DCHECK(ToRegister(instr->context()).is(esi)); |
5544 DCHECK(ToRegister(instr->value()).is(ebx)); | 5543 DCHECK(ToRegister(instr->value()).is(ebx)); |
5545 Label end, do_call; | 5544 Label end, do_call; |
5546 Register value_register = ToRegister(instr->value()); | 5545 Register value_register = ToRegister(instr->value()); |
5547 __ JumpIfNotSmi(value_register, &do_call); | 5546 __ JumpIfNotSmi(value_register, &do_call); |
5548 __ mov(eax, Immediate(isolate()->factory()->number_string())); | 5547 __ mov(eax, Immediate(isolate()->factory()->number_string())); |
5549 __ jmp(&end); | 5548 __ jmp(&end); |
5550 __ bind(&do_call); | 5549 __ bind(&do_call); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5889 __ bind(deferred->exit()); | 5888 __ bind(deferred->exit()); |
5890 __ bind(&done); | 5889 __ bind(&done); |
5891 } | 5890 } |
5892 | 5891 |
5893 #undef __ | 5892 #undef __ |
5894 | 5893 |
5895 } // namespace internal | 5894 } // namespace internal |
5896 } // namespace v8 | 5895 } // namespace v8 |
5897 | 5896 |
5898 #endif // V8_TARGET_ARCH_X87 | 5897 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |