diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-01-01 12:28:07 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-01-01 16:07:02 +0400 |
commit | 7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a (patch) | |
tree | 1eb943733a2e660fc0183778fd441443e06196e2 /deps/v8/src/contexts.cc | |
parent | 9e32c2ef3ede29ba0ae2086bdf658f6cd44182df (diff) | |
download | android-node-v8-7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a.tar.gz android-node-v8-7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a.tar.bz2 android-node-v8-7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a.zip |
deps: update v8 to 3.15.11
Diffstat (limited to 'deps/v8/src/contexts.cc')
-rw-r--r-- | deps/v8/src/contexts.cc | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/deps/v8/src/contexts.cc b/deps/v8/src/contexts.cc index 169d9a1223..4cb52d3a6c 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); } @@ -305,6 +326,18 @@ 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; +} + + #ifdef DEBUG bool Context::IsBootstrappingOrValidParentContext( Object* object, Context* child) { |