Index: test/cctest/test-serialize.cc |
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
index d0c7fc408e17320f058bd2bfe2a0b4c3a8505fd3..716b2788243d85beb96c9b1af4cdfe99305a81f2 100644 |
--- a/test/cctest/test-serialize.cc |
+++ b/test/cctest/test-serialize.cc |
@@ -50,12 +50,6 @@ |
using namespace v8::internal; |
- |
-bool DefaultSnapshotAvailable() { |
- return i::Snapshot::DefaultSnapshotBlob() != NULL; |
-} |
- |
- |
void DisableTurbofan() { |
const char* flag = "--turbo-filter=\"\""; |
FlagList::SetFlagsFromString(flag, StrLength(flag)); |
@@ -77,34 +71,14 @@ class TestIsolate : public Isolate { |
} |
}; |
- |
-void WritePayload(const Vector<const byte>& payload, const char* file_name) { |
- FILE* file = v8::base::OS::FOpen(file_name, "wb"); |
- if (file == NULL) { |
- PrintF("Unable to write to snapshot file \"%s\"\n", file_name); |
- exit(1); |
- } |
- size_t written = fwrite(payload.begin(), 1, payload.length(), file); |
- if (written != static_cast<size_t>(payload.length())) { |
- i::PrintF("Writing snapshot file failed.. Aborting.\n"); |
- exit(1); |
- } |
- fclose(file); |
+static Vector<const byte> WritePayload(const Vector<const byte>& payload) { |
+ int length = payload.length(); |
+ byte* blob = NewArray<byte>(length); |
+ memcpy(blob, payload.begin(), length); |
+ return Vector<const byte>(const_cast<const byte*>(blob), length); |
} |
- |
-static bool WriteToFile(Isolate* isolate, const char* snapshot_file) { |
- SnapshotByteSink sink; |
- StartupSerializer ser(isolate, &sink); |
- ser.SerializeStrongReferences(); |
- ser.SerializeWeakReferencesAndDeferred(); |
- SnapshotData snapshot_data(ser); |
- WritePayload(snapshot_data.RawData(), snapshot_file); |
- return true; |
-} |
- |
- |
-static void Serialize(v8::Isolate* isolate) { |
+static Vector<const byte> Serialize(v8::Isolate* isolate) { |
// We have to create one context. One reason for this is so that the builtins |
// can be loaded from v8natives.js and their addresses can be processed. This |
// will clear the pending fixups array, which would otherwise contain GC roots |
@@ -117,7 +91,12 @@ static void Serialize(v8::Isolate* isolate) { |
Isolate* internal_isolate = reinterpret_cast<Isolate*>(isolate); |
internal_isolate->heap()->CollectAllAvailableGarbage("serialize"); |
- WriteToFile(internal_isolate, FLAG_testing_serialization_file); |
+ SnapshotByteSink sink; |
+ StartupSerializer ser(internal_isolate, &sink); |
+ ser.SerializeStrongReferences(); |
+ ser.SerializeWeakReferencesAndDeferred(); |
+ SnapshotData snapshot_data(ser); |
+ return WritePayload(snapshot_data.RawData()); |
} |
@@ -137,49 +116,21 @@ Vector<const uint8_t> ConstructSource(Vector<const uint8_t> head, |
source_length); |
} |
- |
-// Test that the whole heap can be serialized. |
-UNINITIALIZED_TEST(Serialize) { |
- DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
- Serialize(isolate); |
-} |
- |
- |
-// Test that heap serialization is non-destructive. |
-UNINITIALIZED_TEST(SerializeTwice) { |
- DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
- Serialize(isolate); |
- Serialize(isolate); |
-} |
- |
- |
-//---------------------------------------------------------------------------- |
-// Tests that the heap can be deserialized. |
- |
-v8::Isolate* InitializeFromFile(const char* snapshot_file) { |
- int len; |
- byte* str = ReadBytes(snapshot_file, &len); |
- if (!str) return NULL; |
+v8::Isolate* InitializeFromBlob(Vector<const byte> blob) { |
v8::Isolate* v8_isolate = NULL; |
{ |
- SnapshotData snapshot_data(Vector<const byte>(str, len)); |
+ SnapshotData snapshot_data(blob); |
Deserializer deserializer(&snapshot_data); |
Isolate* isolate = new TestIsolate(false); |
v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
v8::Isolate::Scope isolate_scope(v8_isolate); |
isolate->Init(&deserializer); |
} |
- DeleteArray(str); |
return v8_isolate; |
} |
- |
-static v8::Isolate* Deserialize() { |
- v8::Isolate* isolate = InitializeFromFile(FLAG_testing_serialization_file); |
+static v8::Isolate* Deserialize(Vector<const byte> blob) { |
+ v8::Isolate* isolate = InitializeFromBlob(blob); |
CHECK(isolate); |
return isolate; |
} |
@@ -197,15 +148,15 @@ static void SanityCheck(v8::Isolate* v8_isolate) { |
isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("Empty")); |
} |
-UNINITIALIZED_TEST(Deserialize) { |
+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(); |
- if (DefaultSnapshotAvailable()) return; |
Michael Achenbach
2016/03/10 09:26:46
So, the tests are now executed also with snapshot
Yang
2016/03/10 09:33:49
Yes. These tests should be fast enough. Each test
|
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
- Serialize(isolate); |
- isolate = Deserialize(); |
+ Vector<const byte> blob = Serialize(isolate); |
+ isolate = Deserialize(blob); |
+ blob.Dispose(); |
{ |
v8::HandleScope handle_scope(isolate); |
v8::Isolate::Scope isolate_scope(isolate); |
@@ -218,13 +169,14 @@ UNINITIALIZED_TEST(Deserialize) { |
isolate->Dispose(); |
} |
-UNINITIALIZED_TEST(DeserializeFromSecondSerialization) { |
+UNINITIALIZED_TEST(StartupSerializerTwice) { |
DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
- Serialize(isolate); |
- Serialize(isolate); |
- isolate = Deserialize(); |
+ Vector<const byte> blob1 = Serialize(isolate); |
+ Vector<const byte> blob2 = Serialize(isolate); |
+ blob1.Dispose(); |
+ isolate = Deserialize(blob2); |
+ blob2.Dispose(); |
{ |
v8::Isolate::Scope isolate_scope(isolate); |
v8::HandleScope handle_scope(isolate); |
@@ -237,12 +189,12 @@ UNINITIALIZED_TEST(DeserializeFromSecondSerialization) { |
isolate->Dispose(); |
} |
-UNINITIALIZED_TEST(DeserializeAndRunScript2) { |
+UNINITIALIZED_TEST(StartupSerializerOnceRunScript) { |
DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
- Serialize(isolate); |
- isolate = Deserialize(); |
+ Vector<const byte> blob = Serialize(isolate); |
+ isolate = Deserialize(blob); |
+ blob.Dispose(); |
{ |
v8::Isolate::Scope isolate_scope(isolate); |
v8::HandleScope handle_scope(isolate); |
@@ -261,13 +213,14 @@ UNINITIALIZED_TEST(DeserializeAndRunScript2) { |
isolate->Dispose(); |
} |
-UNINITIALIZED_TEST(DeserializeFromSecondSerializationAndRunScript2) { |
+UNINITIALIZED_TEST(StartupSerializerTwiceRunScript) { |
DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
v8::Isolate* isolate = TestIsolate::NewInitialized(true); |
- Serialize(isolate); |
- Serialize(isolate); |
- isolate = Deserialize(); |
+ Vector<const byte> blob1 = Serialize(isolate); |
+ Vector<const byte> blob2 = Serialize(isolate); |
+ blob1.Dispose(); |
+ isolate = Deserialize(blob2); |
+ blob2.Dispose(); |
{ |
v8::Isolate::Scope isolate_scope(isolate); |
v8::HandleScope handle_scope(isolate); |
@@ -285,7 +238,8 @@ UNINITIALIZED_TEST(DeserializeFromSecondSerializationAndRunScript2) { |
isolate->Dispose(); |
} |
-static void PartiallySerialize() { |
+static void PartiallySerializeObject(Vector<const byte>* startup_blob_out, |
+ Vector<const byte>* partial_blob_out) { |
v8::Isolate* v8_isolate = TestIsolate::NewInitialized(true); |
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
v8_isolate->Enter(); |
@@ -320,10 +274,6 @@ static void PartiallySerialize() { |
raw_foo = *(v8::Utils::OpenHandle(*foo)); |
} |
- int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
- Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
- SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
- |
{ |
v8::HandleScope handle_scope(v8_isolate); |
v8::Local<v8::Context>::New(v8_isolate, env)->Exit(); |
@@ -344,40 +294,25 @@ static void PartiallySerialize() { |
SnapshotData startup_snapshot(startup_serializer); |
SnapshotData partial_snapshot(partial_serializer); |
- WritePayload(partial_snapshot.RawData(), FLAG_testing_serialization_file); |
- WritePayload(startup_snapshot.RawData(), startup_name.start()); |
- |
- startup_name.Dispose(); |
+ *partial_blob_out = WritePayload(partial_snapshot.RawData()); |
+ *startup_blob_out = WritePayload(startup_snapshot.RawData()); |
} |
v8_isolate->Exit(); |
v8_isolate->Dispose(); |
} |
-UNINITIALIZED_TEST(PartialSerialization) { |
- DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- PartiallySerialize(); |
-} |
- |
-UNINITIALIZED_TEST(PartialDeserialization) { |
+UNINITIALIZED_TEST(PartialSerializerObject) { |
DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- PartiallySerialize(); |
- int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
- Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
- SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
+ Vector<const byte> startup_blob; |
+ Vector<const byte> partial_blob; |
+ PartiallySerializeObject(&startup_blob, &partial_blob); |
- v8::Isolate* v8_isolate = InitializeFromFile(startup_name.start()); |
+ v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob); |
+ startup_blob.Dispose(); |
CHECK(v8_isolate); |
- startup_name.Dispose(); |
{ |
v8::Isolate::Scope isolate_scope(v8_isolate); |
- const char* file_name = FLAG_testing_serialization_file; |
- |
- int snapshot_size = 0; |
- byte* snapshot = ReadBytes(file_name, &snapshot_size); |
- |
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
HandleScope handle_scope(isolate); |
Handle<Object> root; |
@@ -385,7 +320,7 @@ UNINITIALIZED_TEST(PartialDeserialization) { |
// any references to the global proxy in this test. |
Handle<JSGlobalProxy> global_proxy = Handle<JSGlobalProxy>::null(); |
{ |
- SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); |
+ SnapshotData snapshot_data(partial_blob); |
Deserializer deserializer(&snapshot_data); |
root = deserializer.DeserializePartial(isolate, global_proxy) |
.ToHandleChecked(); |
@@ -394,20 +329,20 @@ UNINITIALIZED_TEST(PartialDeserialization) { |
Handle<Object> root2; |
{ |
- SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); |
+ SnapshotData snapshot_data(partial_blob); |
Deserializer deserializer(&snapshot_data); |
root2 = deserializer.DeserializePartial(isolate, global_proxy) |
.ToHandleChecked(); |
CHECK(root2->IsString()); |
CHECK(root.is_identical_to(root2)); |
} |
- |
- DeleteArray(snapshot); |
+ partial_blob.Dispose(); |
} |
v8_isolate->Dispose(); |
} |
-static void SerializeContext() { |
+static void PartiallySerializeContext(Vector<const byte>* startup_blob_out, |
+ Vector<const byte>* partial_blob_out) { |
v8::Isolate* v8_isolate = TestIsolate::NewInitialized(true); |
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
Heap* heap = isolate->heap(); |
@@ -435,10 +370,6 @@ static void SerializeContext() { |
// context even after we have disposed of env. |
heap->CollectAllGarbage(); |
- int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
- Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
- SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
- |
{ |
v8::HandleScope handle_scope(v8_isolate); |
v8::Local<v8::Context>::New(v8_isolate, env)->Exit(); |
@@ -461,46 +392,31 @@ static void SerializeContext() { |
SnapshotData startup_snapshot(startup_serializer); |
SnapshotData partial_snapshot(partial_serializer); |
- WritePayload(partial_snapshot.RawData(), FLAG_testing_serialization_file); |
- WritePayload(startup_snapshot.RawData(), startup_name.start()); |
- |
- startup_name.Dispose(); |
+ *partial_blob_out = WritePayload(partial_snapshot.RawData()); |
+ *startup_blob_out = WritePayload(startup_snapshot.RawData()); |
} |
v8_isolate->Dispose(); |
} |
-UNINITIALIZED_TEST(ContextSerialization) { |
+UNINITIALIZED_TEST(PartialSerializerContext) { |
DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- SerializeContext(); |
-} |
- |
-UNINITIALIZED_TEST(ContextDeserialization) { |
- DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- SerializeContext(); |
- int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
- Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
- SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
+ Vector<const byte> startup_blob; |
+ Vector<const byte> partial_blob; |
+ PartiallySerializeContext(&startup_blob, &partial_blob); |
- v8::Isolate* v8_isolate = InitializeFromFile(startup_name.start()); |
+ v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob); |
CHECK(v8_isolate); |
- startup_name.Dispose(); |
+ startup_blob.Dispose(); |
{ |
v8::Isolate::Scope isolate_scope(v8_isolate); |
- const char* file_name = FLAG_testing_serialization_file; |
- |
- int snapshot_size = 0; |
- byte* snapshot = ReadBytes(file_name, &snapshot_size); |
- |
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
HandleScope handle_scope(isolate); |
Handle<Object> root; |
Handle<JSGlobalProxy> global_proxy = |
isolate->factory()->NewUninitializedJSGlobalProxy(); |
{ |
- SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); |
+ SnapshotData snapshot_data(partial_blob); |
Deserializer deserializer(&snapshot_data); |
root = deserializer.DeserializePartial(isolate, global_proxy) |
.ToHandleChecked(); |
@@ -510,19 +426,21 @@ UNINITIALIZED_TEST(ContextDeserialization) { |
Handle<Object> root2; |
{ |
- SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); |
+ SnapshotData snapshot_data(partial_blob); |
Deserializer deserializer(&snapshot_data); |
root2 = deserializer.DeserializePartial(isolate, global_proxy) |
.ToHandleChecked(); |
CHECK(root2->IsContext()); |
CHECK(!root.is_identical_to(root2)); |
} |
- DeleteArray(snapshot); |
+ partial_blob.Dispose(); |
} |
v8_isolate->Dispose(); |
} |
-static void SerializeCustomContext() { |
+static void PartiallySerializeCustomContext( |
+ Vector<const byte>* startup_blob_out, |
+ Vector<const byte>* partial_blob_out) { |
v8::Isolate* v8_isolate = TestIsolate::NewInitialized(true); |
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
{ |
@@ -569,10 +487,6 @@ static void SerializeCustomContext() { |
// context even after we have disposed of env. |
isolate->heap()->CollectAllAvailableGarbage("snapshotting"); |
- int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
- Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
- SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
- |
{ |
v8::HandleScope handle_scope(v8_isolate); |
v8::Local<v8::Context>::New(v8_isolate, env)->Exit(); |
@@ -595,47 +509,32 @@ static void SerializeCustomContext() { |
SnapshotData startup_snapshot(startup_serializer); |
SnapshotData partial_snapshot(partial_serializer); |
- WritePayload(partial_snapshot.RawData(), FLAG_testing_serialization_file); |
- WritePayload(startup_snapshot.RawData(), startup_name.start()); |
- |
- startup_name.Dispose(); |
+ *partial_blob_out = WritePayload(partial_snapshot.RawData()); |
+ *startup_blob_out = WritePayload(startup_snapshot.RawData()); |
} |
v8_isolate->Dispose(); |
} |
-UNINITIALIZED_TEST(CustomContextSerialization) { |
- DisableTurbofan(); |
- if (DefaultSnapshotAvailable()) return; |
- SerializeCustomContext(); |
-} |
- |
-UNINITIALIZED_TEST(CustomContextDeserialization) { |
+UNINITIALIZED_TEST(PartialSerializerCustomContext) { |
DisableTurbofan(); |
FLAG_crankshaft = false; |
- if (DefaultSnapshotAvailable()) return; |
- SerializeCustomContext(); |
- int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
- Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
- SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
+ Vector<const byte> startup_blob; |
+ Vector<const byte> partial_blob; |
+ PartiallySerializeCustomContext(&startup_blob, &partial_blob); |
- v8::Isolate* v8_isolate = InitializeFromFile(startup_name.start()); |
+ v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob); |
CHECK(v8_isolate); |
- startup_name.Dispose(); |
+ startup_blob.Dispose(); |
{ |
v8::Isolate::Scope isolate_scope(v8_isolate); |
- const char* file_name = FLAG_testing_serialization_file; |
- |
- int snapshot_size = 0; |
- byte* snapshot = ReadBytes(file_name, &snapshot_size); |
- |
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
HandleScope handle_scope(isolate); |
Handle<Object> root; |
Handle<JSGlobalProxy> global_proxy = |
isolate->factory()->NewUninitializedJSGlobalProxy(); |
{ |
- SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); |
+ SnapshotData snapshot_data(partial_blob); |
Deserializer deserializer(&snapshot_data); |
root = deserializer.DeserializePartial(isolate, global_proxy) |
.ToHandleChecked(); |
@@ -684,13 +583,12 @@ UNINITIALIZED_TEST(CustomContextDeserialization) { |
.FromJust(); |
CHECK_EQ(100002, b); |
} |
- DeleteArray(snapshot); |
+ partial_blob.Dispose(); |
} |
v8_isolate->Dispose(); |
} |
- |
-TEST(PerIsolateSnapshotBlobs) { |
+TEST(CustomSnapshotDataBlob) { |
DisableTurbofan(); |
const char* source1 = "function f() { return 42; }"; |
const char* source2 = |
@@ -744,8 +642,7 @@ static void SerializationFunctionTemplate( |
args.GetReturnValue().Set(args[0]); |
} |
- |
-TEST(PerIsolateSnapshotBlobsOutdatedContextWithOverflow) { |
+TEST(CustomSnapshotDataBlobOutdatedContextWithOverflow) { |
DisableTurbofan(); |
const char* source1 = |
@@ -791,8 +688,7 @@ TEST(PerIsolateSnapshotBlobsOutdatedContextWithOverflow) { |
isolate->Dispose(); |
} |
- |
-TEST(PerIsolateSnapshotBlobsWithLocker) { |
+TEST(CustomSnapshotDataBlobWithLocker) { |
DisableTurbofan(); |
v8::Isolate::CreateParams create_params; |
create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
@@ -830,8 +726,7 @@ TEST(PerIsolateSnapshotBlobsWithLocker) { |
isolate1->Dispose(); |
} |
- |
-TEST(SnapshotBlobsStackOverflow) { |
+TEST(CustomSnapshotDataBlobStackOverflow) { |
DisableTurbofan(); |
const char* source = |
"var a = [0];" |
@@ -902,8 +797,7 @@ static Handle<SharedFunctionInfo> CompileScript( |
NOT_NATIVES_CODE, false); |
} |
- |
-TEST(SerializeToplevelOnePlusOne) { |
+TEST(CodeSerializerOnePlusOne) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -953,8 +847,7 @@ TEST(SerializeToplevelOnePlusOne) { |
delete cache; |
} |
- |
-TEST(CodeCachePromotedToCompilationCache) { |
+TEST(CodeSerializerPromotedToCompilationCache) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -984,8 +877,7 @@ TEST(CodeCachePromotedToCompilationCache) { |
delete cache; |
} |
- |
-TEST(SerializeToplevelInternalizedString) { |
+TEST(CodeSerializerInternalizedString) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1044,8 +936,7 @@ TEST(SerializeToplevelInternalizedString) { |
delete cache; |
} |
- |
-TEST(SerializeToplevelLargeCodeObject) { |
+TEST(CodeSerializerLargeCodeObject) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1092,8 +983,7 @@ TEST(SerializeToplevelLargeCodeObject) { |
source.Dispose(); |
} |
- |
-TEST(SerializeToplevelLargeStrings) { |
+TEST(CodeSerializerLargeStrings) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1150,8 +1040,7 @@ TEST(SerializeToplevelLargeStrings) { |
source_t.Dispose(); |
} |
- |
-TEST(SerializeToplevelThreeBigStrings) { |
+TEST(CodeSerializerThreeBigStrings) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1261,8 +1150,7 @@ class SerializerTwoByteResource : public v8::String::ExternalStringResource { |
size_t length_; |
}; |
- |
-TEST(SerializeToplevelExternalString) { |
+TEST(CodeSerializerExternalString) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1324,8 +1212,7 @@ TEST(SerializeToplevelExternalString) { |
delete cache; |
} |
- |
-TEST(SerializeToplevelLargeExternalString) { |
+TEST(CodeSerializerLargeExternalString) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1383,8 +1270,7 @@ TEST(SerializeToplevelLargeExternalString) { |
string.Dispose(); |
} |
- |
-TEST(SerializeToplevelExternalScriptName) { |
+TEST(CodeSerializerExternalScriptName) { |
FLAG_serialize_toplevel = true; |
LocalContext context; |
Isolate* isolate = CcTest::i_isolate(); |
@@ -1483,8 +1369,7 @@ v8::ScriptCompiler::CachedData* ProduceCache(const char* source) { |
return cache; |
} |
- |
-TEST(SerializeToplevelIsolates) { |
+TEST(CodeSerializerIsolates) { |
FLAG_serialize_toplevel = true; |
const char* source = "function f() { return 'abc'; }; f() + 'def'"; |
@@ -1525,8 +1410,7 @@ TEST(SerializeToplevelIsolates) { |
isolate2->Dispose(); |
} |
- |
-TEST(SerializeToplevelFlagChange) { |
+TEST(CodeSerializerFlagChange) { |
FLAG_serialize_toplevel = true; |
const char* source = "function f() { return 'abc'; }; f() + 'def'"; |
@@ -1555,8 +1439,7 @@ TEST(SerializeToplevelFlagChange) { |
isolate2->Dispose(); |
} |
- |
-TEST(SerializeToplevelBitFlip) { |
+TEST(CodeSerializerBitFlip) { |
FLAG_serialize_toplevel = true; |
const char* source = "function f() { return 'abc'; }; f() + 'def'"; |
@@ -1585,8 +1468,7 @@ TEST(SerializeToplevelBitFlip) { |
isolate2->Dispose(); |
} |
- |
-TEST(SerializeWithHarmonyScoping) { |
+TEST(CodeSerializerWithHarmonyScoping) { |
FLAG_serialize_toplevel = true; |
const char* source1 = "'use strict'; let x = 'X'"; |
@@ -1664,8 +1546,7 @@ TEST(SerializeWithHarmonyScoping) { |
isolate2->Dispose(); |
} |
- |
-TEST(SerializeInternalReference) { |
+TEST(CodeSerializerInternalReference) { |
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 |
return; |
#endif |
@@ -1753,7 +1634,6 @@ TEST(SerializeInternalReference) { |
TEST(Regress503552) { |
// Test that the code serializer can deal with weak cells that form a linked |
// list during incremental marking. |
- |
CcTest::InitializeVM(); |
Isolate* isolate = CcTest::i_isolate(); |