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

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 1250733005: SIMD.js Add the other SIMD Phase 1 types. (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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 0c367479d2ef8446c344964ec6cf029f9d13febd..d2697a124908884c2bcf06d0ebc4a13a3ca66e8b 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -482,20 +482,31 @@ TEST(HeapSnapshotSymbol) {
}
-TEST(HeapSnapshotFloat32x4) {
+void CheckSimdSnapshot(const char* program, const char* var_name) {
i::FLAG_harmony_simd = true;
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
- CompileRun("a = SIMD.Float32x4(1, 2, 3, 4);\n");
+ CompileRun(program);
const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot();
CHECK(ValidateSnapshot(snapshot));
const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
- const v8::HeapGraphNode* a =
- GetProperty(global, v8::HeapGraphEdge::kProperty, "a");
- CHECK(a);
- CHECK_EQ(a->GetType(), v8::HeapGraphNode::kSimdValue);
+ const v8::HeapGraphNode* var =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, var_name);
+ CHECK(var);
+ CHECK_EQ(var->GetType(), v8::HeapGraphNode::kSimdValue);
+}
+
+
+TEST(HeapSnapshotSimd) {
+ CheckSimdSnapshot("a = SIMD.Float32x4();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Int32x4();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Bool32x4();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Int16x8();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Bool16x8();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Int8x16();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Bool8x16();\n", "a");
}

Powered by Google App Engine
This is Rietveld 408576698