Revision: 18776
Author: [email protected]
Date: Thu Jan 23 13:02:27 2014 UTC
Log: Remove Heap::MaxRegularSpaceAllocationSize and use
Page::MaxRegularHeapObjectSize instead.
BUG=
[email protected], [email protected]
Review URL: https://codereview.chromium.org/141653016
http://code.google.com/p/v8/source/detail?r=18776
Modified:
/branches/bleeding_edge/src/arm/macro-assembler-arm.cc
/branches/bleeding_edge/src/heap.cc
/branches/bleeding_edge/src/heap.h
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc
/branches/bleeding_edge/src/mark-compact.cc
/branches/bleeding_edge/src/mips/macro-assembler-mips.cc
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects-visiting.h
/branches/bleeding_edge/src/objects.h
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/src/spaces-inl.h
/branches/bleeding_edge/src/spaces.h
/branches/bleeding_edge/src/x64/macro-assembler-x64.cc
/branches/bleeding_edge/test/cctest/test-alloc.cc
/branches/bleeding_edge/test/cctest/test-heap.cc
/branches/bleeding_edge/test/cctest/test-mark-compact.cc
/branches/bleeding_edge/test/cctest/test-spaces.cc
/branches/bleeding_edge/test/mjsunit/allocation-folding.js
/branches/bleeding_edge/test/mjsunit/regress/regress-3027.js
=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Tue Jan 21
11:20:11 2014 UTC
+++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Thu Jan 23
13:02:27 2014 UTC
@@ -1639,7 +1639,7 @@
Register scratch2,
Label* gc_required,
AllocationFlags flags) {
- ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
if (!FLAG_inline_new) {
if (emit_debug_code()) {
// Trash the registers to simulate an allocation failure.
=======================================
--- /branches/bleeding_edge/src/heap.cc Thu Jan 23 12:13:20 2014 UTC
+++ /branches/bleeding_edge/src/heap.cc Thu Jan 23 13:02:27 2014 UTC
@@ -2282,7 +2282,7 @@
HeapObject** slot,
HeapObject* object,
int object_size) {
- SLOW_ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ SLOW_ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
SLOW_ASSERT(object->Size() == object_size);
int allocation_size = object_size;
@@ -2936,7 +2936,8 @@
// Statically ensure that it is safe to allocate heap numbers in paged
// spaces.
int size = HeapNumber::kSize;
- STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxNonCodeHeapObjectSize);
+ STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxRegularHeapObjectSize);
+
AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
Object* result;
@@ -2952,7 +2953,7 @@
MaybeObject* Heap::AllocateCell(Object* value) {
int size = Cell::kSize;
- STATIC_ASSERT(Cell::kSize <= Page::kMaxNonCodeHeapObjectSize);
+ STATIC_ASSERT(Cell::kSize <= Page::kMaxRegularHeapObjectSize);
Object* result;
{ MaybeObject* maybe_result = AllocateRaw(size, CELL_SPACE, CELL_SPACE);
@@ -2966,7 +2967,7 @@
MaybeObject* Heap::AllocatePropertyCell() {
int size = PropertyCell::kSize;
- STATIC_ASSERT(PropertyCell::kSize <= Page::kMaxNonCodeHeapObjectSize);
+ STATIC_ASSERT(PropertyCell::kSize <= Page::kMaxRegularHeapObjectSize);
Object* result;
MaybeObject* maybe_result =
@@ -3724,7 +3725,7 @@
MaybeObject* Heap::AllocateForeign(Address address, PretenureFlag
pretenure) {
// Statically ensure that it is safe to allocate foreigns in paged
spaces.
- STATIC_ASSERT(Foreign::kSize <= Page::kMaxNonCodeHeapObjectSize);
+ STATIC_ASSERT(Foreign::kSize <= Page::kMaxRegularHeapObjectSize);
AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE :
NEW_SPACE;
Foreign* result;
MaybeObject* maybe_result = Allocate(foreign_map(), space);
@@ -5348,7 +5349,7 @@
MaybeObject* Heap::AllocateSymbol() {
// Statically ensure that it is safe to allocate symbols in paged spaces.
- STATIC_ASSERT(Symbol::kSize <= Page::kMaxNonCodeHeapObjectSize);
+ STATIC_ASSERT(Symbol::kSize <= Page::kMaxRegularHeapObjectSize);
Object* result;
MaybeObject* maybe =
@@ -6312,7 +6313,7 @@
Page::kPageSize));
// We rely on being able to allocate new arrays in paged spaces.
- ASSERT(MaxRegularSpaceAllocationSize() >=
+ ASSERT(Page::kMaxRegularHeapObjectSize >=
(JSArray::kSize +
FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) +
AllocationMemento::kSize));
=======================================
--- /branches/bleeding_edge/src/heap.h Wed Jan 22 12:07:14 2014 UTC
+++ /branches/bleeding_edge/src/heap.h Thu Jan 23 13:02:27 2014 UTC
@@ -531,7 +531,6 @@
int InitialSemiSpaceSize() { return initial_semispace_size_; }
intptr_t MaxOldGenerationSize() { return max_old_generation_size_; }
intptr_t MaxExecutableSize() { return max_executable_size_; }
- int MaxRegularSpaceAllocationSize() { return InitialSemiSpaceSize() *
4/5; }
// Returns the capacity of the heap in bytes w/o growing. Heap grows when
// more spaces are needed until it reaches the limit.
@@ -2103,7 +2102,7 @@
PretenureFlag pretenure) {
ASSERT(preferred_old_space == OLD_POINTER_SPACE ||
preferred_old_space == OLD_DATA_SPACE);
- if (object_size > Page::kMaxNonCodeHeapObjectSize) return LO_SPACE;
+ if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE;
return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE;
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Wed Jan 22
11:54:51 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Jan 23
13:02:27 2014 UTC
@@ -3453,7 +3453,9 @@
}
}
- if (new_dominator_size >
isolate()->heap()->MaxRegularSpaceAllocationSize()) {
+ // Since we clear the first word after folded memory, we cannot use the
+ // whole Page::kMaxRegularHeapObjectSize memory.
+ if (new_dominator_size > Page::kMaxRegularHeapObjectSize - kPointerSize)
{
if (FLAG_trace_allocation_folding) {
PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n",
id(), Mnemonic(), dominator_allocate->id(),
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Wed Jan 22 13:22:58 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Thu Jan 23 13:02:27 2014 UTC
@@ -2369,10 +2369,9 @@
void HGraphBuilder::BuildNewSpaceArrayCheck(HValue* length, ElementsKind
kind) {
- Heap* heap = isolate()->heap();
int element_size = IsFastDoubleElementsKind(kind) ? kDoubleSize
: kPointerSize;
- int max_size = heap->MaxRegularSpaceAllocationSize() / element_size;
+ int max_size = Page::kMaxRegularHeapObjectSize / element_size;
max_size -= JSArray::kSize / element_size;
HConstant* max_size_constant = Add<HConstant>(max_size);
Add<HBoundsCheck>(length, max_size_constant);
=======================================
--- /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Tue Jan 21
11:20:11 2014 UTC
+++ /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Thu Jan 23
13:02:27 2014 UTC
@@ -1591,7 +1591,7 @@
Label* gc_required,
AllocationFlags flags) {
ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0);
- ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
if (!FLAG_inline_new) {
if (emit_debug_code()) {
// Trash the registers to simulate an allocation failure.
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Tue Jan 21 19:40:25 2014 UTC
+++ /branches/bleeding_edge/src/mark-compact.cc Thu Jan 23 13:02:27 2014 UTC
@@ -2792,7 +2792,7 @@
heap_profiler->ObjectMoveEvent(src, dst, size);
}
ASSERT(heap()->AllowedToBeMigrated(HeapObject::FromAddress(src), dest));
- ASSERT(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize);
+ ASSERT(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize);
if (dest == OLD_POINTER_SPACE) {
Address src_slot = src;
Address dst_slot = dst;
@@ -2966,7 +2966,7 @@
bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
int object_size) {
// TODO(hpayer): Replace that check with an assert.
- CHECK(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ CHECK(object_size <= Page::kMaxRegularHeapObjectSize);
OldSpace* target_space = heap()->TargetSpace(object);
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue Jan 21
17:48:57 2014 UTC
+++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Thu Jan 23
13:02:27 2014 UTC
@@ -2844,7 +2844,7 @@
Register scratch2,
Label* gc_required,
AllocationFlags flags) {
- ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
if (!FLAG_inline_new) {
if (emit_debug_code()) {
// Trash the registers to simulate an allocation failure.
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Wed Jan 22 14:02:00 2014 UTC
+++ /branches/bleeding_edge/src/objects-inl.h Thu Jan 23 13:02:27 2014 UTC
@@ -4702,7 +4702,7 @@
if (!HasTransitionArray()) return true;
return FixedArray::SizeFor(transitions()->length() +
TransitionArray::kTransitionSize)
- <= Page::kMaxNonCodeHeapObjectSize;
+ <= Page::kMaxRegularHeapObjectSize;
}
=======================================
--- /branches/bleeding_edge/src/objects-visiting.h Thu Jan 16 17:08:45 2014
UTC
+++ /branches/bleeding_edge/src/objects-visiting.h Thu Jan 23 13:02:27 2014
UTC
@@ -144,7 +144,7 @@
(base == kVisitJSObject));
ASSERT(IsAligned(object_size, kPointerSize));
ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size);
- ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
const VisitorId specialization = static_cast<VisitorId>(
base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords);
=======================================
--- /branches/bleeding_edge/src/objects.h Tue Jan 21 16:22:52 2014 UTC
+++ /branches/bleeding_edge/src/objects.h Thu Jan 23 13:02:27 2014 UTC
@@ -2663,7 +2663,7 @@
// don't want to be wasteful with long lived objects.
static const int kMaxUncheckedOldFastElementsLength = 500;
- // Note that Heap::MaxRegularSpaceAllocationSize() puts a limit on
+ // Note that Page::kMaxRegularHeapObjectSize puts a limit on
// permissible values (see the ASSERT in heap.cc).
static const int kInitialMaxFastElementArray = 100000;
=======================================
--- /branches/bleeding_edge/src/runtime.cc Thu Jan 23 08:36:22 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc Thu Jan 23 13:02:27 2014 UTC
@@ -9757,7 +9757,7 @@
Heap* heap = isolate->heap();
RUNTIME_ASSERT(IsAligned(size, kPointerSize));
RUNTIME_ASSERT(size > 0);
- RUNTIME_ASSERT(size <= heap->MaxRegularSpaceAllocationSize());
+ RUNTIME_ASSERT(size <= Page::kMaxRegularHeapObjectSize);
HeapObject* allocation;
{ MaybeObject* maybe_allocation = heap->AllocateRaw(size, space, space);
if (!maybe_allocation->To(&allocation)) return maybe_allocation;
=======================================
--- /branches/bleeding_edge/src/spaces-inl.h Thu Jan 23 12:13:20 2014 UTC
+++ /branches/bleeding_edge/src/spaces-inl.h Thu Jan 23 13:02:27 2014 UTC
@@ -165,7 +165,7 @@
Executability executable,
PagedSpace* owner) {
Page* page = reinterpret_cast<Page*>(chunk);
- ASSERT(page->area_size() <= kMaxNonCodeHeapObjectSize);
+ ASSERT(page->area_size() <= kMaxRegularHeapObjectSize);
ASSERT(chunk->owner() == owner);
owner->IncreaseCapacity(page->area_size());
owner->Free(page->area_start(), page->area_size());
=======================================
--- /branches/bleeding_edge/src/spaces.h Thu Jan 23 12:13:20 2014 UTC
+++ /branches/bleeding_edge/src/spaces.h Thu Jan 23 13:02:27 2014 UTC
@@ -103,7 +103,7 @@
ASSERT((OffsetFrom(address) & kObjectAlignmentMask) == 0)
#define
ASSERT_OBJECT_SIZE(size) \
- ASSERT((0 < size) && (size <= Page::kMaxNonCodeHeapObjectSize))
+ ASSERT((0 < size) && (size <= Page::kMaxRegularHeapObjectSize))
#define
ASSERT_PAGE_OFFSET(offset) \
ASSERT((Page::kObjectStartOffset <=
offset) \
@@ -783,7 +783,7 @@
// are allocated in large object space and are never moved in memory.
This
// also applies to new space allocation, since objects are never migrated
// from new space to large object space. Takes double alignment into
account.
- static const int kMaxNonCodeHeapObjectSize = kPageSize -
kObjectStartOffset;
+ static const int kMaxRegularHeapObjectSize = kPageSize -
kObjectStartOffset;
// Page size mask.
static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1;
@@ -1076,7 +1076,7 @@
// Returns maximum available bytes that the old space can have.
intptr_t MaxAvailable() {
- return (Available() / Page::kPageSize) *
Page::kMaxNonCodeHeapObjectSize;
+ return (Available() / Page::kPageSize) *
Page::kMaxRegularHeapObjectSize;
}
// Returns an indication of whether a pointer is in a space that has
@@ -1631,7 +1631,7 @@
private:
// The size range of blocks, in bytes.
static const int kMinBlockSize = 3 * kPointerSize;
- static const int kMaxBlockSize = Page::kMaxNonCodeHeapObjectSize;
+ static const int kMaxBlockSize = Page::kMaxRegularHeapObjectSize;
FreeListNode* FindNodeFor(int size_in_bytes, int* node_size);
@@ -2009,7 +2009,7 @@
(1 << MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING) |
(1 << MemoryChunk::SCAN_ON_SCAVENGE);
- static const int kAreaSize = Page::kMaxNonCodeHeapObjectSize;
+ static const int kAreaSize = Page::kMaxRegularHeapObjectSize;
inline NewSpacePage* next_page() const {
return static_cast<NewSpacePage*>(next_chunk());
@@ -2669,7 +2669,7 @@
virtual void VerifyObject(HeapObject* obj);
private:
- static const int kMapsPerPage = Page::kMaxNonCodeHeapObjectSize /
Map::kSize;
+ static const int kMapsPerPage = Page::kMaxRegularHeapObjectSize /
Map::kSize;
// Do map space compaction if there is a page gap.
int CompactionThreshold() {
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Tue Jan 21
11:20:11 2014 UTC
+++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Jan 23
13:02:27 2014 UTC
@@ -4048,7 +4048,7 @@
Label* gc_required,
AllocationFlags flags) {
ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0);
- ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
+ ASSERT(object_size <= Page::kMaxRegularHeapObjectSize);
if (!FLAG_inline_new) {
if (emit_debug_code()) {
// Trash the registers to simulate an allocation failure.
=======================================
--- /branches/bleeding_edge/test/cctest/test-alloc.cc Fri Nov 22 12:43:17
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-alloc.cc Thu Jan 23 13:02:27
2014 UTC
@@ -198,11 +198,11 @@
if (current_allocated < code_range_size / 10) {
// Allocate a block.
// Geometrically distributed sizes, greater than
- // Page::kMaxNonCodeHeapObjectSize (which is greater than code page
area).
+ // Page::kMaxRegularHeapObjectSize (which is greater than code page
area).
// TODO(gc): instead of using 3 use some contant based on
code_range_size
// kMaxHeapObjectSize.
size_t requested =
- (Page::kMaxNonCodeHeapObjectSize << (Pseudorandom() % 3)) +
+ (Page::kMaxRegularHeapObjectSize << (Pseudorandom() % 3)) +
Pseudorandom() % 5000 + 1;
size_t allocated = 0;
Address base = code_range.AllocateRawMemory(requested,
=======================================
--- /branches/bleeding_edge/test/cctest/test-heap.cc Wed Jan 22 12:59:25
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-heap.cc Thu Jan 23 13:02:27
2014 UTC
@@ -918,7 +918,7 @@
factory->NewStringFromAscii(CStrVector("abcdefghij"), TENURED);
// Allocate a large string (for large object space).
- int large_size = Page::kMaxNonCodeHeapObjectSize + 1;
+ int large_size = Page::kMaxRegularHeapObjectSize + 1;
char* str = new char[large_size];
for (int i = 0; i < large_size - 1; ++i) str[i] = 'a';
str[large_size - 1] = '\0';
@@ -987,7 +987,7 @@
// just enough room to allocate JSObject and thus fill the newspace.
int allocation_amount = Min(FixedArray::kMaxSize,
- Page::kMaxNonCodeHeapObjectSize +
kPointerSize);
+ Page::kMaxRegularHeapObjectSize +
kPointerSize);
int allocation_len = LenFromSize(allocation_amount);
NewSpace* new_space = heap->new_space();
Address* top_addr = new_space->allocation_top_address();
=======================================
--- /branches/bleeding_edge/test/cctest/test-mark-compact.cc Wed Dec 18
08:09:37 2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-mark-compact.cc Thu Jan 23
13:02:27 2014 UTC
@@ -82,7 +82,7 @@
// Allocate a fixed array in the new space.
int array_length =
- (Page::kMaxNonCodeHeapObjectSize - FixedArray::kHeaderSize) /
+ (Page::kMaxRegularHeapObjectSize - FixedArray::kHeaderSize) /
(4 * kPointerSize);
Object* obj = heap->AllocateFixedArray(array_length)->ToObjectChecked();
Handle<FixedArray> array(FixedArray::cast(obj));
@@ -107,7 +107,7 @@
// Allocate a big fixed array in the new space.
int array_length =
- (Page::kMaxNonCodeHeapObjectSize - FixedArray::kHeaderSize) /
+ (Page::kMaxRegularHeapObjectSize - FixedArray::kHeaderSize) /
(2 * kPointerSize);
Object* obj = heap->AllocateFixedArray(array_length)->ToObjectChecked();
Handle<FixedArray> array(FixedArray::cast(obj));
=======================================
--- /branches/bleeding_edge/test/cctest/test-spaces.cc Fri Sep 20 12:18:17
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-spaces.cc Thu Jan 23 13:02:27
2014 UTC
@@ -327,9 +327,9 @@
CcTest::heap()->ReservedSemiSpaceSize()));
CHECK(new_space.HasBeenSetUp());
- while (new_space.Available() >= Page::kMaxNonCodeHeapObjectSize) {
+ while (new_space.Available() >= Page::kMaxRegularHeapObjectSize) {
Object* obj =
- new_space.AllocateRaw(Page::kMaxNonCodeHeapObjectSize)->
+ new_space.AllocateRaw(Page::kMaxRegularHeapObjectSize)->
ToObjectUnchecked();
CHECK(new_space.Contains(HeapObject::cast(obj)));
}
@@ -359,7 +359,7 @@
CHECK(s->SetUp());
while (s->Available() > 0) {
- s->AllocateRaw(Page::kMaxNonCodeHeapObjectSize)->ToObjectUnchecked();
+ s->AllocateRaw(Page::kMaxRegularHeapObjectSize)->ToObjectUnchecked();
}
s->TearDown();
=======================================
--- /branches/bleeding_edge/test/mjsunit/allocation-folding.js Fri Nov 15
18:44:59 2013 UTC
+++ /branches/bleeding_edge/test/mjsunit/allocation-folding.js Thu Jan 23
13:02:27 2014 UTC
@@ -101,8 +101,7 @@
assertEquals(result[1], 4);
assertEquals(result2[1], 6);
-// Test to exceed the Heap::MaxRegularSpaceAllocationSize limit but not
-// the Page::kMaxNonCodeHeapObjectSize limit with allocation folding.
+// Test to almost exceed the Page::MaxRegularHeapObjectSize limit.
function boom() {
var a1 = new Array(84632);
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-3027.js Thu Nov 28
09:29:57 2013 UTC
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-3027.js Thu Jan 23
13:02:27 2014 UTC
@@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Test to exceed the Heap::MaxRegularSpaceAllocationSize with an array
+// Test to exceed the Page::MaxRegularHeapObjectSize with an array
// constructor call taking many arguments.
function boom() {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.