Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.cc

Issue 1972553002: Cleanup allocation folding states in lithium. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 4851 matching lines...) Expand 10 before | Expand all | Expand 10 after
4862 4862
4863 // Allocate memory for the object. 4863 // Allocate memory for the object.
4864 AllocationFlags flags = NO_ALLOCATION_FLAGS; 4864 AllocationFlags flags = NO_ALLOCATION_FLAGS;
4865 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 4865 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
4866 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 4866 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
4867 } 4867 }
4868 if (instr->hydrogen()->IsOldSpaceAllocation()) { 4868 if (instr->hydrogen()->IsOldSpaceAllocation()) {
4869 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); 4869 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
4870 flags = static_cast<AllocationFlags>(flags | PRETENURE); 4870 flags = static_cast<AllocationFlags>(flags | PRETENURE);
4871 } 4871 }
4872
4873 if (instr->hydrogen()->IsAllocationFoldingDominator()) { 4872 if (instr->hydrogen()->IsAllocationFoldingDominator()) {
4874 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); 4873 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR);
4875 } 4874 }
4876 4875 DCHECK(!instr->hydrogen()->IsAllocationFolded());
4877 if (instr->hydrogen()->IsAllocationFolded()) {
4878 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED);
4879 }
4880 4876
4881 if (instr->size()->IsConstantOperand()) { 4877 if (instr->size()->IsConstantOperand()) {
4882 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 4878 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
4883 CHECK(size <= Page::kMaxRegularHeapObjectSize); 4879 CHECK(size <= Page::kMaxRegularHeapObjectSize);
4884 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); 4880 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
4885 } else { 4881 } else {
4886 Register size = ToRegister(instr->size()); 4882 Register size = ToRegister(instr->size());
4887 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); 4883 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
4888 } 4884 }
4889 4885
(...skipping 12 matching lines...) Expand all
4902 __ bind(&loop); 4898 __ bind(&loop);
4903 __ mov(FieldOperand(result, temp, times_pointer_size, 0), 4899 __ mov(FieldOperand(result, temp, times_pointer_size, 0),
4904 isolate()->factory()->one_pointer_filler_map()); 4900 isolate()->factory()->one_pointer_filler_map());
4905 __ dec(temp); 4901 __ dec(temp);
4906 __ j(not_zero, &loop); 4902 __ j(not_zero, &loop);
4907 } 4903 }
4908 } 4904 }
4909 4905
4910 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { 4906 void LCodeGen::DoFastAllocate(LFastAllocate* instr) {
4911 DCHECK(instr->hydrogen()->IsAllocationFolded()); 4907 DCHECK(instr->hydrogen()->IsAllocationFolded());
4908 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator());
4912 Register result = ToRegister(instr->result()); 4909 Register result = ToRegister(instr->result());
4913 Register temp = ToRegister(instr->temp()); 4910 Register temp = ToRegister(instr->temp());
4914 4911
4915 AllocationFlags flags = NO_ALLOCATION_FLAGS; 4912 AllocationFlags flags = ALLOCATION_FOLDED;
4916 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 4913 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
4917 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 4914 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
4918 } 4915 }
4919 if (instr->hydrogen()->IsOldSpaceAllocation()) { 4916 if (instr->hydrogen()->IsOldSpaceAllocation()) {
4920 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); 4917 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
4921 flags = static_cast<AllocationFlags>(flags | PRETENURE); 4918 flags = static_cast<AllocationFlags>(flags | PRETENURE);
4922 } 4919 }
4923 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { 4920 if (instr->size()->IsConstantOperand()) {
4924 if (instr->size()->IsConstantOperand()) { 4921 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
4925 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 4922 CHECK(size <= Page::kMaxRegularHeapObjectSize);
4926 CHECK(size <= Page::kMaxRegularHeapObjectSize); 4923 __ FastAllocate(size, result, temp, flags);
4927 __ FastAllocate(size, result, temp, flags); 4924 } else {
4928 } else { 4925 Register size = ToRegister(instr->size());
4929 Register size = ToRegister(instr->size()); 4926 __ FastAllocate(size, result, temp, flags);
4930 __ FastAllocate(size, result, temp, flags);
4931 }
4932 } 4927 }
4933 } 4928 }
4934 4929
4935 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { 4930 void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
4936 Register result = ToRegister(instr->result()); 4931 Register result = ToRegister(instr->result());
4937 4932
4938 // TODO(3095996): Get rid of this. For now, we need to make the 4933 // TODO(3095996): Get rid of this. For now, we need to make the
4939 // result register contain a valid pointer because it is already 4934 // result register contain a valid pointer because it is already
4940 // contained in the register pointer map. 4935 // contained in the register pointer map.
4941 __ Move(result, Immediate(Smi::FromInt(0))); 4936 __ Move(result, Immediate(Smi::FromInt(0)));
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
5336 __ bind(deferred->exit()); 5331 __ bind(deferred->exit());
5337 __ bind(&done); 5332 __ bind(&done);
5338 } 5333 }
5339 5334
5340 #undef __ 5335 #undef __
5341 5336
5342 } // namespace internal 5337 } // namespace internal
5343 } // namespace v8 5338 } // namespace v8
5344 5339
5345 #endif // V8_TARGET_ARCH_IA32 5340 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698