28 #ifndef V8_CONTEXTS_H_
29 #define V8_CONTEXTS_H_
99 #define NATIVE_CONTEXT_FIELDS(V) \
100 V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \
101 V(SECURITY_TOKEN_INDEX, Object, security_token) \
102 V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \
103 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \
104 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \
105 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \
106 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \
107 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
108 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \
109 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
110 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \
111 V(DATE_FUNCTION_INDEX, JSFunction, date_function) \
112 V(JSON_OBJECT_INDEX, JSObject, json_object) \
113 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
114 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \
115 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \
116 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
117 V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \
118 V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \
119 V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \
120 V(TO_OBJECT_FUN_INDEX, JSFunction, to_object_fun) \
121 V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \
122 V(TO_UINT32_FUN_INDEX, JSFunction, to_uint32_fun) \
123 V(TO_INT32_FUN_INDEX, JSFunction, to_int32_fun) \
124 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \
125 V(INSTANTIATE_FUN_INDEX, JSFunction, instantiate_fun) \
126 V(CONFIGURE_INSTANCE_FUN_INDEX, JSFunction, configure_instance_fun) \
127 V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \
128 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \
129 V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \
130 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \
131 V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \
132 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \
133 V(INT32_ARRAY_FUN_INDEX, JSFunction, int32_array_fun) \
134 V(FLOAT32_ARRAY_FUN_INDEX, JSFunction, float32_array_fun) \
135 V(FLOAT64_ARRAY_FUN_INDEX, JSFunction, float64_array_fun) \
136 V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun) \
137 V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun) \
138 V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map) \
139 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \
140 V(SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
141 sloppy_function_without_prototype_map) \
142 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
143 strict_function_without_prototype_map) \
144 V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map)\
145 V(SLOPPY_ARGUMENTS_BOILERPLATE_INDEX, JSObject, \
146 sloppy_arguments_boilerplate) \
147 V(ALIASED_ARGUMENTS_BOILERPLATE_INDEX, JSObject, \
148 aliased_arguments_boilerplate) \
149 V(STRICT_ARGUMENTS_BOILERPLATE_INDEX, JSObject, \
150 strict_arguments_boilerplate) \
151 V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \
152 V(MAKE_MESSAGE_FUN_INDEX, JSFunction, make_message_fun) \
153 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \
154 V(CONFIGURE_GLOBAL_INDEX, JSFunction, configure_global_fun) \
155 V(FUNCTION_CACHE_INDEX, JSObject, function_cache) \
156 V(JSFUNCTION_RESULT_CACHES_INDEX, FixedArray, jsfunction_result_caches) \
157 V(NORMALIZED_MAP_CACHE_INDEX, NormalizedMapCache, normalized_map_cache) \
158 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
159 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
160 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \
161 call_as_constructor_delegate) \
162 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
163 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
164 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \
165 V(MAP_CACHE_INDEX, Object, map_cache) \
166 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \
167 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \
168 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \
169 error_message_for_code_gen_from_strings) \
170 V(RUN_MICROTASKS_INDEX, JSFunction, run_microtasks) \
171 V(ENQUEUE_EXTERNAL_MICROTASK_INDEX, JSFunction, enqueue_external_microtask) \
172 V(IS_PROMISE_INDEX, JSFunction, is_promise) \
173 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \
174 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \
175 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \
176 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \
177 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \
178 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \
179 to_complete_property_descriptor) \
180 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \
181 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \
182 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \
183 V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) \
184 V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \
185 V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \
186 V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, \
187 observers_begin_perform_splice) \
188 V(OBSERVERS_END_SPLICE_INDEX, JSFunction, \
189 observers_end_perform_splice) \
190 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \
191 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \
192 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, \
193 generator_object_prototype_map) \
194 V(GENERATOR_RESULT_MAP_INDEX, Map, generator_result_map)
245 ASSERT(context->IsContext());
246 return reinterpret_cast<Context*
>(context);
371 Object* result = unchecked_previous();
372 ASSERT(IsBootstrappingOrValidParentContext(result,
this));
373 return reinterpret_cast<Context*
>(result);
415 return map == map->
GetHeap()->native_context_map();
419 return map == map->
GetHeap()->function_context_map();
423 return map == map->
GetHeap()->catch_context_map();
427 return map == map->
GetHeap()->with_context_map();
431 return map == map->
GetHeap()->block_context_map();
435 return map == map->
GetHeap()->module_context_map();
439 return map == map->
GetHeap()->global_context_map();
458 #define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
459 void set_##name(type* value) { \
460 ASSERT(IsNativeContext()); \
463 bool is_##name(type* value) { \
464 ASSERT(IsNativeContext()); \
465 return type::cast(get(index)) == value; \
468 ASSERT(IsNativeContext()); \
469 return type::cast(get(index)); \
472 #undef NATIVE_CONTEXT_FIELD_ACCESSORS
529 static bool IsBootstrappingOrValidParentContext(
Object*
object,
Context* kid);
530 static bool IsBootstrappingOrGlobalObject(
Isolate* isolate,
Object*
object);
539 #endif // V8_CONTEXTS_H_
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
#define NATIVE_CONTEXT_FIELDS(V)
static int SlotOffset(int index)
void set(int index, Object *value)
Object * OptimizedCodeListHead()
static int FunctionMapIndex(StrictMode strict_mode, bool is_generator)
void SetDeoptimizedCodeListHead(Object *head)
JSBuiltinsObject * builtins()
void set_global_proxy(JSObject *global)
Context * global_context()
#define ASSERT(condition)
void SetOptimizedFunctionsListHead(Object *head)
static Context * cast(Object *context)
void AddOptimizedCode(Code *code)
void set_module(JSModule *module)
Object * DeoptimizedCodeListHead()
void set_closure(JSFunction *closure)
GlobalObject * global_object()
static const int kContextEmbedderDataIndex
Handle< Object > Lookup(Handle< String > name, ContextLookupFlags flags, int *index, PropertyAttributes *attributes, BindingFlags *binding_flags)
void set_global_object(GlobalObject *object)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including flags
Context * native_context()
JSObject * global_proxy()
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
void SetOptimizedCodeListHead(Object *head)
Object * OptimizedFunctionsListHead()
void RemoveOptimizedFunction(JSFunction *function)
FixedBodyDescriptor< kHeaderSize, kSize, kSize > ScavengeBodyDescriptor
static const int kHeaderSize
#define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name)
void set_extension(Object *object)
static const int kContextHeaderSize
void set_previous(Context *context)
void AddOptimizedFunction(JSFunction *function)
Handle< Object > ErrorMessageForCodeGenerationFromStrings()
Context * declaration_context()
static JSModule * cast(Object *obj)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
FixedBodyDescriptor< kHeaderSize, kHeaderSize+FIRST_WEAK_SLOT *kPointerSize, kSize > MarkCompactBodyDescriptor
static JSFunction * cast(Object *obj)