diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-03-18 13:49:34 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-03-20 01:11:01 +0100 |
commit | 83261e789eb903da39f279cb5a161611482e7df5 (patch) | |
tree | 4133b5ca9f53bed4365e1a94544a227d68a0cf12 /deps/v8/src/contexts.cc | |
parent | a05f973f82d2be8527aad4c371d40d3c7e4c564e (diff) | |
download | android-node-v8-83261e789eb903da39f279cb5a161611482e7df5.tar.gz android-node-v8-83261e789eb903da39f279cb5a161611482e7df5.tar.bz2 android-node-v8-83261e789eb903da39f279cb5a161611482e7df5.zip |
deps: update v8 to 3.17.13
Diffstat (limited to 'deps/v8/src/contexts.cc')
-rw-r--r-- | deps/v8/src/contexts.cc | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/deps/v8/src/contexts.cc b/deps/v8/src/contexts.cc index 93c9795404..5edbc5ac2d 100644 --- a/deps/v8/src/contexts.cc +++ b/deps/v8/src/contexts.cc @@ -55,6 +55,15 @@ JSBuiltinsObject* Context::builtins() { } +Context* Context::global_context() { + Context* current = this; + while (!current->IsGlobalContext()) { + current = current->previous(); + } + return current; +} + + Context* Context::native_context() { // Fast case: the global object for this context has been set. In // that case, the global object has a direct pointer to the global @@ -183,6 +192,10 @@ Handle<Object> Context::Lookup(Handle<String> name, ? IMMUTABLE_CHECK_INITIALIZED_HARMONY : IMMUTABLE_IS_INITIALIZED_HARMONY; break; + case MODULE: + *attributes = READ_ONLY; + *binding_flags = IMMUTABLE_IS_INITIALIZED_HARMONY; + break; case DYNAMIC: case DYNAMIC_GLOBAL: case DYNAMIC_LOCAL: @@ -251,8 +264,6 @@ void Context::AddOptimizedFunction(JSFunction* function) { } } - CHECK(function->next_function_link()->IsUndefined()); - // Check that the context belongs to the weak native contexts list. bool found = false; Object* context = GetHeap()->native_contexts_list(); @@ -265,6 +276,16 @@ void Context::AddOptimizedFunction(JSFunction* function) { } CHECK(found); #endif + + // If the function link field is already used then the function was + // enqueued as a code flushing candidate and we remove it now. + if (!function->next_function_link()->IsUndefined()) { + CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); + flusher->EvictCandidate(function); + } + + ASSERT(function->next_function_link()->IsUndefined()); + function->set_next_function_link(get(OPTIMIZED_FUNCTIONS_LIST)); set(OPTIMIZED_FUNCTIONS_LIST, function); } @@ -306,14 +327,11 @@ void Context::ClearOptimizedFunctions() { Handle<Object> Context::ErrorMessageForCodeGenerationFromStrings() { - Handle<Object> result(error_message_for_code_gen_from_strings()); - if (result->IsUndefined()) { - const char* error = - "Code generation from strings disallowed for this context"; - Isolate* isolate = Isolate::Current(); - result = isolate->factory()->NewStringFromAscii(i::CStrVector(error)); - } - return result; + Handle<Object> result(error_message_for_code_gen_from_strings(), + GetIsolate()); + if (!result->IsUndefined()) return result; + return GetIsolate()->factory()->NewStringFromAscii(i::CStrVector( + "Code generation from strings disallowed for this context")); } @@ -322,7 +340,7 @@ bool Context::IsBootstrappingOrValidParentContext( Object* object, Context* child) { // During bootstrapping we allow all objects to pass as // contexts. This is necessary to fix circular dependencies. - if (Isolate::Current()->bootstrapper()->IsActive()) return true; + if (child->GetIsolate()->bootstrapper()->IsActive()) return true; if (!object->IsContext()) return false; Context* context = Context::cast(object); return context->IsNativeContext() || context->IsGlobalContext() || |