diff options
| author | Steve Block <steveblock@google.com> | 2011-05-26 01:26:41 +0100 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2011-06-02 15:09:56 +0100 |
| commit | 44f0eee88ff00398ff7f715fab053374d808c90d (patch) | |
| tree | addd100e906cd43f843f3aaf64b445f17f46fe0f /src/contexts.cc | |
| parent | 1b63b9ad386abd62f61af0e29246a687f5311b53 (diff) | |
| download | android_external_v8-44f0eee88ff00398ff7f715fab053374d808c90d.tar.gz android_external_v8-44f0eee88ff00398ff7f715fab053374d808c90d.tar.bz2 android_external_v8-44f0eee88ff00398ff7f715fab053374d808c90d.zip | |
Update V8 to r7427: Initial merge by git
As required by WebKit r82507
Change-Id: I7ae83ef3f689356043b4929255b7c1dd31d8c5df
Diffstat (limited to 'src/contexts.cc')
| -rw-r--r-- | src/contexts.cc | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/contexts.cc b/src/contexts.cc index 3ad72a16..520f3dde 100644 --- a/src/contexts.cc +++ b/src/contexts.cc @@ -55,7 +55,7 @@ Context* Context::global_context() { // During bootstrapping, the global object might not be set and we // have to search the context chain to find the global context. - ASSERT(Bootstrapper::IsActive()); + ASSERT(Isolate::Current()->bootstrapper()->IsActive()); Context* current = this; while (!current->IsGlobalContext()) { JSFunction* closure = JSFunction::cast(current->closure()); @@ -76,7 +76,8 @@ void Context::set_global_proxy(JSObject* object) { Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, int* index_, PropertyAttributes* attributes) { - Handle<Context> context(this); + Isolate* isolate = GetIsolate(); + Handle<Context> context(this, isolate); bool follow_context_chain = (flags & FOLLOW_CONTEXT_CHAIN) != 0; *index_ = -1; @@ -97,7 +98,8 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, // check extension/with object if (context->has_extension()) { - Handle<JSObject> extension = Handle<JSObject>(context->extension()); + Handle<JSObject> extension = Handle<JSObject>(context->extension(), + isolate); // Context extension objects needs to behave as if they have no // prototype. So even if we want to follow prototype chains, we // need to only do a local lookup for context extension objects. @@ -122,7 +124,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, // check non-parameter locals in context Handle<SerializedScopeInfo> scope_info( - context->closure()->shared()->scope_info()); + context->closure()->shared()->scope_info(), isolate); Variable::Mode mode; int index = scope_info->ContextSlotIndex(*name, &mode); ASSERT(index < 0 || index >= MIN_CONTEXT_SLOTS); @@ -155,11 +157,12 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, int param_index = scope_info->ParameterIndex(*name); if (param_index >= 0) { // slot found. - int index = - scope_info->ContextSlotIndex(Heap::arguments_shadow_symbol(), NULL); + int index = scope_info->ContextSlotIndex( + isolate->heap()->arguments_shadow_symbol(), NULL); ASSERT(index >= 0); // arguments must exist and be in the heap context - Handle<JSObject> arguments(JSObject::cast(context->get(index))); - ASSERT(arguments->HasLocalProperty(Heap::length_symbol())); + Handle<JSObject> arguments(JSObject::cast(context->get(index)), + isolate); + ASSERT(arguments->HasLocalProperty(isolate->heap()->length_symbol())); if (FLAG_trace_contexts) { PrintF("=> found parameter %d in arguments object\n", param_index); } @@ -188,9 +191,10 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, if (context->IsGlobalContext()) { follow_context_chain = false; } else if (context->is_function_context()) { - context = Handle<Context>(Context::cast(context->closure()->context())); + context = Handle<Context>(Context::cast(context->closure()->context()), + isolate); } else { - context = Handle<Context>(context->previous()); + context = Handle<Context>(context->previous(), isolate); } } while (follow_context_chain); @@ -252,7 +256,7 @@ void Context::AddOptimizedFunction(JSFunction* function) { // Check that the context belongs to the weak global contexts list. bool found = false; - Object* context = Heap::global_contexts_list(); + Object* context = GetHeap()->global_contexts_list(); while (!context->IsUndefined()) { if (context == this) { found = true; @@ -281,7 +285,7 @@ void Context::RemoveOptimizedFunction(JSFunction* function) { } else { prev->set_next_function_link(element_function->next_function_link()); } - element_function->set_next_function_link(Heap::undefined_value()); + element_function->set_next_function_link(GetHeap()->undefined_value()); return; } prev = element_function; @@ -298,7 +302,7 @@ Object* Context::OptimizedFunctionsListHead() { void Context::ClearOptimizedFunctions() { - set(OPTIMIZED_FUNCTIONS_LIST, Heap::undefined_value()); + set(OPTIMIZED_FUNCTIONS_LIST, GetHeap()->undefined_value()); } @@ -306,14 +310,17 @@ void Context::ClearOptimizedFunctions() { bool Context::IsBootstrappingOrContext(Object* object) { // During bootstrapping we allow all objects to pass as // contexts. This is necessary to fix circular dependencies. - return Bootstrapper::IsActive() || object->IsContext(); + return Isolate::Current()->bootstrapper()->IsActive() || object->IsContext(); } bool Context::IsBootstrappingOrGlobalObject(Object* object) { // During bootstrapping we allow all objects to pass as global // objects. This is necessary to fix circular dependencies. - return Bootstrapper::IsActive() || object->IsGlobalObject(); + Isolate* isolate = Isolate::Current(); + return isolate->heap()->gc_state() != Heap::NOT_IN_GC || + isolate->bootstrapper()->IsActive() || + object->IsGlobalObject(); } #endif |
