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

Unified Diff: src/heap.cc

Issue 230393002: Handlify all context allocators 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') | src/runtime.cc » ('j') | 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 56a0dd7e6d81c98e59d7e6fc401f4ad072f6b930..8c2b4e78fa289e26b09e1cf538a283866b4e2d5e 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -5410,97 +5410,6 @@ MaybeObject* Heap::AllocatePrivateSymbol() {
}
-MaybeObject* Heap::AllocateGlobalContext(JSFunction* function,
- 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(global_context_map());
- context->set_closure(function);
- context->set_previous(function->context());
- context->set_extension(scope_info);
- context->set_global_object(function->context()->global_object());
- ASSERT(context->IsGlobalContext());
- ASSERT(result->IsContext());
- return context;
-}
-
-
-MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
- ASSERT(length >= Context::MIN_CONTEXT_SLOTS);
- Object* result;
- { MaybeObject* maybe_result = AllocateFixedArray(length);
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Context* context = reinterpret_cast<Context*>(result);
- context->set_map_no_write_barrier(function_context_map());
- context->set_closure(function);
- context->set_previous(function->context());
- context->set_extension(Smi::FromInt(0));
- context->set_global_object(function->context()->global_object());
- return context;
-}
-
-
-MaybeObject* Heap::AllocateCatchContext(JSFunction* function,
- Context* previous,
- String* name,
- Object* thrown_object) {
- STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX);
- Object* result;
- { MaybeObject* maybe_result =
- AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1);
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Context* context = reinterpret_cast<Context*>(result);
- context->set_map_no_write_barrier(catch_context_map());
- context->set_closure(function);
- context->set_previous(previous);
- context->set_extension(name);
- context->set_global_object(previous->global_object());
- context->set(Context::THROWN_OBJECT_INDEX, thrown_object);
- return context;
-}
-
-
-MaybeObject* Heap::AllocateWithContext(JSFunction* function,
- Context* previous,
- JSReceiver* extension) {
- Object* result;
- { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Context* context = reinterpret_cast<Context*>(result);
- context->set_map_no_write_barrier(with_context_map());
- context->set_closure(function);
- context->set_previous(previous);
- context->set_extension(extension);
- context->set_global_object(previous->global_object());
- return context;
-}
-
-
-MaybeObject* Heap::AllocateBlockContext(JSFunction* function,
- Context* previous,
- ScopeInfo* scope_info) {
- Object* result;
- { MaybeObject* maybe_result =
- AllocateFixedArrayWithHoles(scope_info->ContextLength());
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Context* context = reinterpret_cast<Context*>(result);
- context->set_map_no_write_barrier(block_context_map());
- context->set_closure(function);
- context->set_previous(previous);
- context->set_extension(scope_info);
- context->set_global_object(previous->global_object());
- return context;
-}
-
-
MaybeObject* Heap::AllocateStruct(InstanceType type) {
Map* map;
switch (type) {
« no previous file with comments | « src/heap.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698