OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 value = factory->NewFloat32x4(special_lanes); | 281 value = factory->NewFloat32x4(special_lanes); |
282 std::ostringstream os; | 282 std::ostringstream os; |
283 value->Float32x4Print(os); | 283 value->Float32x4Print(os); |
284 // Value printing doesn't preserve signed zeroes. | 284 // Value printing doesn't preserve signed zeroes. |
285 CHECK_EQ("0, 0, NaN, NaN", os.str()); | 285 CHECK_EQ("0, 0, NaN, NaN", os.str()); |
286 } | 286 } |
287 #endif // OBJECT_PRINT | 287 #endif // OBJECT_PRINT |
288 } | 288 } |
289 // Int32x4 | 289 // Int32x4 |
290 { | 290 { |
291 int32_t lanes[4] = {-1, 0, 1, 2}; | 291 int32_t lanes[4] = {1, 2, 3, 4}; |
292 | 292 |
293 Handle<Int32x4> value = factory->NewInt32x4(lanes); | 293 Handle<Int32x4> value = factory->NewInt32x4(lanes); |
294 CHECK(value->IsInt32x4()); | 294 CHECK(value->IsInt32x4()); |
295 CheckSimdValue<Int32x4, int32_t, 4>(*value, lanes, 3); | 295 CheckSimdValue<Int32x4, int32_t, 4>(*value, lanes, 3); |
296 | 296 |
297 #ifdef OBJECT_PRINT | 297 #ifdef OBJECT_PRINT |
298 std::ostringstream os; | 298 std::ostringstream os; |
299 value->Int32x4Print(os); | 299 value->Int32x4Print(os); |
300 CHECK_EQ("-1, 0, 1, 2", os.str()); | 300 CHECK_EQ("1, 2, 3, 4", os.str()); |
| 301 #endif // OBJECT_PRINT |
| 302 } |
| 303 // Uint32x4 |
| 304 { |
| 305 uint32_t lanes[4] = {1, 2, 3, 4}; |
| 306 |
| 307 Handle<Uint32x4> value = factory->NewUint32x4(lanes); |
| 308 CHECK(value->IsUint32x4()); |
| 309 CheckSimdValue<Uint32x4, uint32_t, 4>(*value, lanes, 3); |
| 310 |
| 311 #ifdef OBJECT_PRINT |
| 312 std::ostringstream os; |
| 313 value->Uint32x4Print(os); |
| 314 CHECK_EQ("1, 2, 3, 4", os.str()); |
301 #endif // OBJECT_PRINT | 315 #endif // OBJECT_PRINT |
302 } | 316 } |
303 // Bool32x4 | 317 // Bool32x4 |
304 { | 318 { |
305 bool lanes[4] = {true, true, true, false}; | 319 bool lanes[4] = {true, false, true, false}; |
306 | 320 |
307 Handle<Bool32x4> value = factory->NewBool32x4(lanes); | 321 Handle<Bool32x4> value = factory->NewBool32x4(lanes); |
308 CHECK(value->IsBool32x4()); | 322 CHECK(value->IsBool32x4()); |
309 CheckSimdValue<Bool32x4, bool, 4>(*value, lanes, false); | 323 CheckSimdValue<Bool32x4, bool, 4>(*value, lanes, false); |
310 | 324 |
311 #ifdef OBJECT_PRINT | 325 #ifdef OBJECT_PRINT |
312 std::ostringstream os; | 326 std::ostringstream os; |
313 value->Bool32x4Print(os); | 327 value->Bool32x4Print(os); |
314 CHECK_EQ("true, true, true, false", os.str()); | 328 CHECK_EQ("true, false, true, false", os.str()); |
315 #endif // OBJECT_PRINT | 329 #endif // OBJECT_PRINT |
316 } | 330 } |
317 // Int16x8 | 331 // Int16x8 |
318 { | 332 { |
319 int16_t lanes[8] = {-1, 0, 1, 2, 3, 4, 5, -32768}; | 333 int16_t lanes[8] = {1, 2, 3, 4, 5, 6, 7, 8}; |
320 | 334 |
321 Handle<Int16x8> value = factory->NewInt16x8(lanes); | 335 Handle<Int16x8> value = factory->NewInt16x8(lanes); |
322 CHECK(value->IsInt16x8()); | 336 CHECK(value->IsInt16x8()); |
323 CheckSimdValue<Int16x8, int16_t, 8>(*value, lanes, 32767); | 337 CheckSimdValue<Int16x8, int16_t, 8>(*value, lanes, 32767); |
324 | 338 |
325 #ifdef OBJECT_PRINT | 339 #ifdef OBJECT_PRINT |
326 std::ostringstream os; | 340 std::ostringstream os; |
327 value->Int16x8Print(os); | 341 value->Int16x8Print(os); |
328 CHECK_EQ("-1, 0, 1, 2, 3, 4, 5, -32768", os.str()); | 342 CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8", os.str()); |
| 343 #endif // OBJECT_PRINT |
| 344 } |
| 345 // Uint16x8 |
| 346 { |
| 347 uint16_t lanes[8] = {1, 2, 3, 4, 5, 6, 7, 8}; |
| 348 |
| 349 Handle<Uint16x8> value = factory->NewUint16x8(lanes); |
| 350 CHECK(value->IsUint16x8()); |
| 351 CheckSimdValue<Uint16x8, uint16_t, 8>(*value, lanes, 32767); |
| 352 |
| 353 #ifdef OBJECT_PRINT |
| 354 std::ostringstream os; |
| 355 value->Uint16x8Print(os); |
| 356 CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8", os.str()); |
329 #endif // OBJECT_PRINT | 357 #endif // OBJECT_PRINT |
330 } | 358 } |
331 // Bool16x8 | 359 // Bool16x8 |
332 { | 360 { |
333 bool lanes[8] = {true, true, true, true, true, true, true, false}; | 361 bool lanes[8] = {true, false, true, false, true, false, true, false}; |
334 | 362 |
335 Handle<Bool16x8> value = factory->NewBool16x8(lanes); | 363 Handle<Bool16x8> value = factory->NewBool16x8(lanes); |
336 CHECK(value->IsBool16x8()); | 364 CHECK(value->IsBool16x8()); |
337 CheckSimdValue<Bool16x8, bool, 8>(*value, lanes, false); | 365 CheckSimdValue<Bool16x8, bool, 8>(*value, lanes, false); |
338 | 366 |
339 #ifdef OBJECT_PRINT | 367 #ifdef OBJECT_PRINT |
340 std::ostringstream os; | 368 std::ostringstream os; |
341 value->Bool16x8Print(os); | 369 value->Bool16x8Print(os); |
342 CHECK_EQ("true, true, true, true, true, true, true, false", os.str()); | 370 CHECK_EQ("true, false, true, false, true, false, true, false", os.str()); |
343 #endif // OBJECT_PRINT | 371 #endif // OBJECT_PRINT |
344 } | 372 } |
345 // Int8x16 | 373 // Int8x16 |
346 { | 374 { |
347 int8_t lanes[16] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -128}; | 375 int8_t lanes[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; |
348 | 376 |
349 Handle<Int8x16> value = factory->NewInt8x16(lanes); | 377 Handle<Int8x16> value = factory->NewInt8x16(lanes); |
350 CHECK(value->IsInt8x16()); | 378 CHECK(value->IsInt8x16()); |
351 CheckSimdValue<Int8x16, int8_t, 16>(*value, lanes, 127); | 379 CheckSimdValue<Int8x16, int8_t, 16>(*value, lanes, 127); |
352 | 380 |
353 #ifdef OBJECT_PRINT | 381 #ifdef OBJECT_PRINT |
354 std::ostringstream os; | 382 std::ostringstream os; |
355 value->Int8x16Print(os); | 383 value->Int8x16Print(os); |
356 CHECK_EQ("-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -128", | 384 CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16", os.str()); |
357 os.str()); | 385 #endif // OBJECT_PRINT |
| 386 } |
| 387 // Uint8x16 |
| 388 { |
| 389 uint8_t lanes[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; |
| 390 |
| 391 Handle<Uint8x16> value = factory->NewUint8x16(lanes); |
| 392 CHECK(value->IsUint8x16()); |
| 393 CheckSimdValue<Uint8x16, uint8_t, 16>(*value, lanes, 127); |
| 394 |
| 395 #ifdef OBJECT_PRINT |
| 396 std::ostringstream os; |
| 397 value->Uint8x16Print(os); |
| 398 CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16", os.str()); |
358 #endif // OBJECT_PRINT | 399 #endif // OBJECT_PRINT |
359 } | 400 } |
360 // Bool8x16 | 401 // Bool8x16 |
361 { | 402 { |
362 bool lanes[16] = {true, true, true, true, true, true, true, false, | 403 bool lanes[16] = {true, false, true, false, true, false, true, false, |
363 true, true, true, true, true, true, true, false}; | 404 true, false, true, false, true, false, true, false}; |
364 | 405 |
365 Handle<Bool8x16> value = factory->NewBool8x16(lanes); | 406 Handle<Bool8x16> value = factory->NewBool8x16(lanes); |
366 CHECK(value->IsBool8x16()); | 407 CHECK(value->IsBool8x16()); |
367 CheckSimdValue<Bool8x16, bool, 16>(*value, lanes, false); | 408 CheckSimdValue<Bool8x16, bool, 16>(*value, lanes, false); |
368 | 409 |
369 #ifdef OBJECT_PRINT | 410 #ifdef OBJECT_PRINT |
370 std::ostringstream os; | 411 std::ostringstream os; |
371 value->Bool8x16Print(os); | 412 value->Bool8x16Print(os); |
372 CHECK_EQ( | 413 CHECK_EQ( |
373 "true, true, true, true, true, true, true, false, true, true, true, " | 414 "true, false, true, false, true, false, true, false, true, false, " |
374 "true, true, true, true, false", | 415 "true, false, true, false, true, false", |
375 os.str()); | 416 os.str()); |
376 #endif // OBJECT_PRINT | 417 #endif // OBJECT_PRINT |
377 } | 418 } |
378 } | 419 } |
379 | 420 |
380 | 421 |
381 TEST(Tagging) { | 422 TEST(Tagging) { |
382 CcTest::InitializeVM(); | 423 CcTest::InitializeVM(); |
383 int request = 24; | 424 int request = 24; |
384 CHECK_EQ(request, static_cast<int>(OBJECT_POINTER_ALIGN(request))); | 425 CHECK_EQ(request, static_cast<int>(OBJECT_POINTER_ALIGN(request))); |
(...skipping 6140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6525 { | 6566 { |
6526 SharedFunctionInfo::Iterator iterator(isolate); | 6567 SharedFunctionInfo::Iterator iterator(isolate); |
6527 while (iterator.Next()) sfi_count--; | 6568 while (iterator.Next()) sfi_count--; |
6528 } | 6569 } |
6529 | 6570 |
6530 CHECK_EQ(0, sfi_count); | 6571 CHECK_EQ(0, sfi_count); |
6531 } | 6572 } |
6532 | 6573 |
6533 } // namespace internal | 6574 } // namespace internal |
6534 } // namespace v8 | 6575 } // namespace v8 |
OLD | NEW |