| Index: test/cctest/test-serialize.cc
|
| ===================================================================
|
| --- test/cctest/test-serialize.cc (revision 7267)
|
| +++ test/cctest/test-serialize.cc (working copy)
|
| @@ -99,8 +99,9 @@
|
|
|
|
|
| TEST(ExternalReferenceEncoder) {
|
| - StatsTable::SetCounterFunction(counter_function);
|
| - Heap::Setup(false);
|
| + OS::Setup();
|
| + i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function);
|
| + HEAP->Setup(false);
|
| ExternalReferenceEncoder encoder;
|
| CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode),
|
| Encode(encoder, Builtins::ArrayCode));
|
| @@ -109,7 +110,7 @@
|
| CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty),
|
| Encode(encoder, IC_Utility(IC::kLoadCallbackProperty)));
|
| ExternalReference keyed_load_function_prototype =
|
| - ExternalReference(&Counters::keyed_load_function_prototype);
|
| + ExternalReference(COUNTERS->keyed_load_function_prototype());
|
| CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype),
|
| encoder.Encode(keyed_load_function_prototype.address()));
|
| ExternalReference the_hole_value_location =
|
| @@ -136,8 +137,9 @@
|
|
|
|
|
| TEST(ExternalReferenceDecoder) {
|
| - StatsTable::SetCounterFunction(counter_function);
|
| - Heap::Setup(false);
|
| + OS::Setup();
|
| + i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function);
|
| + HEAP->Setup(false);
|
| ExternalReferenceDecoder decoder;
|
| CHECK_EQ(AddressOf(Builtins::ArrayCode),
|
| decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode)));
|
| @@ -147,7 +149,7 @@
|
| CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)),
|
| decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty)));
|
| ExternalReference keyed_load_function =
|
| - ExternalReference(&Counters::keyed_load_function_prototype);
|
| + ExternalReference(COUNTERS->keyed_load_function_prototype());
|
| CHECK_EQ(keyed_load_function.address(),
|
| decoder.Decode(
|
| make_code(STATS_COUNTER,
|
| @@ -276,12 +278,12 @@
|
| static void SanityCheck() {
|
| v8::HandleScope scope;
|
| #ifdef DEBUG
|
| - Heap::Verify();
|
| + HEAP->Verify();
|
| #endif
|
| - CHECK(Top::global()->IsJSObject());
|
| - CHECK(Top::global_context()->IsContext());
|
| - CHECK(Heap::symbol_table()->IsSymbolTable());
|
| - CHECK(!Factory::LookupAsciiSymbol("Empty")->IsFailure());
|
| + CHECK(Isolate::Current()->global()->IsJSObject());
|
| + CHECK(Isolate::Current()->global_context()->IsContext());
|
| + CHECK(HEAP->symbol_table()->IsSymbolTable());
|
| + CHECK(!FACTORY->LookupAsciiSymbol("Empty")->IsFailure());
|
| }
|
|
|
|
|
| @@ -291,7 +293,6 @@
|
| // serialize a snapshot in a VM that is booted from a snapshot.
|
| if (!Snapshot::IsEnabled()) {
|
| v8::HandleScope scope;
|
| -
|
| Deserialize();
|
|
|
| v8::Persistent<v8::Context> env = v8::Context::New();
|
| @@ -305,7 +306,6 @@
|
| DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) {
|
| if (!Snapshot::IsEnabled()) {
|
| v8::HandleScope scope;
|
| -
|
| Deserialize();
|
|
|
| v8::Persistent<v8::Context> env = v8::Context::New();
|
| @@ -319,7 +319,6 @@
|
| DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
|
| if (!Snapshot::IsEnabled()) {
|
| v8::HandleScope scope;
|
| -
|
| Deserialize();
|
|
|
| v8::Persistent<v8::Context> env = v8::Context::New();
|
| @@ -337,7 +336,6 @@
|
| SerializeTwice) {
|
| if (!Snapshot::IsEnabled()) {
|
| v8::HandleScope scope;
|
| -
|
| Deserialize();
|
|
|
| v8::Persistent<v8::Context> env = v8::Context::New();
|
| @@ -361,11 +359,11 @@
|
| // Make sure all builtin scripts are cached.
|
| { HandleScope scope;
|
| for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
|
| - Bootstrapper::NativesSourceLookup(i);
|
| + Isolate::Current()->bootstrapper()->NativesSourceLookup(i);
|
| }
|
| }
|
| - Heap::CollectAllGarbage(true);
|
| - Heap::CollectAllGarbage(true);
|
| + HEAP->CollectAllGarbage(true);
|
| + HEAP->CollectAllGarbage(true);
|
|
|
| Object* raw_foo;
|
| {
|
| @@ -425,7 +423,7 @@
|
| #undef fscanf
|
| #endif
|
| fclose(fp);
|
| - Heap::ReserveSpace(new_size,
|
| + HEAP->ReserveSpace(new_size,
|
| pointer_size,
|
| data_size,
|
| code_size,
|
| @@ -482,12 +480,12 @@
|
| // Make sure all builtin scripts are cached.
|
| { HandleScope scope;
|
| for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
|
| - Bootstrapper::NativesSourceLookup(i);
|
| + Isolate::Current()->bootstrapper()->NativesSourceLookup(i);
|
| }
|
| }
|
| // If we don't do this then we end up with a stray root pointing at the
|
| // context even after we have disposed of env.
|
| - Heap::CollectAllGarbage(true);
|
| + HEAP->CollectAllGarbage(true);
|
|
|
| int file_name_length = StrLength(FLAG_testing_serialization_file) + 10;
|
| Vector<char> startup_name = Vector<char>::New(file_name_length + 1);
|
| @@ -561,7 +559,7 @@
|
|
|
| for (int size = 1000; size < 5 * MB; size += size >> 1) {
|
| int new_space_size = (size < new_space_max) ? size : new_space_max;
|
| - Heap::ReserveSpace(
|
| + HEAP->ReserveSpace(
|
| new_space_size,
|
| size, // Old pointer space.
|
| size, // Old data space.
|
| @@ -584,7 +582,7 @@
|
| i + kSmallFixedArraySize <= new_space_size;
|
| i += kSmallFixedArraySize) {
|
| Object* obj =
|
| - Heap::AllocateFixedArray(kSmallFixedArrayLength)->ToObjectChecked();
|
| + HEAP->AllocateFixedArray(kSmallFixedArrayLength)->ToObjectChecked();
|
| if (new_last != NULL) {
|
| CHECK(reinterpret_cast<char*>(obj) ==
|
| reinterpret_cast<char*>(new_last) + kSmallFixedArraySize);
|
| @@ -596,7 +594,7 @@
|
| for (int i = 0;
|
| i + kSmallFixedArraySize <= size;
|
| i += kSmallFixedArraySize) {
|
| - Object* obj = Heap::AllocateFixedArray(kSmallFixedArrayLength,
|
| + Object* obj = HEAP->AllocateFixedArray(kSmallFixedArrayLength,
|
| TENURED)->ToObjectChecked();
|
| int old_page_fullness = i % Page::kPageSize;
|
| int page_fullness = (i + kSmallFixedArraySize) % Page::kPageSize;
|
| @@ -614,7 +612,7 @@
|
|
|
| Object* data_last = NULL;
|
| for (int i = 0; i + kSmallStringSize <= size; i += kSmallStringSize) {
|
| - Object* obj = Heap::AllocateRawAsciiString(kSmallStringLength,
|
| + Object* obj = HEAP->AllocateRawAsciiString(kSmallStringLength,
|
| TENURED)->ToObjectChecked();
|
| int old_page_fullness = i % Page::kPageSize;
|
| int page_fullness = (i + kSmallStringSize) % Page::kPageSize;
|
| @@ -632,7 +630,7 @@
|
|
|
| Object* map_last = NULL;
|
| for (int i = 0; i + kMapSize <= size; i += kMapSize) {
|
| - Object* obj = Heap::AllocateMap(JS_OBJECT_TYPE,
|
| + Object* obj = HEAP->AllocateMap(JS_OBJECT_TYPE,
|
| 42 * kPointerSize)->ToObjectChecked();
|
| int old_page_fullness = i % Page::kPageSize;
|
| int page_fullness = (i + kMapSize) % Page::kPageSize;
|
| @@ -654,7 +652,7 @@
|
| AlwaysAllocateScope always;
|
| int large_object_array_length =
|
| (size - FixedArray::kHeaderSize) / kPointerSize;
|
| - Object* obj = Heap::AllocateFixedArray(large_object_array_length,
|
| + Object* obj = HEAP->AllocateFixedArray(large_object_array_length,
|
| TENURED)->ToObjectChecked();
|
| CHECK(!obj->IsFailure());
|
| }
|
|
|