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 @@ ...@@ -57,6 +57,13 @@
namespace v8 { namespace v8 {
namespace internal { 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() { void DisableAlwaysOpt() {
// Isolates prepared for serialization do not optimize. The only exception is // Isolates prepared for serialization do not optimize. The only exception is
// with the flag --always-opt. // with the flag --always-opt.
...@@ -192,6 +199,7 @@ static void SanityCheck(v8::Isolate* v8_isolate) { ...@@ -192,6 +199,7 @@ static void SanityCheck(v8::Isolate* v8_isolate) {
} }
UNINITIALIZED_TEST(StartupSerializerOnce) { UNINITIALIZED_TEST(StartupSerializerOnce) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs = Serialize(isolate); StartupBlobs blobs = Serialize(isolate);
...@@ -258,6 +266,7 @@ UNINITIALIZED_TEST(StartupSerializerRootMapDependencies) { ...@@ -258,6 +266,7 @@ UNINITIALIZED_TEST(StartupSerializerRootMapDependencies) {
} }
UNINITIALIZED_TEST(StartupSerializerTwice) { UNINITIALIZED_TEST(StartupSerializerTwice) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs1 = Serialize(isolate); StartupBlobs blobs1 = Serialize(isolate);
...@@ -278,6 +287,7 @@ UNINITIALIZED_TEST(StartupSerializerTwice) { ...@@ -278,6 +287,7 @@ UNINITIALIZED_TEST(StartupSerializerTwice) {
} }
UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { UNINITIALIZED_TEST(StartupSerializerOnceRunScript) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs = Serialize(isolate); StartupBlobs blobs = Serialize(isolate);
...@@ -302,6 +312,7 @@ UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { ...@@ -302,6 +312,7 @@ UNINITIALIZED_TEST(StartupSerializerOnceRunScript) {
} }
UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) { UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
StartupBlobs blobs1 = Serialize(isolate); StartupBlobs blobs1 = Serialize(isolate);
...@@ -386,6 +397,7 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out, ...@@ -386,6 +397,7 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out,
} }
UNINITIALIZED_TEST(PartialSerializerContext) { UNINITIALIZED_TEST(PartialSerializerContext) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
Vector<const byte> startup_blob; Vector<const byte> startup_blob;
Vector<const byte> builtin_blob; Vector<const byte> builtin_blob;
...@@ -510,6 +522,7 @@ static void PartiallySerializeCustomContext( ...@@ -510,6 +522,7 @@ static void PartiallySerializeCustomContext(
} }
UNINITIALIZED_TEST(PartialSerializerCustomContext) { UNINITIALIZED_TEST(PartialSerializerCustomContext) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
Vector<const byte> startup_blob; Vector<const byte> startup_blob;
Vector<const byte> builtin_blob; Vector<const byte> builtin_blob;
...@@ -761,6 +774,7 @@ TEST(CustomSnapshotDataBlobNeuteredArrayBuffer) { ...@@ -761,6 +774,7 @@ TEST(CustomSnapshotDataBlobNeuteredArrayBuffer) {
Int32Expectations expectations = {std::make_tuple("x.buffer.byteLength", 0), Int32Expectations expectations = {std::make_tuple("x.buffer.byteLength", 0),
std::make_tuple("x.length", 0)}; std::make_tuple("x.length", 0)};
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
i::FLAG_allow_natives_syntax = true; i::FLAG_allow_natives_syntax = true;
v8::StartupData blob; v8::StartupData blob;
...@@ -1050,6 +1064,7 @@ bool IsCompiled(const char* name) { ...@@ -1050,6 +1064,7 @@ bool IsCompiled(const char* name) {
} }
TEST(SnapshotDataBlobWithWarmup) { TEST(SnapshotDataBlobWithWarmup) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
const char* warmup = "Math.abs(1); Math.random = 1;"; const char* warmup = "Math.abs(1); Math.random = 1;";
...@@ -1079,6 +1094,7 @@ TEST(SnapshotDataBlobWithWarmup) { ...@@ -1079,6 +1094,7 @@ TEST(SnapshotDataBlobWithWarmup) {
} }
TEST(CustomSnapshotDataBlobWithWarmup) { TEST(CustomSnapshotDataBlobWithWarmup) {
DisableLazyDeserialization();
DisableAlwaysOpt(); DisableAlwaysOpt();
const char* source = const char* source =
"function f() { return Math.abs(1); }\n" "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