Commit 1dba8633 authored by yangguo's avatar yangguo Committed by Commit bot

[test] no longer disable turbofan for serializer tests.

This is no longer necessary. Isolates created for serialization
have optimization disabled anyways.

R=jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2479823002
Cr-Commit-Position: refs/heads/master@{#40761}
parent 8daff84d
...@@ -50,9 +50,10 @@ ...@@ -50,9 +50,10 @@
using namespace v8::internal; using namespace v8::internal;
void DisableTurbofan() { void DisableAlwaysOpt() {
const char* flag = "--turbo-filter=\"\""; // Isolates prepared for serialization do not optimize. The only exception is
FlagList::SetFlagsFromString(flag, StrLength(flag)); // with the flag --always-opt.
FLAG_always_opt = false;
} }
...@@ -150,10 +151,7 @@ static void SanityCheck(v8::Isolate* v8_isolate) { ...@@ -150,10 +151,7 @@ static void SanityCheck(v8::Isolate* v8_isolate) {
} }
UNINITIALIZED_TEST(StartupSerializerOnce) { UNINITIALIZED_TEST(StartupSerializerOnce) {
// The serialize-deserialize tests only work if the VM is built without DisableAlwaysOpt();
// 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();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
Vector<const byte> blob = Serialize(isolate); Vector<const byte> blob = Serialize(isolate);
isolate = Deserialize(blob); isolate = Deserialize(blob);
...@@ -171,7 +169,7 @@ UNINITIALIZED_TEST(StartupSerializerOnce) { ...@@ -171,7 +169,7 @@ UNINITIALIZED_TEST(StartupSerializerOnce) {
} }
UNINITIALIZED_TEST(StartupSerializerTwice) { UNINITIALIZED_TEST(StartupSerializerTwice) {
DisableTurbofan(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
Vector<const byte> blob1 = Serialize(isolate); Vector<const byte> blob1 = Serialize(isolate);
Vector<const byte> blob2 = Serialize(isolate); Vector<const byte> blob2 = Serialize(isolate);
...@@ -191,7 +189,7 @@ UNINITIALIZED_TEST(StartupSerializerTwice) { ...@@ -191,7 +189,7 @@ UNINITIALIZED_TEST(StartupSerializerTwice) {
} }
UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { UNINITIALIZED_TEST(StartupSerializerOnceRunScript) {
DisableTurbofan(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
Vector<const byte> blob = Serialize(isolate); Vector<const byte> blob = Serialize(isolate);
isolate = Deserialize(blob); isolate = Deserialize(blob);
...@@ -215,7 +213,7 @@ UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { ...@@ -215,7 +213,7 @@ UNINITIALIZED_TEST(StartupSerializerOnceRunScript) {
} }
UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) { UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) {
DisableTurbofan(); DisableAlwaysOpt();
v8::Isolate* isolate = TestIsolate::NewInitialized(true); v8::Isolate* isolate = TestIsolate::NewInitialized(true);
Vector<const byte> blob1 = Serialize(isolate); Vector<const byte> blob1 = Serialize(isolate);
Vector<const byte> blob2 = Serialize(isolate); Vector<const byte> blob2 = Serialize(isolate);
...@@ -303,7 +301,7 @@ static void PartiallySerializeObject(Vector<const byte>* startup_blob_out, ...@@ -303,7 +301,7 @@ static void PartiallySerializeObject(Vector<const byte>* startup_blob_out,
} }
UNINITIALIZED_TEST(PartialSerializerObject) { UNINITIALIZED_TEST(PartialSerializerObject) {
DisableTurbofan(); DisableAlwaysOpt();
Vector<const byte> startup_blob; Vector<const byte> startup_blob;
Vector<const byte> partial_blob; Vector<const byte> partial_blob;
PartiallySerializeObject(&startup_blob, &partial_blob); PartiallySerializeObject(&startup_blob, &partial_blob);
...@@ -401,7 +399,7 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out, ...@@ -401,7 +399,7 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out,
} }
UNINITIALIZED_TEST(PartialSerializerContext) { UNINITIALIZED_TEST(PartialSerializerContext) {
DisableTurbofan(); DisableAlwaysOpt();
Vector<const byte> startup_blob; Vector<const byte> startup_blob;
Vector<const byte> partial_blob; Vector<const byte> partial_blob;
PartiallySerializeContext(&startup_blob, &partial_blob); PartiallySerializeContext(&startup_blob, &partial_blob);
...@@ -521,7 +519,7 @@ static void PartiallySerializeCustomContext( ...@@ -521,7 +519,7 @@ static void PartiallySerializeCustomContext(
} }
UNINITIALIZED_TEST(PartialSerializerCustomContext) { UNINITIALIZED_TEST(PartialSerializerCustomContext) {
DisableTurbofan(); DisableAlwaysOpt();
Vector<const byte> startup_blob; Vector<const byte> startup_blob;
Vector<const byte> partial_blob; Vector<const byte> partial_blob;
PartiallySerializeCustomContext(&startup_blob, &partial_blob); PartiallySerializeCustomContext(&startup_blob, &partial_blob);
...@@ -612,7 +610,7 @@ UNINITIALIZED_TEST(PartialSerializerCustomContext) { ...@@ -612,7 +610,7 @@ UNINITIALIZED_TEST(PartialSerializerCustomContext) {
} }
TEST(CustomSnapshotDataBlob1) { TEST(CustomSnapshotDataBlob1) {
DisableTurbofan(); DisableAlwaysOpt();
const char* source1 = "function f() { return 42; }"; const char* source1 = "function f() { return 42; }";
v8::StartupData data1 = v8::V8::CreateSnapshotDataBlob(source1); v8::StartupData data1 = v8::V8::CreateSnapshotDataBlob(source1);
...@@ -637,7 +635,7 @@ TEST(CustomSnapshotDataBlob1) { ...@@ -637,7 +635,7 @@ TEST(CustomSnapshotDataBlob1) {
} }
TEST(CustomSnapshotDataBlob2) { TEST(CustomSnapshotDataBlob2) {
DisableTurbofan(); DisableAlwaysOpt();
const char* source2 = const char* source2 =
"function f() { return g() * 2; }" "function f() { return g() * 2; }"
"function g() { return 43; }" "function g() { return 43; }"
...@@ -670,8 +668,7 @@ static void SerializationFunctionTemplate( ...@@ -670,8 +668,7 @@ static void SerializationFunctionTemplate(
} }
TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) { TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) {
DisableTurbofan(); DisableAlwaysOpt();
const char* source1 = const char* source1 =
"var o = {};" "var o = {};"
"(function() {" "(function() {"
...@@ -716,7 +713,7 @@ TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) { ...@@ -716,7 +713,7 @@ TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) {
} }
TEST(CustomSnapshotDataBlobWithLocker) { TEST(CustomSnapshotDataBlobWithLocker) {
DisableTurbofan(); DisableAlwaysOpt();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate0 = v8::Isolate::New(create_params); v8::Isolate* isolate0 = v8::Isolate::New(create_params);
...@@ -754,7 +751,7 @@ TEST(CustomSnapshotDataBlobWithLocker) { ...@@ -754,7 +751,7 @@ TEST(CustomSnapshotDataBlobWithLocker) {
} }
TEST(CustomSnapshotDataBlobStackOverflow) { TEST(CustomSnapshotDataBlobStackOverflow) {
DisableTurbofan(); DisableAlwaysOpt();
const char* source = const char* source =
"var a = [0];" "var a = [0];"
"var b = a;" "var b = a;"
...@@ -800,7 +797,7 @@ bool IsCompiled(const char* name) { ...@@ -800,7 +797,7 @@ bool IsCompiled(const char* name) {
} }
TEST(SnapshotDataBlobWithWarmup) { TEST(SnapshotDataBlobWithWarmup) {
DisableTurbofan(); DisableAlwaysOpt();
const char* warmup = "Math.abs(1); Math.random = 1;"; const char* warmup = "Math.abs(1); Math.random = 1;";
v8::StartupData cold = v8::V8::CreateSnapshotDataBlob(); v8::StartupData cold = v8::V8::CreateSnapshotDataBlob();
...@@ -828,7 +825,7 @@ TEST(SnapshotDataBlobWithWarmup) { ...@@ -828,7 +825,7 @@ TEST(SnapshotDataBlobWithWarmup) {
} }
TEST(CustomSnapshotDataBlobWithWarmup) { TEST(CustomSnapshotDataBlobWithWarmup) {
DisableTurbofan(); DisableAlwaysOpt();
const char* source = const char* source =
"function f() { return Math.abs(1); }\n" "function f() { return Math.abs(1); }\n"
"function g() { return String.raw(1); }\n" "function g() { return String.raw(1); }\n"
...@@ -864,7 +861,7 @@ TEST(CustomSnapshotDataBlobWithWarmup) { ...@@ -864,7 +861,7 @@ TEST(CustomSnapshotDataBlobWithWarmup) {
} }
TEST(CustomSnapshotDataBlobImmortalImmovableRoots) { TEST(CustomSnapshotDataBlobImmortalImmovableRoots) {
DisableTurbofan(); DisableAlwaysOpt();
// Flood the startup snapshot with shared function infos. If they are // Flood the startup snapshot with shared function infos. If they are
// serialized before the immortal immovable root, the root will no longer end // serialized before the immortal immovable root, the root will no longer end
// up on the first page. // up on the first page.
...@@ -1955,7 +1952,7 @@ TEST(CodeSerializerEmbeddedObject) { ...@@ -1955,7 +1952,7 @@ TEST(CodeSerializerEmbeddedObject) {
} }
TEST(SnapshotCreatorMultipleContexts) { TEST(SnapshotCreatorMultipleContexts) {
DisableTurbofan(); DisableAlwaysOpt();
v8::StartupData blob; v8::StartupData blob;
{ {
v8::SnapshotCreator creator; v8::SnapshotCreator creator;
...@@ -2032,7 +2029,7 @@ intptr_t replaced_external_references[] = { ...@@ -2032,7 +2029,7 @@ intptr_t replaced_external_references[] = {
reinterpret_cast<intptr_t>(SerializedCallbackReplacement), 0}; reinterpret_cast<intptr_t>(SerializedCallbackReplacement), 0};
TEST(SnapshotCreatorExternalReferences) { TEST(SnapshotCreatorExternalReferences) {
DisableTurbofan(); DisableAlwaysOpt();
v8::StartupData blob; v8::StartupData blob;
{ {
v8::SnapshotCreator creator(original_external_references); v8::SnapshotCreator creator(original_external_references);
...@@ -2092,7 +2089,7 @@ TEST(SnapshotCreatorExternalReferences) { ...@@ -2092,7 +2089,7 @@ TEST(SnapshotCreatorExternalReferences) {
} }
TEST(SnapshotCreatorUnknownExternalReferences) { TEST(SnapshotCreatorUnknownExternalReferences) {
DisableTurbofan(); DisableAlwaysOpt();
v8::SnapshotCreator creator; v8::SnapshotCreator creator;
v8::Isolate* isolate = creator.GetIsolate(); v8::Isolate* isolate = creator.GetIsolate();
{ {
...@@ -2138,7 +2135,7 @@ void DeserializeInternalFields(v8::Local<v8::Object> holder, int index, ...@@ -2138,7 +2135,7 @@ void DeserializeInternalFields(v8::Local<v8::Object> holder, int index,
} }
TEST(SnapshotCreatorTemplates) { TEST(SnapshotCreatorTemplates) {
DisableTurbofan(); DisableAlwaysOpt();
v8::StartupData blob; v8::StartupData blob;
{ {
......
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