v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
contexts.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_CONTEXTS_H_
29 #define V8_CONTEXTS_H_
30 
31 #include "heap.h"
32 #include "objects.h"
33 
34 namespace v8 {
35 namespace internal {
36 
37 
41 
44 };
45 
46 
47 // ES5 10.2 defines lexical environments with mutable and immutable bindings.
48 // Immutable bindings have two states, initialized and uninitialized, and
49 // their state is changed by the InitializeImmutableBinding method. The
50 // BindingFlags enum represents information if a binding has definitely been
51 // initialized. A mutable binding does not need to be checked and thus has
52 // the BindingFlag MUTABLE_IS_INITIALIZED.
53 //
54 // There are two possibilities for immutable bindings
55 // * 'const' declared variables. They are initialized when evaluating the
56 // corresponding declaration statement. They need to be checked for being
57 // initialized and thus get the flag IMMUTABLE_CHECK_INITIALIZED.
58 // * The function name of a named function literal. The binding is immediately
59 // initialized when entering the function and thus does not need to be
60 // checked. it gets the BindingFlag IMMUTABLE_IS_INITIALIZED.
61 // Accessing an uninitialized binding produces the undefined value.
62 //
63 // The harmony proposal for block scoped bindings also introduces the
64 // uninitialized state for mutable bindings.
65 // * A 'let' declared variable. They are initialized when evaluating the
66 // corresponding declaration statement. They need to be checked for being
67 // initialized and thus get the flag MUTABLE_CHECK_INITIALIZED.
68 // * A 'var' declared variable. It is initialized immediately upon creation
69 // and thus doesn't need to be checked. It gets the flag
70 // MUTABLE_IS_INITIALIZED.
71 // * Catch bound variables, function parameters and variables introduced by
72 // function declarations are initialized immediately and do not need to be
73 // checked. Thus they get the flag MUTABLE_IS_INITIALIZED.
74 // Immutable bindings in harmony mode get the _HARMONY flag variants. Accessing
75 // an uninitialized binding produces a reference error.
76 //
77 // In V8 uninitialized bindings are set to the hole value upon creation and set
78 // to a different value upon initialization.
87 };
88 
89 
90 // Heap-allocated activation contexts.
91 //
92 // Contexts are implemented as FixedArray objects; the Context
93 // class is a convenience interface casted on a FixedArray object.
94 //
95 // Note: Context must have no virtual functions and Context objects
96 // must always be allocated via Heap::AllocateContext() or
97 // Factory::NewContext.
98 
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)
195 
196 // JSFunctions are pairs (context, function code), sometimes also called
197 // closures. A Context object is used to represent function contexts and
198 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak).
199 //
200 // At runtime, the contexts build a stack in parallel to the execution
201 // stack, with the top-most context being the current context. All contexts
202 // have the following slots:
203 //
204 // [ closure ] This is the current function. It is the same for all
205 // contexts inside a function. It provides access to the
206 // incoming context (i.e., the outer context, which may
207 // or may not become the current function's context), and
208 // it provides access to the functions code and thus it's
209 // scope information, which in turn contains the names of
210 // statically allocated context slots. The names are needed
211 // for dynamic lookups in the presence of 'with' or 'eval'.
212 //
213 // [ previous ] A pointer to the previous context. It is NULL for
214 // function contexts, and non-NULL for 'with' contexts.
215 // Used to implement the 'with' statement.
216 //
217 // [ extension ] A pointer to an extension JSObject, or NULL. Used to
218 // implement 'with' statements and dynamic declarations
219 // (through 'eval'). The object in a 'with' statement is
220 // stored in the extension slot of a 'with' context.
221 // Dynamically declared variables/functions are also added
222 // to lazily allocated extension object. Context::Lookup
223 // searches the extension object for properties.
224 // For global and block contexts, contains the respective
225 // ScopeInfo.
226 // For module contexts, points back to the respective JSModule.
227 //
228 // [ global_object ] A pointer to the global object. Provided for quick
229 // access to the global object from inside the code (since
230 // we always have a context pointer).
231 //
232 // In addition, function contexts may have statically allocated context slots
233 // to store local variables/functions that are accessed from inner functions
234 // (via static context addresses) or through 'eval' (dynamic context lookups).
235 // The native context contains additional slots for fast access to native
236 // properties.
237 //
238 // Finally, with Harmony scoping, the JSFunction representing a top level
239 // script will have the GlobalContext rather than a FunctionContext.
240 
241 class Context: public FixedArray {
242  public:
243  // Conversions.
244  static Context* cast(Object* context) {
245  ASSERT(context->IsContext());
246  return reinterpret_cast<Context*>(context);
247  }
248 
249  // The default context slot layout; indices are FixedArray slot indices.
250  enum {
251  // These slots are in all contexts.
254  // The extension slot is used for either the global object (in global
255  // contexts), eval extension object (function contexts), subject of with
256  // (with contexts), or the variable name (catch contexts), the serialized
257  // scope info (block contexts), or the module instance (module contexts).
261 
262  // This slot holds the thrown value in catch contexts.
264 
265  // These slots are only in native contexts.
351 
352  // Properties from here are treated as weak references by the full GC.
353  // Scavenge treats them as strong references.
357  MAP_CACHE_INDEX, // Weak.
359 
360  // Total number of slots.
362 
364  };
365 
366  // Direct slot access.
369 
371  Object* result = unchecked_previous();
372  ASSERT(IsBootstrappingOrValidParentContext(result, this));
373  return reinterpret_cast<Context*>(result);
374  }
375  void set_previous(Context* context) { set(PREVIOUS_INDEX, context); }
376 
377  bool has_extension() { return extension() != NULL; }
378  Object* extension() { return get(EXTENSION_INDEX); }
379  void set_extension(Object* object) { set(EXTENSION_INDEX, object); }
380 
383 
384  // Get the context where var declarations will be hoisted to, which
385  // may be the context itself.
387 
389  Object* result = get(GLOBAL_OBJECT_INDEX);
390  ASSERT(IsBootstrappingOrGlobalObject(this->GetIsolate(), result));
391  return reinterpret_cast<GlobalObject*>(result);
392  }
394  set(GLOBAL_OBJECT_INDEX, object);
395  }
396 
397  // Returns a JSGlobalProxy object or null.
399  void set_global_proxy(JSObject* global);
400 
401  // The builtins object.
403 
404  // Get the innermost global context by traversing the context chain.
406 
407  // Compute the native context by traversing the context chain.
409 
410  // Predicates for context types. IsNativeContext is also defined on Object
411  // because we frequently have to know if arbitrary objects are natives
412  // contexts.
414  Map* map = this->map();
415  return map == map->GetHeap()->native_context_map();
416  }
418  Map* map = this->map();
419  return map == map->GetHeap()->function_context_map();
420  }
421  bool IsCatchContext() {
422  Map* map = this->map();
423  return map == map->GetHeap()->catch_context_map();
424  }
425  bool IsWithContext() {
426  Map* map = this->map();
427  return map == map->GetHeap()->with_context_map();
428  }
429  bool IsBlockContext() {
430  Map* map = this->map();
431  return map == map->GetHeap()->block_context_map();
432  }
434  Map* map = this->map();
435  return map == map->GetHeap()->module_context_map();
436  }
438  Map* map = this->map();
439  return map == map->GetHeap()->global_context_map();
440  }
441 
442  // A native context holds a list of all functions with optimized code.
443  void AddOptimizedFunction(JSFunction* function);
444  void RemoveOptimizedFunction(JSFunction* function);
447 
448  // The native context also stores a list of all optimized code and a
449  // list of all deoptimized code, which are needed by the deoptimizer.
450  void AddOptimizedCode(Code* code);
451  void SetOptimizedCodeListHead(Object* head);
455 
457 
458 #define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
459  void set_##name(type* value) { \
460  ASSERT(IsNativeContext()); \
461  set(index, value); \
462  } \
463  bool is_##name(type* value) { \
464  ASSERT(IsNativeContext()); \
465  return type::cast(get(index)) == value; \
466  } \
467  type* name() { \
468  ASSERT(IsNativeContext()); \
469  return type::cast(get(index)); \
470  }
472 #undef NATIVE_CONTEXT_FIELD_ACCESSORS
473 
474  // Lookup the slot called name, starting with the current context.
475  // There are three possibilities:
476  //
477  // 1) result->IsContext():
478  // The binding was found in a context. *index is always the
479  // non-negative slot index. *attributes is NONE for var and let
480  // declarations, READ_ONLY for const declarations (never ABSENT).
481  //
482  // 2) result->IsJSObject():
483  // The binding was found as a named property in a context extension
484  // object (i.e., was introduced via eval), as a property on the subject
485  // of with, or as a property of the global object. *index is -1 and
486  // *attributes is not ABSENT.
487  //
488  // 3) result.is_null():
489  // There was no binding found, *index is always -1 and *attributes is
490  // always ABSENT.
491  Handle<Object> Lookup(Handle<String> name,
493  int* index,
494  PropertyAttributes* attributes,
495  BindingFlags* binding_flags);
496 
497  // Code generation support.
498  static int SlotOffset(int index) {
499  return kHeaderSize + index * kPointerSize - kHeapObjectTag;
500  }
501 
502  static int FunctionMapIndex(StrictMode strict_mode, bool is_generator) {
503  return is_generator
504  ? (strict_mode == SLOPPY
507  : (strict_mode == SLOPPY
510  }
511 
513 
514  // GC support.
515  typedef FixedBodyDescriptor<
517 
518  typedef FixedBodyDescriptor<
519  kHeaderSize,
522 
523  private:
524  // Unchecked access to the slots.
525  Object* unchecked_previous() { return get(PREVIOUS_INDEX); }
526 
527 #ifdef DEBUG
528  // Bootstrapping-aware type checks.
529  static bool IsBootstrappingOrValidParentContext(Object* object, Context* kid);
530  static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object);
531 #endif
532 
535 };
536 
537 } } // namespace v8::internal
538 
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
Definition: flags.cc:269
#define NATIVE_CONTEXT_FIELDS(V)
Definition: contexts.h:99
static int SlotOffset(int index)
Definition: contexts.h:498
void set(int index, Object *value)
Definition: objects-inl.h:2147
JSModule * module()
Definition: contexts.h:381
Object * OptimizedCodeListHead()
Definition: contexts.cc:349
static int FunctionMapIndex(StrictMode strict_mode, bool is_generator)
Definition: contexts.h:502
Context * previous()
Definition: contexts.h:370
void SetDeoptimizedCodeListHead(Object *head)
Definition: contexts.cc:355
JSBuiltinsObject * builtins()
Definition: contexts.cc:47
void set_global_proxy(JSObject *global)
Definition: contexts.cc:92
Context * global_context()
Definition: contexts.cc:58
#define ASSERT(condition)
Definition: checks.h:329
void SetOptimizedFunctionsListHead(Object *head)
Definition: contexts.cc:322
static Context * cast(Object *context)
Definition: contexts.h:244
void AddOptimizedCode(Code *code)
Definition: contexts.cc:334
void set_module(JSModule *module)
Definition: contexts.h:382
PropertyAttributes
Object * DeoptimizedCodeListHead()
Definition: contexts.cc:361
void set_closure(JSFunction *closure)
Definition: contexts.h:368
GlobalObject * global_object()
Definition: contexts.h:388
static const int kContextEmbedderDataIndex
Definition: v8.h:5562
Handle< Object > Lookup(Handle< String > name, ContextLookupFlags flags, int *index, PropertyAttributes *attributes, BindingFlags *binding_flags)
Definition: contexts.cc:97
void set_global_object(GlobalObject *object)
Definition: contexts.h:393
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
Definition: flags.cc:665
Context * native_context()
Definition: contexts.cc:67
JSObject * global_proxy()
Definition: contexts.cc:87
const int kPointerSize
Definition: globals.h:268
const int kHeapObjectTag
Definition: v8.h:5473
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)
Definition: contexts.cc:343
static const int kSize
Definition: contexts.h:512
Object * OptimizedFunctionsListHead()
Definition: contexts.cc:328
void RemoveOptimizedFunction(JSFunction *function)
Definition: contexts.cc:298
FixedBodyDescriptor< kHeaderSize, kSize, kSize > ScavengeBodyDescriptor
Definition: contexts.h:516
ContextLookupFlags
Definition: contexts.h:38
static const int kHeaderSize
Definition: objects.h:3016
#define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name)
Definition: contexts.h:458
void set_extension(Object *object)
Definition: contexts.h:379
bool IsFunctionContext()
Definition: contexts.h:417
static const int kContextHeaderSize
Definition: v8.h:5561
Object * extension()
Definition: contexts.h:378
void set_previous(Context *context)
Definition: contexts.h:375
void AddOptimizedFunction(JSFunction *function)
Definition: contexts.cc:260
Handle< Object > ErrorMessageForCodeGenerationFromStrings()
Definition: contexts.cc:367
JSFunction * closure()
Definition: contexts.h:367
Context * declaration_context()
Definition: contexts.cc:37
static JSModule * cast(Object *obj)
Definition: objects-inl.h:5748
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
Definition: flags.cc:505
FixedBodyDescriptor< kHeaderSize, kHeaderSize+FIRST_WEAK_SLOT *kPointerSize, kSize > MarkCompactBodyDescriptor
Definition: contexts.h:521
static JSFunction * cast(Object *obj)