OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 os << "DictionaryProperties"; | 445 os << "DictionaryProperties"; |
446 } | 446 } |
447 PrototypeIterator iter(obj->GetIsolate(), obj); | 447 PrototypeIterator iter(obj->GetIsolate(), obj); |
448 os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); | 448 os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); |
449 os << "\n - elements = " << Brief(obj->elements()) << " [" | 449 os << "\n - elements = " << Brief(obj->elements()) << " [" |
450 << ElementsKindToString(obj->map()->elements_kind()); | 450 << ElementsKindToString(obj->map()->elements_kind()); |
451 if (obj->elements()->map() == obj->GetHeap()->fixed_cow_array_map()) { | 451 if (obj->elements()->map() == obj->GetHeap()->fixed_cow_array_map()) { |
452 os << " (COW)"; | 452 os << " (COW)"; |
453 } | 453 } |
454 os << "]"; | 454 os << "]"; |
455 if (obj->GetInternalFieldCount() > 0) { | 455 if (obj->GetEmbedderFieldCount() > 0) { |
456 os << "\n - internal fields: " << obj->GetInternalFieldCount(); | 456 os << "\n - embedder fields: " << obj->GetEmbedderFieldCount(); |
457 } | 457 } |
458 } | 458 } |
459 | 459 |
460 | 460 |
461 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT | 461 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT |
462 bool print_elements = true) { | 462 bool print_elements = true) { |
463 os << "\n - properties = " << Brief(obj->properties()) << " {"; | 463 os << "\n - properties = " << Brief(obj->properties()) << " {"; |
464 if (obj->PrintProperties(os)) os << "\n "; | 464 if (obj->PrintProperties(os)) os << "\n "; |
465 os << "}\n"; | 465 os << "}\n"; |
466 if (print_elements && obj->elements()->length() > 0) { | 466 if (print_elements && obj->elements()->length() > 0) { |
467 os << " - elements = " << Brief(obj->elements()) << " {"; | 467 os << " - elements = " << Brief(obj->elements()) << " {"; |
468 if (obj->PrintElements(os)) os << "\n "; | 468 if (obj->PrintElements(os)) os << "\n "; |
469 os << "}\n"; | 469 os << "}\n"; |
470 } | 470 } |
471 int internal_fields = obj->GetInternalFieldCount(); | 471 int embedder_fields = obj->GetEmbedderFieldCount(); |
472 if (internal_fields > 0) { | 472 if (embedder_fields > 0) { |
473 os << " - internal fields = {"; | 473 os << " - embedder fields = {"; |
474 for (int i = 0; i < internal_fields; i++) { | 474 for (int i = 0; i < embedder_fields; i++) { |
475 os << "\n " << Brief(obj->GetInternalField(i)); | 475 os << "\n " << Brief(obj->GetEmbedderField(i)); |
476 } | 476 } |
477 os << "\n }\n"; | 477 os << "\n }\n"; |
478 } | 478 } |
479 } | 479 } |
480 | 480 |
481 | 481 |
482 void JSObject::JSObjectPrint(std::ostream& os) { // NOLINT | 482 void JSObject::JSObjectPrint(std::ostream& os) { // NOLINT |
483 JSObjectPrintHeader(os, this, nullptr); | 483 JSObjectPrintHeader(os, this, nullptr); |
484 JSObjectPrintBody(os, this); | 484 JSObjectPrintBody(os, this); |
485 } | 485 } |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 } | 1364 } |
1365 | 1365 |
1366 | 1366 |
1367 void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) { // NOLINT | 1367 void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) { // NOLINT |
1368 HeapObject::PrintHeader(os, "ObjectTemplateInfo"); | 1368 HeapObject::PrintHeader(os, "ObjectTemplateInfo"); |
1369 os << "\n - tag: " << Brief(tag()); | 1369 os << "\n - tag: " << Brief(tag()); |
1370 os << "\n - serial_number: " << Brief(serial_number()); | 1370 os << "\n - serial_number: " << Brief(serial_number()); |
1371 os << "\n - property_list: " << Brief(property_list()); | 1371 os << "\n - property_list: " << Brief(property_list()); |
1372 os << "\n - property_accessors: " << Brief(property_accessors()); | 1372 os << "\n - property_accessors: " << Brief(property_accessors()); |
1373 os << "\n - constructor: " << Brief(constructor()); | 1373 os << "\n - constructor: " << Brief(constructor()); |
1374 os << "\n - internal_field_count: " << internal_field_count(); | 1374 os << "\n - embedder_field_count: " << embedder_field_count(); |
1375 os << "\n - immutable_proto: " << (immutable_proto() ? "true" : "false"); | 1375 os << "\n - immutable_proto: " << (immutable_proto() ? "true" : "false"); |
1376 os << "\n"; | 1376 os << "\n"; |
1377 } | 1377 } |
1378 | 1378 |
1379 | 1379 |
1380 void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT | 1380 void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT |
1381 HeapObject::PrintHeader(os, "AllocationSite"); | 1381 HeapObject::PrintHeader(os, "AllocationSite"); |
1382 os << "\n - weak_next: " << Brief(weak_next()); | 1382 os << "\n - weak_next: " << Brief(weak_next()); |
1383 os << "\n - dependent code: " << Brief(dependent_code()); | 1383 os << "\n - dependent code: " << Brief(dependent_code()); |
1384 os << "\n - nested site: " << Brief(nested_site()); | 1384 os << "\n - nested site: " << Brief(nested_site()); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1705 printf("Not a transition array\n"); | 1705 printf("Not a transition array\n"); |
1706 } else { | 1706 } else { |
1707 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1707 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
1708 } | 1708 } |
1709 } | 1709 } |
1710 | 1710 |
1711 extern void _v8_internal_Print_StackTrace() { | 1711 extern void _v8_internal_Print_StackTrace() { |
1712 i::Isolate* isolate = i::Isolate::Current(); | 1712 i::Isolate* isolate = i::Isolate::Current(); |
1713 isolate->PrintStack(stdout); | 1713 isolate->PrintStack(stdout); |
1714 } | 1714 } |
OLD | NEW |