diff options
author | Ben Murdoch <benm@google.com> | 2011-11-30 16:03:39 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-12-02 17:28:02 +0000 |
commit | 69a99ed0b2b2ef69d393c371b03db3a98aaf880e (patch) | |
tree | 6438154d0f3ab526b9206f8860fa4db5cf073c11 /src/contexts.h | |
parent | 3fb3ca8c7ca439d408449a395897395c0faae8d1 (diff) | |
download | android_external_v8-69a99ed0b2b2ef69d393c371b03db3a98aaf880e.tar.gz android_external_v8-69a99ed0b2b2ef69d393c371b03db3a98aaf880e.tar.bz2 android_external_v8-69a99ed0b2b2ef69d393c371b03db3a98aaf880e.zip |
Upgrade to V8 3.5
Merge V8 3.5.10.24
Simple merge required updates to makefiles only.
Bug: 5688872
Change-Id: I0acdb9a1a53919d84e9a7525308e8371739d2f06
Diffstat (limited to 'src/contexts.h')
-rw-r--r-- | src/contexts.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/contexts.h b/src/contexts.h index 53b40f12..505f86c8 100644 --- a/src/contexts.h +++ b/src/contexts.h @@ -44,6 +44,30 @@ enum ContextLookupFlags { }; +// ES5 10.2 defines lexical environments with mutable and immutable bindings. +// Immutable bindings have two states, initialized and uninitialized, and +// their state is changed by the InitializeImmutableBinding method. +// +// The harmony proposal for block scoped bindings also introduces the +// uninitialized state for mutable bindings. A 'let' declared variable +// is a mutable binding that is created uninitalized upon activation of its +// lexical environment and it is initialized when evaluating its declaration +// statement. Var declared variables are mutable bindings that are +// immediately initialized upon creation. The BindingFlags enum represents +// information if a binding has definitely been initialized. 'const' declared +// variables are created as uninitialized immutable bindings. + +// In harmony mode accessing an uninitialized binding produces a reference +// error. +enum BindingFlags { + MUTABLE_IS_INITIALIZED, + MUTABLE_CHECK_INITIALIZED, + IMMUTABLE_IS_INITIALIZED, + IMMUTABLE_CHECK_INITIALIZED, + MISSING_BINDING +}; + + // Heap-allocated activation contexts. // // Contexts are implemented as FixedArray objects; the Context @@ -295,6 +319,10 @@ class Context: public FixedArray { Map* map = this->map(); return map == map->GetHeap()->with_context_map(); } + bool IsBlockContext() { + Map* map = this->map(); + return map == map->GetHeap()->block_context_map(); + } // Tells whether the global context is marked with out of memory. inline bool has_out_of_memory(); @@ -347,8 +375,11 @@ class Context: public FixedArray { // 4) index_ < 0 && result.is_null(): // there was no context found with the corresponding property. // attributes == ABSENT. - Handle<Object> Lookup(Handle<String> name, ContextLookupFlags flags, - int* index_, PropertyAttributes* attributes); + Handle<Object> Lookup(Handle<String> name, + ContextLookupFlags flags, + int* index_, + PropertyAttributes* attributes, + BindingFlags* binding_flags); // Determine if a local variable with the given name exists in a // context. Do not consider context extension objects. This is |