From 41f986e62ba7380b16bccd4836e76e6dcc679683 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Wed, 16 Apr 2014 12:54:29 +0000 Subject: [PATCH] Handlify Heap::AllocateAllocationSite. R=ishell@chromium.org Review URL: https://codereview.chromium.org/239993003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20805 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/factory.cc | 12 ++++++++---- src/factory.h | 4 +--- src/heap.cc | 24 ------------------------ src/heap.h | 6 ------ 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/src/factory.cc b/src/factory.cc index a44b3c6..3865aa8 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -839,10 +839,14 @@ Handle Factory::NewPropertyCell(Handle value) { Handle Factory::NewAllocationSite() { - CALL_HEAP_FUNCTION( - isolate(), - isolate()->heap()->AllocateAllocationSite(), - AllocationSite); + Handle map = allocation_site_map(); + Handle site = New(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; } diff --git a/src/factory.h b/src/factory.h index 834bd78..677e708 100644 --- a/src/factory.h +++ b/src/factory.h @@ -255,6 +255,7 @@ class Factory V8_FINAL { Handle NewPropertyCell(Handle value); + // Allocate a tenured AllocationSite. It's payload is null. Handle NewAllocationSite(); Handle NewMap( @@ -325,9 +326,6 @@ class Factory V8_FINAL { bool allocate_properties = true, Handle allocation_site = Handle::null()); - Handle NewJSObjectFromMapForDeoptimizer( - Handle map, PretenureFlag pretenure = NOT_TENURED); - // JS modules are pretenured. Handle NewJSModule(Handle context, Handle scope_info); diff --git a/src/heap.cc b/src/heap.cc index ac69e3a..f099229 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, diff --git a/src/heap.h b/src/heap.h index 8386e9c..d09c882 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. -- 2.7.4