Reviewers: Michael Starzinger, danno,
Description:
Allow allocations in spaces with constant allocation size use the
smallest possible size-class.
BUG=
Please review this at https://codereview.chromium.org/16957003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/spaces.h
M src/spaces.cc
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index
8e953e2a556c8d26557445b8835a825b38bfc6d0..27aab9d5a85f876b65e6c638526ad88e6e66b694
100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -2202,6 +2202,11 @@ int FreeList::Free(Address start, int size_in_bytes)
{
// Insert other blocks at the head of a free list of the appropriate
// magnitude.
if (size_in_bytes <= kSmallListMax) {
+ ASSERT(!owner_->ConstantAllocationSize() ||
+ (owner_->identity() == MAP_SPACE && size_in_bytes >= Map::kSize) ||
+ (owner_->identity() == CELL_SPACE && size_in_bytes >= Cell::kSize)
||
+ (owner_->identity() == PROPERTY_CELL_SPACE &&
+ size_in_bytes >= JSGlobalPropertyCell::kSize));
small_list_.Free(node, size_in_bytes);
page->add_available_in_small_free_list(size_in_bytes);
} else if (size_in_bytes <= kMediumListMax) {
@@ -2224,9 +2229,11 @@ FreeListNode* FreeList::FindNodeFor(int
size_in_bytes, int* node_size) {
FreeListNode* node = NULL;
Page* page = NULL;
- if (size_in_bytes <= kSmallAllocationMax) {
+ if ((owner_->ConstantAllocationSize() && size_in_bytes <= kSmallListMax)
||
+ size_in_bytes <= kSmallAllocationMax) {
node = small_list_.PickNodeFromList(node_size);
if (node != NULL) {
+ ASSERT(size_in_bytes <= *node_size);
page = Page::FromAddress(node->address());
page->add_available_in_small_free_list(-(*node_size));
return node;
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index
ca61081ded8ae4f71e8a9cd4b336fb8cb240255a..56be1406b6384eccc7335458729ff77c019f2c96
100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1820,6 +1820,11 @@ class PagedSpace : public Space {
return area_size_;
}
+ bool ConstantAllocationSize() {
+ return identity() == MAP_SPACE || identity() == CELL_SPACE ||
+ identity() == PROPERTY_CELL_SPACE;
+ }
+
protected:
FreeList* free_list() { return &free_list_; }
--
--
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.