OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 463 matching lines...) Loading... |
474 CHECK(a); | 474 CHECK(a); |
475 CHECK_EQ(a->GetType(), v8::HeapGraphNode::kSymbol); | 475 CHECK_EQ(a->GetType(), v8::HeapGraphNode::kSymbol); |
476 CHECK(v8_str("symbol")->Equals(a->GetName())); | 476 CHECK(v8_str("symbol")->Equals(a->GetName())); |
477 const v8::HeapGraphNode* name = | 477 const v8::HeapGraphNode* name = |
478 GetProperty(a, v8::HeapGraphEdge::kInternal, "name"); | 478 GetProperty(a, v8::HeapGraphEdge::kInternal, "name"); |
479 CHECK(name); | 479 CHECK(name); |
480 CHECK(v8_str("mySymbol")->Equals(name->GetName())); | 480 CHECK(v8_str("mySymbol")->Equals(name->GetName())); |
481 } | 481 } |
482 | 482 |
483 | 483 |
| 484 TEST(HeapSnapshotFloat32x4) { |
| 485 i::FLAG_harmony_simd = true; |
| 486 LocalContext env; |
| 487 v8::HandleScope scope(env->GetIsolate()); |
| 488 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
| 489 |
| 490 CompileRun("a = SIMD.float32x4(1, 2, 3, 4);\n"); |
| 491 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(); |
| 492 CHECK(ValidateSnapshot(snapshot)); |
| 493 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
| 494 const v8::HeapGraphNode* a = |
| 495 GetProperty(global, v8::HeapGraphEdge::kProperty, "a"); |
| 496 CHECK(a); |
| 497 CHECK_EQ(a->GetType(), v8::HeapGraphNode::kSimdValue); |
| 498 } |
| 499 |
| 500 |
484 TEST(HeapSnapshotWeakCollection) { | 501 TEST(HeapSnapshotWeakCollection) { |
485 LocalContext env; | 502 LocalContext env; |
486 v8::HandleScope scope(env->GetIsolate()); | 503 v8::HandleScope scope(env->GetIsolate()); |
487 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 504 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
488 | 505 |
489 CompileRun( | 506 CompileRun( |
490 "k = {}; v = {}; s = 'str';\n" | 507 "k = {}; v = {}; s = 'str';\n" |
491 "ws = new WeakSet(); ws.add(k); ws.add(v); ws[s] = s;\n" | 508 "ws = new WeakSet(); ws.add(k); ws.add(v); ws[s] = s;\n" |
492 "wm = new WeakMap(); wm.set(k, v); wm[s] = s;\n"); | 509 "wm = new WeakMap(); wm.set(k, v); wm[s] = s;\n"); |
493 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(); | 510 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(); |
(...skipping 2262 matching lines...) Loading... |
2756 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2773 map.AddRange(ToAddress(0x180), 0x80, 6U); |
2757 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2774 map.AddRange(ToAddress(0x180), 0x80, 7U); |
2758 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); | 2775 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); |
2759 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); | 2776 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); |
2760 CHECK_EQ(3u, map.size()); | 2777 CHECK_EQ(3u, map.size()); |
2761 | 2778 |
2762 map.Clear(); | 2779 map.Clear(); |
2763 CHECK_EQ(0u, map.size()); | 2780 CHECK_EQ(0u, map.size()); |
2764 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); | 2781 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); |
2765 } | 2782 } |
OLD | NEW |