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

Unified Diff: test/cctest/test-serialize.cc

Issue 1811913002: [serializer] ensure that immortal immovable roots are correctly deserialized. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« src/snapshot/serializer.cc ('K') | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-serialize.cc
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index c59dc3b355e0a24519cb43b9abbffe5e75867266..cd349f9d735160753e691473f4b50a4165de434e 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -854,6 +854,36 @@ TEST(CustomSnapshotDataBlobWithWarmup) {
isolate->Dispose();
}
+TEST(CustomSnapshotDataBlobImmortalImmovableRoots) {
+ DisableTurbofan();
+ // Flood the startup snapshot with shared function infos. If they are
+ // serialized before the immortal immovable root, the root will no longer end
+ // up on the first page.
+ Vector<const uint8_t> source =
+ ConstructSource(STATIC_CHAR_VECTOR("var a = [];"),
+ STATIC_CHAR_VECTOR("a.push(function() {return 7});"),
+ STATIC_CHAR_VECTOR("\0"), 10000);
+
+ v8::StartupData data = v8::V8::CreateSnapshotDataBlob(
+ reinterpret_cast<const char*>(source.start()));
+
+ v8::Isolate::CreateParams params;
+ params.snapshot_blob = &data;
+ params.array_buffer_allocator = CcTest::array_buffer_allocator();
+
+ v8::Isolate* isolate = v8::Isolate::New(params);
+ {
+ v8::Isolate::Scope i_scope(isolate);
+ v8::HandleScope h_scope(isolate);
+ v8::Local<v8::Context> context = v8::Context::New(isolate);
+ delete[] data.data; // We can dispose of the snapshot blob now.
+ v8::Context::Scope c_scope(context);
+ CHECK_EQ(7, CompileRun("a[0]()")->Int32Value(context).FromJust());
+ }
+ isolate->Dispose();
+ source.Dispose();
+}
+
TEST(TestThatAlwaysSucceeds) {
}
« src/snapshot/serializer.cc ('K') | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698