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
types.cc
Go to the documentation of this file.
1 // Copyright 2013 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 "types.h"
29 #include "string-stream.h"
30 
31 namespace v8 {
32 namespace internal {
33 
34 template<class Config>
36  if (this->IsClass()) {
37  return 1;
38  } else if (this->IsUnion()) {
39  UnionedHandle unioned = this->AsUnion();
40  int result = 0;
41  for (int i = 0; i < Config::union_length(unioned); ++i) {
42  if (Config::union_get(unioned, i)->IsClass()) ++result;
43  }
44  return result;
45  } else {
46  return 0;
47  }
48 }
49 
50 
51 template<class Config>
53  if (this->IsConstant()) {
54  return 1;
55  } else if (this->IsUnion()) {
56  UnionedHandle unioned = this->AsUnion();
57  int result = 0;
58  for (int i = 0; i < Config::union_length(unioned); ++i) {
59  if (Config::union_get(unioned, i)->IsConstant()) ++result;
60  }
61  return result;
62  } else {
63  return 0;
64  }
65 }
66 
67 
68 template<class Config> template<class T>
71  ASSERT(!Done());
72  return type_->IsUnion() ? Config::union_get(type_->AsUnion(), index_) : type_;
73 }
74 
75 
76 // C++ cannot specialise nested templates, so we have to go through this
77 // contortion with an auxiliary template to simulate it.
78 template<class Config, class T>
80  static bool matches(typename TypeImpl<Config>::TypeHandle type);
82 };
83 
84 template<class Config>
85 struct TypeImplIteratorAux<Config, i::Map> {
86  static bool matches(typename TypeImpl<Config>::TypeHandle type) {
87  return type->IsClass();
88  }
90  return type->AsClass();
91  }
92 };
93 
94 template<class Config>
95 struct TypeImplIteratorAux<Config, i::Object> {
96  static bool matches(typename TypeImpl<Config>::TypeHandle type) {
97  return type->IsConstant();
98  }
100  typename TypeImpl<Config>::TypeHandle type) {
101  return type->AsConstant();
102  }
103 };
104 
105 template<class Config> template<class T>
106 bool TypeImpl<Config>::Iterator<T>::matches(TypeHandle type) {
108 }
109 
110 template<class Config> template<class T>
112  return TypeImplIteratorAux<Config, T>::current(get_type());
113 }
114 
115 
116 template<class Config> template<class T>
118  ++index_;
119  if (type_->IsUnion()) {
120  UnionedHandle unioned = type_->AsUnion();
121  for (; index_ < Config::union_length(unioned); ++index_) {
122  if (matches(Config::union_get(unioned, index_))) return;
123  }
124  } else if (index_ == 0 && matches(type_)) {
125  return;
126  }
127  index_ = -1;
128 }
129 
130 
131 // Get the smallest bitset subsuming this type.
132 template<class Config>
134  if (this->IsBitset()) {
135  return this->AsBitset();
136  } else if (this->IsUnion()) {
137  UnionedHandle unioned = this->AsUnion();
138  int bitset = kNone;
139  for (int i = 0; i < Config::union_length(unioned); ++i) {
140  bitset |= Config::union_get(unioned, i)->LubBitset();
141  }
142  return bitset;
143  } else if (this->IsClass()) {
144  int bitset = Config::lub_bitset(this);
145  return bitset ? bitset : LubBitset(*this->AsClass());
146  } else {
147  int bitset = Config::lub_bitset(this);
148  return bitset ? bitset : LubBitset(*this->AsConstant());
149  }
150 }
151 
152 
153 template<class Config>
154 int TypeImpl<Config>::LubBitset(i::Object* value) {
155  if (value->IsSmi()) return kSignedSmall & kTaggedInt;
156  i::Map* map = i::HeapObject::cast(value)->map();
157  if (map->instance_type() == HEAP_NUMBER_TYPE) {
158  int32_t i;
159  uint32_t u;
160  return kTaggedPtr & (
161  value->ToInt32(&i) ? (Smi::IsValid(i) ? kSignedSmall : kOtherSigned32) :
162  value->ToUint32(&u) ? kUnsigned32 : kFloat);
163  }
164  if (map->instance_type() == ODDBALL_TYPE) {
165  if (value->IsUndefined()) return kUndefined;
166  if (value->IsNull()) return kNull;
167  if (value->IsBoolean()) return kBoolean;
168  if (value->IsTheHole()) return kAny; // TODO(rossberg): kNone?
169  if (value->IsUninitialized()) return kNone;
170  UNREACHABLE();
171  }
172  return LubBitset(map);
173 }
174 
175 
176 template<class Config>
177 int TypeImpl<Config>::LubBitset(i::Map* map) {
178  switch (map->instance_type()) {
179  case STRING_TYPE:
180  case ASCII_STRING_TYPE:
181  case CONS_STRING_TYPE:
183  case SLICED_STRING_TYPE:
201  return kString;
202  case SYMBOL_TYPE:
203  return kSymbol;
204  case ODDBALL_TYPE:
205  return kOddball;
206  case HEAP_NUMBER_TYPE:
207  return kFloat & kTaggedPtr;
208  case JS_VALUE_TYPE:
209  case JS_DATE_TYPE:
210  case JS_OBJECT_TYPE:
213  case JS_MODULE_TYPE:
218  case JS_TYPED_ARRAY_TYPE:
219  case JS_DATA_VIEW_TYPE:
220  case JS_SET_TYPE:
221  case JS_MAP_TYPE:
222  case JS_WEAK_MAP_TYPE:
223  case JS_WEAK_SET_TYPE:
224  if (map->is_undetectable()) return kUndetectable;
225  return kOtherObject;
226  case JS_ARRAY_TYPE:
227  return kArray;
228  case JS_FUNCTION_TYPE:
229  return kFunction;
230  case JS_REGEXP_TYPE:
231  return kRegExp;
232  case JS_PROXY_TYPE:
234  return kProxy;
235  case MAP_TYPE:
236  // When compiling stub templates, the meta map is used as a place holder
237  // for the actual map with which the template is later instantiated.
238  // We treat it as a kind of type variable whose upper bound is Any.
239  // TODO(rossberg): for caching of CompareNilIC stubs to work correctly,
240  // we must exclude Undetectable here. This makes no sense, really,
241  // because it means that the template isn't actually parametric.
242  // Also, it doesn't apply elsewhere. 8-(
243  // We ought to find a cleaner solution for compiling stubs parameterised
244  // over type or class variables, esp ones with bounds...
245  return kDetectable;
248  case ACCESSOR_PAIR_TYPE:
249  case FIXED_ARRAY_TYPE:
250  return kInternal & kTaggedPtr;
251  default:
252  UNREACHABLE();
253  return kNone;
254  }
255 }
256 
257 
258 // Get the largest bitset subsumed by this type.
259 template<class Config>
260 int TypeImpl<Config>::GlbBitset() {
261  if (this->IsBitset()) {
262  return this->AsBitset();
263  } else if (this->IsUnion()) {
264  // All but the first are non-bitsets and thus would yield kNone anyway.
265  return Config::union_get(this->AsUnion(), 0)->GlbBitset();
266  } else {
267  return kNone;
268  }
269 }
270 
271 
272 // Most precise _current_ type of a value (usually its class).
273 template<class Config>
275  i::Handle<i::Object> value, Region* region) {
276  if (value->IsSmi() ||
279  return Of(value, region);
280  }
281  return Class(i::handle(i::HeapObject::cast(*value)->map()), region);
282 }
283 
284 
285 // Check this <= that.
286 template<class Config>
288  // Fast path for bitsets.
289  if (this->IsNone()) return true;
290  if (that->IsBitset()) {
291  return (this->LubBitset() | that->AsBitset()) == that->AsBitset();
292  }
293 
294  if (that->IsClass()) {
295  return this->IsClass() && *this->AsClass() == *that->AsClass();
296  }
297  if (that->IsConstant()) {
298  return this->IsConstant() && *this->AsConstant() == *that->AsConstant();
299  }
300 
301  // (T1 \/ ... \/ Tn) <= T <=> (T1 <= T) /\ ... /\ (Tn <= T)
302  if (this->IsUnion()) {
303  UnionedHandle unioned = this->AsUnion();
304  for (int i = 0; i < Config::union_length(unioned); ++i) {
305  TypeHandle this_i = Config::union_get(unioned, i);
306  if (!this_i->Is(that)) return false;
307  }
308  return true;
309  }
310 
311  // T <= (T1 \/ ... \/ Tn) <=> (T <= T1) \/ ... \/ (T <= Tn)
312  // (iff T is not a union)
313  ASSERT(!this->IsUnion());
314  if (that->IsUnion()) {
315  UnionedHandle unioned = that->AsUnion();
316  for (int i = 0; i < Config::union_length(unioned); ++i) {
317  TypeHandle that_i = Config::union_get(unioned, i);
318  if (this->Is(that_i)) return true;
319  if (this->IsBitset()) break; // Fast fail, only first field is a bitset.
320  }
321  return false;
322  }
323 
324  return false;
325 }
326 
327 
328 template<class Config>
330  return this->Is(that) ||
331  (this->IsConstant() && that->IsClass() &&
332  this->AsConstant()->IsHeapObject() &&
333  i::HeapObject::cast(*this->AsConstant())->map() == *that->AsClass());
334 }
335 
336 
337 // Check this overlaps that.
338 template<class Config>
340  // Fast path for bitsets.
341  if (this->IsBitset()) {
342  return IsInhabited(this->AsBitset() & that->LubBitset());
343  }
344  if (that->IsBitset()) {
345  return IsInhabited(this->LubBitset() & that->AsBitset());
346  }
347 
348  // (T1 \/ ... \/ Tn) overlaps T <=> (T1 overlaps T) \/ ... \/ (Tn overlaps T)
349  if (this->IsUnion()) {
350  UnionedHandle unioned = this->AsUnion();
351  for (int i = 0; i < Config::union_length(unioned); ++i) {
352  TypeHandle this_i = Config::union_get(unioned, i);
353  if (this_i->Maybe(that)) return true;
354  }
355  return false;
356  }
357 
358  // T overlaps (T1 \/ ... \/ Tn) <=> (T overlaps T1) \/ ... \/ (T overlaps Tn)
359  if (that->IsUnion()) {
360  UnionedHandle unioned = that->AsUnion();
361  for (int i = 0; i < Config::union_length(unioned); ++i) {
362  TypeHandle that_i = Config::union_get(unioned, i);
363  if (this->Maybe(that_i)) return true;
364  }
365  return false;
366  }
367 
368  ASSERT(!this->IsUnion() && !that->IsUnion());
369  if (this->IsClass()) {
370  return that->IsClass() && *this->AsClass() == *that->AsClass();
371  }
372  if (this->IsConstant()) {
373  return that->IsConstant() && *this->AsConstant() == *that->AsConstant();
374  }
375 
376  return false;
377 }
378 
379 
380 template<class Config>
381 bool TypeImpl<Config>::InUnion(UnionedHandle unioned, int current_size) {
382  ASSERT(!this->IsUnion());
383  for (int i = 0; i < current_size; ++i) {
384  TypeHandle type = Config::union_get(unioned, i);
385  if (this->Is(type)) return true;
386  }
387  return false;
388 }
389 
390 
391 // Get non-bitsets from this which are not subsumed by union, store at unioned,
392 // starting at index. Returns updated index.
393 template<class Config>
394 int TypeImpl<Config>::ExtendUnion(
395  UnionedHandle result, TypeHandle type, int current_size) {
396  int old_size = current_size;
397  if (type->IsClass() || type->IsConstant()) {
398  if (!type->InUnion(result, old_size)) {
399  Config::union_set(result, current_size++, type);
400  }
401  } else if (type->IsUnion()) {
402  UnionedHandle unioned = type->AsUnion();
403  for (int i = 0; i < Config::union_length(unioned); ++i) {
404  TypeHandle type = Config::union_get(unioned, i);
405  ASSERT(i == 0 ||
406  !(type->IsBitset() || type->Is(Config::union_get(unioned, 0))));
407  if (!type->IsBitset() && !type->InUnion(result, old_size)) {
408  Config::union_set(result, current_size++, type);
409  }
410  }
411  }
412  return current_size;
413 }
414 
415 
416 // Union is O(1) on simple bit unions, but O(n*m) on structured unions.
417 // TODO(rossberg): Should we use object sets somehow? Is it worth it?
418 template<class Config>
420  TypeHandle type1, TypeHandle type2, Region* region) {
421  // Fast case: bit sets.
422  if (type1->IsBitset() && type2->IsBitset()) {
423  return Config::from_bitset(type1->AsBitset() | type2->AsBitset(), region);
424  }
425 
426  // Fast case: top or bottom types.
427  if (type1->IsAny()) return type1;
428  if (type2->IsAny()) return type2;
429  if (type1->IsNone()) return type2;
430  if (type2->IsNone()) return type1;
431 
432  // Semi-fast case: Unioned objects are neither involved nor produced.
433  if (!(type1->IsUnion() || type2->IsUnion())) {
434  if (type1->Is(type2)) return type2;
435  if (type2->Is(type1)) return type1;
436  }
437 
438  // Slow case: may need to produce a Unioned object.
439  int size = type1->IsBitset() || type2->IsBitset() ? 1 : 0;
440  if (!type1->IsBitset()) {
441  size += (type1->IsUnion() ? Config::union_length(type1->AsUnion()) : 1);
442  }
443  if (!type2->IsBitset()) {
444  size += (type2->IsUnion() ? Config::union_length(type2->AsUnion()) : 1);
445  }
446  ASSERT(size >= 2);
447  UnionedHandle unioned = Config::union_create(size, region);
448  size = 0;
449 
450  int bitset = type1->GlbBitset() | type2->GlbBitset();
451  if (bitset != kNone) {
452  Config::union_set(unioned, size++, Config::from_bitset(bitset, region));
453  }
454  size = ExtendUnion(unioned, type1, size);
455  size = ExtendUnion(unioned, type2, size);
456 
457  if (size == 1) {
458  return Config::union_get(unioned, 0);
459  } else {
460  Config::union_shrink(unioned, size);
461  return Config::from_union(unioned);
462  }
463 }
464 
465 
466 // Get non-bitsets from type which are also in other, store at unioned,
467 // starting at index. Returns updated index.
468 template<class Config>
470  UnionedHandle result, TypeHandle type, TypeHandle other, int current_size) {
471  int old_size = current_size;
472  if (type->IsClass() || type->IsConstant()) {
473  if (type->Is(other) && !type->InUnion(result, old_size)) {
474  Config::union_set(result, current_size++, type);
475  }
476  } else if (type->IsUnion()) {
477  UnionedHandle unioned = type->AsUnion();
478  for (int i = 0; i < Config::union_length(unioned); ++i) {
479  TypeHandle type = Config::union_get(unioned, i);
480  ASSERT(i == 0 ||
481  !(type->IsBitset() || type->Is(Config::union_get(unioned, 0))));
482  if (!type->IsBitset() && type->Is(other) &&
483  !type->InUnion(result, old_size)) {
484  Config::union_set(result, current_size++, type);
485  }
486  }
487  }
488  return current_size;
489 }
490 
491 
492 // Intersection is O(1) on simple bit unions, but O(n*m) on structured unions.
493 // TODO(rossberg): Should we use object sets somehow? Is it worth it?
494 template<class Config>
496  TypeHandle type1, TypeHandle type2, Region* region) {
497  // Fast case: bit sets.
498  if (type1->IsBitset() && type2->IsBitset()) {
499  return Config::from_bitset(type1->AsBitset() & type2->AsBitset(), region);
500  }
501 
502  // Fast case: top or bottom types.
503  if (type1->IsNone()) return type1;
504  if (type2->IsNone()) return type2;
505  if (type1->IsAny()) return type2;
506  if (type2->IsAny()) return type1;
507 
508  // Semi-fast case: Unioned objects are neither involved nor produced.
509  if (!(type1->IsUnion() || type2->IsUnion())) {
510  if (type1->Is(type2)) return type1;
511  if (type2->Is(type1)) return type2;
512  }
513 
514  // Slow case: may need to produce a Unioned object.
515  int size = 0;
516  if (!type1->IsBitset()) {
517  size = (type1->IsUnion() ? Config::union_length(type1->AsUnion()) : 2);
518  }
519  if (!type2->IsBitset()) {
520  int size2 = (type2->IsUnion() ? Config::union_length(type2->AsUnion()) : 2);
521  size = (size == 0 ? size2 : Min(size, size2));
522  }
523  ASSERT(size >= 2);
524  UnionedHandle unioned = Config::union_create(size, region);
525  size = 0;
526 
527  int bitset = type1->GlbBitset() & type2->GlbBitset();
528  if (bitset != kNone) {
529  Config::union_set(unioned, size++, Config::from_bitset(bitset, region));
530  }
531  size = ExtendIntersection(unioned, type1, type2, size);
532  size = ExtendIntersection(unioned, type2, type1, size);
533 
534  if (size == 0) {
535  return None(region);
536  } else if (size == 1) {
537  return Config::union_get(unioned, 0);
538  } else {
539  Config::union_shrink(unioned, size);
540  return Config::from_union(unioned);
541  }
542 }
543 
544 
545 template<class Config>
546 template<class OtherType>
548  typename OtherType::TypeHandle type, Region* region) {
549  if (type->IsBitset()) {
550  return Config::from_bitset(type->AsBitset(), region);
551  } else if (type->IsClass()) {
552  return Config::from_class(type->AsClass(), type->LubBitset(), region);
553  } else if (type->IsConstant()) {
554  return Config::from_constant(type->AsConstant(), type->LubBitset(), region);
555  } else {
556  ASSERT(type->IsUnion());
557  typename OtherType::UnionedHandle unioned = type->AsUnion();
558  int length = OtherType::UnionLength(unioned);
559  UnionedHandle new_unioned = Config::union_create(length, region);
560  for (int i = 0; i < length; ++i) {
561  Config::union_set(new_unioned, i,
562  Convert<OtherType>(OtherType::UnionGet(unioned, i), region));
563  }
564  return Config::from_union(new_unioned);
565  }
566 }
567 
568 
569 // TODO(rossberg): this does not belong here.
571  if (type->Is(Type::None())) return Representation::None();
572  if (type->Is(Type::SignedSmall())) return Representation::Smi();
573  if (type->Is(Type::Signed32())) return Representation::Integer32();
574  if (type->Is(Type::Number())) return Representation::Double();
575  return Representation::Tagged();
576 }
577 
578 
579 #ifdef OBJECT_PRINT
580 template<class Config>
581 void TypeImpl<Config>::TypePrint(PrintDimension dim) {
582  TypePrint(stdout, dim);
583  PrintF(stdout, "\n");
584  Flush(stdout);
585 }
586 
587 
588 template<class Config>
589 const char* TypeImpl<Config>::bitset_name(int bitset) {
590  switch (bitset) {
591  case kAny & kRepresentation: return "Any";
592  #define PRINT_COMPOSED_TYPE(type, value) \
593  case k##type & kRepresentation: return #type;
594  REPRESENTATION_BITSET_TYPE_LIST(PRINT_COMPOSED_TYPE)
595  #undef PRINT_COMPOSED_TYPE
596 
597  #define PRINT_COMPOSED_TYPE(type, value) \
598  case k##type & kSemantic: return #type;
599  SEMANTIC_BITSET_TYPE_LIST(PRINT_COMPOSED_TYPE)
600  #undef PRINT_COMPOSED_TYPE
601 
602  default:
603  return NULL;
604  }
605 }
606 
607 
608 template<class Config>
609 void TypeImpl<Config>::BitsetTypePrint(FILE* out, int bitset) {
610  const char* name = bitset_name(bitset);
611  if (name != NULL) {
612  PrintF(out, "%s", name);
613  } else {
614  static const int named_bitsets[] = {
615  #define BITSET_CONSTANT(type, value) k##type & kRepresentation,
616  REPRESENTATION_BITSET_TYPE_LIST(BITSET_CONSTANT)
617  #undef BITSET_CONSTANT
618 
619  #define BITSET_CONSTANT(type, value) k##type & kSemantic,
620  SEMANTIC_BITSET_TYPE_LIST(BITSET_CONSTANT)
621  #undef BITSET_CONSTANT
622  };
623 
624  bool is_first = true;
625  PrintF(out, "(");
626  for (int i(ARRAY_SIZE(named_bitsets) - 1); bitset != 0 && i >= 0; --i) {
627  int subset = named_bitsets[i];
628  if ((bitset & subset) == subset) {
629  if (!is_first) PrintF(out, " | ");
630  is_first = false;
631  PrintF(out, "%s", bitset_name(subset));
632  bitset -= subset;
633  }
634  }
635  ASSERT(bitset == 0);
636  PrintF(out, ")");
637  }
638 }
639 
640 
641 template<class Config>
642 void TypeImpl<Config>::TypePrint(FILE* out, PrintDimension dim) {
643  if (this->IsBitset()) {
644  int bitset = this->AsBitset();
645  switch (dim) {
646  case BOTH_DIMS:
647  BitsetTypePrint(out, bitset & kSemantic);
648  PrintF("/");
649  BitsetTypePrint(out, bitset & kRepresentation);
650  break;
651  case SEMANTIC_DIM:
652  BitsetTypePrint(out, bitset & kSemantic);
653  break;
654  case REPRESENTATION_DIM:
655  BitsetTypePrint(out, bitset & kRepresentation);
656  break;
657  }
658  } else if (this->IsConstant()) {
659  PrintF(out, "Constant(%p : ", static_cast<void*>(*this->AsConstant()));
660  Config::from_bitset(this->LubBitset())->TypePrint(out);
661  PrintF(")");
662  } else if (this->IsClass()) {
663  PrintF(out, "Class(%p < ", static_cast<void*>(*this->AsClass()));
664  Config::from_bitset(this->LubBitset())->TypePrint(out);
665  PrintF(")");
666  } else if (this->IsUnion()) {
667  PrintF(out, "(");
668  UnionedHandle unioned = this->AsUnion();
669  for (int i = 0; i < Config::union_length(unioned); ++i) {
670  TypeHandle type_i = Config::union_get(unioned, i);
671  if (i > 0) PrintF(out, " | ");
672  type_i->TypePrint(out);
673  }
674  PrintF(out, ")");
675  }
676 }
677 #endif
678 
679 
680 template class TypeImpl<ZoneTypeConfig>;
683 
684 template class TypeImpl<HeapTypeConfig>;
685 template class TypeImpl<HeapTypeConfig>::Iterator<i::Map>;
686 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>;
687 
690  TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*);
691 template TypeImpl<HeapTypeConfig>::TypeHandle
692  TypeImpl<HeapTypeConfig>::Convert<Type>(
693  TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*);
694 
695 
696 } } // 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
i::Handle< i::Map > AsClass()
Definition: types.h:262
static Representation Smi()
void PrintF(const char *format,...)
Definition: v8utils.cc:40
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 i::Handle< i::Map > current(typename TypeImpl< Config >::TypeHandle type)
Definition: types.cc:89
bool ToUint32(uint32_t *value)
Definition: objects.cc:200
static bool matches(typename TypeImpl< Config >::TypeHandle type)
Definition: types.cc:86
static HeapObject * cast(Object *obj)
static Representation Integer32()
#define SEMANTIC_BITSET_TYPE_LIST(V)
Definition: types.h:152
bool ToInt32(int32_t *value)
Definition: objects.cc:184
TypeImpl< ZoneTypeConfig > Type
int int32_t
Definition: unicode.cc:47
static bool matches(typename TypeImpl< Config >::TypeHandle type)
Definition: types.cc:96
#define ASSERT(condition)
Definition: checks.h:329
static bool matches(typename TypeImpl< Config >::TypeHandle type)
#define REPRESENTATION_BITSET_TYPE_LIST(V)
Definition: types.h:135
i::Handle< i::Object > AsConstant()
Definition: types.h:263
static Representation Double()
bool Maybe(TypeImpl *that)
Definition: types.cc:339
static Representation FromType(Type *type)
Definition: types.cc:570
static i::Handle< i::Object > current(typename TypeImpl< Config >::TypeHandle type)
Definition: types.cc:99
#define UNREACHABLE()
Definition: checks.h:52
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
Definition: v8.h:917
static bool IsValid(intptr_t value)
Definition: objects-inl.h:1278
static TypeHandle Convert(typename OtherTypeImpl::TypeHandle type, Region *region)
bool Is(Object *obj)
bool IsCurrently(TypeImpl *that)
Definition: types.cc:329
bool Is(TypeImpl *that)
Definition: types.h:246
Definition: v8.h:2107
static TypeHandle Intersect(TypeHandle type1, TypeHandle type2, Region *reg)
Definition: types.cc:495
Config::Region Region
Definition: types.h:222
Config::template Handle< TypeImpl >::type TypeHandle
Definition: types.h:221
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:103
bool is_undetectable()
Definition: objects.h:5921
InstanceType instance_type()
Definition: objects-inl.h:4012
static TypeHandle OfCurrently(i::Handle< i::Object > value, Region *region)
Definition: types.cc:274
static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region *reg)
Definition: types.cc:419
static Representation None()
static Representation Tagged()
T Min(T a, T b)
Definition: utils.h:234
void Flush(FILE *out)
Definition: v8utils.cc:65
TypeImpl< HeapTypeConfig > HeapType
Definition: list.h:212
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
#define ARRAY_SIZE(a)
Definition: globals.h:333
static i::Handle< T > current(typename TypeImpl< Config >::TypeHandle type)