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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.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
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h"
(...skipping 5266 matching lines...) Expand 10 before | Expand all | Expand 10 after
5277 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 5277 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
5278 } 5278 }
5279 if (instr->hydrogen()->IsOldSpaceAllocation()) { 5279 if (instr->hydrogen()->IsOldSpaceAllocation()) {
5280 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); 5280 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
5281 flags = static_cast<AllocationFlags>(flags | PRETENURE); 5281 flags = static_cast<AllocationFlags>(flags | PRETENURE);
5282 } 5282 }
5283 5283
5284 if (instr->hydrogen()->IsAllocationFoldingDominator()) { 5284 if (instr->hydrogen()->IsAllocationFoldingDominator()) {
5285 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); 5285 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR);
5286 } 5286 }
5287 5287 DCHECK(!instr->hydrogen()->IsAllocationFolded());
5288 if (instr->hydrogen()->IsAllocationFolded()) {
5289 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED);
5290 }
5291 5288
5292 if (instr->size()->IsConstantOperand()) { 5289 if (instr->size()->IsConstantOperand()) {
5293 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5290 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5294 CHECK(size <= Page::kMaxRegularHeapObjectSize); 5291 CHECK(size <= Page::kMaxRegularHeapObjectSize);
5295 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5292 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5296 } else { 5293 } else {
5297 Register size = ToRegister(instr->size()); 5294 Register size = ToRegister(instr->size());
5298 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5295 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5299 } 5296 }
5300 5297
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
5374 Register top_address = scratch0(); 5371 Register top_address = scratch0();
5375 __ Dsubu(v0, v0, Operand(kHeapObjectTag)); 5372 __ Dsubu(v0, v0, Operand(kHeapObjectTag));
5376 __ li(top_address, Operand(allocation_top)); 5373 __ li(top_address, Operand(allocation_top));
5377 __ sd(v0, MemOperand(top_address)); 5374 __ sd(v0, MemOperand(top_address));
5378 __ Daddu(v0, v0, Operand(kHeapObjectTag)); 5375 __ Daddu(v0, v0, Operand(kHeapObjectTag));
5379 } 5376 }
5380 } 5377 }
5381 5378
5382 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { 5379 void LCodeGen::DoFastAllocate(LFastAllocate* instr) {
5383 DCHECK(instr->hydrogen()->IsAllocationFolded()); 5380 DCHECK(instr->hydrogen()->IsAllocationFolded());
5381 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator());
5384 Register result = ToRegister(instr->result()); 5382 Register result = ToRegister(instr->result());
5385 Register scratch1 = ToRegister(instr->temp1()); 5383 Register scratch1 = ToRegister(instr->temp1());
5386 Register scratch2 = ToRegister(instr->temp2()); 5384 Register scratch2 = ToRegister(instr->temp2());
5387 5385
5388 AllocationFlags flags = NO_ALLOCATION_FLAGS; 5386 AllocationFlags flags = ALLOCATION_FOLDED;
5389 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 5387 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
5390 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 5388 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
5391 } 5389 }
5392 if (instr->hydrogen()->IsOldSpaceAllocation()) { 5390 if (instr->hydrogen()->IsOldSpaceAllocation()) {
5393 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); 5391 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
5394 flags = static_cast<AllocationFlags>(flags | PRETENURE); 5392 flags = static_cast<AllocationFlags>(flags | PRETENURE);
5395 } 5393 }
5396 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { 5394 if (instr->size()->IsConstantOperand()) {
5397 if (instr->size()->IsConstantOperand()) { 5395 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5398 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5396 CHECK(size <= Page::kMaxRegularHeapObjectSize);
5399 CHECK(size <= Page::kMaxRegularHeapObjectSize); 5397 __ FastAllocate(size, result, scratch1, scratch2, flags);
5400 __ FastAllocate(size, result, scratch1, scratch2, flags); 5398 } else {
5401 } else { 5399 Register size = ToRegister(instr->size());
5402 Register size = ToRegister(instr->size()); 5400 __ FastAllocate(size, result, scratch1, scratch2, flags);
5403 __ FastAllocate(size, result, scratch1, scratch2, flags);
5404 }
5405 } 5401 }
5406 } 5402 }
5407 5403
5408 5404
5409 void LCodeGen::DoTypeof(LTypeof* instr) { 5405 void LCodeGen::DoTypeof(LTypeof* instr) {
5410 DCHECK(ToRegister(instr->value()).is(a3)); 5406 DCHECK(ToRegister(instr->value()).is(a3));
5411 DCHECK(ToRegister(instr->result()).is(v0)); 5407 DCHECK(ToRegister(instr->result()).is(v0));
5412 Label end, do_call; 5408 Label end, do_call;
5413 Register value_register = ToRegister(instr->value()); 5409 Register value_register = ToRegister(instr->value());
5414 __ JumpIfNotSmi(value_register, &do_call); 5410 __ JumpIfNotSmi(value_register, &do_call);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
5789 __ ld(result, FieldMemOperand(scratch, 5785 __ ld(result, FieldMemOperand(scratch,
5790 FixedArray::kHeaderSize - kPointerSize)); 5786 FixedArray::kHeaderSize - kPointerSize));
5791 __ bind(deferred->exit()); 5787 __ bind(deferred->exit());
5792 __ bind(&done); 5788 __ bind(&done);
5793 } 5789 }
5794 5790
5795 #undef __ 5791 #undef __
5796 5792
5797 } // namespace internal 5793 } // namespace internal
5798 } // namespace v8 5794 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698