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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 break; | 67 break; |
68 case HEAP_NUMBER_TYPE: | 68 case HEAP_NUMBER_TYPE: |
69 HeapNumber::cast(this)->HeapNumberPrint(os); | 69 HeapNumber::cast(this)->HeapNumberPrint(os); |
70 os << "\n"; | 70 os << "\n"; |
71 break; | 71 break; |
72 case MUTABLE_HEAP_NUMBER_TYPE: | 72 case MUTABLE_HEAP_NUMBER_TYPE: |
73 os << "<mutable "; | 73 os << "<mutable "; |
74 HeapNumber::cast(this)->HeapNumberPrint(os); | 74 HeapNumber::cast(this)->HeapNumberPrint(os); |
75 os << ">\n"; | 75 os << ">\n"; |
76 break; | 76 break; |
77 case SIMD128_VALUE_TYPE: | |
78 Simd128Value::cast(this)->Simd128ValuePrint(os); | |
79 break; | |
80 case FIXED_DOUBLE_ARRAY_TYPE: | 77 case FIXED_DOUBLE_ARRAY_TYPE: |
81 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); | 78 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); |
82 break; | 79 break; |
83 case FIXED_ARRAY_TYPE: | 80 case FIXED_ARRAY_TYPE: |
84 FixedArray::cast(this)->FixedArrayPrint(os); | 81 FixedArray::cast(this)->FixedArrayPrint(os); |
85 break; | 82 break; |
86 case BYTE_ARRAY_TYPE: | 83 case BYTE_ARRAY_TYPE: |
87 ByteArray::cast(this)->ByteArrayPrint(os); | 84 ByteArray::cast(this)->ByteArrayPrint(os); |
88 break; | 85 break; |
89 case BYTECODE_ARRAY_TYPE: | 86 case BYTECODE_ARRAY_TYPE: |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 STRUCT_LIST(MAKE_STRUCT_CASE) | 243 STRUCT_LIST(MAKE_STRUCT_CASE) |
247 #undef MAKE_STRUCT_CASE | 244 #undef MAKE_STRUCT_CASE |
248 | 245 |
249 default: | 246 default: |
250 os << "UNKNOWN TYPE " << map()->instance_type(); | 247 os << "UNKNOWN TYPE " << map()->instance_type(); |
251 UNREACHABLE(); | 248 UNREACHABLE(); |
252 break; | 249 break; |
253 } | 250 } |
254 } | 251 } |
255 | 252 |
256 | |
257 void Simd128Value::Simd128ValuePrint(std::ostream& os) { // NOLINT | |
258 #define PRINT_SIMD128_VALUE(TYPE, Type, type, lane_count, lane_type) \ | |
259 if (Is##Type()) return Type::cast(this)->Type##Print(os); | |
260 SIMD128_TYPES(PRINT_SIMD128_VALUE) | |
261 #undef PRINT_SIMD128_VALUE | |
262 UNREACHABLE(); | |
263 } | |
264 | |
265 | |
266 void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT | |
267 char arr[100]; | |
268 Vector<char> buffer(arr, arraysize(arr)); | |
269 os << std::string(DoubleToCString(get_lane(0), buffer)) << ", " | |
270 << std::string(DoubleToCString(get_lane(1), buffer)) << ", " | |
271 << std::string(DoubleToCString(get_lane(2), buffer)) << ", " | |
272 << std::string(DoubleToCString(get_lane(3), buffer)); | |
273 } | |
274 | |
275 | |
276 #define SIMD128_INT_PRINT_FUNCTION(type, lane_count) \ | |
277 void type::type##Print(std::ostream& os) { \ | |
278 char arr[100]; \ | |
279 Vector<char> buffer(arr, arraysize(arr)); \ | |
280 os << std::string(IntToCString(get_lane(0), buffer)); \ | |
281 for (int i = 1; i < lane_count; i++) { \ | |
282 os << ", " << std::string(IntToCString(get_lane(i), buffer)); \ | |
283 } \ | |
284 } | |
285 SIMD128_INT_PRINT_FUNCTION(Int32x4, 4) | |
286 SIMD128_INT_PRINT_FUNCTION(Uint32x4, 4) | |
287 SIMD128_INT_PRINT_FUNCTION(Int16x8, 8) | |
288 SIMD128_INT_PRINT_FUNCTION(Uint16x8, 8) | |
289 SIMD128_INT_PRINT_FUNCTION(Int8x16, 16) | |
290 SIMD128_INT_PRINT_FUNCTION(Uint8x16, 16) | |
291 #undef SIMD128_INT_PRINT_FUNCTION | |
292 | |
293 | |
294 #define SIMD128_BOOL_PRINT_FUNCTION(type, lane_count) \ | |
295 void type::type##Print(std::ostream& os) { \ | |
296 char arr[100]; \ | |
297 Vector<char> buffer(arr, arraysize(arr)); \ | |
298 os << std::string(get_lane(0) ? "true" : "false"); \ | |
299 for (int i = 1; i < lane_count; i++) { \ | |
300 os << ", " << std::string(get_lane(i) ? "true" : "false"); \ | |
301 } \ | |
302 } | |
303 SIMD128_BOOL_PRINT_FUNCTION(Bool32x4, 4) | |
304 SIMD128_BOOL_PRINT_FUNCTION(Bool16x8, 8) | |
305 SIMD128_BOOL_PRINT_FUNCTION(Bool8x16, 16) | |
306 #undef SIMD128_BOOL_PRINT_FUNCTION | |
307 | |
308 | |
309 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT | 253 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT |
310 os << "byte array, data starts at " << GetDataStartAddress(); | 254 os << "byte array, data starts at " << GetDataStartAddress(); |
311 } | 255 } |
312 | 256 |
313 | 257 |
314 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT | 258 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT |
315 Disassemble(os); | 259 Disassemble(os); |
316 } | 260 } |
317 | 261 |
318 | 262 |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 printf("Not a transition array\n"); | 1666 printf("Not a transition array\n"); |
1723 } else { | 1667 } else { |
1724 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1668 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
1725 } | 1669 } |
1726 } | 1670 } |
1727 | 1671 |
1728 extern void _v8_internal_Print_StackTrace() { | 1672 extern void _v8_internal_Print_StackTrace() { |
1729 i::Isolate* isolate = i::Isolate::Current(); | 1673 i::Isolate* isolate = i::Isolate::Current(); |
1730 isolate->PrintStack(stdout); | 1674 isolate->PrintStack(stdout); |
1731 } | 1675 } |
OLD | NEW |