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

Side by Side Diff: src/arm/lithium-codegen-arm.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 | « no previous file | src/code-stubs-hydrogen.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 5335 matching lines...) Expand 10 before | Expand all | Expand 10 after
5346 5346
5347 Register result = ToRegister(instr->result()); 5347 Register result = ToRegister(instr->result());
5348 Register scratch = ToRegister(instr->temp1()); 5348 Register scratch = ToRegister(instr->temp1());
5349 Register scratch2 = ToRegister(instr->temp2()); 5349 Register scratch2 = ToRegister(instr->temp2());
5350 5350
5351 // Allocate memory for the object. 5351 // Allocate memory for the object.
5352 AllocationFlags flags = TAG_OBJECT; 5352 AllocationFlags flags = TAG_OBJECT;
5353 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 5353 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
5354 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 5354 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
5355 } 5355 }
5356 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 5356 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
5357 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); 5357 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
5358 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5358 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); 5359 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
5359 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { 5360 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
5361 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5360 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); 5362 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE);
5361 } 5363 }
5362 5364
5363 if (instr->size()->IsConstantOperand()) { 5365 if (instr->size()->IsConstantOperand()) {
5364 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5366 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5365 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5367 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5366 } else { 5368 } else {
5367 Register size = ToRegister(instr->size()); 5369 Register size = ToRegister(instr->size());
5368 __ Allocate(size, 5370 __ Allocate(size,
5369 result, 5371 result,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5408 if (instr->size()->IsRegister()) { 5410 if (instr->size()->IsRegister()) {
5409 Register size = ToRegister(instr->size()); 5411 Register size = ToRegister(instr->size());
5410 ASSERT(!size.is(result)); 5412 ASSERT(!size.is(result));
5411 __ SmiTag(size); 5413 __ SmiTag(size);
5412 __ push(size); 5414 __ push(size);
5413 } else { 5415 } else {
5414 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5416 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5415 __ Push(Smi::FromInt(size)); 5417 __ Push(Smi::FromInt(size));
5416 } 5418 }
5417 5419
5418 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 5420 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
5419 ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); 5421 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
5422 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5420 CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr); 5423 CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
5421 } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { 5424 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
5425 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5422 CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr); 5426 CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr);
5423 } else { 5427 } else {
5424 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); 5428 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
5425 } 5429 }
5426 __ StoreToSafepointRegisterSlot(r0, result); 5430 __ StoreToSafepointRegisterSlot(r0, result);
5427 } 5431 }
5428 5432
5429 5433
5430 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { 5434 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
5431 ASSERT(ToRegister(instr->value()).is(r0)); 5435 ASSERT(ToRegister(instr->value()).is(r0));
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
5836 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5840 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5837 __ ldr(result, FieldMemOperand(scratch, 5841 __ ldr(result, FieldMemOperand(scratch,
5838 FixedArray::kHeaderSize - kPointerSize)); 5842 FixedArray::kHeaderSize - kPointerSize));
5839 __ bind(&done); 5843 __ bind(&done);
5840 } 5844 }
5841 5845
5842 5846
5843 #undef __ 5847 #undef __
5844 5848
5845 } } // namespace v8::internal 5849 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698