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
objects-debug.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 "disassembler.h"
31 #include "disasm.h"
32 #include "jsregexp.h"
33 #include "macro-assembler.h"
34 #include "objects-visiting.h"
35 
36 namespace v8 {
37 namespace internal {
38 
39 #ifdef VERIFY_HEAP
40 
41 void MaybeObject::Verify() {
42  Object* this_as_object;
43  if (ToObject(&this_as_object)) {
44  if (this_as_object->IsSmi()) {
45  Smi::cast(this_as_object)->SmiVerify();
46  } else {
47  HeapObject::cast(this_as_object)->HeapObjectVerify();
48  }
49  } else {
50  Failure::cast(this)->FailureVerify();
51  }
52 }
53 
54 
55 void Object::VerifyPointer(Object* p) {
56  if (p->IsHeapObject()) {
57  HeapObject::VerifyHeapPointer(p);
58  } else {
59  CHECK(p->IsSmi());
60  }
61 }
62 
63 
64 void Smi::SmiVerify() {
65  CHECK(IsSmi());
66 }
67 
68 
69 void Failure::FailureVerify() {
70  CHECK(IsFailure());
71 }
72 
73 
74 void HeapObject::HeapObjectVerify() {
75  InstanceType instance_type = map()->instance_type();
76 
77  if (instance_type < FIRST_NONSTRING_TYPE) {
78  String::cast(this)->StringVerify();
79  return;
80  }
81 
82  switch (instance_type) {
83  case SYMBOL_TYPE:
84  Symbol::cast(this)->SymbolVerify();
85  break;
86  case MAP_TYPE:
87  Map::cast(this)->MapVerify();
88  break;
89  case HEAP_NUMBER_TYPE:
90  HeapNumber::cast(this)->HeapNumberVerify();
91  break;
92  case FIXED_ARRAY_TYPE:
93  FixedArray::cast(this)->FixedArrayVerify();
94  break;
96  FixedDoubleArray::cast(this)->FixedDoubleArrayVerify();
97  break;
99  ConstantPoolArray::cast(this)->ConstantPoolArrayVerify();
100  break;
101  case BYTE_ARRAY_TYPE:
102  ByteArray::cast(this)->ByteArrayVerify();
103  break;
104  case FREE_SPACE_TYPE:
105  FreeSpace::cast(this)->FreeSpaceVerify();
106  break;
107 
108 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \
109  case EXTERNAL_##TYPE##_ARRAY_TYPE: \
110  External##Type##Array::cast(this)->External##Type##ArrayVerify(); \
111  break; \
112  case FIXED_##TYPE##_ARRAY_TYPE: \
113  Fixed##Type##Array::cast(this)->FixedTypedArrayVerify(); \
114  break;
115 
116  TYPED_ARRAYS(VERIFY_TYPED_ARRAY)
117 #undef VERIFY_TYPED_ARRAY
118 
119  case CODE_TYPE:
120  Code::cast(this)->CodeVerify();
121  break;
122  case ODDBALL_TYPE:
123  Oddball::cast(this)->OddballVerify();
124  break;
125  case JS_OBJECT_TYPE:
127  JSObject::cast(this)->JSObjectVerify();
128  break;
130  JSGeneratorObject::cast(this)->JSGeneratorObjectVerify();
131  break;
132  case JS_MODULE_TYPE:
133  JSModule::cast(this)->JSModuleVerify();
134  break;
135  case JS_VALUE_TYPE:
136  JSValue::cast(this)->JSValueVerify();
137  break;
138  case JS_DATE_TYPE:
139  JSDate::cast(this)->JSDateVerify();
140  break;
141  case JS_FUNCTION_TYPE:
142  JSFunction::cast(this)->JSFunctionVerify();
143  break;
145  JSGlobalProxy::cast(this)->JSGlobalProxyVerify();
146  break;
148  JSGlobalObject::cast(this)->JSGlobalObjectVerify();
149  break;
151  JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify();
152  break;
153  case CELL_TYPE:
154  Cell::cast(this)->CellVerify();
155  break;
156  case PROPERTY_CELL_TYPE:
157  PropertyCell::cast(this)->PropertyCellVerify();
158  break;
159  case JS_ARRAY_TYPE:
160  JSArray::cast(this)->JSArrayVerify();
161  break;
162  case JS_SET_TYPE:
163  JSSet::cast(this)->JSSetVerify();
164  break;
165  case JS_MAP_TYPE:
166  JSMap::cast(this)->JSMapVerify();
167  break;
168  case JS_WEAK_MAP_TYPE:
169  JSWeakMap::cast(this)->JSWeakMapVerify();
170  break;
171  case JS_WEAK_SET_TYPE:
172  JSWeakSet::cast(this)->JSWeakSetVerify();
173  break;
174  case JS_REGEXP_TYPE:
175  JSRegExp::cast(this)->JSRegExpVerify();
176  break;
177  case FILLER_TYPE:
178  break;
179  case JS_PROXY_TYPE:
180  JSProxy::cast(this)->JSProxyVerify();
181  break;
183  JSFunctionProxy::cast(this)->JSFunctionProxyVerify();
184  break;
185  case FOREIGN_TYPE:
186  Foreign::cast(this)->ForeignVerify();
187  break;
189  SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify();
190  break;
192  JSMessageObject::cast(this)->JSMessageObjectVerify();
193  break;
195  JSArrayBuffer::cast(this)->JSArrayBufferVerify();
196  break;
197  case JS_TYPED_ARRAY_TYPE:
198  JSTypedArray::cast(this)->JSTypedArrayVerify();
199  break;
200  case JS_DATA_VIEW_TYPE:
201  JSDataView::cast(this)->JSDataViewVerify();
202  break;
203 
204 #define MAKE_STRUCT_CASE(NAME, Name, name) \
205  case NAME##_TYPE: \
206  Name::cast(this)->Name##Verify(); \
207  break;
209 #undef MAKE_STRUCT_CASE
210 
211  default:
212  UNREACHABLE();
213  break;
214  }
215 }
216 
217 
218 void HeapObject::VerifyHeapPointer(Object* p) {
219  CHECK(p->IsHeapObject());
220  HeapObject* ho = HeapObject::cast(p);
221  CHECK(ho->GetHeap()->Contains(ho));
222 }
223 
224 
225 void Symbol::SymbolVerify() {
226  CHECK(IsSymbol());
227  CHECK(HasHashCode());
228  CHECK_GT(Hash(), 0);
229  CHECK(name()->IsUndefined() || name()->IsString());
230  CHECK(flags()->IsSmi());
231 }
232 
233 
234 void HeapNumber::HeapNumberVerify() {
235  CHECK(IsHeapNumber());
236 }
237 
238 
239 void ByteArray::ByteArrayVerify() {
240  CHECK(IsByteArray());
241 }
242 
243 
244 void FreeSpace::FreeSpaceVerify() {
245  CHECK(IsFreeSpace());
246 }
247 
248 
249 #define EXTERNAL_ARRAY_VERIFY(Type, type, TYPE, ctype, size) \
250  void External##Type##Array::External##Type##ArrayVerify() { \
251  CHECK(IsExternal##Type##Array()); \
252  }
253 
254 TYPED_ARRAYS(EXTERNAL_ARRAY_VERIFY)
255 #undef EXTERNAL_ARRAY_VERIFY
256 
257 
258 template <class Traits>
259 void FixedTypedArray<Traits>::FixedTypedArrayVerify() {
260  CHECK(IsHeapObject() &&
261  HeapObject::cast(this)->map()->instance_type() ==
262  Traits::kInstanceType);
263 }
264 
265 
266 bool JSObject::ElementsAreSafeToExamine() {
267  // If a GC was caused while constructing this object, the elements
268  // pointer may point to a one pointer filler map.
269  return reinterpret_cast<Map*>(elements()) !=
270  GetHeap()->one_pointer_filler_map();
271 }
272 
273 
274 void JSObject::JSObjectVerify() {
275  VerifyHeapPointer(properties());
276  VerifyHeapPointer(elements());
277 
279  CHECK(this->elements()->IsFixedArray());
280  CHECK_GE(this->elements()->length(), 2);
281  }
282 
283  if (HasFastProperties()) {
284  CHECK_EQ(map()->unused_property_fields(),
285  (map()->inobject_properties() + properties()->length() -
286  map()->NextFreePropertyIndex()));
287  DescriptorArray* descriptors = map()->instance_descriptors();
288  for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
289  if (descriptors->GetDetails(i).type() == FIELD) {
290  Representation r = descriptors->GetDetails(i).representation();
291  int field = descriptors->GetFieldIndex(i);
292  Object* value = RawFastPropertyAt(field);
293  if (r.IsDouble()) ASSERT(value->IsHeapNumber());
294  if (value->IsUninitialized()) continue;
295  if (r.IsSmi()) ASSERT(value->IsSmi());
296  if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
297  }
298  }
299  }
300 
301  // If a GC was caused while constructing this object, the elements
302  // pointer may point to a one pointer filler map.
303  if (ElementsAreSafeToExamine()) {
304  CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
305  (elements() == GetHeap()->empty_fixed_array())),
306  (elements()->map() == GetHeap()->fixed_array_map() ||
307  elements()->map() == GetHeap()->fixed_cow_array_map()));
308  CHECK(map()->has_fast_object_elements() == HasFastObjectElements());
309  }
310 }
311 
312 
313 void Map::MapVerify() {
314  Heap* heap = GetHeap();
315  CHECK(!heap->InNewSpace(this));
318  (kPointerSize <= instance_size() &&
319  instance_size() < heap->Capacity()));
320  VerifyHeapPointer(prototype());
321  VerifyHeapPointer(instance_descriptors());
322  SLOW_ASSERT(instance_descriptors()->IsSortedNoDuplicates());
323  if (HasTransitionArray()) {
324  SLOW_ASSERT(transitions()->IsSortedNoDuplicates());
325  SLOW_ASSERT(transitions()->IsConsistentWithBackPointers(this));
326  }
327 }
328 
329 
330 void Map::SharedMapVerify() {
331  MapVerify();
332  CHECK(is_shared());
333  CHECK(instance_descriptors()->IsEmpty());
337  visitor_id());
338 }
339 
340 
341 void Map::VerifyOmittedMapChecks() {
342  if (!FLAG_omit_map_checks_for_leaf_maps) return;
343  if (!is_stable() ||
344  is_deprecated() ||
345  HasTransitionArray() ||
346  is_dictionary_map()) {
347  CHECK_EQ(0, dependent_code()->number_of_entries(
349  }
350 }
351 
352 
353 void CodeCache::CodeCacheVerify() {
354  VerifyHeapPointer(default_cache());
355  VerifyHeapPointer(normal_type_cache());
356  CHECK(default_cache()->IsFixedArray());
357  CHECK(normal_type_cache()->IsUndefined()
358  || normal_type_cache()->IsCodeCacheHashTable());
359 }
360 
361 
362 void PolymorphicCodeCache::PolymorphicCodeCacheVerify() {
363  VerifyHeapPointer(cache());
364  CHECK(cache()->IsUndefined() || cache()->IsPolymorphicCodeCacheHashTable());
365 }
366 
367 
368 void TypeFeedbackInfo::TypeFeedbackInfoVerify() {
369  VerifyObjectField(kStorage1Offset);
370  VerifyObjectField(kStorage2Offset);
371  VerifyHeapPointer(feedback_vector());
372 }
373 
374 
375 void AliasedArgumentsEntry::AliasedArgumentsEntryVerify() {
376  VerifySmiField(kAliasedContextSlot);
377 }
378 
379 
380 void FixedArray::FixedArrayVerify() {
381  for (int i = 0; i < length(); i++) {
382  Object* e = get(i);
383  if (e->IsHeapObject()) {
384  VerifyHeapPointer(e);
385  } else {
386  e->Verify();
387  }
388  }
389 }
390 
391 
392 void FixedDoubleArray::FixedDoubleArrayVerify() {
393  for (int i = 0; i < length(); i++) {
394  if (!is_the_hole(i)) {
395  double value = get_scalar(i);
396  CHECK(!std::isnan(value) ||
397  (BitCast<uint64_t>(value) ==
398  BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) ||
399  ((BitCast<uint64_t>(value) & Double::kSignMask) != 0));
400  }
401  }
402 }
403 
404 
405 void ConstantPoolArray::ConstantPoolArrayVerify() {
406  CHECK(IsConstantPoolArray());
407  for (int i = 0; i < count_of_code_ptr_entries(); i++) {
408  Address code_entry = get_code_ptr_entry(first_code_ptr_index() + i);
409  VerifyPointer(Code::GetCodeFromTargetAddress(code_entry));
410  }
411  for (int i = 0; i < count_of_heap_ptr_entries(); i++) {
412  VerifyObjectField(OffsetOfElementAt(first_heap_ptr_index() + i));
413  }
414 }
415 
416 
417 void JSGeneratorObject::JSGeneratorObjectVerify() {
418  // In an expression like "new g()", there can be a point where a generator
419  // object is allocated but its fields are all undefined, as it hasn't yet been
420  // initialized by the generator. Hence these weak checks.
421  VerifyObjectField(kFunctionOffset);
422  VerifyObjectField(kContextOffset);
423  VerifyObjectField(kReceiverOffset);
424  VerifyObjectField(kOperandStackOffset);
425  VerifyObjectField(kContinuationOffset);
426  VerifyObjectField(kStackHandlerIndexOffset);
427 }
428 
429 
430 void JSModule::JSModuleVerify() {
431  VerifyObjectField(kContextOffset);
432  VerifyObjectField(kScopeInfoOffset);
433  CHECK(context()->IsUndefined() ||
434  Context::cast(context())->IsModuleContext());
435 }
436 
437 
438 void JSValue::JSValueVerify() {
439  Object* v = value();
440  if (v->IsHeapObject()) {
441  VerifyHeapPointer(v);
442  }
443 }
444 
445 
446 void JSDate::JSDateVerify() {
447  if (value()->IsHeapObject()) {
448  VerifyHeapPointer(value());
449  }
450  CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber());
451  CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN());
452  CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN());
453  CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN());
454  CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN());
455  CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN());
456  CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN());
457  CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN());
458  CHECK(cache_stamp()->IsUndefined() ||
459  cache_stamp()->IsSmi() ||
460  cache_stamp()->IsNaN());
461 
462  if (month()->IsSmi()) {
463  int month = Smi::cast(this->month())->value();
464  CHECK(0 <= month && month <= 11);
465  }
466  if (day()->IsSmi()) {
467  int day = Smi::cast(this->day())->value();
468  CHECK(1 <= day && day <= 31);
469  }
470  if (hour()->IsSmi()) {
471  int hour = Smi::cast(this->hour())->value();
472  CHECK(0 <= hour && hour <= 23);
473  }
474  if (min()->IsSmi()) {
475  int min = Smi::cast(this->min())->value();
476  CHECK(0 <= min && min <= 59);
477  }
478  if (sec()->IsSmi()) {
479  int sec = Smi::cast(this->sec())->value();
480  CHECK(0 <= sec && sec <= 59);
481  }
482  if (weekday()->IsSmi()) {
483  int weekday = Smi::cast(this->weekday())->value();
484  CHECK(0 <= weekday && weekday <= 6);
485  }
486  if (cache_stamp()->IsSmi()) {
487  CHECK(Smi::cast(cache_stamp())->value() <=
488  Smi::cast(GetIsolate()->date_cache()->stamp())->value());
489  }
490 }
491 
492 
493 void JSMessageObject::JSMessageObjectVerify() {
494  CHECK(IsJSMessageObject());
495  CHECK(type()->IsString());
496  CHECK(arguments()->IsJSArray());
497  VerifyObjectField(kStartPositionOffset);
498  VerifyObjectField(kEndPositionOffset);
499  VerifyObjectField(kArgumentsOffset);
500  VerifyObjectField(kScriptOffset);
501  VerifyObjectField(kStackFramesOffset);
502 }
503 
504 
505 void String::StringVerify() {
506  CHECK(IsString());
507  CHECK(length() >= 0 && length() <= Smi::kMaxValue);
508  if (IsInternalizedString()) {
509  CHECK(!GetHeap()->InNewSpace(this));
510  }
511  if (IsConsString()) {
512  ConsString::cast(this)->ConsStringVerify();
513  } else if (IsSlicedString()) {
514  SlicedString::cast(this)->SlicedStringVerify();
515  }
516 }
517 
518 
519 void ConsString::ConsStringVerify() {
520  CHECK(this->first()->IsString());
521  CHECK(this->second() == GetHeap()->empty_string() ||
522  this->second()->IsString());
523  CHECK(this->length() >= ConsString::kMinLength);
524  if (this->IsFlat()) {
525  // A flat cons can only be created by String::SlowTryFlatten.
526  // Afterwards, the first part may be externalized.
527  CHECK(this->first()->IsSeqString() || this->first()->IsExternalString());
528  }
529 }
530 
531 
532 void SlicedString::SlicedStringVerify() {
533  CHECK(!this->parent()->IsConsString());
534  CHECK(!this->parent()->IsSlicedString());
536 }
537 
538 
539 void JSFunction::JSFunctionVerify() {
540  CHECK(IsJSFunction());
541  VerifyObjectField(kPrototypeOrInitialMapOffset);
542  VerifyObjectField(kNextFunctionLinkOffset);
543  CHECK(code()->IsCode());
544  CHECK(next_function_link() == NULL ||
545  next_function_link()->IsUndefined() ||
546  next_function_link()->IsJSFunction());
547 }
548 
549 
550 void SharedFunctionInfo::SharedFunctionInfoVerify() {
551  CHECK(IsSharedFunctionInfo());
552  VerifyObjectField(kNameOffset);
553  VerifyObjectField(kCodeOffset);
554  VerifyObjectField(kOptimizedCodeMapOffset);
555  VerifyObjectField(kScopeInfoOffset);
556  VerifyObjectField(kInstanceClassNameOffset);
557  VerifyObjectField(kFunctionDataOffset);
558  VerifyObjectField(kScriptOffset);
559  VerifyObjectField(kDebugInfoOffset);
560 }
561 
562 
563 void JSGlobalProxy::JSGlobalProxyVerify() {
564  CHECK(IsJSGlobalProxy());
565  JSObjectVerify();
566  VerifyObjectField(JSGlobalProxy::kNativeContextOffset);
567  // Make sure that this object has no properties, elements.
568  CHECK_EQ(0, properties()->length());
570  CHECK_EQ(0, FixedArray::cast(elements())->length());
571 }
572 
573 
574 void JSGlobalObject::JSGlobalObjectVerify() {
575  CHECK(IsJSGlobalObject());
576  JSObjectVerify();
577  for (int i = GlobalObject::kBuiltinsOffset;
579  i += kPointerSize) {
580  VerifyObjectField(i);
581  }
582 }
583 
584 
585 void JSBuiltinsObject::JSBuiltinsObjectVerify() {
586  CHECK(IsJSBuiltinsObject());
587  JSObjectVerify();
588  for (int i = GlobalObject::kBuiltinsOffset;
590  i += kPointerSize) {
591  VerifyObjectField(i);
592  }
593 }
594 
595 
596 void Oddball::OddballVerify() {
597  CHECK(IsOddball());
598  VerifyHeapPointer(to_string());
599  Object* number = to_number();
600  if (number->IsHeapObject()) {
601  CHECK(number == HeapObject::cast(number)->GetHeap()->nan_value());
602  } else {
603  CHECK(number->IsSmi());
604  int value = Smi::cast(number)->value();
605  // Hidden oddballs have negative smis.
606  const int kLeastHiddenOddballNumber = -4;
607  CHECK_LE(value, 1);
608  CHECK(value >= kLeastHiddenOddballNumber);
609  }
610 }
611 
612 
613 void Cell::CellVerify() {
614  CHECK(IsCell());
615  VerifyObjectField(kValueOffset);
616 }
617 
618 
619 void PropertyCell::PropertyCellVerify() {
620  CHECK(IsPropertyCell());
621  VerifyObjectField(kValueOffset);
622  VerifyObjectField(kTypeOffset);
623 }
624 
625 
626 void Code::CodeVerify() {
627  CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()),
628  kCodeAlignment));
629  relocation_info()->Verify();
630  Address last_gc_pc = NULL;
631  for (RelocIterator it(this); !it.done(); it.next()) {
632  it.rinfo()->Verify();
633  // Ensure that GC will not iterate twice over the same pointer.
634  if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) {
635  CHECK(it.rinfo()->pc() != last_gc_pc);
636  last_gc_pc = it.rinfo()->pc();
637  }
638  }
639 }
640 
641 
642 void Code::VerifyEmbeddedObjectsDependency() {
643  int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
644  for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
645  Object* obj = it.rinfo()->target_object();
646  if (IsWeakObject(obj)) {
647  if (obj->IsMap()) {
648  Map* map = Map::cast(obj);
649  CHECK(map->dependent_code()->Contains(
651  } else if (obj->IsJSObject()) {
652  Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table();
653  WeakHashTable* table = WeakHashTable::cast(raw_table);
654  CHECK(DependentCode::cast(table->Lookup(obj))->Contains(
656  }
657  }
658  }
659 }
660 
661 
662 void JSArray::JSArrayVerify() {
663  JSObjectVerify();
664  CHECK(length()->IsNumber() || length()->IsUndefined());
665  // If a GC was caused while constructing this array, the elements
666  // pointer may point to a one pointer filler map.
667  if (ElementsAreSafeToExamine()) {
668  CHECK(elements()->IsUndefined() ||
669  elements()->IsFixedArray() ||
670  elements()->IsFixedDoubleArray());
671  }
672 }
673 
674 
675 void JSSet::JSSetVerify() {
676  CHECK(IsJSSet());
677  JSObjectVerify();
678  VerifyHeapPointer(table());
679  CHECK(table()->IsHashTable() || table()->IsUndefined());
680 }
681 
682 
683 void JSMap::JSMapVerify() {
684  CHECK(IsJSMap());
685  JSObjectVerify();
686  VerifyHeapPointer(table());
687  CHECK(table()->IsHashTable() || table()->IsUndefined());
688 }
689 
690 
691 void JSWeakMap::JSWeakMapVerify() {
692  CHECK(IsJSWeakMap());
693  JSObjectVerify();
694  VerifyHeapPointer(table());
695  CHECK(table()->IsHashTable() || table()->IsUndefined());
696 }
697 
698 
699 void JSWeakSet::JSWeakSetVerify() {
700  CHECK(IsJSWeakSet());
701  JSObjectVerify();
702  VerifyHeapPointer(table());
703  CHECK(table()->IsHashTable() || table()->IsUndefined());
704 }
705 
706 
707 void JSRegExp::JSRegExpVerify() {
708  JSObjectVerify();
709  CHECK(data()->IsUndefined() || data()->IsFixedArray());
710  switch (TypeTag()) {
711  case JSRegExp::ATOM: {
712  FixedArray* arr = FixedArray::cast(data());
713  CHECK(arr->get(JSRegExp::kAtomPatternIndex)->IsString());
714  break;
715  }
716  case JSRegExp::IRREGEXP: {
717  bool is_native = RegExpImpl::UsesNativeRegExp();
718 
719  FixedArray* arr = FixedArray::cast(data());
720  Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex);
721  // Smi : Not compiled yet (-1) or code prepared for flushing.
722  // JSObject: Compilation error.
723  // Code/ByteArray: Compiled code.
724  CHECK(ascii_data->IsSmi() ||
725  (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray()));
726  Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex);
727  CHECK(uc16_data->IsSmi() ||
728  (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray()));
729 
730  Object* ascii_saved = arr->get(JSRegExp::kIrregexpASCIICodeSavedIndex);
731  CHECK(ascii_saved->IsSmi() || ascii_saved->IsString() ||
732  ascii_saved->IsCode());
733  Object* uc16_saved = arr->get(JSRegExp::kIrregexpUC16CodeSavedIndex);
734  CHECK(uc16_saved->IsSmi() || uc16_saved->IsString() ||
735  uc16_saved->IsCode());
736 
737  CHECK(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi());
739  break;
740  }
741  default:
743  CHECK(data()->IsUndefined());
744  break;
745  }
746 }
747 
748 
749 void JSProxy::JSProxyVerify() {
750  CHECK(IsJSProxy());
751  VerifyPointer(handler());
752  CHECK(hash()->IsSmi() || hash()->IsUndefined());
753 }
754 
755 
756 void JSFunctionProxy::JSFunctionProxyVerify() {
757  CHECK(IsJSFunctionProxy());
758  JSProxyVerify();
759  VerifyPointer(call_trap());
760  VerifyPointer(construct_trap());
761 }
762 
763 
764 void JSArrayBuffer::JSArrayBufferVerify() {
765  CHECK(IsJSArrayBuffer());
766  JSObjectVerify();
767  VerifyPointer(byte_length());
768  CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
769  || byte_length()->IsUndefined());
770 }
771 
772 
773 void JSArrayBufferView::JSArrayBufferViewVerify() {
774  CHECK(IsJSArrayBufferView());
775  JSObjectVerify();
776  VerifyPointer(buffer());
777  CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()
778  || buffer() == Smi::FromInt(0));
779 
780  VerifyPointer(byte_offset());
781  CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber()
782  || byte_offset()->IsUndefined());
783 
784  VerifyPointer(byte_length());
785  CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
786  || byte_length()->IsUndefined());
787 }
788 
789 
790 void JSTypedArray::JSTypedArrayVerify() {
791  CHECK(IsJSTypedArray());
792  JSArrayBufferViewVerify();
793  VerifyPointer(length());
794  CHECK(length()->IsSmi() || length()->IsHeapNumber()
795  || length()->IsUndefined());
796 
797  VerifyPointer(elements());
798 }
799 
800 
801 void JSDataView::JSDataViewVerify() {
802  CHECK(IsJSDataView());
803  JSArrayBufferViewVerify();
804 }
805 
806 
807 void Foreign::ForeignVerify() {
808  CHECK(IsForeign());
809 }
810 
811 
812 void Box::BoxVerify() {
813  CHECK(IsBox());
814  value()->Verify();
815 }
816 
817 
818 void AccessorInfo::AccessorInfoVerify() {
819  VerifyPointer(name());
820  VerifyPointer(flag());
821  VerifyPointer(expected_receiver_type());
822 }
823 
824 
825 void ExecutableAccessorInfo::ExecutableAccessorInfoVerify() {
826  CHECK(IsExecutableAccessorInfo());
827  AccessorInfoVerify();
828  VerifyPointer(getter());
829  VerifyPointer(setter());
830  VerifyPointer(data());
831 }
832 
833 
834 void DeclaredAccessorDescriptor::DeclaredAccessorDescriptorVerify() {
835  CHECK(IsDeclaredAccessorDescriptor());
836  VerifyPointer(serialized_data());
837 }
838 
839 
840 void DeclaredAccessorInfo::DeclaredAccessorInfoVerify() {
841  CHECK(IsDeclaredAccessorInfo());
842  AccessorInfoVerify();
843  VerifyPointer(descriptor());
844 }
845 
846 
847 void AccessorPair::AccessorPairVerify() {
848  CHECK(IsAccessorPair());
849  VerifyPointer(getter());
850  VerifyPointer(setter());
851  VerifySmiField(kAccessFlagsOffset);
852 }
853 
854 
855 void AccessCheckInfo::AccessCheckInfoVerify() {
856  CHECK(IsAccessCheckInfo());
857  VerifyPointer(named_callback());
858  VerifyPointer(indexed_callback());
859  VerifyPointer(data());
860 }
861 
862 
863 void InterceptorInfo::InterceptorInfoVerify() {
864  CHECK(IsInterceptorInfo());
865  VerifyPointer(getter());
866  VerifyPointer(setter());
867  VerifyPointer(query());
868  VerifyPointer(deleter());
869  VerifyPointer(enumerator());
870  VerifyPointer(data());
871 }
872 
873 
874 void CallHandlerInfo::CallHandlerInfoVerify() {
875  CHECK(IsCallHandlerInfo());
876  VerifyPointer(callback());
877  VerifyPointer(data());
878 }
879 
880 
881 void TemplateInfo::TemplateInfoVerify() {
882  VerifyPointer(tag());
883  VerifyPointer(property_list());
884  VerifyPointer(property_accessors());
885 }
886 
887 
888 void FunctionTemplateInfo::FunctionTemplateInfoVerify() {
889  CHECK(IsFunctionTemplateInfo());
890  TemplateInfoVerify();
891  VerifyPointer(serial_number());
892  VerifyPointer(call_code());
893  VerifyPointer(prototype_template());
894  VerifyPointer(parent_template());
895  VerifyPointer(named_property_handler());
896  VerifyPointer(indexed_property_handler());
897  VerifyPointer(instance_template());
898  VerifyPointer(signature());
899  VerifyPointer(access_check_info());
900 }
901 
902 
903 void ObjectTemplateInfo::ObjectTemplateInfoVerify() {
904  CHECK(IsObjectTemplateInfo());
905  TemplateInfoVerify();
906  VerifyPointer(constructor());
907  VerifyPointer(internal_field_count());
908 }
909 
910 
911 void SignatureInfo::SignatureInfoVerify() {
912  CHECK(IsSignatureInfo());
913  VerifyPointer(receiver());
914  VerifyPointer(args());
915 }
916 
917 
918 void TypeSwitchInfo::TypeSwitchInfoVerify() {
919  CHECK(IsTypeSwitchInfo());
920  VerifyPointer(types());
921 }
922 
923 
924 void AllocationSite::AllocationSiteVerify() {
925  CHECK(IsAllocationSite());
926 }
927 
928 
929 void AllocationMemento::AllocationMementoVerify() {
930  CHECK(IsAllocationMemento());
931  VerifyHeapPointer(allocation_site());
932  CHECK(!IsValid() || GetAllocationSite()->IsAllocationSite());
933 }
934 
935 
936 void Script::ScriptVerify() {
937  CHECK(IsScript());
938  VerifyPointer(source());
939  VerifyPointer(name());
940  line_offset()->SmiVerify();
941  column_offset()->SmiVerify();
942  VerifyPointer(wrapper());
943  type()->SmiVerify();
944  VerifyPointer(line_ends());
945  VerifyPointer(id());
946 }
947 
948 
949 void JSFunctionResultCache::JSFunctionResultCacheVerify() {
950  JSFunction::cast(get(kFactoryIndex))->Verify();
951 
952  int size = Smi::cast(get(kCacheSizeIndex))->value();
953  CHECK(kEntriesIndex <= size);
954  CHECK(size <= length());
955  CHECK_EQ(0, size % kEntrySize);
956 
957  int finger = Smi::cast(get(kFingerIndex))->value();
958  CHECK(kEntriesIndex <= finger);
959  CHECK((finger < size) || (finger == kEntriesIndex && finger == size));
960  CHECK_EQ(0, finger % kEntrySize);
961 
963  for (int i = kEntriesIndex; i < size; i++) {
964  CHECK(!get(i)->IsTheHole());
965  get(i)->Verify();
966  }
967  for (int i = size; i < length(); i++) {
968  CHECK(get(i)->IsTheHole());
969  get(i)->Verify();
970  }
971  }
972 }
973 
974 
975 void NormalizedMapCache::NormalizedMapCacheVerify() {
976  FixedArray::cast(this)->Verify();
978  for (int i = 0; i < length(); i++) {
979  Object* e = get(i);
980  if (e->IsMap()) {
981  Map::cast(e)->SharedMapVerify();
982  } else {
983  CHECK(e->IsUndefined());
984  }
985  }
986  }
987 }
988 
989 
990 #ifdef ENABLE_DEBUGGER_SUPPORT
991 void DebugInfo::DebugInfoVerify() {
992  CHECK(IsDebugInfo());
993  VerifyPointer(shared());
994  VerifyPointer(original_code());
995  VerifyPointer(code());
996  VerifyPointer(break_points());
997 }
998 
999 
1000 void BreakPointInfo::BreakPointInfoVerify() {
1001  CHECK(IsBreakPointInfo());
1002  code_position()->SmiVerify();
1003  source_position()->SmiVerify();
1004  statement_position()->SmiVerify();
1005  VerifyPointer(break_point_objects());
1006 }
1007 #endif // ENABLE_DEBUGGER_SUPPORT
1008 #endif // VERIFY_HEAP
1009 
1010 #ifdef DEBUG
1011 
1012 void JSObject::IncrementSpillStatistics(SpillInformation* info) {
1013  info->number_of_objects_++;
1014  // Named properties
1015  if (HasFastProperties()) {
1016  info->number_of_objects_with_fast_properties_++;
1017  info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex();
1018  info->number_of_fast_unused_fields_ += map()->unused_property_fields();
1019  } else {
1020  NameDictionary* dict = property_dictionary();
1021  info->number_of_slow_used_properties_ += dict->NumberOfElements();
1022  info->number_of_slow_unused_properties_ +=
1023  dict->Capacity() - dict->NumberOfElements();
1024  }
1025  // Indexed properties
1026  switch (GetElementsKind()) {
1028  case FAST_SMI_ELEMENTS:
1030  case FAST_DOUBLE_ELEMENTS:
1031  case FAST_HOLEY_ELEMENTS:
1032  case FAST_ELEMENTS: {
1033  info->number_of_objects_with_fast_elements_++;
1034  int holes = 0;
1035  FixedArray* e = FixedArray::cast(elements());
1036  int len = e->length();
1037  Heap* heap = GetHeap();
1038  for (int i = 0; i < len; i++) {
1039  if (e->get(i) == heap->the_hole_value()) holes++;
1040  }
1041  info->number_of_fast_used_elements_ += len - holes;
1042  info->number_of_fast_unused_elements_ += holes;
1043  break;
1044  }
1045 
1046 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
1047  case EXTERNAL_##TYPE##_ELEMENTS: \
1048  case TYPE##_ELEMENTS:
1049 
1051 #undef TYPED_ARRAY_CASE
1052  { info->number_of_objects_with_fast_elements_++;
1053  FixedArrayBase* e = FixedArrayBase::cast(elements());
1054  info->number_of_fast_used_elements_ += e->length();
1055  break;
1056  }
1057  case DICTIONARY_ELEMENTS: {
1058  SeededNumberDictionary* dict = element_dictionary();
1059  info->number_of_slow_used_elements_ += dict->NumberOfElements();
1060  info->number_of_slow_unused_elements_ +=
1061  dict->Capacity() - dict->NumberOfElements();
1062  break;
1063  }
1065  break;
1066  }
1067 }
1068 
1069 
1070 void JSObject::SpillInformation::Clear() {
1071  number_of_objects_ = 0;
1072  number_of_objects_with_fast_properties_ = 0;
1073  number_of_objects_with_fast_elements_ = 0;
1074  number_of_fast_used_fields_ = 0;
1075  number_of_fast_unused_fields_ = 0;
1076  number_of_slow_used_properties_ = 0;
1077  number_of_slow_unused_properties_ = 0;
1078  number_of_fast_used_elements_ = 0;
1079  number_of_fast_unused_elements_ = 0;
1080  number_of_slow_used_elements_ = 0;
1081  number_of_slow_unused_elements_ = 0;
1082 }
1083 
1084 
1086  PrintF("\n JSObject Spill Statistics (#%d):\n", number_of_objects_);
1087 
1088  PrintF(" - fast properties (#%d): %d (used) %d (unused)\n",
1089  number_of_objects_with_fast_properties_,
1090  number_of_fast_used_fields_, number_of_fast_unused_fields_);
1091 
1092  PrintF(" - slow properties (#%d): %d (used) %d (unused)\n",
1093  number_of_objects_ - number_of_objects_with_fast_properties_,
1094  number_of_slow_used_properties_, number_of_slow_unused_properties_);
1095 
1096  PrintF(" - fast elements (#%d): %d (used) %d (unused)\n",
1097  number_of_objects_with_fast_elements_,
1098  number_of_fast_used_elements_, number_of_fast_unused_elements_);
1099 
1100  PrintF(" - slow elements (#%d): %d (used) %d (unused)\n",
1101  number_of_objects_ - number_of_objects_with_fast_elements_,
1102  number_of_slow_used_elements_, number_of_slow_unused_elements_);
1103 
1104  PrintF("\n");
1105 }
1106 
1107 
1108 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) {
1109  if (valid_entries == -1) valid_entries = number_of_descriptors();
1110  Name* current_key = NULL;
1111  uint32_t current = 0;
1112  for (int i = 0; i < number_of_descriptors(); i++) {
1113  Name* key = GetSortedKey(i);
1114  if (key == current_key) {
1115  PrintDescriptors();
1116  return false;
1117  }
1118  current_key = key;
1119  uint32_t hash = GetSortedKey(i)->Hash();
1120  if (hash < current) {
1121  PrintDescriptors();
1122  return false;
1123  }
1124  current = hash;
1125  }
1126  return true;
1127 }
1128 
1129 
1130 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) {
1131  ASSERT(valid_entries == -1);
1132  Name* current_key = NULL;
1133  uint32_t current = 0;
1134  for (int i = 0; i < number_of_transitions(); i++) {
1135  Name* key = GetSortedKey(i);
1136  if (key == current_key) {
1137  PrintTransitions();
1138  return false;
1139  }
1140  current_key = key;
1141  uint32_t hash = GetSortedKey(i)->Hash();
1142  if (hash < current) {
1143  PrintTransitions();
1144  return false;
1145  }
1146  current = hash;
1147  }
1148  return true;
1149 }
1150 
1151 
1152 static bool CheckOneBackPointer(Map* current_map, Object* target) {
1153  return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map;
1154 }
1155 
1156 
1157 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) {
1158  for (int i = 0; i < number_of_transitions(); ++i) {
1159  if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1160  }
1161  return true;
1162 }
1163 
1164 
1165 #endif // DEBUG
1166 
1167 } } // namespace v8::internal
static const int kFunctionOffset
Definition: objects.h:7324
static const int kStartPositionOffset
Definition: objects.h:7843
byte * Address
Definition: globals.h:186
static const int kArgumentsOffset
Definition: objects.h:7840
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
static const int kScopeInfoOffset
Definition: objects.h:7370
static const int kTypeOffset
Definition: objects.h:9597
#define SLOW_ASSERT(condition)
Definition: checks.h:306
static const int kCodeOffset
Definition: objects.h:7103
#define CHECK_EQ(expected, value)
Definition: checks.h:252
static ConstantPoolArray * cast(Object *obj)
static const int kIrregexpMaxRegisterCountIndex
Definition: objects.h:7954
static const int kPrototypeOrInitialMapOffset
Definition: objects.h:7519
static const int kCacheSizeIndex
Definition: objects.h:4327
static const int kValueOffset
Definition: objects.h:9547
static const int kBuiltinsOffset
Definition: objects.h:7610
AllocationSite * GetAllocationSite()
Definition: objects.h:8452
void PrintF(const char *format,...)
Definition: v8utils.cc:40
static const int kSize
Definition: objects.h:7671
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 String * cast(Object *obj)
int unused_property_fields()
Definition: objects-inl.h:4022
static Smi * FromInt(int value)
Definition: objects-inl.h:1209
static const int kStorage2Offset
Definition: objects.h:8210
#define CHECK_GT(a, b)
Definition: checks.h:260
int NumberOfOwnDescriptors()
Definition: objects.h:6174
static const int kOptimizedCodeMapOffset
Definition: objects.h:7104
static HeapObject * cast(Object *obj)
static JSBuiltinsObject * cast(Object *obj)
const int kVariableSizeSentinel
Definition: objects.h:314
static JSSet * cast(Object *obj)
SeededNumberDictionary * element_dictionary()
Definition: objects-inl.h:6148
static Map * cast(Object *obj)
kSerializedDataOffset Object
Definition: objects-inl.h:5016
static ByteArray * cast(Object *obj)
static FreeSpace * cast(Object *obj)
Object * weak_object_to_code_table()
Definition: heap.h:1367
static Foreign * cast(Object *obj)
static const int kContextOffset
Definition: objects.h:7369
static const int kIrregexpASCIICodeIndex
Definition: objects.h:7939
static const int kIrregexpUC16CodeIndex
Definition: objects.h:7943
#define ASSERT(condition)
Definition: checks.h:329
static const int kIrregexpASCIICodeSavedIndex
Definition: objects.h:7947
static const int kDebugInfoOffset
Definition: objects.h:7112
static JSRegExp * cast(Object *obj)
static const int kNativeContextOffset
Definition: objects.h:7567
bool IsWeakObject(Object *object)
Definition: objects.h:5570
static Context * cast(Object *context)
Definition: contexts.h:244
const intptr_t kCodeAlignment
Definition: v8globals.h:58
static SharedFunctionInfo * cast(Object *obj)
static const int kReceiverOffset
Definition: objects.h:7326
#define CHECK(condition)
Definition: checks.h:75
Name * GetSortedKey(int descriptor_number)
Definition: objects-inl.h:2612
static const int kInstanceClassNameOffset
Definition: objects.h:7107
const bool FLAG_enable_slow_asserts
Definition: checks.h:307
#define CHECK_GE(a, b)
Definition: checks.h:261
static Code * cast(Object *obj)
static Symbol * cast(Object *obj)
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset internal_field_count
Definition: objects-inl.h:5034
static const int kAccessFlagsOffset
Definition: objects.h:10350
static Smi * cast(Object *object)
kInstanceClassNameOffset flag
Definition: objects-inl.h:5115
int isnan(double x)
static const int kMinLength
Definition: objects.h:9170
static JSFunctionProxy * cast(Object *obj)
static JSGeneratorObject * cast(Object *obj)
Definition: objects-inl.h:5737
#define UNREACHABLE()
Definition: checks.h:52
static const int kIrregexpUC16CodeSavedIndex
Definition: objects.h:7950
static JSGlobalProxy * cast(Object *obj)
static const uint64_t kSignMask
Definition: double.h:43
static Cell * cast(Object *obj)
static const int kAliasedContextSlot
Definition: objects.h:8486
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
friend class RelocIterator
Definition: objects.h:5688
static const int kStackFramesOffset
Definition: objects.h:7842
static SlicedString * cast(Object *obj)
int pre_allocated_property_fields()
Definition: objects-inl.h:3933
static const int kScopeInfoOffset
Definition: objects.h:7105
static Failure * cast(MaybeObject *object)
Definition: objects-inl.h:667
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size)
ElementsKind GetElementsKind()
Definition: objects-inl.h:5999
byte * instruction_start()
Definition: objects-inl.h:5857
const int kPointerSize
Definition: globals.h:268
static Oddball * cast(Object *obj)
bool IsAligned(T value, U alignment)
Definition: utils.h:211
static DependentCode * cast(Object *object)
Object * RawFastPropertyAt(int index)
Definition: objects-inl.h:1964
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 const int kNameOffset
Definition: objects.h:7102
static JSTypedArray * cast(Object *obj)
static const int kStorage1Offset
Definition: objects.h:8209
static FixedDoubleArray * cast(Object *obj)
static Code * GetCodeFromTargetAddress(Address address)
Definition: objects-inl.h:4662
static const int kMinLength
Definition: objects.h:9214
static const int kNextFunctionLinkOffset
Definition: objects.h:7526
static const int kIrregexpCaptureCountIndex
Definition: objects.h:7956
static PropertyCell * cast(Object *obj)
static JSMap * cast(Object *obj)
double get_scalar(int index)
Definition: objects-inl.h:2173
static JSMessageObject * cast(Object *obj)
Definition: objects-inl.h:5791
static const int kEndPositionOffset
Definition: objects.h:7844
#define CHECK_LE(a, b)
Definition: checks.h:263
static JSArray * cast(Object *obj)
static JSDate * cast(Object *obj)
Definition: objects-inl.h:5776
bool HasTransitionArray()
Definition: objects-inl.h:4807
static JSDataView * cast(Object *obj)
static const int kContextOffset
Definition: objects.h:7325
static const int kFunctionDataOffset
Definition: objects.h:7109
static HeapNumber * cast(Object *obj)
NameDictionary * property_dictionary()
Definition: objects-inl.h:6142
#define STRUCT_LIST(V)
Definition: objects.h:590
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
static const int kAtomPatternIndex
Definition: objects.h:7932
Map * GetTarget(int transition_number)
static bool UsesNativeRegExp()
Definition: jsregexp.h:48
Object * GetBackPointer()
Definition: objects-inl.h:4791
static JSValue * cast(Object *obj)
Definition: objects-inl.h:5758
friend class Object
Definition: objects.h:2775
#define TYPED_ARRAYS(V)
Definition: objects.h:4663
static JSWeakMap * cast(Object *obj)
bool is_dictionary_map()
Definition: objects-inl.h:4132
static JSWeakSet * cast(Object *obj)
static const int kContinuationOffset
Definition: objects.h:7327
InstanceType instance_type()
Definition: objects-inl.h:4012
static JSProxy * cast(Object *obj)
static double canonical_not_the_hole_nan_as_double()
Definition: objects-inl.h:2166
static FixedArray * cast(Object *obj)
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset kInternalFieldCountOffset dependent_code
Definition: objects-inl.h:5047
int OffsetOfElementAt(int index)
Definition: objects.h:3244
kSerializedDataOffset kPrototypeTemplateOffset indexed_property_handler
Definition: objects-inl.h:5021
static const int kScriptOffset
Definition: objects.h:7111
static VisitorId GetVisitorId(int instance_type, int instance_size)
HeapObject * obj
static WeakHashTable * cast(Object *obj)
Definition: objects.h:4282
static JSArrayBuffer * cast(Object *obj)
static const int kScriptOffset
Definition: objects.h:7841
static const int kStackHandlerIndexOffset
Definition: objects.h:7329
kSerializedDataOffset prototype_template
Definition: objects-inl.h:5016
static const int kSize
Definition: objects.h:7638
static ConsString * cast(Object *obj)
static FixedArrayBase * cast(Object *object)
Definition: objects-inl.h:2121
static JSModule * cast(Object *obj)
Definition: objects-inl.h:5748
static const int kMaxValue
Definition: objects.h:1681
int NextFreePropertyIndex()
Definition: objects.cc:5930
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 MAKE_STRUCT_CASE(NAME, Name, name)
Name * GetSortedKey(int transition_number)
Definition: transitions.h:66
Address get_code_ptr_entry(int index)
Definition: objects-inl.h:2292
static JSObject * cast(Object *obj)
static const int kOperandStackOffset
Definition: objects.h:7328
static JSGlobalObject * cast(Object *obj)
static JSFunction * cast(Object *obj)