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 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 HeapObject::PrintHeader(os, "Cell"); | 988 HeapObject::PrintHeader(os, "Cell"); |
989 os << "\n - value: " << Brief(value()); | 989 os << "\n - value: " << Brief(value()); |
990 os << "\n"; | 990 os << "\n"; |
991 } | 991 } |
992 | 992 |
993 | 993 |
994 void PropertyCell::PropertyCellPrint(std::ostream& os) { // NOLINT | 994 void PropertyCell::PropertyCellPrint(std::ostream& os) { // NOLINT |
995 HeapObject::PrintHeader(os, "PropertyCell"); | 995 HeapObject::PrintHeader(os, "PropertyCell"); |
996 os << "\n - value: " << Brief(value()); | 996 os << "\n - value: " << Brief(value()); |
997 os << "\n - details: " << property_details(); | 997 os << "\n - details: " << property_details(); |
| 998 PropertyCellType cell_type = property_details().cell_type(); |
| 999 os << "\n - cell_type: "; |
| 1000 if (value()->IsTheHole(GetIsolate())) { |
| 1001 switch (cell_type) { |
| 1002 case PropertyCellType::kUninitialized: |
| 1003 os << "Uninitialized"; |
| 1004 break; |
| 1005 case PropertyCellType::kInvalidated: |
| 1006 os << "Invalidated"; |
| 1007 break; |
| 1008 default: |
| 1009 os << "??? " << static_cast<int>(cell_type); |
| 1010 break; |
| 1011 } |
| 1012 } else { |
| 1013 switch (cell_type) { |
| 1014 case PropertyCellType::kUndefined: |
| 1015 os << "Undefined"; |
| 1016 break; |
| 1017 case PropertyCellType::kConstant: |
| 1018 os << "Constant"; |
| 1019 break; |
| 1020 case PropertyCellType::kConstantType: |
| 1021 os << "ConstantType" |
| 1022 << " ("; |
| 1023 switch (GetConstantType()) { |
| 1024 case PropertyCellConstantType::kSmi: |
| 1025 os << "Smi"; |
| 1026 break; |
| 1027 case PropertyCellConstantType::kStableMap: |
| 1028 os << "StableMap"; |
| 1029 break; |
| 1030 } |
| 1031 os << ")"; |
| 1032 break; |
| 1033 case PropertyCellType::kMutable: |
| 1034 os << "Mutable"; |
| 1035 break; |
| 1036 } |
| 1037 } |
998 os << "\n"; | 1038 os << "\n"; |
999 } | 1039 } |
1000 | 1040 |
1001 | 1041 |
1002 void WeakCell::WeakCellPrint(std::ostream& os) { // NOLINT | 1042 void WeakCell::WeakCellPrint(std::ostream& os) { // NOLINT |
1003 HeapObject::PrintHeader(os, "WeakCell"); | 1043 HeapObject::PrintHeader(os, "WeakCell"); |
1004 if (cleared()) { | 1044 if (cleared()) { |
1005 os << "\n - cleared"; | 1045 os << "\n - cleared"; |
1006 } else { | 1046 } else { |
1007 os << "\n - value: " << Brief(value()); | 1047 os << "\n - value: " << Brief(value()); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1419 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1380 Object* transitions = map()->raw_transitions(); | 1420 Object* transitions = map()->raw_transitions(); |
1381 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1421 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1382 if (num_transitions == 0) return; | 1422 if (num_transitions == 0) return; |
1383 os << "\n - transitions"; | 1423 os << "\n - transitions"; |
1384 TransitionArray::PrintTransitions(os, transitions, false); | 1424 TransitionArray::PrintTransitions(os, transitions, false); |
1385 } | 1425 } |
1386 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1426 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1387 } // namespace internal | 1427 } // namespace internal |
1388 } // namespace v8 | 1428 } // namespace v8 |
OLD | NEW |