Reviewers: Hannes Payer,

Description:
Remove specialized raw Cell and Map allocators.

[email protected]

Please review this at https://codereview.chromium.org/30023003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+10, -38 lines):
  M src/heap-inl.h
  M src/heap.h
  M src/heap.cc


Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 1f0f93ffead1cdfd8d3577149065af8c2fc9bc60..0636c13f28bcf3b04fe8f28ddc43c3430087d987 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -297,36 +297,7 @@ void Heap::FinalizeExternalString(String* string) {


 MaybeObject* Heap::AllocateRawMap() {
-#ifdef DEBUG
-  isolate_->counters()->objs_since_last_full()->Increment();
-  isolate_->counters()->objs_since_last_young()->Increment();
-#endif
-  MaybeObject* result = map_space_->AllocateRaw(Map::kSize);
-  if (result->IsFailure()) old_gen_exhausted_ = true;
-  return result;
-}
-
-
-MaybeObject* Heap::AllocateRawCell() {
-#ifdef DEBUG
-  isolate_->counters()->objs_since_last_full()->Increment();
-  isolate_->counters()->objs_since_last_young()->Increment();
-#endif
-  MaybeObject* result = cell_space_->AllocateRaw(Cell::kSize);
-  if (result->IsFailure()) old_gen_exhausted_ = true;
-  return result;
-}
-
-
-MaybeObject* Heap::AllocateRawPropertyCell() {
-#ifdef DEBUG
-  isolate_->counters()->objs_since_last_full()->Increment();
-  isolate_->counters()->objs_since_last_young()->Increment();
-#endif
-  MaybeObject* result =
-      property_cell_space_->AllocateRaw(PropertyCell::kSize);
-  if (result->IsFailure()) old_gen_exhausted_ = true;
-  return result;
+  return AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE);
 }


Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 2e460487c75468ba5f629a3f8d39ee0684bdcf9e..39b000d70ca55edffa9006fac5b1b324249d7083 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2953,8 +2953,11 @@ MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {


 MaybeObject* Heap::AllocateCell(Object* value) {
+  int size = Cell::kSize;
+  STATIC_ASSERT(Cell::kSize <= Page::kNonCodeObjectAreaSize);
+
   Object* result;
-  { MaybeObject* maybe_result = AllocateRawCell();
+  { MaybeObject* maybe_result = AllocateRaw(size, CELL_SPACE, CELL_SPACE);
     if (!maybe_result->ToObject(&result)) return maybe_result;
   }
   HeapObject::cast(result)->set_map_no_write_barrier(cell_map());
@@ -2964,8 +2967,12 @@ MaybeObject* Heap::AllocateCell(Object* value) {


 MaybeObject* Heap::AllocatePropertyCell() {
+  int size = PropertyCell::kSize;
+  STATIC_ASSERT(PropertyCell::kSize <= Page::kNonCodeObjectAreaSize);
+
   Object* result;
-  MaybeObject* maybe_result = AllocateRawPropertyCell();
+  MaybeObject* maybe_result =
+      AllocateRaw(size, PROPERTY_CELL_SPACE, PROPERTY_CELL_SPACE);
   if (!maybe_result->ToObject(&result)) return maybe_result;

   HeapObject::cast(result)->set_map_no_write_barrier(
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 0bd2c405f0ee09a78e6a3fea5d67317b6662edcb..931ec0cd3bf9d43fee5f5d1f3e3bebef89c7523c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -2091,12 +2091,6 @@ class Heap {
   // (since both AllocateRaw and AllocateRawMap are inlined).
   MUST_USE_RESULT inline MaybeObject* AllocateRawMap();

-  // Allocate an uninitialized object in the simple cell space.
-  MUST_USE_RESULT inline MaybeObject* AllocateRawCell();
-
-  // Allocate an uninitialized object in the global property cell space.
-  MUST_USE_RESULT inline MaybeObject* AllocateRawPropertyCell();
-
   // Allocate an uninitialized fixed array.
   MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(
       int length, PretenureFlag pretenure);


--
--
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.

Reply via email to