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
compilation-cache.cc
Go to the documentation of this file.
1 // Copyright 2011 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 #include "v8.h"
29 
30 #include "assembler.h"
31 #include "compilation-cache.h"
32 #include "serialize.h"
33 
34 namespace v8 {
35 namespace internal {
36 
37 
38 // The number of generations for each sub cache.
39 // The number of ScriptGenerations is carefully chosen based on histograms.
40 // See issue 458: http://code.google.com/p/v8/issues/detail?id=458
41 static const int kScriptGenerations = 5;
42 static const int kEvalGlobalGenerations = 2;
43 static const int kEvalContextualGenerations = 2;
44 static const int kRegExpGenerations = 2;
45 
46 // Initial size of each compilation cache table allocated.
47 static const int kInitialCacheSize = 64;
48 
49 
50 CompilationCache::CompilationCache(Isolate* isolate)
51  : isolate_(isolate),
52  script_(isolate, kScriptGenerations),
53  eval_global_(isolate, kEvalGlobalGenerations),
54  eval_contextual_(isolate, kEvalContextualGenerations),
55  reg_exp_(isolate, kRegExpGenerations),
56  enabled_(true) {
57  CompilationSubCache* subcaches[kSubCacheCount] =
58  {&script_, &eval_global_, &eval_contextual_, &reg_exp_};
59  for (int i = 0; i < kSubCacheCount; ++i) {
60  subcaches_[i] = subcaches[i];
61  }
62 }
63 
64 
65 CompilationCache::~CompilationCache() {}
66 
67 
68 static Handle<CompilationCacheTable> AllocateTable(Isolate* isolate, int size) {
69  CALL_HEAP_FUNCTION(isolate,
70  CompilationCacheTable::Allocate(isolate->heap(), size),
71  CompilationCacheTable);
72 }
73 
74 
76  ASSERT(generation < generations_);
78  if (tables_[generation]->IsUndefined()) {
79  result = AllocateTable(isolate(), kInitialCacheSize);
80  tables_[generation] = *result;
81  } else {
82  CompilationCacheTable* table =
83  CompilationCacheTable::cast(tables_[generation]);
84  result = Handle<CompilationCacheTable>(table, isolate());
85  }
86  return result;
87 }
88 
89 
91  // Age the generations implicitly killing off the oldest.
92  for (int i = generations_ - 1; i > 0; i--) {
93  tables_[i] = tables_[i - 1];
94  }
95 
96  // Set the first generation as unborn.
97  tables_[0] = isolate()->heap()->undefined_value();
98 }
99 
100 
102  Object* undefined = isolate()->heap()->undefined_value();
103  for (int i = 0; i < generations_; i++) {
104  if (tables_[i] != undefined) {
105  reinterpret_cast<CompilationCacheTable*>(tables_[i])->IterateElements(v);
106  }
107  }
108 }
109 
110 
111 void CompilationSubCache::Iterate(ObjectVisitor* v) {
112  v->VisitPointers(&tables_[0], &tables_[generations_]);
113 }
114 
115 
117  MemsetPointer(tables_, isolate()->heap()->undefined_value(), generations_);
118 }
119 
120 
122  // Probe the script generation tables. Make sure not to leak handles
123  // into the caller's handle scope.
124  { HandleScope scope(isolate());
125  for (int generation = 0; generation < generations(); generation++) {
127  table->Remove(*function_info);
128  }
129  }
130 }
131 
132 
134  int generations)
135  : CompilationSubCache(isolate, generations),
136  script_histogram_(NULL),
137  script_histogram_initialized_(false) { }
138 
139 
140 // We only re-use a cached function for some script source code if the
141 // script originates from the same place. This is to avoid issues
142 // when reporting errors, etc.
143 bool CompilationCacheScript::HasOrigin(
144  Handle<SharedFunctionInfo> function_info,
146  int line_offset,
147  int column_offset,
148  bool is_shared_cross_origin) {
149  Handle<Script> script =
150  Handle<Script>(Script::cast(function_info->script()), isolate());
151  // If the script name isn't set, the boilerplate script should have
152  // an undefined name to have the same origin.
153  if (name.is_null()) {
154  return script->name()->IsUndefined();
155  }
156  // Do the fast bailout checks first.
157  if (line_offset != script->line_offset()->value()) return false;
158  if (column_offset != script->column_offset()->value()) return false;
159  // Check that both names are strings. If not, no match.
160  if (!name->IsString() || !script->name()->IsString()) return false;
161  // Were both scripts tagged by the embedder as being shared cross-origin?
162  if (is_shared_cross_origin != script->is_shared_cross_origin()) return false;
163  // Compare the two name strings for equality.
164  return String::cast(*name)->Equals(String::cast(script->name()));
165 }
166 
167 
168 // TODO(245): Need to allow identical code from different contexts to
169 // be cached in the same script generation. Currently the first use
170 // will be cached, but subsequent code from different source / line
171 // won't.
173  Handle<String> source,
174  Handle<Object> name,
175  int line_offset,
176  int column_offset,
177  bool is_shared_cross_origin,
178  Handle<Context> context) {
179  Object* result = NULL;
180  int generation;
181 
182  // Probe the script generation tables. Make sure not to leak handles
183  // into the caller's handle scope.
184  { HandleScope scope(isolate());
185  for (generation = 0; generation < generations(); generation++) {
186  Handle<CompilationCacheTable> table = GetTable(generation);
187  Handle<Object> probe(table->Lookup(*source, *context), isolate());
188  if (probe->IsSharedFunctionInfo()) {
189  Handle<SharedFunctionInfo> function_info =
191  // Break when we've found a suitable shared function info that
192  // matches the origin.
193  if (HasOrigin(function_info,
194  name,
195  line_offset,
196  column_offset,
197  is_shared_cross_origin)) {
198  result = *function_info;
199  break;
200  }
201  }
202  }
203  }
204 
205  if (!script_histogram_initialized_) {
206  script_histogram_ = isolate()->stats_table()->CreateHistogram(
207  "V8.ScriptCache",
208  0,
209  kScriptGenerations,
210  kScriptGenerations + 1);
211  script_histogram_initialized_ = true;
212  }
213 
214  if (script_histogram_ != NULL) {
215  // The level NUMBER_OF_SCRIPT_GENERATIONS is equivalent to a cache miss.
216  isolate()->stats_table()->AddHistogramSample(script_histogram_, generation);
217  }
218 
219  // Once outside the manacles of the handle scope, we need to recheck
220  // to see if we actually found a cached script. If so, we return a
221  // handle created in the caller's handle scope.
222  if (result != NULL) {
224  isolate());
225  ASSERT(HasOrigin(shared,
226  name,
227  line_offset,
228  column_offset,
229  is_shared_cross_origin));
230  // If the script was found in a later generation, we promote it to
231  // the first generation to let it survive longer in the cache.
232  if (generation != 0) Put(source, context, shared);
233  isolate()->counters()->compilation_cache_hits()->Increment();
234  return shared;
235  } else {
236  isolate()->counters()->compilation_cache_misses()->Increment();
238  }
239 }
240 
241 
242 MaybeObject* CompilationCacheScript::TryTablePut(
243  Handle<String> source,
244  Handle<Context> context,
245  Handle<SharedFunctionInfo> function_info) {
247  return table->Put(*source, *context, *function_info);
248 }
249 
250 
251 Handle<CompilationCacheTable> CompilationCacheScript::TablePut(
252  Handle<String> source,
253  Handle<Context> context,
254  Handle<SharedFunctionInfo> function_info) {
256  TryTablePut(source, context, function_info),
257  CompilationCacheTable);
258 }
259 
260 
262  Handle<Context> context,
263  Handle<SharedFunctionInfo> function_info) {
264  HandleScope scope(isolate());
265  SetFirstTable(TablePut(source, context, function_info));
266 }
267 
268 
270  Handle<String> source,
271  Handle<Context> context,
272  StrictMode strict_mode,
273  int scope_position) {
274  // Make sure not to leak the table into the surrounding handle
275  // scope. Otherwise, we risk keeping old tables around even after
276  // having cleared the cache.
277  Object* result = NULL;
278  int generation;
279  { HandleScope scope(isolate());
280  for (generation = 0; generation < generations(); generation++) {
281  Handle<CompilationCacheTable> table = GetTable(generation);
282  result = table->LookupEval(
283  *source, *context, strict_mode, scope_position);
284  if (result->IsSharedFunctionInfo()) {
285  break;
286  }
287  }
288  }
289  if (result->IsSharedFunctionInfo()) {
291  function_info(SharedFunctionInfo::cast(result), isolate());
292  if (generation != 0) {
293  Put(source, context, function_info, scope_position);
294  }
295  isolate()->counters()->compilation_cache_hits()->Increment();
296  return function_info;
297  } else {
298  isolate()->counters()->compilation_cache_misses()->Increment();
300  }
301 }
302 
303 
304 MaybeObject* CompilationCacheEval::TryTablePut(
305  Handle<String> source,
306  Handle<Context> context,
307  Handle<SharedFunctionInfo> function_info,
308  int scope_position) {
310  return table->PutEval(*source, *context, *function_info, scope_position);
311 }
312 
313 
314 Handle<CompilationCacheTable> CompilationCacheEval::TablePut(
315  Handle<String> source,
316  Handle<Context> context,
317  Handle<SharedFunctionInfo> function_info,
318  int scope_position) {
320  TryTablePut(
321  source, context, function_info, scope_position),
322  CompilationCacheTable);
323 }
324 
325 
327  Handle<Context> context,
328  Handle<SharedFunctionInfo> function_info,
329  int scope_position) {
330  HandleScope scope(isolate());
331  SetFirstTable(TablePut(source, context, function_info, scope_position));
332 }
333 
334 
337  // Make sure not to leak the table into the surrounding handle
338  // scope. Otherwise, we risk keeping old tables around even after
339  // having cleared the cache.
340  Object* result = NULL;
341  int generation;
342  { HandleScope scope(isolate());
343  for (generation = 0; generation < generations(); generation++) {
344  Handle<CompilationCacheTable> table = GetTable(generation);
345  result = table->LookupRegExp(*source, flags);
346  if (result->IsFixedArray()) {
347  break;
348  }
349  }
350  }
351  if (result->IsFixedArray()) {
353  if (generation != 0) {
354  Put(source, flags, data);
355  }
356  isolate()->counters()->compilation_cache_hits()->Increment();
357  return data;
358  } else {
359  isolate()->counters()->compilation_cache_misses()->Increment();
360  return Handle<FixedArray>::null();
361  }
362 }
363 
364 
365 MaybeObject* CompilationCacheRegExp::TryTablePut(
366  Handle<String> source,
368  Handle<FixedArray> data) {
370  return table->PutRegExp(*source, flags, *data);
371 }
372 
373 
374 Handle<CompilationCacheTable> CompilationCacheRegExp::TablePut(
375  Handle<String> source,
376  JSRegExp::Flags flags,
377  Handle<FixedArray> data) {
379  TryTablePut(source, flags, data),
380  CompilationCacheTable);
381 }
382 
383 
385  JSRegExp::Flags flags,
386  Handle<FixedArray> data) {
387  HandleScope scope(isolate());
388  SetFirstTable(TablePut(source, flags, data));
389 }
390 
391 
393  if (!IsEnabled()) return;
394 
395  eval_global_.Remove(function_info);
396  eval_contextual_.Remove(function_info);
397  script_.Remove(function_info);
398 }
399 
400 
402  Handle<String> source,
403  Handle<Object> name,
404  int line_offset,
405  int column_offset,
406  bool is_shared_cross_origin,
407  Handle<Context> context) {
408  if (!IsEnabled()) {
410  }
411 
412  return script_.Lookup(source,
413  name,
414  line_offset,
415  column_offset,
416  is_shared_cross_origin,
417  context);
418 }
419 
420 
422  Handle<String> source,
423  Handle<Context> context,
424  StrictMode strict_mode,
425  int scope_position) {
426  if (!IsEnabled()) {
428  }
429 
431  if (context->IsNativeContext()) {
432  result = eval_global_.Lookup(
433  source, context, strict_mode, scope_position);
434  } else {
435  ASSERT(scope_position != RelocInfo::kNoPosition);
436  result = eval_contextual_.Lookup(
437  source, context, strict_mode, scope_position);
438  }
439  return result;
440 }
441 
442 
444  JSRegExp::Flags flags) {
445  if (!IsEnabled()) {
446  return Handle<FixedArray>::null();
447  }
448 
449  return reg_exp_.Lookup(source, flags);
450 }
451 
452 
454  Handle<Context> context,
455  Handle<SharedFunctionInfo> function_info) {
456  if (!IsEnabled()) return;
457 
458  script_.Put(source, context, function_info);
459 }
460 
461 
463  Handle<Context> context,
464  Handle<SharedFunctionInfo> function_info,
465  int scope_position) {
466  if (!IsEnabled()) return;
467 
468  HandleScope scope(isolate());
469  if (context->IsNativeContext()) {
470  eval_global_.Put(source, context, function_info, scope_position);
471  } else {
472  ASSERT(scope_position != RelocInfo::kNoPosition);
473  eval_contextual_.Put(source, context, function_info, scope_position);
474  }
475 }
476 
477 
478 
480  JSRegExp::Flags flags,
481  Handle<FixedArray> data) {
482  if (!IsEnabled()) {
483  return;
484  }
485 
486  reg_exp_.Put(source, flags, data);
487 }
488 
489 
491  for (int i = 0; i < kSubCacheCount; i++) {
492  subcaches_[i]->Clear();
493  }
494 }
495 
496 
497 void CompilationCache::Iterate(ObjectVisitor* v) {
498  for (int i = 0; i < kSubCacheCount; i++) {
499  subcaches_[i]->Iterate(v);
500  }
501 }
502 
503 
504 void CompilationCache::IterateFunctions(ObjectVisitor* v) {
505  for (int i = 0; i < kSubCacheCount; i++) {
506  subcaches_[i]->IterateFunctions(v);
507  }
508 }
509 
510 
512  for (int i = 0; i < kSubCacheCount; i++) {
513  subcaches_[i]->Age();
514  }
515 }
516 
517 
519  enabled_ = true;
520 }
521 
522 
524  enabled_ = false;
525  Clear();
526 }
527 
528 
529 } } // namespace v8::internal
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
void Put(Handle< String > source, Handle< Context > context, Handle< SharedFunctionInfo > function_info, int scope_position)
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 true
Definition: flags.cc:208
void Put(Handle< String > source, Handle< Context > context, Handle< SharedFunctionInfo > function_info)
static String * cast(Object *obj)
StatsTable * stats_table()
Definition: isolate.cc:2110
static CompilationCacheTable * cast(Object *obj)
static Handle< T > cast(Handle< S > that)
Definition: handles.h:75
Handle< SharedFunctionInfo > LookupScript(Handle< String > source, Handle< Object > name, int line_offset, int column_offset, bool is_shared_cross_origin, Handle< Context > context)
Handle< FixedArray > LookupRegExp(Handle< String > source, JSRegExp::Flags flags)
Handle< SharedFunctionInfo > LookupEval(Handle< String > source, Handle< Context > context, StrictMode strict_mode, int scope_position)
#define ASSERT(condition)
Definition: checks.h:329
static Script * cast(Object *obj)
static SharedFunctionInfo * cast(Object *obj)
void SetFirstTable(Handle< CompilationCacheTable > value)
Handle< CompilationCacheTable > GetTable(int generation)
void PutScript(Handle< String > source, Handle< Context > context, Handle< SharedFunctionInfo > function_info)
bool Equals(String *other)
Definition: objects-inl.h:2969
Handle< SharedFunctionInfo > Lookup(Handle< String > source, Handle< Context > context, StrictMode strict_mode, int scope_position)
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 size
Definition: flags.cc:211
void PutEval(Handle< String > source, Handle< Context > context, Handle< SharedFunctionInfo > function_info, int scope_position)
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
#define CALL_HEAP_FUNCTION(ISOLATE, FUNCTION_CALL, TYPE)
Definition: heap-inl.h:679
void Iterate(ObjectVisitor *v)
Handle< SharedFunctionInfo > Lookup(Handle< String > source, Handle< Object > name, int line_offset, int column_offset, bool is_shared_cross_origin, Handle< Context > context)
void PutRegExp(Handle< String > source, JSRegExp::Flags flags, Handle< FixedArray > data)
V8_INLINE bool IsString() const
Definition: v8.h:6265
Handle< FixedArray > Lookup(Handle< String > source, JSRegExp::Flags flags)
static MUST_USE_RESULT MaybeObject * Allocate(Heap *heap, int at_least_space_for, MinimumCapacity capacity_option=USE_DEFAULT_MINIMUM_CAPACITY, PretenureFlag pretenure=NOT_TENURED)
Handle< CompilationCacheTable > GetFirstTable()
static Handle< T > null()
Definition: handles.h:80
void MemsetPointer(T **dest, U *value, int counter)
Definition: v8utils.h:198
void IterateFunctions(ObjectVisitor *v)
Counters * counters()
Definition: isolate.h:859
static FixedArray * cast(Object *obj)
CompilationCacheScript(Isolate *isolate, int generations)
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 generation(in kBytes)") DEFINE_int(max_old_space_size
void Remove(Handle< SharedFunctionInfo > function_info)
void * CreateHistogram(const char *name, int min, int max, size_t buckets)
Definition: counters.h:81
void AddHistogramSample(void *histogram, int sample)
Definition: counters.h:91
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
void Remove(Handle< SharedFunctionInfo > function_info)
void IterateFunctions(ObjectVisitor *v)
void Put(Handle< String > source, JSRegExp::Flags flags, Handle< FixedArray > data)