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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.cc ('k') | src/mips/lithium-codegen-mips.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 6030 matching lines...) Expand 10 before | Expand all | Expand 10 after
6041 new(zone()) DeferredAllocate(this, instr); 6041 new(zone()) DeferredAllocate(this, instr);
6042 6042
6043 Register result = ToRegister(instr->result()); 6043 Register result = ToRegister(instr->result());
6044 Register temp = ToRegister(instr->temp()); 6044 Register temp = ToRegister(instr->temp());
6045 6045
6046 // Allocate memory for the object. 6046 // Allocate memory for the object.
6047 AllocationFlags flags = TAG_OBJECT; 6047 AllocationFlags flags = TAG_OBJECT;
6048 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 6048 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
6049 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 6049 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
6050 } 6050 }
6051 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 6051 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
6052 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); 6052 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
6053 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
6053 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); 6054 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
6054 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { 6055 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
6056 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
6055 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); 6057 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE);
6056 } 6058 }
6057 6059
6058 if (instr->size()->IsConstantOperand()) { 6060 if (instr->size()->IsConstantOperand()) {
6059 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 6061 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
6060 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); 6062 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
6061 } else { 6063 } else {
6062 Register size = ToRegister(instr->size()); 6064 Register size = ToRegister(instr->size());
6063 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); 6065 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
6064 } 6066 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
6096 if (instr->size()->IsRegister()) { 6098 if (instr->size()->IsRegister()) {
6097 Register size = ToRegister(instr->size()); 6099 Register size = ToRegister(instr->size());
6098 ASSERT(!size.is(result)); 6100 ASSERT(!size.is(result));
6099 __ SmiTag(ToRegister(instr->size())); 6101 __ SmiTag(ToRegister(instr->size()));
6100 __ push(size); 6102 __ push(size);
6101 } else { 6103 } else {
6102 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 6104 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
6103 __ push(Immediate(Smi::FromInt(size))); 6105 __ push(Immediate(Smi::FromInt(size)));
6104 } 6106 }
6105 6107
6106 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 6108 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
6107 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); 6109 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
6110 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
6108 CallRuntimeFromDeferred( 6111 CallRuntimeFromDeferred(
6109 Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context()); 6112 Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context());
6110 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { 6113 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
6114 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
6111 CallRuntimeFromDeferred( 6115 CallRuntimeFromDeferred(
6112 Runtime::kAllocateInOldDataSpace, 1, instr, instr->context()); 6116 Runtime::kAllocateInOldDataSpace, 1, instr, instr->context());
6113 } else { 6117 } else {
6114 CallRuntimeFromDeferred( 6118 CallRuntimeFromDeferred(
6115 Runtime::kAllocateInNewSpace, 1, instr, instr->context()); 6119 Runtime::kAllocateInNewSpace, 1, instr, instr->context());
6116 } 6120 }
6117 __ StoreToSafepointRegisterSlot(result, eax); 6121 __ StoreToSafepointRegisterSlot(result, eax);
6118 } 6122 }
6119 6123
6120 6124
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
6523 FixedArray::kHeaderSize - kPointerSize)); 6527 FixedArray::kHeaderSize - kPointerSize));
6524 __ bind(&done); 6528 __ bind(&done);
6525 } 6529 }
6526 6530
6527 6531
6528 #undef __ 6532 #undef __
6529 6533
6530 } } // namespace v8::internal 6534 } } // namespace v8::internal
6531 6535
6532 #endif // V8_TARGET_ARCH_IA32 6536 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698