Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: src/objects-printer.cc

Issue 2692933002: Revert of Remove SIMD.js from V8. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
77 case FIXED_DOUBLE_ARRAY_TYPE: 80 case FIXED_DOUBLE_ARRAY_TYPE:
78 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); 81 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os);
79 break; 82 break;
80 case FIXED_ARRAY_TYPE: 83 case FIXED_ARRAY_TYPE:
81 FixedArray::cast(this)->FixedArrayPrint(os); 84 FixedArray::cast(this)->FixedArrayPrint(os);
82 break; 85 break;
83 case BYTE_ARRAY_TYPE: 86 case BYTE_ARRAY_TYPE:
84 ByteArray::cast(this)->ByteArrayPrint(os); 87 ByteArray::cast(this)->ByteArrayPrint(os);
85 break; 88 break;
86 case BYTECODE_ARRAY_TYPE: 89 case BYTECODE_ARRAY_TYPE:
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 STRUCT_LIST(MAKE_STRUCT_CASE) 246 STRUCT_LIST(MAKE_STRUCT_CASE)
244 #undef MAKE_STRUCT_CASE 247 #undef MAKE_STRUCT_CASE
245 248
246 default: 249 default:
247 os << "UNKNOWN TYPE " << map()->instance_type(); 250 os << "UNKNOWN TYPE " << map()->instance_type();
248 UNREACHABLE(); 251 UNREACHABLE();
249 break; 252 break;
250 } 253 }
251 } 254 }
252 255
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
253 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT 309 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT
254 os << "byte array, data starts at " << GetDataStartAddress(); 310 os << "byte array, data starts at " << GetDataStartAddress();
255 } 311 }
256 312
257 313
258 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT 314 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT
259 Disassemble(os); 315 Disassemble(os);
260 } 316 }
261 317
262 318
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 printf("Not a transition array\n"); 1722 printf("Not a transition array\n");
1667 } else { 1723 } else {
1668 reinterpret_cast<i::TransitionArray*>(object)->Print(); 1724 reinterpret_cast<i::TransitionArray*>(object)->Print();
1669 } 1725 }
1670 } 1726 }
1671 1727
1672 extern void _v8_internal_Print_StackTrace() { 1728 extern void _v8_internal_Print_StackTrace() {
1673 i::Isolate* isolate = i::Isolate::Current(); 1729 i::Isolate* isolate = i::Isolate::Current();
1674 isolate->PrintStack(stdout); 1730 isolate->PrintStack(stdout);
1675 } 1731 }
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698