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
type-info.cc
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 #include "v8.h"
29 
30 #include "ast.h"
31 #include "code-stubs.h"
32 #include "compiler.h"
33 #include "ic.h"
34 #include "macro-assembler.h"
35 #include "stub-cache.h"
36 #include "type-info.h"
37 
38 #include "ic-inl.h"
39 #include "objects-inl.h"
40 
41 namespace v8 {
42 namespace internal {
43 
44 
46  Handle<Context> native_context,
47  Zone* zone)
48  : native_context_(native_context),
49  zone_(zone) {
50  Object* raw_info = code->type_feedback_info();
51  if (raw_info->IsTypeFeedbackInfo()) {
52  feedback_vector_ = Handle<FixedArray>(TypeFeedbackInfo::cast(raw_info)->
53  feedback_vector());
54  }
55 
56  BuildDictionary(code);
57  ASSERT(dictionary_->IsDictionary());
58 }
59 
60 
61 static uint32_t IdToKey(TypeFeedbackId ast_id) {
62  return static_cast<uint32_t>(ast_id.ToInt());
63 }
64 
65 
66 Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) {
67  int entry = dictionary_->FindEntry(IdToKey(ast_id));
69  Object* value = dictionary_->ValueAt(entry);
70  if (value->IsCell()) {
71  Cell* cell = Cell::cast(value);
72  return Handle<Object>(cell->value(), isolate());
73  } else {
74  return Handle<Object>(value, isolate());
75  }
76  }
77  return Handle<Object>::cast(isolate()->factory()->undefined_value());
78 }
79 
80 
81 Handle<Object> TypeFeedbackOracle::GetInfo(int slot) {
82  ASSERT(slot >= 0 && slot < feedback_vector_->length());
83  Object* obj = feedback_vector_->get(slot);
84  if (!obj->IsJSFunction() ||
85  !CanRetainOtherContext(JSFunction::cast(obj), *native_context_)) {
86  return Handle<Object>(obj, isolate());
87  }
88  return Handle<Object>::cast(isolate()->factory()->undefined_value());
89 }
90 
91 
93  Handle<Object> maybe_code = GetInfo(id);
94  if (maybe_code->IsCode()) {
95  Handle<Code> code = Handle<Code>::cast(maybe_code);
96  return code->is_inline_cache_stub() && code->ic_state() == UNINITIALIZED;
97  }
98  return false;
99 }
100 
101 
103  Handle<Object> maybe_code = GetInfo(ast_id);
104  if (!maybe_code->IsCode()) return false;
105  Handle<Code> code = Handle<Code>::cast(maybe_code);
106  return code->ic_state() == UNINITIALIZED;
107 }
108 
109 
111  Handle<Object> maybe_code = GetInfo(ast_id);
112  if (maybe_code->IsCode()) {
113  Handle<Code> code = Handle<Code>::cast(maybe_code);
114  return code->is_keyed_store_stub() &&
115  code->ic_state() == POLYMORPHIC;
116  }
117  return false;
118 }
119 
120 
122  Handle<Object> value = GetInfo(slot);
123  return FLAG_pretenuring_call_new
124  ? value->IsJSFunction()
125  : value->IsAllocationSite() || value->IsJSFunction();
126 }
127 
128 
130  Handle<Object> info = GetInfo(slot);
131  return FLAG_pretenuring_call_new
132  ? info->IsJSFunction()
133  : info->IsAllocationSite() || info->IsJSFunction();
134 }
135 
136 
137 byte TypeFeedbackOracle::ForInType(int feedback_vector_slot) {
138  Handle<Object> value = GetInfo(feedback_vector_slot);
139  return value->IsSmi() &&
141  ? ForInStatement::FAST_FOR_IN : ForInStatement::SLOW_FOR_IN;
142 }
143 
144 
146  TypeFeedbackId ast_id) {
147  Handle<Object> maybe_code = GetInfo(ast_id);
148  if (maybe_code->IsCode()) {
149  Handle<Code> code = Handle<Code>::cast(maybe_code);
150  if (code->kind() == Code::KEYED_STORE_IC) {
151  return KeyedStoreIC::GetKeyedAccessStoreMode(code->extra_ic_state());
152  }
153  }
154  return STANDARD_STORE;
155 }
156 
157 
159  Handle<Object> info = GetInfo(slot);
160  if (FLAG_pretenuring_call_new || info->IsJSFunction()) {
161  return Handle<JSFunction>::cast(info);
162  }
163 
164  ASSERT(info->IsAllocationSite());
165  return Handle<JSFunction>(isolate()->native_context()->array_function());
166 }
167 
168 
170  Handle<Object> info = GetInfo(slot);
171  if (FLAG_pretenuring_call_new || info->IsJSFunction()) {
172  return Handle<JSFunction>::cast(info);
173  }
174 
175  ASSERT(info->IsAllocationSite());
176  return Handle<JSFunction>(isolate()->native_context()->array_function());
177 }
178 
179 
181  Handle<Object> info = GetInfo(slot);
182  if (FLAG_pretenuring_call_new || info->IsAllocationSite()) {
183  return Handle<AllocationSite>::cast(info);
184  }
186 }
187 
188 
190  TypeFeedbackId id, Builtins::Name builtin) {
191  return *GetInfo(id) == isolate()->builtins()->builtin(builtin);
192 }
193 
194 
196  Handle<Object> object = GetInfo(id);
197  if (!object->IsCode()) return false;
199  if (!code->is_load_stub()) return false;
200  if (code->ic_state() != MONOMORPHIC) return false;
201  return stub->Describes(*code);
202 }
203 
204 
206  Type** left_type,
207  Type** right_type,
208  Type** combined_type) {
209  Handle<Object> info = GetInfo(id);
210  if (!info->IsCode()) {
211  // For some comparisons we don't have ICs, e.g. LiteralCompareTypeof.
212  *left_type = *right_type = *combined_type = Type::None(zone());
213  return;
214  }
216 
218  Map* raw_map = code->FindFirstMap();
219  if (raw_map != NULL) {
220  map = Map::CurrentMapForDeprecated(handle(raw_map));
221  if (!map.is_null() && CanRetainOtherContext(*map, *native_context_)) {
222  map = Handle<Map>::null();
223  }
224  }
225 
226  if (code->is_compare_ic_stub()) {
227  int stub_minor_key = code->stub_info();
229  stub_minor_key, left_type, right_type, combined_type, map, zone());
230  } else if (code->is_compare_nil_ic_stub()) {
231  CompareNilICStub stub(code->extra_ic_state());
232  *combined_type = stub.GetType(zone(), map);
233  *left_type = *right_type = stub.GetInputType(zone(), map);
234  }
235 }
236 
237 
239  Type** left,
240  Type** right,
241  Type** result,
242  Maybe<int>* fixed_right_arg,
243  Handle<AllocationSite>* allocation_site,
244  Token::Value op) {
245  Handle<Object> object = GetInfo(id);
246  if (!object->IsCode()) {
247  // For some binary ops we don't have ICs, e.g. Token::COMMA, but for the
248  // operations covered by the BinaryOpIC we should always have them.
249  ASSERT(op < BinaryOpIC::State::FIRST_TOKEN ||
250  op > BinaryOpIC::State::LAST_TOKEN);
251  *left = *right = *result = Type::None(zone());
252  *fixed_right_arg = Maybe<int>();
253  *allocation_site = Handle<AllocationSite>::null();
254  return;
255  }
257  ASSERT_EQ(Code::BINARY_OP_IC, code->kind());
258  BinaryOpIC::State state(code->extra_ic_state());
259  ASSERT_EQ(op, state.op());
260 
261  *left = state.GetLeftType(zone());
262  *right = state.GetRightType(zone());
263  *result = state.GetResultType(zone());
264  *fixed_right_arg = state.fixed_right_arg();
265 
266  AllocationSite* first_allocation_site = code->FindFirstAllocationSite();
267  if (first_allocation_site != NULL) {
268  *allocation_site = handle(first_allocation_site);
269  } else {
270  *allocation_site = Handle<AllocationSite>::null();
271  }
272 }
273 
274 
276  Handle<Object> object = GetInfo(id);
277  if (!object->IsCode()) return Type::None(zone());
279  ASSERT_EQ(Code::BINARY_OP_IC, code->kind());
280  BinaryOpIC::State state(code->extra_ic_state());
281  return state.GetLeftType(zone());
282 }
283 
284 
287  SmallMapList* receiver_types, bool* is_prototype) {
288  receiver_types->Clear();
289  FunctionPrototypeStub proto_stub(Code::LOAD_IC);
290  *is_prototype = LoadIsStub(id, &proto_stub);
291  if (!*is_prototype) {
293  CollectReceiverTypes(id, name, flags, receiver_types);
294  }
295 }
296 
297 
299  TypeFeedbackId id, SmallMapList* receiver_types, bool* is_string) {
300  receiver_types->Clear();
301  *is_string = false;
302  if (LoadIsBuiltin(id, Builtins::kKeyedLoadIC_String)) {
303  *is_string = true;
304  } else {
305  CollectReceiverTypes(id, receiver_types);
306  }
307 }
308 
309 
311  TypeFeedbackId id, Handle<String> name, SmallMapList* receiver_types) {
312  receiver_types->Clear();
313  Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC);
314  CollectReceiverTypes(id, name, flags, receiver_types);
315 }
316 
317 
319  TypeFeedbackId id, SmallMapList* receiver_types,
320  KeyedAccessStoreMode* store_mode) {
321  receiver_types->Clear();
322  CollectReceiverTypes(id, receiver_types);
323  *store_mode = GetStoreMode(id);
324 }
325 
326 
328  SmallMapList* receiver_types) {
329  receiver_types->Clear();
330  CollectReceiverTypes(id, receiver_types);
331 }
332 
333 
337  SmallMapList* types) {
338  Handle<Object> object = GetInfo(ast_id);
339  if (object->IsUndefined() || object->IsSmi()) return;
340 
341  ASSERT(object->IsCode());
343 
344  if (FLAG_collect_megamorphic_maps_from_stub_cache &&
345  code->ic_state() == MEGAMORPHIC) {
346  types->Reserve(4, zone());
348  types, name, flags, native_context_, zone());
349  } else {
350  CollectReceiverTypes(ast_id, types);
351  }
352 }
353 
354 
355 // Check if a map originates from a given native context. We use this
356 // information to filter out maps from different context to avoid
357 // retaining objects from different tabs in Chrome via optimized code.
359  Context* native_context) {
360  Object* constructor = NULL;
361  while (!map->prototype()->IsNull()) {
362  constructor = map->constructor();
363  if (!constructor->IsNull()) {
364  // If the constructor is not null or a JSFunction, we have to
365  // conservatively assume that it may retain a native context.
366  if (!constructor->IsJSFunction()) return true;
367  // Check if the constructor directly references a foreign context.
368  if (CanRetainOtherContext(JSFunction::cast(constructor),
369  native_context)) {
370  return true;
371  }
372  }
373  map = HeapObject::cast(map->prototype())->map();
374  }
375  constructor = map->constructor();
376  if (constructor->IsNull()) return false;
377  JSFunction* function = JSFunction::cast(constructor);
378  return CanRetainOtherContext(function, native_context);
379 }
380 
381 
383  Context* native_context) {
384  return function->context()->global_object() != native_context->global_object()
385  && function->context()->global_object() != native_context->builtins();
386 }
387 
388 
390  SmallMapList* types) {
391  Handle<Object> object = GetInfo(ast_id);
392  if (!object->IsCode()) return;
394  MapHandleList maps;
395  if (code->ic_state() == MONOMORPHIC) {
396  Map* map = code->FindFirstMap();
397  if (map != NULL) maps.Add(handle(map));
398  } else if (code->ic_state() == POLYMORPHIC) {
399  code->FindAllMaps(&maps);
400  } else {
401  return;
402  }
403  types->Reserve(maps.length(), zone());
404  for (int i = 0; i < maps.length(); i++) {
405  Handle<Map> map(maps.at(i));
406  if (!CanRetainOtherContext(*map, *native_context_)) {
407  types->AddMapIfMissing(map, zone());
408  }
409  }
410 }
411 
412 
414  Handle<Object> object = GetInfo(id);
415  return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0;
416 }
417 
418 
419 // Things are a bit tricky here: The iterator for the RelocInfos and the infos
420 // themselves are not GC-safe, so we first get all infos, then we create the
421 // dictionary (possibly triggering GC), and finally we relocate the collected
422 // infos before we process them.
423 void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) {
424  DisallowHeapAllocation no_allocation;
425  ZoneList<RelocInfo> infos(16, zone());
426  HandleScope scope(isolate());
427  GetRelocInfos(code, &infos);
428  CreateDictionary(code, &infos);
429  ProcessRelocInfos(&infos);
430  // Allocate handle in the parent scope.
431  dictionary_ = scope.CloseAndEscape(dictionary_);
432 }
433 
434 
435 void TypeFeedbackOracle::GetRelocInfos(Handle<Code> code,
436  ZoneList<RelocInfo>* infos) {
437  int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID);
438  for (RelocIterator it(*code, mask); !it.done(); it.next()) {
439  infos->Add(*it.rinfo(), zone());
440  }
441 }
442 
443 
444 void TypeFeedbackOracle::CreateDictionary(Handle<Code> code,
445  ZoneList<RelocInfo>* infos) {
446  AllowHeapAllocation allocation_allowed;
447  Code* old_code = *code;
448  dictionary_ =
449  isolate()->factory()->NewUnseededNumberDictionary(infos->length());
450  RelocateRelocInfos(infos, old_code, *code);
451 }
452 
453 
454 void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos,
455  Code* old_code,
456  Code* new_code) {
457  for (int i = 0; i < infos->length(); i++) {
458  RelocInfo* info = &(*infos)[i];
459  info->set_host(new_code);
460  info->set_pc(new_code->instruction_start() +
461  (info->pc() - old_code->instruction_start()));
462  }
463 }
464 
465 
466 void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
467  for (int i = 0; i < infos->length(); i++) {
468  RelocInfo reloc_entry = (*infos)[i];
469  Address target_address = reloc_entry.target_address();
470  TypeFeedbackId ast_id =
471  TypeFeedbackId(static_cast<unsigned>((*infos)[i].data()));
472  Code* target = Code::GetCodeFromTargetAddress(target_address);
473  switch (target->kind()) {
474  case Code::LOAD_IC:
475  case Code::STORE_IC:
476  case Code::KEYED_LOAD_IC:
477  case Code::KEYED_STORE_IC:
478  case Code::BINARY_OP_IC:
479  case Code::COMPARE_IC:
480  case Code::TO_BOOLEAN_IC:
481  case Code::COMPARE_NIL_IC:
482  SetInfo(ast_id, target);
483  break;
484 
485  default:
486  break;
487  }
488  }
489 }
490 
491 
492 void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) {
493  ASSERT(dictionary_->FindEntry(IdToKey(ast_id)) ==
495  MaybeObject* maybe_result = dictionary_->AtNumberPut(IdToKey(ast_id), target);
496  USE(maybe_result);
497 #ifdef DEBUG
498  Object* result = NULL;
499  // Dictionary has been allocated with sufficient size for all elements.
500  ASSERT(maybe_result->ToObject(&result));
501  ASSERT(*dictionary_ == result);
502 #endif
503 }
504 
505 
506 } } // namespace v8::internal
byte * Address
Definition: globals.h:186
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
bool CallNewIsMonomorphic(int slot)
Definition: type-info.cc:129
Code * builtin(Name name)
Definition: builtins.h:322
static const int kForInFastCaseMarker
Definition: objects.h:8230
byte ToBooleanTypes(TypeFeedbackId id)
Definition: type-info.cc:413
Handle< AllocationSite > GetCallNewAllocationSite(int slot)
Definition: type-info.cc:180
static Handle< Map > CurrentMapForDeprecated(Handle< Map > map)
Definition: objects.cc:2784
Type * CountType(TypeFeedbackId id)
Definition: type-info.cc:275
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 map
Definition: flags.cc:350
static TypeFeedbackInfo * cast(Object *obj)
static Flags ComputeHandlerFlags(Kind handler_kind, StubType type=NORMAL, InlineCacheHolderFlag holder=OWN_MAP)
Definition: objects-inl.h:4624
static HeapObject * cast(Object *obj)
static Handle< T > cast(Handle< S > that)
Definition: handles.h:75
static bool CanRetainOtherContext(Map *map, Context *native_context)
Definition: type-info.cc:358
void CollectMatchingMaps(SmallMapList *types, Handle< Name > name, Code::Flags flags, Handle< Context > native_context, Zone *zone)
Definition: stub-cache.cc:436
void AssignmentReceiverTypes(TypeFeedbackId id, Handle< String > name, SmallMapList *receiver_types)
Definition: type-info.cc:310
kSerializedDataOffset Object
Definition: objects-inl.h:5016
JSBuiltinsObject * builtins()
Definition: contexts.cc:47
T & at(int i) const
Definition: list.h:90
Builtins * builtins()
Definition: isolate.h:948
KeyedAccessStoreMode
Definition: objects.h:164
uint32_t Flags
Definition: objects.h:5184
#define ASSERT(condition)
Definition: checks.h:329
void CollectReceiverTypes(TypeFeedbackId id, SmallMapList *types)
Definition: type-info.cc:389
Factory * factory()
Definition: isolate.h:995
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, true > AllowHeapAllocation
Definition: assert-scope.h:218
static Smi * cast(Object *object)
static void StubInfoToType(int stub_minor_key, Type **left_type, Type **right_type, Type **overall_type, Handle< Map > map, Zone *zone)
Definition: ic.cc:2533
uint8_t byte
Definition: globals.h:185
GlobalObject * global_object()
Definition: contexts.h:388
bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id)
Definition: type-info.cc:189
Handle< JSFunction > GetCallNewTarget(int slot)
Definition: type-info.cc:169
void CompareType(TypeFeedbackId id, Type **left, Type **right, Type **combined)
Definition: type-info.cc:205
static Cell * 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 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
bool Describes(Code *code)
Definition: code-stubs.h:822
static KeyedAccessStoreMode GetKeyedAccessStoreMode(ExtraICState extra_state)
Definition: ic.h:597
void PropertyReceiverTypes(TypeFeedbackId id, Handle< String > name, SmallMapList *receiver_types, bool *is_prototype)
Definition: type-info.cc:285
void CountReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types)
Definition: type-info.cc:327
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
static Code * GetCodeFromTargetAddress(Address address)
Definition: objects-inl.h:4662
byte ForInType(int feedback_vector_slot)
Definition: type-info.cc:137
V8_INLINE bool IsUndefined() const
Definition: v8.h:6229
bool LoadIsStub(TypeFeedbackId id, ICStub *stub)
Definition: type-info.cc:195
StubCache * stub_cache()
Definition: isolate.h:877
Definition: v8.h:2107
bool is_null() const
Definition: handles.h:81
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:103
TypeFeedbackOracle(Handle< Code > code, Handle< Context > native_context, Zone *zone)
Definition: type-info.cc:45
bool LoadIsUninitialized(TypeFeedbackId id)
Definition: type-info.cc:92
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 info
Definition: flags.cc:317
void KeyedPropertyReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types, bool *is_string)
Definition: type-info.cc:298
static Handle< T > null()
Definition: handles.h:80
#define ASSERT_EQ(v1, v2)
Definition: checks.h:330
void USE(T)
Definition: globals.h:341
bool StoreIsUninitialized(TypeFeedbackId id)
Definition: type-info.cc:102
Handle< JSFunction > GetCallTarget(int slot)
Definition: type-info.cc:158
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:39
void KeyedAssignmentReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types, KeyedAccessStoreMode *store_mode)
Definition: type-info.cc:318
HeapObject * obj
Handle< Context > native_context()
Definition: isolate.cc:1372
KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id)
Definition: type-info.cc:145
void BinaryType(TypeFeedbackId id, Type **left, Type **right, Type **result, Maybe< int > *fixed_right_arg, Handle< AllocationSite > *allocation_site, Token::Value operation)
Definition: type-info.cc:238
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
bool StoreIsKeyedPolymorphic(TypeFeedbackId id)
Definition: type-info.cc:110
Handle< UnseededNumberDictionary > NewUnseededNumberDictionary(int at_least_space_for)
Definition: factory.cc:126
Isolate * isolate() const
Definition: type-info.h:118
static JSFunction * cast(Object *obj)