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 "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 break; | 389 break; |
390 } | 390 } |
391 } | 391 } |
392 | 392 |
393 | 393 |
394 static void JSObjectPrintHeader(std::ostream& os, JSObject* obj, | 394 static void JSObjectPrintHeader(std::ostream& os, JSObject* obj, |
395 const char* id) { // NOLINT | 395 const char* id) { // NOLINT |
396 obj->PrintHeader(os, id); | 396 obj->PrintHeader(os, id); |
397 // Don't call GetElementsKind, its validation code can cause the printer to | 397 // Don't call GetElementsKind, its validation code can cause the printer to |
398 // fail when debugging. | 398 // fail when debugging. |
| 399 os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " [" |
| 400 << ElementsKindToString(obj->map()->elements_kind()); |
| 401 if (obj->elements()->map() == obj->GetHeap()->fixed_cow_array_map()) { |
| 402 os << " (COW)"; |
| 403 } |
399 PrototypeIterator iter(obj->GetIsolate(), obj); | 404 PrototypeIterator iter(obj->GetIsolate(), obj); |
400 os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " [" | 405 os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); |
401 << ElementsKindToString(obj->map()->elements_kind()) | 406 if (obj->elements()->length() > 0) { |
402 << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); | 407 os << "\n - elements = " << Brief(obj->elements()); |
| 408 } |
403 } | 409 } |
404 | 410 |
405 | 411 |
406 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT | 412 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT |
407 bool print_elements = true) { | 413 bool print_elements = true) { |
408 os << "\n {"; | 414 os << "\n {"; |
409 obj->PrintProperties(os); | 415 obj->PrintProperties(os); |
410 obj->PrintTransitions(os); | 416 obj->PrintTransitions(os); |
411 if (print_elements) obj->PrintElements(os); | 417 if (print_elements) obj->PrintElements(os); |
412 os << "\n }\n"; | 418 os << "\n }\n"; |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1336 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1331 Object* transitions = map()->raw_transitions(); | 1337 Object* transitions = map()->raw_transitions(); |
1332 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1338 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1333 if (num_transitions == 0) return; | 1339 if (num_transitions == 0) return; |
1334 os << "\n - transitions"; | 1340 os << "\n - transitions"; |
1335 TransitionArray::PrintTransitions(os, transitions, false); | 1341 TransitionArray::PrintTransitions(os, transitions, false); |
1336 } | 1342 } |
1337 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1343 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1338 } // namespace internal | 1344 } // namespace internal |
1339 } // namespace v8 | 1345 } // namespace v8 |
OLD | NEW |