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

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

Issue 1302513004: [simd.js] Macro-ize more SIMD code (2). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 2 more #undefs Created 5 years, 4 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') | no next file » | 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/v8.h" 5 #include "src/v8.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/ostreams.h" 10 #include "src/ostreams.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT 203 void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT
204 char arr[100]; 204 char arr[100];
205 Vector<char> buffer(arr, arraysize(arr)); 205 Vector<char> buffer(arr, arraysize(arr));
206 os << std::string(DoubleToCString(get_lane(0), buffer)) << ", " 206 os << std::string(DoubleToCString(get_lane(0), buffer)) << ", "
207 << std::string(DoubleToCString(get_lane(1), buffer)) << ", " 207 << std::string(DoubleToCString(get_lane(1), buffer)) << ", "
208 << std::string(DoubleToCString(get_lane(2), buffer)) << ", " 208 << std::string(DoubleToCString(get_lane(2), buffer)) << ", "
209 << std::string(DoubleToCString(get_lane(3), buffer)); 209 << std::string(DoubleToCString(get_lane(3), buffer));
210 } 210 }
211 211
212 212
213 void Int32x4::Int32x4Print(std::ostream& os) { // NOLINT 213 #define SIMD128_INT_PRINT_FUNCTION(type, lane_count) \
214 char arr[100]; 214 void type::type##Print(std::ostream& os) { \
215 Vector<char> buffer(arr, arraysize(arr)); 215 char arr[100]; \
216 os << std::string(IntToCString(get_lane(0), buffer)) << ", " 216 Vector<char> buffer(arr, arraysize(arr)); \
217 << std::string(IntToCString(get_lane(1), buffer)) << ", " 217 os << std::string(IntToCString(get_lane(0), buffer)); \
218 << std::string(IntToCString(get_lane(2), buffer)) << ", " 218 for (int i = 1; i < lane_count; i++) { \
219 << std::string(IntToCString(get_lane(3), buffer)); 219 os << ", " << std::string(IntToCString(get_lane(i), buffer)); \
220 } 220 } \
221 }
222 SIMD128_INT_PRINT_FUNCTION(Int32x4, 4)
223 SIMD128_INT_PRINT_FUNCTION(Int16x8, 8)
224 SIMD128_INT_PRINT_FUNCTION(Int8x16, 16)
225 #undef SIMD128_INT_PRINT_FUNCTION
221 226
222 227
223 void Bool32x4::Bool32x4Print(std::ostream& os) { // NOLINT 228 #define SIMD128_BOOL_PRINT_FUNCTION(type, lane_count) \
224 os << std::string(get_lane(0) ? "true" : "false") << ", " 229 void type::type##Print(std::ostream& os) { \
225 << std::string(get_lane(1) ? "true" : "false") << ", " 230 char arr[100]; \
226 << std::string(get_lane(2) ? "true" : "false") << ", " 231 Vector<char> buffer(arr, arraysize(arr)); \
227 << std::string(get_lane(3) ? "true" : "false"); 232 os << std::string(get_lane(0) ? "true" : "false"); \
228 } 233 for (int i = 1; i < lane_count; i++) { \
229 234 os << ", " << std::string(get_lane(i) ? "true" : "false"); \
230 235 } \
231 void Int16x8::Int16x8Print(std::ostream& os) { // NOLINT
232 char arr[100];
233 Vector<char> buffer(arr, arraysize(arr));
234 os << std::string(IntToCString(get_lane(0), buffer));
235 for (int i = 1; i < 8; i++) {
236 os << ", " << std::string(IntToCString(get_lane(i), buffer));
237 } 236 }
238 } 237 SIMD128_BOOL_PRINT_FUNCTION(Bool32x4, 4)
239 238 SIMD128_BOOL_PRINT_FUNCTION(Bool16x8, 8)
240 239 SIMD128_BOOL_PRINT_FUNCTION(Bool8x16, 16)
241 void Bool16x8::Bool16x8Print(std::ostream& os) { // NOLINT 240 #undef SIMD128_BOOL_PRINT_FUNCTION
242 char arr[100];
243 Vector<char> buffer(arr, arraysize(arr));
244 os << std::string(get_lane(0) ? "true" : "false");
245 for (int i = 1; i < 8; i++) {
246 os << ", " << std::string(get_lane(i) ? "true" : "false");
247 }
248 }
249
250
251 void Int8x16::Int8x16Print(std::ostream& os) { // NOLINT
252 char arr[100];
253 Vector<char> buffer(arr, arraysize(arr));
254 os << std::string(IntToCString(get_lane(0), buffer));
255 for (int i = 1; i < 16; i++) {
256 os << ", " << std::string(IntToCString(get_lane(i), buffer));
257 }
258 }
259
260
261 void Bool8x16::Bool8x16Print(std::ostream& os) { // NOLINT
262 char arr[100];
263 Vector<char> buffer(arr, arraysize(arr));
264 os << std::string(get_lane(0) ? "true" : "false");
265 for (int i = 1; i < 16; i++) {
266 os << ", " << std::string(get_lane(i) ? "true" : "false");
267 }
268 }
269 241
270 242
271 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT 243 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT
272 os << "byte array, data starts at " << GetDataStartAddress(); 244 os << "byte array, data starts at " << GetDataStartAddress();
273 } 245 }
274 246
275 247
276 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT 248 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT
277 Disassemble(os); 249 Disassemble(os);
278 } 250 }
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 } 1255 }
1284 } 1256 }
1285 1257
1286 1258
1287 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1259 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1288 TransitionArray::PrintTransitions(os, map()->raw_transitions()); 1260 TransitionArray::PrintTransitions(os, map()->raw_transitions());
1289 } 1261 }
1290 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1262 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1291 } // namespace internal 1263 } // namespace internal
1292 } // namespace v8 1264 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698