diff options
Diffstat (limited to 'deps/v8/src/contexts.h')
-rw-r--r-- | deps/v8/src/contexts.h | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/deps/v8/src/contexts.h b/deps/v8/src/contexts.h index b80475f0f..505f86c8c 100644 --- a/deps/v8/src/contexts.h +++ b/deps/v8/src/contexts.h @@ -134,8 +134,6 @@ enum BindingFlags { V(MAP_CACHE_INDEX, Object, map_cache) \ V(CONTEXT_DATA_INDEX, Object, data) \ V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ - V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ - to_complete_property_descriptor) \ V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) @@ -254,7 +252,6 @@ class Context: public FixedArray { OUT_OF_MEMORY_INDEX, CONTEXT_DATA_INDEX, ALLOW_CODE_GEN_FROM_STRINGS_INDEX, - TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, DERIVED_HAS_TRAP_INDEX, DERIVED_GET_TRAP_INDEX, DERIVED_SET_TRAP_INDEX, @@ -333,6 +330,12 @@ class Context: public FixedArray { // Mark the global context with out of memory. inline void mark_out_of_memory(); + // The exception holder is the object used as a with object in + // the implementation of a catch block. + bool is_exception_holder(Object* object) { + return IsCatchContext() && extension() == object; + } + // A global context hold a list of all functions which have been optimized. void AddOptimizedFunction(JSFunction* function); void RemoveOptimizedFunction(JSFunction* function); @@ -352,25 +355,29 @@ class Context: public FixedArray { #undef GLOBAL_CONTEXT_FIELD_ACCESSORS // Lookup the the slot called name, starting with the current context. - // There are three possibilities: + // There are 4 possible outcomes: + // + // 1) index_ >= 0 && result->IsContext(): + // most common case, the result is a Context, and index is the + // context slot index, and the slot exists. + // attributes == READ_ONLY for the function name variable, NONE otherwise. // - // 1) result->IsContext(): - // The binding was found in a context. *index is always the - // non-negative slot index. *attributes is NONE for var and let - // declarations, READ_ONLY for const declarations (never ABSENT). + // 2) index_ >= 0 && result->IsJSObject(): + // the result is the JSObject arguments object, the index is the parameter + // index, i.e., key into the arguments object, and the property exists. + // attributes != ABSENT. // - // 2) result->IsJSObject(): - // The binding was found as a named property in a context extension - // object (i.e., was introduced via eval), as a property on the subject - // of with, or as a property of the global object. *index is -1 and - // *attributes is not ABSENT. + // 3) index_ < 0 && result->IsJSObject(): + // the result is the JSObject extension context or the global object, + // and the name is the property name, and the property exists. + // attributes != ABSENT. // - // 3) result.is_null(): - // There was no binding found, *index is always -1 and *attributes is - // always ABSENT. + // 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, + int* index_, PropertyAttributes* attributes, BindingFlags* binding_flags); |