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(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
107 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \
108 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
109 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \
110 V(DATE_FUNCTION_INDEX, JSFunction, date_function) \
111 V(JSON_OBJECT_INDEX, JSObject, json_object) \
112 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
113 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \
114 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
115 V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \
116 V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \
117 V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \
118 V(TO_OBJECT_FUN_INDEX, JSFunction, to_object_fun) \
119 V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \
120 V(TO_UINT32_FUN_INDEX, JSFunction, to_uint32_fun) \
121 V(TO_INT32_FUN_INDEX, JSFunction, to_int32_fun) \
122 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \
123 V(INSTANTIATE_FUN_INDEX, JSFunction, instantiate_fun) \
124 V(CONFIGURE_INSTANCE_FUN_INDEX, JSFunction, configure_instance_fun) \
125 V(FUNCTION_MAP_INDEX, Map, function_map) \
126 V(STRICT_MODE_FUNCTION_MAP_INDEX, Map, strict_mode_function_map) \
127 V(FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, function_without_prototype_map) \
128 V(STRICT_MODE_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
129 strict_mode_function_without_prototype_map) \
130 V(FUNCTION_INSTANCE_MAP_INDEX, Map, function_instance_map) \
131 V(STRICT_MODE_FUNCTION_INSTANCE_MAP_INDEX, Map, \
132 strict_mode_function_instance_map) \
133 V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map)\
134 V(ARGUMENTS_BOILERPLATE_INDEX, JSObject, arguments_boilerplate) \
135 V(ALIASED_ARGUMENTS_BOILERPLATE_INDEX, JSObject, \
136 aliased_arguments_boilerplate) \
137 V(STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX, JSObject, \
138 strict_mode_arguments_boilerplate) \
139 V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \
140 V(MAKE_MESSAGE_FUN_INDEX, JSFunction, make_message_fun) \
141 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \
142 V(CONFIGURE_GLOBAL_INDEX, JSFunction, configure_global_fun) \
143 V(FUNCTION_CACHE_INDEX, JSObject, function_cache) \
144 V(JSFUNCTION_RESULT_CACHES_INDEX, FixedArray, jsfunction_result_caches) \
145 V(NORMALIZED_MAP_CACHE_INDEX, NormalizedMapCache, normalized_map_cache) \
146 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
147 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
148 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \
149 call_as_constructor_delegate) \
150 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
151 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
152 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \
153 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \
154 V(MAP_CACHE_INDEX, Object, map_cache) \
155 V(CONTEXT_DATA_INDEX, Object, data) \
156 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \
157 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \
158 error_message_for_code_gen_from_strings) \
159 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \
160 to_complete_property_descriptor) \
161 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \
162 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \
163 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \
164 V(PROXY_ENUMERATE, JSFunction, proxy_enumerate) \
165 V(RANDOM_SEED_INDEX, ByteArray, random_seed)
213 ASSERT(context->IsContext());
214 return reinterpret_cast<Context*
>(context);
311 Object* result = unchecked_previous();
312 ASSERT(IsBootstrappingOrValidParentContext(result,
this));
313 return reinterpret_cast<Context*
>(result);
330 ASSERT(IsBootstrappingOrGlobalObject(result));
352 return map == map->
GetHeap()->function_context_map();
356 return map == map->
GetHeap()->catch_context_map();
360 return map == map->
GetHeap()->with_context_map();
364 return map == map->
GetHeap()->block_context_map();
368 return map == map->
GetHeap()->module_context_map();
372 return map == map->
GetHeap()->global_context_map();
389 #define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
390 void set_##name(type* value) { \
391 ASSERT(IsNativeContext()); \
395 ASSERT(IsNativeContext()); \
396 return type::cast(get(index)); \
399 #undef NATIVE_CONTEXT_FIELD_ACCESSORS
418 Handle<Object>
Lookup(Handle<String> name,
446 static bool IsBootstrappingOrValidParentContext(
Object*
object,
Context* kid);
447 static bool IsBootstrappingOrGlobalObject(
Object*
object);
453 #endif // V8_CONTEXTS_H_
#define NATIVE_CONTEXT_FIELDS(V)
static int SlotOffset(int index)
void set(int index, Object *value)
JSBuiltinsObject * builtins()
void set_global_proxy(JSObject *global)
void mark_out_of_memory()
#define ASSERT(condition)
static Context * cast(Object *context)
void set_module(JSModule *module)
void set_closure(JSFunction *closure)
void ClearOptimizedFunctions()
GlobalObject * global_object()
Handle< Object > Lookup(Handle< String > name, ContextLookupFlags flags, int *index, PropertyAttributes *attributes, BindingFlags *binding_flags)
void set_global_object(GlobalObject *object)
Context * native_context()
JSObject * global_proxy()
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)
void set_previous(Context *context)
void AddOptimizedFunction(JSFunction *function)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit 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 SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if NULL
Handle< Object > ErrorMessageForCodeGenerationFromStrings()
Context * declaration_context()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit 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 SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting 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 more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including flags
static JSModule * cast(Object *obj)
FixedBodyDescriptor< kHeaderSize, kHeaderSize+FIRST_WEAK_SLOT *kPointerSize, kSize > MarkCompactBodyDescriptor
static JSFunction * cast(Object *obj)