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/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 break; | 96 break; |
97 | 97 |
98 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 98 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
99 case Fixed##Type##Array::kInstanceType: \ | 99 case Fixed##Type##Array::kInstanceType: \ |
100 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ | 100 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ |
101 break; | 101 break; |
102 | 102 |
103 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) | 103 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) |
104 #undef PRINT_FIXED_TYPED_ARRAY | 104 #undef PRINT_FIXED_TYPED_ARRAY |
105 | 105 |
| 106 case JS_TYPED_ARRAY_KEY_ITERATOR_TYPE: |
| 107 case JS_FAST_ARRAY_KEY_ITERATOR_TYPE: |
| 108 case JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE: |
| 109 case JS_INT8_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 110 case JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 111 case JS_INT16_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 112 case JS_UINT16_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 113 case JS_INT32_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 114 case JS_UINT32_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 115 case JS_FLOAT32_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 116 case JS_FLOAT64_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 117 case JS_UINT8_CLAMPED_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 118 case JS_FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 119 case JS_FAST_HOLEY_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 120 case JS_FAST_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 121 case JS_FAST_HOLEY_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 122 case JS_FAST_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 123 case JS_FAST_HOLEY_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 124 case JS_GENERIC_ARRAY_KEY_VALUE_ITERATOR_TYPE: |
| 125 case JS_INT8_ARRAY_VALUE_ITERATOR_TYPE: |
| 126 case JS_UINT8_ARRAY_VALUE_ITERATOR_TYPE: |
| 127 case JS_INT16_ARRAY_VALUE_ITERATOR_TYPE: |
| 128 case JS_UINT16_ARRAY_VALUE_ITERATOR_TYPE: |
| 129 case JS_INT32_ARRAY_VALUE_ITERATOR_TYPE: |
| 130 case JS_UINT32_ARRAY_VALUE_ITERATOR_TYPE: |
| 131 case JS_FLOAT32_ARRAY_VALUE_ITERATOR_TYPE: |
| 132 case JS_FLOAT64_ARRAY_VALUE_ITERATOR_TYPE: |
| 133 case JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE: |
| 134 case JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE: |
| 135 case JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE: |
| 136 case JS_FAST_ARRAY_VALUE_ITERATOR_TYPE: |
| 137 case JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE: |
| 138 case JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE: |
| 139 case JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE: |
| 140 case JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE: |
| 141 JSArrayIterator::cast(this)->JSArrayIteratorPrint(os); |
| 142 break; |
| 143 |
106 case FILLER_TYPE: | 144 case FILLER_TYPE: |
107 os << "filler"; | 145 os << "filler"; |
108 break; | 146 break; |
109 case JS_OBJECT_TYPE: // fall through | 147 case JS_OBJECT_TYPE: // fall through |
110 case JS_API_OBJECT_TYPE: | 148 case JS_API_OBJECT_TYPE: |
111 case JS_SPECIAL_API_OBJECT_TYPE: | 149 case JS_SPECIAL_API_OBJECT_TYPE: |
112 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 150 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
113 case JS_GENERATOR_OBJECT_TYPE: | 151 case JS_GENERATOR_OBJECT_TYPE: |
114 case JS_PROMISE_TYPE: | 152 case JS_PROMISE_TYPE: |
115 case JS_ARGUMENTS_TYPE: | 153 case JS_ARGUMENTS_TYPE: |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 void JSTypedArray::JSTypedArrayPrint(std::ostream& os) { // NOLINT | 984 void JSTypedArray::JSTypedArrayPrint(std::ostream& os) { // NOLINT |
947 JSObjectPrintHeader(os, this, "JSTypedArray"); | 985 JSObjectPrintHeader(os, this, "JSTypedArray"); |
948 os << "\n - buffer = " << Brief(buffer()); | 986 os << "\n - buffer = " << Brief(buffer()); |
949 os << "\n - byte_offset = " << Brief(byte_offset()); | 987 os << "\n - byte_offset = " << Brief(byte_offset()); |
950 os << "\n - byte_length = " << Brief(byte_length()); | 988 os << "\n - byte_length = " << Brief(byte_length()); |
951 os << "\n - length = " << Brief(length()); | 989 os << "\n - length = " << Brief(length()); |
952 if (WasNeutered()) os << "\n - neutered"; | 990 if (WasNeutered()) os << "\n - neutered"; |
953 JSObjectPrintBody(os, this, !WasNeutered()); | 991 JSObjectPrintBody(os, this, !WasNeutered()); |
954 } | 992 } |
955 | 993 |
| 994 void JSArrayIterator::JSArrayIteratorPrint(std::ostream& os) { // NOLING |
| 995 JSObjectPrintHeader(os, this, "JSArrayIterator"); |
| 996 |
| 997 InstanceType instance_type = map()->instance_type(); |
| 998 std::string type; |
| 999 if (instance_type <= LAST_ARRAY_KEY_ITERATOR_TYPE) { |
| 1000 type = "keys"; |
| 1001 } else if (instance_type <= LAST_ARRAY_KEY_VALUE_ITERATOR_TYPE) { |
| 1002 type = "entries"; |
| 1003 } else { |
| 1004 type = "values"; |
| 1005 } |
| 1006 |
| 1007 os << "\n - type = " << type; |
| 1008 os << "\n - object = " << Brief(object()); |
| 1009 os << "\n - index = " << Brief(index()); |
| 1010 |
| 1011 JSObjectPrintBody(os, this); |
| 1012 } |
| 1013 |
956 void JSFixedArrayIterator::JSFixedArrayIteratorPrint( | 1014 void JSFixedArrayIterator::JSFixedArrayIteratorPrint( |
957 std::ostream& os) { // NOLINT | 1015 std::ostream& os) { // NOLINT |
958 JSObjectPrintHeader(os, this, "JSFixedArrayIterator"); | 1016 JSObjectPrintHeader(os, this, "JSFixedArrayIterator"); |
959 os << "\n - array = " << Brief(array()); | 1017 os << "\n - array = " << Brief(array()); |
960 os << "\n - index = " << index(); | 1018 os << "\n - index = " << index(); |
961 os << "\n - initial_next = " << Brief(initial_next()); | 1019 os << "\n - initial_next = " << Brief(initial_next()); |
962 JSObjectPrintBody(os, this); | 1020 JSObjectPrintBody(os, this); |
963 } | 1021 } |
964 | 1022 |
965 void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT | 1023 void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 printf("Not a transition array\n"); | 1654 printf("Not a transition array\n"); |
1597 } else { | 1655 } else { |
1598 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1656 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
1599 } | 1657 } |
1600 } | 1658 } |
1601 | 1659 |
1602 extern void _v8_internal_Print_StackTrace() { | 1660 extern void _v8_internal_Print_StackTrace() { |
1603 i::Isolate* isolate = i::Isolate::Current(); | 1661 i::Isolate* isolate = i::Isolate::Current(); |
1604 isolate->PrintStack(stdout); | 1662 isolate->PrintStack(stdout); |
1605 } | 1663 } |
OLD | NEW |