Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: src/heap.cc

Issue 227533002: Handlify six allocator functions from the Heap. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index f06b8be1d98246d3ea9b5f3237b7a96ae211572c..ba055a39a5d0cdced5ea2d39e21d54058412239f 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2690,29 +2690,6 @@ MaybeObject* Heap::AllocatePolymorphicCodeCache() {
}
-MaybeObject* Heap::AllocateAccessorPair() {
- AccessorPair* accessors;
- { MaybeObject* maybe_accessors = AllocateStruct(ACCESSOR_PAIR_TYPE);
- if (!maybe_accessors->To(&accessors)) return maybe_accessors;
- }
- accessors->set_getter(the_hole_value(), SKIP_WRITE_BARRIER);
- accessors->set_setter(the_hole_value(), SKIP_WRITE_BARRIER);
- accessors->set_access_flags(Smi::FromInt(0), SKIP_WRITE_BARRIER);
- return accessors;
-}
-
-
-MaybeObject* Heap::AllocateTypeFeedbackInfo() {
- TypeFeedbackInfo* info;
- { MaybeObject* maybe_info = AllocateStruct(TYPE_FEEDBACK_INFO_TYPE);
- if (!maybe_info->To(&info)) return maybe_info;
- }
- info->initialize_storage();
- info->set_feedback_vector(empty_fixed_array(), SKIP_WRITE_BARRIER);
- return info;
-}
-
-
MaybeObject* Heap::AllocateAliasedArgumentsEntry(int aliased_context_slot) {
AliasedArgumentsEntry* entry;
{ MaybeObject* maybe_entry = AllocateStruct(ALIASED_ARGUMENTS_ENTRY_TYPE);
@@ -5503,21 +5480,6 @@ MaybeObject* Heap::AllocatePrivateSymbol() {
}
-MaybeObject* Heap::AllocateNativeContext() {
- Object* result;
- { MaybeObject* maybe_result =
- AllocateFixedArray(Context::NATIVE_CONTEXT_SLOTS);
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Context* context = reinterpret_cast<Context*>(result);
- context->set_map_no_write_barrier(native_context_map());
- context->set_js_array_maps(undefined_value());
- ASSERT(context->IsNativeContext());
- ASSERT(result->IsContext());
- return result;
-}
-
-
MaybeObject* Heap::AllocateGlobalContext(JSFunction* function,
ScopeInfo* scope_info) {
Object* result;
@@ -5537,20 +5499,6 @@ MaybeObject* Heap::AllocateGlobalContext(JSFunction* function,
}
-MaybeObject* Heap::AllocateModuleContext(ScopeInfo* scope_info) {
- Object* result;
- { MaybeObject* maybe_result =
- AllocateFixedArray(scope_info->ContextLength(), TENURED);
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Context* context = reinterpret_cast<Context*>(result);
- context->set_map_no_write_barrier(module_context_map());
- // Instance link will be set later.
- context->set_extension(Smi::FromInt(0));
- return context;
-}
-
-
MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
ASSERT(length >= Context::MIN_CONTEXT_SLOTS);
Object* result;
@@ -5623,29 +5571,6 @@ MaybeObject* Heap::AllocateBlockContext(JSFunction* function,
}
-MaybeObject* Heap::AllocateScopeInfo(int length) {
- FixedArray* scope_info;
- MaybeObject* maybe_scope_info = AllocateFixedArray(length, TENURED);
- if (!maybe_scope_info->To(&scope_info)) return maybe_scope_info;
- scope_info->set_map_no_write_barrier(scope_info_map());
- return scope_info;
-}
-
-
-MaybeObject* Heap::AllocateExternal(void* value) {
- Foreign* foreign;
- { MaybeObject* maybe_result = AllocateForeign(static_cast<Address>(value));
- if (!maybe_result->To(&foreign)) return maybe_result;
- }
- JSObject* external;
- { MaybeObject* maybe_result = AllocateJSObjectFromMap(external_map());
- if (!maybe_result->To(&external)) return maybe_result;
- }
- external->SetInternalField(0, foreign);
- return external;
-}
-
-
MaybeObject* Heap::AllocateStruct(InstanceType type) {
Map* map;
switch (type) {
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698