Reviewers: Igor Sheludko,

Description:
Handlify Heap::AllocateAllocationSite.

[email protected]

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

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

Affected files (+9, -37 lines):
  M src/factory.h
  M src/factory.cc
  M src/heap.h
  M src/heap.cc


Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3c76e5467c970b410371f1b03802909b2556b292..2b213e85adc7b1b4b4869f2b390c2c4e5c65371d 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -830,10 +830,14 @@ Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) {


 Handle<AllocationSite> Factory::NewAllocationSite() {
-  CALL_HEAP_FUNCTION(
-      isolate(),
-      isolate()->heap()->AllocateAllocationSite(),
-      AllocationSite);
+  Handle<Map> map = allocation_site_map();
+ Handle<AllocationSite> site = New<AllocationSite>(map, OLD_POINTER_SPACE);
+  site->Initialize();
+
+  // Link the site
+  site->set_weak_next(isolate()->heap()->allocation_sites_list());
+  isolate()->heap()->set_allocation_sites_list(*site);
+  return site;
 }


Index: src/factory.h
diff --git a/src/factory.h b/src/factory.h
index 241a19aa1c375e4abdb1ad15c6d66d210b397a55..a22e12c8b88adcd3d7a617e049e259aab93adbc4 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -253,6 +253,7 @@ class Factory V8_FINAL {

   Handle<PropertyCell> NewPropertyCell(Handle<Object> value);

+  // Allocate a tenured AllocationSite. It's payload is null.
   Handle<AllocationSite> NewAllocationSite();

   Handle<Map> NewMap(
@@ -323,9 +324,6 @@ class Factory V8_FINAL {
       bool allocate_properties = true,
Handle<AllocationSite> allocation_site = Handle<AllocationSite>::null());

-  Handle<JSObject> NewJSObjectFromMapForDeoptimizer(
-      Handle<Map> map, PretenureFlag pretenure = NOT_TENURED);
-
   // JS modules are pretenured.
   Handle<JSModule> NewJSModule(Handle<Context> context,
                                Handle<ScopeInfo> scope_info);
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index b4e6dde1d56ee5ef8cd1876d5dc58f8edb55109a..265a62ab1fe3ed9e17839c200491496619b2f769 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2424,16 +2424,6 @@ MaybeObject* Heap::AllocatePolymorphicCodeCache() {
 }


-MaybeObject* Heap::AllocateAliasedArgumentsEntry(int aliased_context_slot) {
-  AliasedArgumentsEntry* entry;
- { MaybeObject* maybe_entry = AllocateStruct(ALIASED_ARGUMENTS_ENTRY_TYPE);
-    if (!maybe_entry->To(&entry)) return maybe_entry;
-  }
-  entry->set_aliased_context_slot(aliased_context_slot);
-  return entry;
-}
-
-
 const Heap::StringTypeTable Heap::string_type_table[] = {
#define STRING_TYPE_ELEMENT(type, size, name, camel_name) \
   {type, size, k##camel_name##MapRootIndex},
@@ -2745,20 +2735,6 @@ MaybeObject* Heap::AllocatePropertyCell() {
 }


-MaybeObject* Heap::AllocateAllocationSite() {
-  AllocationSite* site;
-  MaybeObject* maybe_result = Allocate(allocation_site_map(),
-                                       OLD_POINTER_SPACE);
-  if (!maybe_result->To(&site)) return maybe_result;
-  site->Initialize();
-
-  // Link the site
-  site->set_weak_next(allocation_sites_list());
-  set_allocation_sites_list(site);
-  return site;
-}
-
-
 MaybeObject* Heap::CreateOddball(Map* map,
                                  const char* to_string,
                                  Object* to_number,
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index adf420b333237500a4421db23307736eba89047d..2349fa65b3e29db68589dbc5fd523ffe1f411147 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -773,9 +773,6 @@ class Heap {
   // Allocates an empty PolymorphicCodeCache.
   MUST_USE_RESULT MaybeObject* AllocatePolymorphicCodeCache();

-  // Allocates an AliasedArgumentsEntry.
-  MUST_USE_RESULT MaybeObject* AllocateAliasedArgumentsEntry(int slot);
-
   // Clear the Instanceof cache (used when a prototype changes).
   inline void ClearInstanceofCache();

@@ -907,9 +904,6 @@ class Heap {
   MUST_USE_RESULT MaybeObject* AllocateSymbol();
   MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol();

-  // Allocate a tenured AllocationSite. It's payload is null
-  MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
-
   // Allocates a fixed array initialized with undefined values
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.


--
--
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/d/optout.

Reply via email to