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

Side by Side Diff: test/cctest/test-heap-profiler.cc

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
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...) Expand 10 before | Expand all | Expand 10 after
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 LocalContext env;
486 v8::HandleScope scope(env->GetIsolate());
487 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
488
489 CompileRun("a = SIMD.float32x4(1, 2, 3, 4);\n");
490 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot();
491 CHECK(ValidateSnapshot(snapshot));
492 const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
493 const v8::HeapGraphNode* a =
494 GetProperty(global, v8::HeapGraphEdge::kProperty, "a");
495 CHECK(a);
496 CHECK_EQ(a->GetType(), v8::HeapGraphNode::kSimdValue);
497 }
498
499
484 TEST(HeapSnapshotWeakCollection) { 500 TEST(HeapSnapshotWeakCollection) {
485 LocalContext env; 501 LocalContext env;
486 v8::HandleScope scope(env->GetIsolate()); 502 v8::HandleScope scope(env->GetIsolate());
487 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); 503 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
488 504
489 CompileRun( 505 CompileRun(
490 "k = {}; v = {}; s = 'str';\n" 506 "k = {}; v = {}; s = 'str';\n"
491 "ws = new WeakSet(); ws.add(k); ws.add(v); ws[s] = s;\n" 507 "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"); 508 "wm = new WeakMap(); wm.set(k, v); wm[s] = s;\n");
493 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(); 509 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot();
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after
2756 map.AddRange(ToAddress(0x180), 0x80, 6U); 2772 map.AddRange(ToAddress(0x180), 0x80, 6U);
2757 map.AddRange(ToAddress(0x180), 0x80, 7U); 2773 map.AddRange(ToAddress(0x180), 0x80, 7U);
2758 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); 2774 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180)));
2759 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); 2775 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200)));
2760 CHECK_EQ(3u, map.size()); 2776 CHECK_EQ(3u, map.size());
2761 2777
2762 map.Clear(); 2778 map.Clear();
2763 CHECK_EQ(0u, map.size()); 2779 CHECK_EQ(0u, map.size());
2764 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); 2780 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400)));
2765 } 2781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698