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-printer.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 "objects-visiting.h"
34 
35 namespace v8 {
36 namespace internal {
37 
38 #ifdef OBJECT_PRINT
39 
40 void MaybeObject::Print() {
41  Print(stdout);
42 }
43 
44 
45 void MaybeObject::Print(FILE* out) {
46  Object* this_as_object;
47  if (ToObject(&this_as_object)) {
48  if (this_as_object->IsSmi()) {
49  Smi::cast(this_as_object)->SmiPrint(out);
50  } else {
51  HeapObject::cast(this_as_object)->HeapObjectPrint(out);
52  }
53  } else {
54  Failure::cast(this)->FailurePrint(out);
55  }
56  Flush(out);
57 }
58 
59 
60 void MaybeObject::PrintLn() {
61  PrintLn(stdout);
62 }
63 
64 
65 void MaybeObject::PrintLn(FILE* out) {
66  Print(out);
67  PrintF(out, "\n");
68 }
69 
70 
71 void HeapObject::PrintHeader(FILE* out, const char* id) {
72  PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id);
73 }
74 
75 
76 void HeapObject::HeapObjectPrint(FILE* out) {
77  InstanceType instance_type = map()->instance_type();
78 
79  HandleScope scope(GetIsolate());
80  if (instance_type < FIRST_NONSTRING_TYPE) {
81  String::cast(this)->StringPrint(out);
82  return;
83  }
84 
85  switch (instance_type) {
86  case SYMBOL_TYPE:
87  Symbol::cast(this)->SymbolPrint(out);
88  break;
89  case MAP_TYPE:
90  Map::cast(this)->MapPrint(out);
91  break;
92  case HEAP_NUMBER_TYPE:
94  break;
96  FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(out);
97  break;
99  ConstantPoolArray::cast(this)->ConstantPoolArrayPrint(out);
100  break;
101  case FIXED_ARRAY_TYPE:
102  FixedArray::cast(this)->FixedArrayPrint(out);
103  break;
104  case BYTE_ARRAY_TYPE:
105  ByteArray::cast(this)->ByteArrayPrint(out);
106  break;
107  case FREE_SPACE_TYPE:
108  FreeSpace::cast(this)->FreeSpacePrint(out);
109  break;
110 
111 #define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \
112  case EXTERNAL_##TYPE##_ARRAY_TYPE: \
113  External##Type##Array::cast(this)->External##Type##ArrayPrint(out); \
114  break;
115 
116  TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY)
117 #undef PRINT_EXTERNAL_ARRAY
118 
119 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \
120  case Fixed##Type##Array::kInstanceType: \
121  Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(out); \
122  break;
123 
124  TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY)
125 #undef PRINT_FIXED_TYPED_ARRAY
126 
127  case FILLER_TYPE:
128  PrintF(out, "filler");
129  break;
130  case JS_OBJECT_TYPE: // fall through
132  case JS_ARRAY_TYPE:
134  case JS_REGEXP_TYPE:
135  JSObject::cast(this)->JSObjectPrint(out);
136  break;
137  case ODDBALL_TYPE:
138  Oddball::cast(this)->to_string()->Print(out);
139  break;
140  case JS_MODULE_TYPE:
141  JSModule::cast(this)->JSModulePrint(out);
142  break;
143  case JS_FUNCTION_TYPE:
144  JSFunction::cast(this)->JSFunctionPrint(out);
145  break;
147  JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out);
148  break;
150  JSGlobalObject::cast(this)->JSGlobalObjectPrint(out);
151  break;
153  JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out);
154  break;
155  case JS_VALUE_TYPE:
156  PrintF(out, "Value wrapper around:");
157  JSValue::cast(this)->value()->Print(out);
158  break;
159  case JS_DATE_TYPE:
160  JSDate::cast(this)->JSDatePrint(out);
161  break;
162  case CODE_TYPE:
163  Code::cast(this)->CodePrint(out);
164  break;
165  case JS_PROXY_TYPE:
166  JSProxy::cast(this)->JSProxyPrint(out);
167  break;
169  JSFunctionProxy::cast(this)->JSFunctionProxyPrint(out);
170  break;
171  case JS_SET_TYPE:
172  JSSet::cast(this)->JSSetPrint(out);
173  break;
174  case JS_MAP_TYPE:
175  JSMap::cast(this)->JSMapPrint(out);
176  break;
177  case JS_WEAK_MAP_TYPE:
178  JSWeakMap::cast(this)->JSWeakMapPrint(out);
179  break;
180  case JS_WEAK_SET_TYPE:
181  JSWeakSet::cast(this)->JSWeakSetPrint(out);
182  break;
183  case FOREIGN_TYPE:
184  Foreign::cast(this)->ForeignPrint(out);
185  break;
187  SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out);
188  break;
190  JSMessageObject::cast(this)->JSMessageObjectPrint(out);
191  break;
192  case CELL_TYPE:
193  Cell::cast(this)->CellPrint(out);
194  break;
195  case PROPERTY_CELL_TYPE:
196  PropertyCell::cast(this)->PropertyCellPrint(out);
197  break;
199  JSArrayBuffer::cast(this)->JSArrayBufferPrint(out);
200  break;
201  case JS_TYPED_ARRAY_TYPE:
202  JSTypedArray::cast(this)->JSTypedArrayPrint(out);
203  break;
204  case JS_DATA_VIEW_TYPE:
205  JSDataView::cast(this)->JSDataViewPrint(out);
206  break;
207 #define MAKE_STRUCT_CASE(NAME, Name, name) \
208  case NAME##_TYPE: \
209  Name::cast(this)->Name##Print(out); \
210  break;
212 #undef MAKE_STRUCT_CASE
213 
214  default:
215  PrintF(out, "UNKNOWN TYPE %d", map()->instance_type());
216  UNREACHABLE();
217  break;
218  }
219 }
220 
221 
222 void ByteArray::ByteArrayPrint(FILE* out) {
223  PrintF(out, "byte array, data starts at %p", GetDataStartAddress());
224 }
225 
226 
227 void FreeSpace::FreeSpacePrint(FILE* out) {
228  PrintF(out, "free space, size %d", Size());
229 }
230 
231 
232 #define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \
233  void External##Type##Array::External##Type##ArrayPrint(FILE* out) { \
234  PrintF(out, "external " #type " array"); \
235  }
236 
237 TYPED_ARRAYS(EXTERNAL_ARRAY_PRINTER)
238 
239 #undef EXTERNAL_ARRAY_PRINTER
240 
241 
242 template <class Traits>
243 void FixedTypedArray<Traits>::FixedTypedArrayPrint(FILE* out) {
244  PrintF(out, "fixed %s", Traits::Designator());
245 }
246 
247 
248 void JSObject::PrintProperties(FILE* out) {
249  if (HasFastProperties()) {
250  DescriptorArray* descs = map()->instance_descriptors();
251  for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
252  PrintF(out, " ");
253  descs->GetKey(i)->NamePrint(out);
254  PrintF(out, ": ");
255  switch (descs->GetType(i)) {
256  case FIELD: {
257  int index = descs->GetFieldIndex(i);
258  RawFastPropertyAt(index)->ShortPrint(out);
259  PrintF(out, " (field at offset %d)\n", index);
260  break;
261  }
262  case CONSTANT:
263  descs->GetConstant(i)->ShortPrint(out);
264  PrintF(out, " (constant)\n");
265  break;
266  case CALLBACKS:
267  descs->GetCallbacksObject(i)->ShortPrint(out);
268  PrintF(out, " (callback)\n");
269  break;
270  case NORMAL: // only in slow mode
271  case HANDLER: // only in lookup results, not in descriptors
272  case INTERCEPTOR: // only in lookup results, not in descriptors
273  // There are no transitions in the descriptor array.
274  case TRANSITION:
275  case NONEXISTENT:
276  UNREACHABLE();
277  break;
278  }
279  }
280  } else {
281  property_dictionary()->Print(out);
282  }
283 }
284 
285 
286 template<class T>
287 static void DoPrintElements(FILE *out, Object* object) {
288  T* p = T::cast(object);
289  for (int i = 0; i < p->length(); i++) {
290  PrintF(out, " %d: %d\n", i, p->get_scalar(i));
291  }
292 }
293 
294 
295 template<class T>
296 static void DoPrintDoubleElements(FILE* out, Object* object) {
297  T* p = T::cast(object);
298  for (int i = 0; i < p->length(); i++) {
299  PrintF(out, " %d: %f\n", i, p->get_scalar(i));
300  }
301 }
302 
303 
304 void JSObject::PrintElements(FILE* out) {
305  // Don't call GetElementsKind, its validation code can cause the printer to
306  // fail when debugging.
307  switch (map()->elements_kind()) {
309  case FAST_SMI_ELEMENTS:
310  case FAST_HOLEY_ELEMENTS:
311  case FAST_ELEMENTS: {
312  // Print in array notation for non-sparse arrays.
313  FixedArray* p = FixedArray::cast(elements());
314  for (int i = 0; i < p->length(); i++) {
315  PrintF(out, " %d: ", i);
316  p->get(i)->ShortPrint(out);
317  PrintF(out, "\n");
318  }
319  break;
320  }
322  case FAST_DOUBLE_ELEMENTS: {
323  // Print in array notation for non-sparse arrays.
324  if (elements()->length() > 0) {
325  FixedDoubleArray* p = FixedDoubleArray::cast(elements());
326  for (int i = 0; i < p->length(); i++) {
327  if (p->is_the_hole(i)) {
328  PrintF(out, " %d: <the hole>", i);
329  } else {
330  PrintF(out, " %d: %g", i, p->get_scalar(i));
331  }
332  PrintF(out, "\n");
333  }
334  }
335  break;
336  }
337 
338 
339 #define PRINT_ELEMENTS(Kind, Type) \
340  case Kind: { \
341  DoPrintElements<Type>(out, elements()); \
342  break; \
343  }
344 
345 #define PRINT_DOUBLE_ELEMENTS(Kind, Type) \
346  case Kind: { \
347  DoPrintDoubleElements<Type>(out, elements()); \
348  break; \
349  }
350 
351  PRINT_ELEMENTS(EXTERNAL_UINT8_CLAMPED_ELEMENTS, ExternalUint8ClampedArray)
352  PRINT_ELEMENTS(EXTERNAL_INT8_ELEMENTS, ExternalInt8Array)
353  PRINT_ELEMENTS(EXTERNAL_UINT8_ELEMENTS,
354  ExternalUint8Array)
355  PRINT_ELEMENTS(EXTERNAL_INT16_ELEMENTS, ExternalInt16Array)
356  PRINT_ELEMENTS(EXTERNAL_UINT16_ELEMENTS,
357  ExternalUint16Array)
358  PRINT_ELEMENTS(EXTERNAL_INT32_ELEMENTS, ExternalInt32Array)
359  PRINT_ELEMENTS(EXTERNAL_UINT32_ELEMENTS,
360  ExternalUint32Array)
361  PRINT_DOUBLE_ELEMENTS(EXTERNAL_FLOAT32_ELEMENTS, ExternalFloat32Array)
362  PRINT_DOUBLE_ELEMENTS(EXTERNAL_FLOAT64_ELEMENTS, ExternalFloat64Array)
363 
364 
365  PRINT_ELEMENTS(UINT8_ELEMENTS, FixedUint8Array)
366  PRINT_ELEMENTS(UINT8_CLAMPED_ELEMENTS, FixedUint8ClampedArray)
367  PRINT_ELEMENTS(INT8_ELEMENTS, FixedInt8Array)
368  PRINT_ELEMENTS(UINT16_ELEMENTS, FixedUint16Array)
369  PRINT_ELEMENTS(INT16_ELEMENTS, FixedInt16Array)
370  PRINT_ELEMENTS(UINT32_ELEMENTS, FixedUint32Array)
371  PRINT_ELEMENTS(INT32_ELEMENTS, FixedInt32Array)
372  PRINT_DOUBLE_ELEMENTS(FLOAT32_ELEMENTS, FixedFloat32Array)
373  PRINT_DOUBLE_ELEMENTS(FLOAT64_ELEMENTS, FixedFloat64Array)
374 
375 #undef PRINT_DOUBLE_ELEMENTS
376 #undef PRINT_ELEMENTS
377 
378  case DICTIONARY_ELEMENTS:
379  elements()->Print(out);
380  break;
382  FixedArray* p = FixedArray::cast(elements());
383  PrintF(out, " parameter map:");
384  for (int i = 2; i < p->length(); i++) {
385  PrintF(out, " %d:", i - 2);
386  p->get(i)->ShortPrint(out);
387  }
388  PrintF(out, "\n context: ");
389  p->get(0)->ShortPrint(out);
390  PrintF(out, "\n arguments: ");
391  p->get(1)->ShortPrint(out);
392  PrintF(out, "\n");
393  break;
394  }
395  }
396 }
397 
398 
399 void JSObject::PrintTransitions(FILE* out) {
400  if (!map()->HasTransitionArray()) return;
401  TransitionArray* transitions = map()->transitions();
402  for (int i = 0; i < transitions->number_of_transitions(); i++) {
403  Name* key = transitions->GetKey(i);
404  PrintF(out, " ");
405  key->NamePrint(out);
406  PrintF(out, ": ");
407  if (key == GetHeap()->frozen_symbol()) {
408  PrintF(out, " (transition to frozen)\n");
409  } else if (key == GetHeap()->elements_transition_symbol()) {
410  PrintF(out, " (transition to ");
411  PrintElementsKind(out, transitions->GetTarget(i)->elements_kind());
412  PrintF(out, ")\n");
413  } else if (key == GetHeap()->observed_symbol()) {
414  PrintF(out, " (transition to Object.observe)\n");
415  } else {
416  switch (transitions->GetTargetDetails(i).type()) {
417  case FIELD: {
418  PrintF(out, " (transition to field)\n");
419  break;
420  }
421  case CONSTANT:
422  PrintF(out, " (transition to constant)\n");
423  break;
424  case CALLBACKS:
425  PrintF(out, " (transition to callback)\n");
426  break;
427  // Values below are never in the target descriptor array.
428  case NORMAL:
429  case HANDLER:
430  case INTERCEPTOR:
431  case TRANSITION:
432  case NONEXISTENT:
433  UNREACHABLE();
434  break;
435  }
436  }
437  }
438 }
439 
440 
441 void JSObject::JSObjectPrint(FILE* out) {
442  PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this));
443  PrintF(out, " - map = %p [", reinterpret_cast<void*>(map()));
444  // Don't call GetElementsKind, its validation code can cause the printer to
445  // fail when debugging.
446  PrintElementsKind(out, this->map()->elements_kind());
447  PrintF(out,
448  "]\n - prototype = %p\n",
449  reinterpret_cast<void*>(GetPrototype()));
450  PrintF(out, " {\n");
451  PrintProperties(out);
452  PrintTransitions(out);
453  PrintElements(out);
454  PrintF(out, " }\n");
455 }
456 
457 
458 void JSModule::JSModulePrint(FILE* out) {
459  HeapObject::PrintHeader(out, "JSModule");
460  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
461  PrintF(out, " - context = ");
462  context()->Print(out);
463  PrintF(out, " - scope_info = ");
464  scope_info()->ShortPrint(out);
465  PrintElementsKind(out, this->map()->elements_kind());
466  PrintF(out, " {\n");
467  PrintProperties(out);
468  PrintElements(out);
469  PrintF(out, " }\n");
470 }
471 
472 
473 static const char* TypeToString(InstanceType type) {
474  switch (type) {
475 #define TYPE_TO_STRING(TYPE) case TYPE: return #TYPE;
476  INSTANCE_TYPE_LIST(TYPE_TO_STRING)
477 #undef TYPE_TO_STRING
478  }
479  UNREACHABLE();
480  return "UNKNOWN"; // Keep the compiler happy.
481 }
482 
483 
484 void Symbol::SymbolPrint(FILE* out) {
485  HeapObject::PrintHeader(out, "Symbol");
486  PrintF(out, " - hash: %d\n", Hash());
487  PrintF(out, " - name: ");
488  name()->ShortPrint();
489  PrintF(out, " - private: %d\n", is_private());
490  PrintF(out, "\n");
491 }
492 
493 
494 void Map::MapPrint(FILE* out) {
495  HeapObject::PrintHeader(out, "Map");
496  PrintF(out, " - type: %s\n", TypeToString(instance_type()));
497  PrintF(out, " - instance size: %d\n", instance_size());
498  PrintF(out, " - inobject properties: %d\n", inobject_properties());
499  PrintF(out, " - elements kind: ");
501  PrintF(out, "\n - pre-allocated property fields: %d\n",
503  PrintF(out, " - unused property fields: %d\n", unused_property_fields());
504  if (is_hidden_prototype()) {
505  PrintF(out, " - hidden_prototype\n");
506  }
507  if (has_named_interceptor()) {
508  PrintF(out, " - named_interceptor\n");
509  }
510  if (has_indexed_interceptor()) {
511  PrintF(out, " - indexed_interceptor\n");
512  }
513  if (is_undetectable()) {
514  PrintF(out, " - undetectable\n");
515  }
517  PrintF(out, " - instance_call_handler\n");
518  }
519  if (is_access_check_needed()) {
520  PrintF(out, " - access_check_needed\n");
521  }
522  if (is_frozen()) {
523  PrintF(out, " - frozen\n");
524  } else if (!is_extensible()) {
525  PrintF(out, " - sealed\n");
526  }
527  PrintF(out, " - back pointer: ");
528  GetBackPointer()->ShortPrint(out);
529  PrintF(out, "\n - instance descriptors %s#%i: ",
530  owns_descriptors() ? "(own) " : "",
532  instance_descriptors()->ShortPrint(out);
533  if (HasTransitionArray()) {
534  PrintF(out, "\n - transitions: ");
535  transitions()->ShortPrint(out);
536  }
537  PrintF(out, "\n - prototype: ");
538  prototype()->ShortPrint(out);
539  PrintF(out, "\n - constructor: ");
540  constructor()->ShortPrint(out);
541  PrintF(out, "\n - code cache: ");
542  code_cache()->ShortPrint(out);
543  PrintF(out, "\n - dependent code: ");
544  dependent_code()->ShortPrint(out);
545  PrintF(out, "\n");
546 }
547 
548 
549 void CodeCache::CodeCachePrint(FILE* out) {
550  HeapObject::PrintHeader(out, "CodeCache");
551  PrintF(out, "\n - default_cache: ");
552  default_cache()->ShortPrint(out);
553  PrintF(out, "\n - normal_type_cache: ");
554  normal_type_cache()->ShortPrint(out);
555 }
556 
557 
558 void PolymorphicCodeCache::PolymorphicCodeCachePrint(FILE* out) {
559  HeapObject::PrintHeader(out, "PolymorphicCodeCache");
560  PrintF(out, "\n - cache: ");
561  cache()->ShortPrint(out);
562 }
563 
564 
565 void TypeFeedbackInfo::TypeFeedbackInfoPrint(FILE* out) {
566  HeapObject::PrintHeader(out, "TypeFeedbackInfo");
567  PrintF(out, " - ic_total_count: %d, ic_with_type_info_count: %d\n",
569  PrintF(out, " - feedback_vector: ");
570  feedback_vector()->FixedArrayPrint(out);
571 }
572 
573 
574 void AliasedArgumentsEntry::AliasedArgumentsEntryPrint(FILE* out) {
575  HeapObject::PrintHeader(out, "AliasedArgumentsEntry");
576  PrintF(out, "\n - aliased_context_slot: %d", aliased_context_slot());
577 }
578 
579 
580 void FixedArray::FixedArrayPrint(FILE* out) {
581  HeapObject::PrintHeader(out, "FixedArray");
582  PrintF(out, " - length: %d", length());
583  for (int i = 0; i < length(); i++) {
584  PrintF(out, "\n [%d]: ", i);
585  get(i)->ShortPrint(out);
586  }
587  PrintF(out, "\n");
588 }
589 
590 
591 void FixedDoubleArray::FixedDoubleArrayPrint(FILE* out) {
592  HeapObject::PrintHeader(out, "FixedDoubleArray");
593  PrintF(out, " - length: %d", length());
594  for (int i = 0; i < length(); i++) {
595  if (is_the_hole(i)) {
596  PrintF(out, "\n [%d]: <the hole>", i);
597  } else {
598  PrintF(out, "\n [%d]: %g", i, get_scalar(i));
599  }
600  }
601  PrintF(out, "\n");
602 }
603 
604 
605 void ConstantPoolArray::ConstantPoolArrayPrint(FILE* out) {
606  HeapObject::PrintHeader(out, "ConstantPoolArray");
607  PrintF(out, " - length: %d", length());
608  for (int i = 0; i < length(); i++) {
609  if (i < first_code_ptr_index()) {
610  PrintF(out, "\n [%d]: double: %g", i, get_int64_entry_as_double(i));
611  } else if (i < first_heap_ptr_index()) {
612  PrintF(out, "\n [%d]: code target pointer: %p", i,
613  reinterpret_cast<void*>(get_code_ptr_entry(i)));
614  } else if (i < first_int32_index()) {
615  PrintF(out, "\n [%d]: heap pointer: %p", i,
616  reinterpret_cast<void*>(get_heap_ptr_entry(i)));
617  } else {
618  PrintF(out, "\n [%d]: int32: %d", i, get_int32_entry(i));
619  }
620  }
621  PrintF(out, "\n");
622 }
623 
624 
625 void JSValue::JSValuePrint(FILE* out) {
626  HeapObject::PrintHeader(out, "ValueObject");
627  value()->Print(out);
628 }
629 
630 
631 void JSMessageObject::JSMessageObjectPrint(FILE* out) {
632  HeapObject::PrintHeader(out, "JSMessageObject");
633  PrintF(out, " - type: ");
634  type()->ShortPrint(out);
635  PrintF(out, "\n - arguments: ");
636  arguments()->ShortPrint(out);
637  PrintF(out, "\n - start_position: %d", start_position());
638  PrintF(out, "\n - end_position: %d", end_position());
639  PrintF(out, "\n - script: ");
640  script()->ShortPrint(out);
641  PrintF(out, "\n - stack_frames: ");
642  stack_frames()->ShortPrint(out);
643  PrintF(out, "\n");
644 }
645 
646 
647 void String::StringPrint(FILE* out) {
648  if (StringShape(this).IsInternalized()) {
649  PrintF(out, "#");
650  } else if (StringShape(this).IsCons()) {
651  PrintF(out, "c\"");
652  } else {
653  PrintF(out, "\"");
654  }
655 
656  const char truncated_epilogue[] = "...<truncated>";
657  int len = length();
658  if (!FLAG_use_verbose_printer) {
659  if (len > 100) {
660  len = 100 - sizeof(truncated_epilogue);
661  }
662  }
663  for (int i = 0; i < len; i++) {
664  PrintF(out, "%c", Get(i));
665  }
666  if (len != length()) {
667  PrintF(out, "%s", truncated_epilogue);
668  }
669 
670  if (!StringShape(this).IsInternalized()) PrintF(out, "\"");
671 }
672 
673 
674 void Name::NamePrint(FILE* out) {
675  if (IsString())
676  String::cast(this)->StringPrint(out);
677  else
678  ShortPrint();
679 }
680 
681 
682 // This method is only meant to be called from gdb for debugging purposes.
683 // Since the string can also be in two-byte encoding, non-ASCII characters
684 // will be ignored in the output.
685 char* String::ToAsciiArray() {
686  // Static so that subsequent calls frees previously allocated space.
687  // This also means that previous results will be overwritten.
688  static char* buffer = NULL;
689  if (buffer != NULL) free(buffer);
690  buffer = new char[length()+1];
691  WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length());
692  buffer[length()] = 0;
693  return buffer;
694 }
695 
696 
697 static const char* const weekdays[] = {
698  "???", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
699 };
700 
701 
702 void JSDate::JSDatePrint(FILE* out) {
703  HeapObject::PrintHeader(out, "JSDate");
704  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
705  PrintF(out, " - value = ");
706  value()->Print(out);
707  if (!year()->IsSmi()) {
708  PrintF(out, " - time = NaN\n");
709  } else {
710  PrintF(out, " - time = %s %04d/%02d/%02d %02d:%02d:%02d\n",
711  weekdays[weekday()->IsSmi() ? Smi::cast(weekday())->value() + 1 : 0],
712  year()->IsSmi() ? Smi::cast(year())->value() : -1,
713  month()->IsSmi() ? Smi::cast(month())->value() : -1,
714  day()->IsSmi() ? Smi::cast(day())->value() : -1,
715  hour()->IsSmi() ? Smi::cast(hour())->value() : -1,
716  min()->IsSmi() ? Smi::cast(min())->value() : -1,
717  sec()->IsSmi() ? Smi::cast(sec())->value() : -1);
718  }
719 }
720 
721 
722 void JSProxy::JSProxyPrint(FILE* out) {
723  HeapObject::PrintHeader(out, "JSProxy");
724  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
725  PrintF(out, " - handler = ");
726  handler()->Print(out);
727  PrintF(out, " - hash = ");
728  hash()->Print(out);
729  PrintF(out, "\n");
730 }
731 
732 
733 void JSFunctionProxy::JSFunctionProxyPrint(FILE* out) {
734  HeapObject::PrintHeader(out, "JSFunctionProxy");
735  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
736  PrintF(out, " - handler = ");
737  handler()->Print(out);
738  PrintF(out, " - call_trap = ");
739  call_trap()->Print(out);
740  PrintF(out, " - construct_trap = ");
741  construct_trap()->Print(out);
742  PrintF(out, "\n");
743 }
744 
745 
746 void JSSet::JSSetPrint(FILE* out) {
747  HeapObject::PrintHeader(out, "JSSet");
748  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
749  PrintF(out, " - table = ");
750  table()->ShortPrint(out);
751  PrintF(out, "\n");
752 }
753 
754 
755 void JSMap::JSMapPrint(FILE* out) {
756  HeapObject::PrintHeader(out, "JSMap");
757  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
758  PrintF(out, " - table = ");
759  table()->ShortPrint(out);
760  PrintF(out, "\n");
761 }
762 
763 
764 void JSWeakMap::JSWeakMapPrint(FILE* out) {
765  HeapObject::PrintHeader(out, "JSWeakMap");
766  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
767  PrintF(out, " - table = ");
768  table()->ShortPrint(out);
769  PrintF(out, "\n");
770 }
771 
772 
773 void JSWeakSet::JSWeakSetPrint(FILE* out) {
774  HeapObject::PrintHeader(out, "JSWeakSet");
775  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
776  PrintF(out, " - table = ");
777  table()->ShortPrint(out);
778  PrintF(out, "\n");
779 }
780 
781 
782 void JSArrayBuffer::JSArrayBufferPrint(FILE* out) {
783  HeapObject::PrintHeader(out, "JSArrayBuffer");
784  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
785  PrintF(out, " - backing_store = %p\n", backing_store());
786  PrintF(out, " - byte_length = ");
787  byte_length()->ShortPrint(out);
788  PrintF(out, "\n");
789 }
790 
791 
792 void JSTypedArray::JSTypedArrayPrint(FILE* out) {
793  HeapObject::PrintHeader(out, "JSTypedArray");
794  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
795  PrintF(out, " - buffer =");
796  buffer()->ShortPrint(out);
797  PrintF(out, "\n - byte_offset = ");
798  byte_offset()->ShortPrint(out);
799  PrintF(out, "\n - byte_length = ");
800  byte_length()->ShortPrint(out);
801  PrintF(out, "\n - length = ");
802  length()->ShortPrint(out);
803  PrintF(out, "\n");
804  PrintElements(out);
805 }
806 
807 
808 void JSDataView::JSDataViewPrint(FILE* out) {
809  HeapObject::PrintHeader(out, "JSDataView");
810  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
811  PrintF(out, " - buffer =");
812  buffer()->ShortPrint(out);
813  PrintF(out, "\n - byte_offset = ");
814  byte_offset()->ShortPrint(out);
815  PrintF(out, "\n - byte_length = ");
816  byte_length()->ShortPrint(out);
817  PrintF(out, "\n");
818 }
819 
820 
821 void JSFunction::JSFunctionPrint(FILE* out) {
822  HeapObject::PrintHeader(out, "Function");
823  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
824  PrintF(out, " - initial_map = ");
825  if (has_initial_map()) {
826  initial_map()->ShortPrint(out);
827  }
828  PrintF(out, "\n - shared_info = ");
829  shared()->ShortPrint(out);
830  PrintF(out, "\n - name = ");
831  shared()->name()->Print(out);
832  PrintF(out, "\n - context = ");
833  context()->ShortPrint(out);
834  if (shared()->bound()) {
835  PrintF(out, "\n - bindings = ");
837  } else {
838  PrintF(out, "\n - literals = ");
839  literals()->ShortPrint(out);
840  }
841  PrintF(out, "\n - code = ");
842  code()->ShortPrint(out);
843  PrintF(out, "\n");
844 
845  PrintProperties(out);
846  PrintElements(out);
847 
848  PrintF(out, "\n");
849 }
850 
851 
852 void SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) {
853  HeapObject::PrintHeader(out, "SharedFunctionInfo");
854  PrintF(out, " - name: ");
855  name()->ShortPrint(out);
856  PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties());
857  PrintF(out, "\n - instance class name = ");
858  instance_class_name()->Print(out);
859  PrintF(out, "\n - code = ");
860  code()->ShortPrint(out);
861  if (HasSourceCode()) {
862  PrintF(out, "\n - source code = ");
863  String* source = String::cast(Script::cast(script())->source());
864  int start = start_position();
865  int length = end_position() - start;
866  SmartArrayPointer<char> source_string =
867  source->ToCString(DISALLOW_NULLS,
869  start, length, NULL);
870  PrintF(out, "%s", source_string.get());
871  }
872  // Script files are often large, hard to read.
873  // PrintF(out, "\n - script =");
874  // script()->Print(out);
875  PrintF(out, "\n - function token position = %d", function_token_position());
876  PrintF(out, "\n - start position = %d", start_position());
877  PrintF(out, "\n - end position = %d", end_position());
878  PrintF(out, "\n - is expression = %d", is_expression());
879  PrintF(out, "\n - debug info = ");
880  debug_info()->ShortPrint(out);
881  PrintF(out, "\n - length = %d", length());
882  PrintF(out, "\n - optimized_code_map = ");
883  optimized_code_map()->ShortPrint(out);
884  PrintF(out, "\n");
885 }
886 
887 
888 void JSGlobalProxy::JSGlobalProxyPrint(FILE* out) {
889  PrintF(out, "global_proxy ");
890  JSObjectPrint(out);
891  PrintF(out, "native context : ");
892  native_context()->ShortPrint(out);
893  PrintF(out, "\n");
894 }
895 
896 
897 void JSGlobalObject::JSGlobalObjectPrint(FILE* out) {
898  PrintF(out, "global ");
899  JSObjectPrint(out);
900  PrintF(out, "native context : ");
901  native_context()->ShortPrint(out);
902  PrintF(out, "\n");
903 }
904 
905 
906 void JSBuiltinsObject::JSBuiltinsObjectPrint(FILE* out) {
907  PrintF(out, "builtins ");
908  JSObjectPrint(out);
909 }
910 
911 
912 void Cell::CellPrint(FILE* out) {
913  HeapObject::PrintHeader(out, "Cell");
914 }
915 
916 
917 void PropertyCell::PropertyCellPrint(FILE* out) {
918  HeapObject::PrintHeader(out, "PropertyCell");
919 }
920 
921 
922 void Code::CodePrint(FILE* out) {
923  HeapObject::PrintHeader(out, "Code");
924 #ifdef ENABLE_DISASSEMBLER
925  if (FLAG_use_verbose_printer) {
926  Disassemble(NULL, out);
927  }
928 #endif
929 }
930 
931 
932 void Foreign::ForeignPrint(FILE* out) {
933  PrintF(out, "foreign address : %p", foreign_address());
934 }
935 
936 
937 void ExecutableAccessorInfo::ExecutableAccessorInfoPrint(FILE* out) {
938  HeapObject::PrintHeader(out, "ExecutableAccessorInfo");
939  PrintF(out, "\n - name: ");
940  name()->ShortPrint(out);
941  PrintF(out, "\n - flag: ");
942  flag()->ShortPrint(out);
943  PrintF(out, "\n - getter: ");
944  getter()->ShortPrint(out);
945  PrintF(out, "\n - setter: ");
946  setter()->ShortPrint(out);
947  PrintF(out, "\n - data: ");
948  data()->ShortPrint(out);
949 }
950 
951 
952 void DeclaredAccessorInfo::DeclaredAccessorInfoPrint(FILE* out) {
953  HeapObject::PrintHeader(out, "DeclaredAccessorInfo");
954  PrintF(out, "\n - name: ");
955  name()->ShortPrint(out);
956  PrintF(out, "\n - flag: ");
957  flag()->ShortPrint(out);
958  PrintF(out, "\n - descriptor: ");
959  descriptor()->ShortPrint(out);
960 }
961 
962 
963 void DeclaredAccessorDescriptor::DeclaredAccessorDescriptorPrint(FILE* out) {
964  HeapObject::PrintHeader(out, "DeclaredAccessorDescriptor");
965  PrintF(out, "\n - internal field: ");
966  serialized_data()->ShortPrint(out);
967 }
968 
969 
970 void Box::BoxPrint(FILE* out) {
971  HeapObject::PrintHeader(out, "Box");
972  PrintF(out, "\n - value: ");
973  value()->ShortPrint(out);
974 }
975 
976 
977 void AccessorPair::AccessorPairPrint(FILE* out) {
978  HeapObject::PrintHeader(out, "AccessorPair");
979  PrintF(out, "\n - getter: ");
980  getter()->ShortPrint(out);
981  PrintF(out, "\n - setter: ");
982  setter()->ShortPrint(out);
983  PrintF(out, "\n - flag: ");
984  access_flags()->ShortPrint(out);
985 }
986 
987 
988 void AccessCheckInfo::AccessCheckInfoPrint(FILE* out) {
989  HeapObject::PrintHeader(out, "AccessCheckInfo");
990  PrintF(out, "\n - named_callback: ");
991  named_callback()->ShortPrint(out);
992  PrintF(out, "\n - indexed_callback: ");
993  indexed_callback()->ShortPrint(out);
994  PrintF(out, "\n - data: ");
995  data()->ShortPrint(out);
996 }
997 
998 
999 void InterceptorInfo::InterceptorInfoPrint(FILE* out) {
1000  HeapObject::PrintHeader(out, "InterceptorInfo");
1001  PrintF(out, "\n - getter: ");
1002  getter()->ShortPrint(out);
1003  PrintF(out, "\n - setter: ");
1004  setter()->ShortPrint(out);
1005  PrintF(out, "\n - query: ");
1006  query()->ShortPrint(out);
1007  PrintF(out, "\n - deleter: ");
1008  deleter()->ShortPrint(out);
1009  PrintF(out, "\n - enumerator: ");
1010  enumerator()->ShortPrint(out);
1011  PrintF(out, "\n - data: ");
1012  data()->ShortPrint(out);
1013 }
1014 
1015 
1016 void CallHandlerInfo::CallHandlerInfoPrint(FILE* out) {
1017  HeapObject::PrintHeader(out, "CallHandlerInfo");
1018  PrintF(out, "\n - callback: ");
1019  callback()->ShortPrint(out);
1020  PrintF(out, "\n - data: ");
1021  data()->ShortPrint(out);
1022  PrintF(out, "\n - call_stub_cache: ");
1023 }
1024 
1025 
1026 void FunctionTemplateInfo::FunctionTemplateInfoPrint(FILE* out) {
1027  HeapObject::PrintHeader(out, "FunctionTemplateInfo");
1028  PrintF(out, "\n - class name: ");
1029  class_name()->ShortPrint(out);
1030  PrintF(out, "\n - tag: ");
1031  tag()->ShortPrint(out);
1032  PrintF(out, "\n - property_list: ");
1033  property_list()->ShortPrint(out);
1034  PrintF(out, "\n - serial_number: ");
1035  serial_number()->ShortPrint(out);
1036  PrintF(out, "\n - call_code: ");
1037  call_code()->ShortPrint(out);
1038  PrintF(out, "\n - property_accessors: ");
1039  property_accessors()->ShortPrint(out);
1040  PrintF(out, "\n - prototype_template: ");
1041  prototype_template()->ShortPrint(out);
1042  PrintF(out, "\n - parent_template: ");
1043  parent_template()->ShortPrint(out);
1044  PrintF(out, "\n - named_property_handler: ");
1045  named_property_handler()->ShortPrint(out);
1046  PrintF(out, "\n - indexed_property_handler: ");
1047  indexed_property_handler()->ShortPrint(out);
1048  PrintF(out, "\n - instance_template: ");
1049  instance_template()->ShortPrint(out);
1050  PrintF(out, "\n - signature: ");
1051  signature()->ShortPrint(out);
1052  PrintF(out, "\n - access_check_info: ");
1053  access_check_info()->ShortPrint(out);
1054  PrintF(out, "\n - hidden_prototype: %s",
1055  hidden_prototype() ? "true" : "false");
1056  PrintF(out, "\n - undetectable: %s", undetectable() ? "true" : "false");
1057  PrintF(out, "\n - need_access_check: %s",
1058  needs_access_check() ? "true" : "false");
1059 }
1060 
1061 
1062 void ObjectTemplateInfo::ObjectTemplateInfoPrint(FILE* out) {
1063  HeapObject::PrintHeader(out, "ObjectTemplateInfo");
1064  PrintF(out, " - tag: ");
1065  tag()->ShortPrint(out);
1066  PrintF(out, "\n - property_list: ");
1067  property_list()->ShortPrint(out);
1068  PrintF(out, "\n - property_accessors: ");
1069  property_accessors()->ShortPrint(out);
1070  PrintF(out, "\n - constructor: ");
1071  constructor()->ShortPrint(out);
1072  PrintF(out, "\n - internal_field_count: ");
1073  internal_field_count()->ShortPrint(out);
1074  PrintF(out, "\n");
1075 }
1076 
1077 
1078 void SignatureInfo::SignatureInfoPrint(FILE* out) {
1079  HeapObject::PrintHeader(out, "SignatureInfo");
1080  PrintF(out, "\n - receiver: ");
1081  receiver()->ShortPrint(out);
1082  PrintF(out, "\n - args: ");
1083  args()->ShortPrint(out);
1084 }
1085 
1086 
1087 void TypeSwitchInfo::TypeSwitchInfoPrint(FILE* out) {
1088  HeapObject::PrintHeader(out, "TypeSwitchInfo");
1089  PrintF(out, "\n - types: ");
1090  types()->ShortPrint(out);
1091 }
1092 
1093 
1094 void AllocationSite::AllocationSitePrint(FILE* out) {
1095  HeapObject::PrintHeader(out, "AllocationSite");
1096  PrintF(out, " - weak_next: ");
1097  weak_next()->ShortPrint(out);
1098  PrintF(out, "\n - dependent code: ");
1099  dependent_code()->ShortPrint(out);
1100  PrintF(out, "\n - nested site: ");
1101  nested_site()->ShortPrint(out);
1102  PrintF(out, "\n - memento found count: ");
1104  PrintF(out, "\n - memento create count: ");
1106  PrintF(out, "\n - pretenure decision: ");
1108  PrintF(out, "\n - transition_info: ");
1109  if (transition_info()->IsSmi()) {
1110  ElementsKind kind = GetElementsKind();
1111  PrintF(out, "Array allocation with ElementsKind ");
1112  PrintElementsKind(out, kind);
1113  PrintF(out, "\n");
1114  return;
1115  } else if (transition_info()->IsJSArray()) {
1116  PrintF(out, "Array literal ");
1117  transition_info()->ShortPrint(out);
1118  PrintF(out, "\n");
1119  return;
1120  }
1121 
1122  PrintF(out, "unknown transition_info");
1123  transition_info()->ShortPrint(out);
1124  PrintF(out, "\n");
1125 }
1126 
1127 
1128 void AllocationMemento::AllocationMementoPrint(FILE* out) {
1129  HeapObject::PrintHeader(out, "AllocationMemento");
1130  PrintF(out, " - allocation site: ");
1131  if (IsValid()) {
1132  GetAllocationSite()->Print();
1133  } else {
1134  PrintF(out, "<invalid>\n");
1135  }
1136 }
1137 
1138 
1139 void Script::ScriptPrint(FILE* out) {
1140  HeapObject::PrintHeader(out, "Script");
1141  PrintF(out, "\n - source: ");
1142  source()->ShortPrint(out);
1143  PrintF(out, "\n - name: ");
1144  name()->ShortPrint(out);
1145  PrintF(out, "\n - line_offset: ");
1146  line_offset()->ShortPrint(out);
1147  PrintF(out, "\n - column_offset: ");
1148  column_offset()->ShortPrint(out);
1149  PrintF(out, "\n - type: ");
1150  type()->ShortPrint(out);
1151  PrintF(out, "\n - id: ");
1152  id()->ShortPrint(out);
1153  PrintF(out, "\n - context data: ");
1154  context_data()->ShortPrint(out);
1155  PrintF(out, "\n - wrapper: ");
1156  wrapper()->ShortPrint(out);
1157  PrintF(out, "\n - compilation type: %d", compilation_type());
1158  PrintF(out, "\n - line ends: ");
1159  line_ends()->ShortPrint(out);
1160  PrintF(out, "\n - eval from shared: ");
1161  eval_from_shared()->ShortPrint(out);
1162  PrintF(out, "\n - eval from instructions offset: ");
1163  eval_from_instructions_offset()->ShortPrint(out);
1164  PrintF(out, "\n");
1165 }
1166 
1167 
1168 #ifdef ENABLE_DEBUGGER_SUPPORT
1169 void DebugInfo::DebugInfoPrint(FILE* out) {
1170  HeapObject::PrintHeader(out, "DebugInfo");
1171  PrintF(out, "\n - shared: ");
1172  shared()->ShortPrint(out);
1173  PrintF(out, "\n - original_code: ");
1174  original_code()->ShortPrint(out);
1175  PrintF(out, "\n - code: ");
1176  code()->ShortPrint(out);
1177  PrintF(out, "\n - break_points: ");
1178  break_points()->Print(out);
1179 }
1180 
1181 
1182 void BreakPointInfo::BreakPointInfoPrint(FILE* out) {
1183  HeapObject::PrintHeader(out, "BreakPointInfo");
1184  PrintF(out, "\n - code_position: %d", code_position()->value());
1185  PrintF(out, "\n - source_position: %d", source_position()->value());
1186  PrintF(out, "\n - statement_position: %d", statement_position()->value());
1187  PrintF(out, "\n - break_point_objects: ");
1188  break_point_objects()->ShortPrint(out);
1189 }
1190 #endif // ENABLE_DEBUGGER_SUPPORT
1191 
1192 
1193 void DescriptorArray::PrintDescriptors(FILE* out) {
1194  PrintF(out, "Descriptor array %d\n", number_of_descriptors());
1195  for (int i = 0; i < number_of_descriptors(); i++) {
1196  PrintF(out, " %d: ", i);
1197  Descriptor desc;
1198  Get(i, &desc);
1199  desc.Print(out);
1200  }
1201  PrintF(out, "\n");
1202 }
1203 
1204 
1205 void TransitionArray::PrintTransitions(FILE* out) {
1206  PrintF(out, "Transition array %d\n", number_of_transitions());
1207  for (int i = 0; i < number_of_transitions(); i++) {
1208  PrintF(out, " %d: ", i);
1209  GetKey(i)->NamePrint(out);
1210  PrintF(out, ": ");
1211  switch (GetTargetDetails(i).type()) {
1212  case FIELD: {
1213  PrintF(out, " (transition to field)\n");
1214  break;
1215  }
1216  case CONSTANT:
1217  PrintF(out, " (transition to constant)\n");
1218  break;
1219  case CALLBACKS:
1220  PrintF(out, " (transition to callback)\n");
1221  break;
1222  // Values below are never in the target descriptor array.
1223  case NORMAL:
1224  case HANDLER:
1225  case INTERCEPTOR:
1226  case TRANSITION:
1227  case NONEXISTENT:
1228  UNREACHABLE();
1229  break;
1230  }
1231  }
1232  PrintF(out, "\n");
1233 }
1234 
1235 
1236 #endif // OBJECT_PRINT
1237 
1238 
1239 } } // 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
FixedArray * function_bindings()
Definition: objects-inl.h:5649
static ConstantPoolArray * cast(Object *obj)
#define INSTANCE_TYPE_LIST(V)
Definition: objects.h:342
AllocationSite * GetAllocationSite()
Definition: objects.h:8452
bool is_hidden_prototype()
Definition: objects.h:5889
void PrintF(const char *format,...)
Definition: v8utils.cc:40
kInstanceClassNameOffset kNeedsAccessCheckBit kRemovePrototypeBit is_expression
Definition: objects-inl.h:5123
static String * cast(Object *obj)
kInstanceClassNameOffset needs_access_check
Definition: objects-inl.h:5115
int unused_property_fields()
Definition: objects-inl.h:4022
static Smi * FromInt(int value)
Definition: objects-inl.h:1209
PretenureDecision pretenure_decision()
Definition: objects.h:8309
int NumberOfOwnDescriptors()
Definition: objects.h:6174
static HeapObject * cast(Object *obj)
bool is_access_check_needed()
Definition: objects-inl.h:4085
static JSBuiltinsObject * cast(Object *obj)
void Get(int descriptor_number, Descriptor *desc)
Definition: objects-inl.h:2688
static JSSet * cast(Object *obj)
static Map * cast(Object *obj)
kSerializedDataOffset Object
Definition: objects-inl.h:5016
static ByteArray * cast(Object *obj)
int32_t get_int32_entry(int index)
Definition: objects-inl.h:2306
static FreeSpace * cast(Object *obj)
static Foreign * cast(Object *obj)
FixedArray * literals()
Definition: objects-inl.h:5637
static Script * cast(Object *obj)
static SharedFunctionInfo * cast(Object *obj)
Name * GetKey(int transition_number)
static Code * cast(Object *obj)
static Symbol * cast(Object *obj)
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset internal_field_count
Definition: objects-inl.h:5034
static Smi * cast(Object *object)
kInstanceClassNameOffset flag
Definition: objects-inl.h:5115
bool has_instance_call_handler()
Definition: objects-inl.h:4157
static JSFunctionProxy * cast(Object *obj)
void FailurePrint(FILE *out=stdout)
Definition: objects.cc:1157
#define UNREACHABLE()
Definition: checks.h:52
Object * get_heap_ptr_entry(int index)
Definition: objects-inl.h:2299
static JSGlobalProxy * cast(Object *obj)
static Cell * cast(Object *obj)
int pre_allocated_property_fields()
Definition: objects-inl.h:3933
double get_int64_entry_as_double(int index)
Definition: objects-inl.h:2284
static Failure * cast(MaybeObject *object)
Definition: objects-inl.h:667
static Oddball * cast(Object *obj)
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 JSTypedArray * cast(Object *obj)
static FixedDoubleArray * cast(Object *obj)
ElementsKind GetElementsKind()
Definition: objects.h:8360
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
#define T(name, string, precedence)
Definition: token.cc:48
static JSDate * cast(Object *obj)
Definition: objects-inl.h:5776
bool HasTransitionArray()
Definition: objects-inl.h:4807
static JSDataView * cast(Object *obj)
void PrintElementsKind(FILE *out, ElementsKind kind)
bool has_named_interceptor()
Definition: objects.h:5898
static HeapNumber * cast(Object *obj)
static void WriteToFlat(String *source, sinkchar *sink, int from, int to)
Definition: objects.cc:8635
NameDictionary * property_dictionary()
Definition: objects-inl.h:6142
#define STRUCT_LIST(V)
Definition: objects.h:590
bool has_indexed_interceptor()
Definition: objects.h:5907
Object * GetBackPointer()
Definition: objects-inl.h:4791
void HeapNumberPrint(FILE *out=stdout)
Definition: objects.cc:1905
static JSValue * cast(Object *obj)
Definition: objects-inl.h:5758
void ShortPrint(FILE *out=stdout)
Definition: objects.cc:1123
#define TYPED_ARRAYS(V)
Definition: objects.h:4663
bool is_undetectable()
Definition: objects.h:5921
static JSWeakMap * cast(Object *obj)
static JSWeakSet * cast(Object *obj)
InstanceType instance_type()
Definition: objects-inl.h:4012
static JSProxy * cast(Object *obj)
void SmiPrint(FILE *out=stdout)
Definition: objects.cc:1142
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
ElementsKind elements_kind()
Definition: objects.h:5945
kSerializedDataOffset kPrototypeTemplateOffset indexed_property_handler
Definition: objects-inl.h:5021
static JSArrayBuffer * cast(Object *obj)
int aliased_context_slot()
kSerializedDataOffset prototype_template
Definition: objects-inl.h:5016
void Flush(FILE *out)
Definition: v8utils.cc:65
static JSModule * cast(Object *obj)
Definition: objects-inl.h:5748
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
Definition: flags.cc:505
#define MAKE_STRUCT_CASE(NAME, Name, name)
Address get_code_ptr_entry(int index)
Definition: objects-inl.h:2292
static JSObject * cast(Object *obj)
CompilationType compilation_type()
PropertyDetails GetTargetDetails(int transition_number)
static JSGlobalObject * cast(Object *obj)
static JSFunction * cast(Object *obj)