Index: test/cctest/test-serialize.cc |
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
index 5983bfcc14fb080ae26ceec64b2ccd9c58f91287..d29f12bfc296273b31a48710628c693e16d0c119 100644 |
--- a/test/cctest/test-serialize.cc |
+++ b/test/cctest/test-serialize.cc |
@@ -50,9 +50,10 @@ |
using namespace v8::internal; |
-void DisableTurbofan() { |
- const char* flag = "--turbo-filter=\"\""; |
- FlagList::SetFlagsFromString(flag, StrLength(flag)); |
+void DisableAlwaysOpt() { |
+ // Isolates prepared for serialization do not optimize. The only exception is |
+ // with the flag --always-opt. |
+ FLAG_always_opt = false; |
} |
@@ -150,10 +151,7 @@ static void SanityCheck(v8::Isolate* v8_isolate) { |
} |
UNINITIALIZED_TEST(StartupSerializerOnce) { |
- // The serialize-deserialize tests only work if the VM is built without |
- // serialization. That doesn't matter. We don't need to be able to |
- // serialize a snapshot in a VM that is booted from a snapshot. |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
Vector<const byte> blob = Serialize(isolate); |
isolate = Deserialize(blob); |
@@ -171,7 +169,7 @@ UNINITIALIZED_TEST(StartupSerializerOnce) { |
} |
UNINITIALIZED_TEST(StartupSerializerTwice) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
Vector<const byte> blob1 = Serialize(isolate); |
Vector<const byte> blob2 = Serialize(isolate); |
@@ -191,7 +189,7 @@ UNINITIALIZED_TEST(StartupSerializerTwice) { |
} |
UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
Vector<const byte> blob = Serialize(isolate); |
isolate = Deserialize(blob); |
@@ -215,7 +213,7 @@ UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { |
} |
UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
Vector<const byte> blob1 = Serialize(isolate); |
Vector<const byte> blob2 = Serialize(isolate); |
@@ -303,7 +301,7 @@ static void PartiallySerializeObject(Vector<const byte>* startup_blob_out, |
} |
UNINITIALIZED_TEST(PartialSerializerObject) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
Vector<const byte> startup_blob; |
Vector<const byte> partial_blob; |
PartiallySerializeObject(&startup_blob, &partial_blob); |
@@ -401,7 +399,7 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out, |
} |
UNINITIALIZED_TEST(PartialSerializerContext) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
Vector<const byte> startup_blob; |
Vector<const byte> partial_blob; |
PartiallySerializeContext(&startup_blob, &partial_blob); |
@@ -520,7 +518,7 @@ static void PartiallySerializeCustomContext( |
} |
UNINITIALIZED_TEST(PartialSerializerCustomContext) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
Vector<const byte> startup_blob; |
Vector<const byte> partial_blob; |
PartiallySerializeCustomContext(&startup_blob, &partial_blob); |
@@ -610,7 +608,7 @@ UNINITIALIZED_TEST(PartialSerializerCustomContext) { |
} |
TEST(CustomSnapshotDataBlob1) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
const char* source1 = "function f() { return 42; }"; |
v8::StartupData data1 = v8::V8::CreateSnapshotDataBlob(source1); |
@@ -635,7 +633,7 @@ TEST(CustomSnapshotDataBlob1) { |
} |
TEST(CustomSnapshotDataBlob2) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
const char* source2 = |
"function f() { return g() * 2; }" |
"function g() { return 43; }" |
@@ -668,8 +666,7 @@ static void SerializationFunctionTemplate( |
} |
TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) { |
- DisableTurbofan(); |
- |
+ DisableAlwaysOpt(); |
const char* source1 = |
"var o = {};" |
"(function() {" |
@@ -714,7 +711,7 @@ TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) { |
} |
TEST(CustomSnapshotDataBlobWithLocker) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::Isolate::CreateParams create_params; |
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
v8::Isolate* isolate0 = v8::Isolate::New(create_params); |
@@ -752,7 +749,7 @@ TEST(CustomSnapshotDataBlobWithLocker) { |
} |
TEST(CustomSnapshotDataBlobStackOverflow) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
const char* source = |
"var a = [0];" |
"var b = a;" |
@@ -798,7 +795,7 @@ bool IsCompiled(const char* name) { |
} |
TEST(SnapshotDataBlobWithWarmup) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
const char* warmup = "Math.abs(1); Math.random = 1;"; |
v8::StartupData cold = v8::V8::CreateSnapshotDataBlob(); |
@@ -826,7 +823,7 @@ TEST(SnapshotDataBlobWithWarmup) { |
} |
TEST(CustomSnapshotDataBlobWithWarmup) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
const char* source = |
"function f() { return Math.abs(1); }\n" |
"function g() { return String.raw(1); }\n" |
@@ -862,7 +859,7 @@ TEST(CustomSnapshotDataBlobWithWarmup) { |
} |
TEST(CustomSnapshotDataBlobImmortalImmovableRoots) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
// 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. |
@@ -1953,7 +1950,7 @@ TEST(CodeSerializerEmbeddedObject) { |
} |
TEST(SnapshotCreatorMultipleContexts) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::StartupData blob; |
{ |
v8::SnapshotCreator creator; |
@@ -2030,7 +2027,7 @@ intptr_t replaced_external_references[] = { |
reinterpret_cast<intptr_t>(SerializedCallbackReplacement), 0}; |
TEST(SnapshotCreatorExternalReferences) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::StartupData blob; |
{ |
v8::SnapshotCreator creator(original_external_references); |
@@ -2090,7 +2087,7 @@ TEST(SnapshotCreatorExternalReferences) { |
} |
TEST(SnapshotCreatorUnknownExternalReferences) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::SnapshotCreator creator; |
v8::Isolate* isolate = creator.GetIsolate(); |
{ |
@@ -2136,7 +2133,7 @@ void DeserializeInternalFields(v8::Local<v8::Object> holder, int index, |
} |
TEST(SnapshotCreatorTemplates) { |
- DisableTurbofan(); |
+ DisableAlwaysOpt(); |
v8::StartupData blob; |
{ |