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

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

Issue 2695653005: Revert of Remove SIMD.js from V8. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | test/cctest/test-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index ab94194fa3cbb88fd38fea0c8c3c1a510a28eaec..7662b5e74f7876ee93eb717b9b71bc69237372d0 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -477,6 +477,48 @@
CHECK(name);
CHECK(v8_str("mySymbol")->Equals(env.local(), name->GetName()).FromJust());
}
+
+
+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(program);
+ // The TakeHeapSnapshot function does not do enough GCs to ensure
+ // that all garbage is collected. We perform addition GC here
+ // to reclaim a floating AllocationSite and to fix the following failure:
+ // # Check failed: ValidateSnapshot(snapshot).
+ // Stdout:
+ // 28 @ 13523 entry with no retainer: /hidden/ system / AllocationSite
+ // 44 @ 767 $map: /hidden/ system / Map
+ // 44 @ 59 $map: /hidden/ system / Map
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
+
+ const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot();
+ CHECK(ValidateSnapshot(snapshot));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ 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.Uint32x4();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Bool32x4();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Int16x8();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Uint16x8();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Bool16x8();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Int8x16();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Uint8x16();\n", "a");
+ CheckSimdSnapshot("a = SIMD.Bool8x16();\n", "a");
+}
+
TEST(HeapSnapshotWeakCollection) {
LocalContext env;
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | test/cctest/test-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698