Commit 238b3c96 authored by jgruber's avatar jgruber Committed by Commit Bot

[snapshot] Disable lazy deserialization in some tests

Lazy deserialization requires a fully set-up isolate (in particular, we
need Isolate::snapshot_blob). This CL disables lazy deserialization in
affected tests. This should be fixed at some point by setting up the
isolate as needed.

Bug: v8:6624
Change-Id: I94f792d9dcc8a3ba2d91fdeadd9e04ebb0bb50cf
Reviewed-on: https://chromium-review.googlesource.com/655162Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47887}
parent 65055a9b
......@@ -57,6 +57,13 @@
namespace v8 {
namespace internal {
void DisableLazyDeserialization() {
// UNINITIALIZED tests do not set up the isolate sufficiently for lazy
// deserialization to work.
// TODO(jgruber): Fix this. It may just be enough to set the snapshot_blob.
FLAG_lazy_deserialization = false;
}
void DisableAlwaysOpt() {
// Isolates prepared for serialization do not optimize. The only exception is
// with the flag --always-opt.
......@@ -192,6 +199,7 @@ static void SanityCheck(v8::Isolate* v8_isolate) {
}
UNINITIALIZED_TEST(StartupSerializerOnce) {
DisableLazyDeserialization();
DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs = Serialize(isolate);
......@@ -258,6 +266,7 @@ UNINITIALIZED_TEST(StartupSerializerRootMapDependencies) {
}
UNINITIALIZED_TEST(StartupSerializerTwice) {
DisableLazyDeserialization();
DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs1 = Serialize(isolate);
......@@ -278,6 +287,7 @@ UNINITIALIZED_TEST(StartupSerializerTwice) {
}
UNINITIALIZED_TEST(StartupSerializerOnceRunScript) {
DisableLazyDeserialization();
DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs = Serialize(isolate);
......@@ -302,6 +312,7 @@ UNINITIALIZED_TEST(StartupSerializerOnceRunScript) {
}
UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) {
DisableLazyDeserialization();
DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs1 = Serialize(isolate);
......@@ -386,6 +397,7 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out,
}
UNINITIALIZED_TEST(PartialSerializerContext) {
DisableLazyDeserialization();
DisableAlwaysOpt();
Vector<const byte> startup_blob;
Vector<const byte> builtin_blob;
......@@ -510,6 +522,7 @@ static void PartiallySerializeCustomContext(
}
UNINITIALIZED_TEST(PartialSerializerCustomContext) {
DisableLazyDeserialization();
DisableAlwaysOpt();
Vector<const byte> startup_blob;
Vector<const byte> builtin_blob;
......@@ -761,6 +774,7 @@ TEST(CustomSnapshotDataBlobNeuteredArrayBuffer) {
Int32Expectations expectations = {std::make_tuple("x.buffer.byteLength", 0),
std::make_tuple("x.length", 0)};
DisableLazyDeserialization();
DisableAlwaysOpt();
i::FLAG_allow_natives_syntax = true;
v8::StartupData blob;
......@@ -1050,6 +1064,7 @@ bool IsCompiled(const char* name) {
}
TEST(SnapshotDataBlobWithWarmup) {
DisableLazyDeserialization();
DisableAlwaysOpt();
const char* warmup = "Math.abs(1); Math.random = 1;";
......@@ -1079,6 +1094,7 @@ TEST(SnapshotDataBlobWithWarmup) {
}
TEST(CustomSnapshotDataBlobWithWarmup) {
DisableLazyDeserialization();
DisableAlwaysOpt();
const char* source =
"function f() { return Math.abs(1); }\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment