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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 21089006: Allocation space decisions are precisely made in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/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 // 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 5312 matching lines...) Expand 10 before | Expand all | Expand 10 after
5323 5323
5324 Register result = ToRegister(instr->result()); 5324 Register result = ToRegister(instr->result());
5325 Register scratch = ToRegister(instr->temp1()); 5325 Register scratch = ToRegister(instr->temp1());
5326 Register scratch2 = ToRegister(instr->temp2()); 5326 Register scratch2 = ToRegister(instr->temp2());
5327 5327
5328 // Allocate memory for the object. 5328 // Allocate memory for the object.
5329 AllocationFlags flags = TAG_OBJECT; 5329 AllocationFlags flags = TAG_OBJECT;
5330 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 5330 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
5331 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 5331 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
5332 } 5332 }
5333 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 5333 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
5334 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); 5334 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
5335 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5335 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); 5336 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
5336 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { 5337 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
5338 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5337 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); 5339 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE);
5338 } 5340 }
5339 if (instr->size()->IsConstantOperand()) { 5341 if (instr->size()->IsConstantOperand()) {
5340 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5342 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5341 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5343 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5342 } else { 5344 } else {
5343 Register size = ToRegister(instr->size()); 5345 Register size = ToRegister(instr->size());
5344 __ Allocate(size, 5346 __ Allocate(size,
5345 result, 5347 result,
5346 scratch, 5348 scratch,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
5384 if (instr->size()->IsRegister()) { 5386 if (instr->size()->IsRegister()) {
5385 Register size = ToRegister(instr->size()); 5387 Register size = ToRegister(instr->size());
5386 ASSERT(!size.is(result)); 5388 ASSERT(!size.is(result));
5387 __ SmiTag(size); 5389 __ SmiTag(size);
5388 __ push(size); 5390 __ push(size);
5389 } else { 5391 } else {
5390 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5392 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5391 __ Push(Smi::FromInt(size)); 5393 __ Push(Smi::FromInt(size));
5392 } 5394 }
5393 5395
5394 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 5396 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
5395 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); 5397 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
5398 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5396 CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr); 5399 CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
5397 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { 5400 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
5401 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5398 CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr); 5402 CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr);
5399 } else { 5403 } else {
5400 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); 5404 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
5401 } 5405 }
5402 __ StoreToSafepointRegisterSlot(v0, result); 5406 __ StoreToSafepointRegisterSlot(v0, result);
5403 } 5407 }
5404 5408
5405 5409
5406 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { 5410 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
5407 ASSERT(ToRegister(instr->value()).is(a0)); 5411 ASSERT(ToRegister(instr->value()).is(a0));
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
5854 __ Subu(scratch, result, scratch); 5858 __ Subu(scratch, result, scratch);
5855 __ lw(result, FieldMemOperand(scratch, 5859 __ lw(result, FieldMemOperand(scratch,
5856 FixedArray::kHeaderSize - kPointerSize)); 5860 FixedArray::kHeaderSize - kPointerSize));
5857 __ bind(&done); 5861 __ bind(&done);
5858 } 5862 }
5859 5863
5860 5864
5861 #undef __ 5865 #undef __
5862 5866
5863 } } // namespace v8::internal 5867 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698