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

Unified Diff: src/heap/heap.cc

Issue 1368103002: Revert of [heap] Move large object space selection into AllocateRaw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index bafce6fc6d1461769c41ae56b61b56047728b775..31b93e71991e219b5c6050bd0f17bd890f6018ec 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2364,7 +2364,7 @@
int size = HeapNumber::kSize;
STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxRegularHeapObjectSize);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* result = nullptr;
{
@@ -2385,7 +2385,7 @@
int size = Type::kSize; \
STATIC_ASSERT(Type::kSize <= Page::kMaxRegularHeapObjectSize); \
\
- AllocationSpace space = SelectSpace(pretenure); \
+ AllocationSpace space = SelectSpace(size, pretenure); \
\
HeapObject* result = nullptr; \
{ \
@@ -2923,7 +2923,7 @@
v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true);
}
int size = ByteArray::SizeFor(length);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* result = nullptr;
{
AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
@@ -3134,7 +3134,7 @@
int length, ExternalArrayType array_type, void* external_pointer,
PretenureFlag pretenure) {
int size = FixedTypedArrayBase::kHeaderSize;
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* result = nullptr;
{
AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
@@ -3178,7 +3178,7 @@
ForFixedTypedArray(array_type, &element_size, &elements_kind);
int size = OBJECT_POINTER_ALIGN(length * element_size +
FixedTypedArrayBase::kDataOffset);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* object = nullptr;
AllocationResult allocation = AllocateRaw(
@@ -3393,7 +3393,8 @@
FixedArray* properties = empty_fixed_array();
// Allocate the JSObject.
- AllocationSpace space = SelectSpace(pretenure);
+ int size = map->instance_size();
+ AllocationSpace space = SelectSpace(size, pretenure);
JSObject* js_obj = nullptr;
AllocationResult allocation = Allocate(map, space, allocation_site);
if (!allocation.To(&js_obj)) return allocation;
@@ -3594,11 +3595,12 @@
map = internalized_string_map();
size = SeqTwoByteString::SizeFor(chars);
}
+ AllocationSpace space = SelectSpace(size, TENURED);
// Allocate string.
HeapObject* result = nullptr;
{
- AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE);
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
if (!allocation.To(&result)) return allocation;
}
@@ -3636,7 +3638,7 @@
DCHECK_GE(String::kMaxLength, length);
int size = SeqOneByteString::SizeFor(length);
DCHECK(size <= SeqOneByteString::kMaxSize);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* result = nullptr;
{
@@ -3660,7 +3662,7 @@
DCHECK_GE(String::kMaxLength, length);
int size = SeqTwoByteString::SizeFor(length);
DCHECK(size <= SeqTwoByteString::kMaxSize);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* result = nullptr;
{
@@ -3795,7 +3797,7 @@
v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true);
}
int size = FixedArray::SizeFor(length);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
return AllocateRaw(size, space, OLD_SPACE);
}
@@ -3864,7 +3866,7 @@
kDoubleAligned);
}
int size = FixedDoubleArray::SizeFor(length);
- AllocationSpace space = SelectSpace(pretenure);
+ AllocationSpace space = SelectSpace(size, pretenure);
HeapObject* object = nullptr;
{
@@ -3921,9 +3923,10 @@
return exception();
}
int size = map->instance_size();
+ AllocationSpace space = SelectSpace(size, TENURED);
Struct* result = nullptr;
{
- AllocationResult allocation = Allocate(map, OLD_SPACE);
+ AllocationResult allocation = Allocate(map, space);
if (!allocation.To(&result)) return allocation;
}
result->InitializeBody(size);
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698