OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 Handle<Object> root; | 621 Handle<Object> root; |
622 Handle<FixedArray> outdated_contexts; | 622 Handle<FixedArray> outdated_contexts; |
623 Handle<JSGlobalProxy> global_proxy = | 623 Handle<JSGlobalProxy> global_proxy = |
624 isolate->factory()->NewUninitializedJSGlobalProxy(); | 624 isolate->factory()->NewUninitializedJSGlobalProxy(); |
625 { | 625 { |
626 SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); | 626 SnapshotData snapshot_data(Vector<const byte>(snapshot, snapshot_size)); |
627 Deserializer deserializer(&snapshot_data); | 627 Deserializer deserializer(&snapshot_data); |
628 root = | 628 root = |
629 deserializer.DeserializePartial(isolate, global_proxy, | 629 deserializer.DeserializePartial(isolate, global_proxy, |
630 &outdated_contexts).ToHandleChecked(); | 630 &outdated_contexts).ToHandleChecked(); |
631 CHECK_EQ(3, outdated_contexts->length()); | 631 CHECK_EQ(2, outdated_contexts->length()); |
632 CHECK(root->IsContext()); | 632 CHECK(root->IsContext()); |
633 Handle<Context> context = Handle<Context>::cast(root); | 633 Handle<Context> context = Handle<Context>::cast(root); |
634 CHECK(context->global_proxy() == *global_proxy); | 634 CHECK(context->global_proxy() == *global_proxy); |
635 Handle<String> o = isolate->factory()->NewStringFromAsciiChecked("o"); | 635 Handle<String> o = isolate->factory()->NewStringFromAsciiChecked("o"); |
636 Handle<JSObject> global_object(context->global_object(), isolate); | 636 Handle<JSObject> global_object(context->global_object(), isolate); |
637 Handle<Object> property = JSReceiver::GetDataProperty(global_object, o); | 637 Handle<Object> property = JSReceiver::GetDataProperty(global_object, o); |
638 CHECK(property.is_identical_to(global_proxy)); | 638 CHECK(property.is_identical_to(global_proxy)); |
639 | 639 |
640 v8::Handle<v8::Context> v8_context = v8::Utils::ToLocal(context); | 640 v8::Handle<v8::Context> v8_context = v8::Utils::ToLocal(context); |
641 v8::Context::Scope context_scope(v8_context); | 641 v8::Context::Scope context_scope(v8_context); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 isolate->Dispose(); | 1607 isolate->Dispose(); |
1608 } | 1608 } |
1609 | 1609 |
1610 | 1610 |
1611 TEST(SerializationMemoryStats) { | 1611 TEST(SerializationMemoryStats) { |
1612 FLAG_profile_deserialization = true; | 1612 FLAG_profile_deserialization = true; |
1613 FLAG_always_opt = false; | 1613 FLAG_always_opt = false; |
1614 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 1614 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
1615 delete[] blob.data; | 1615 delete[] blob.data; |
1616 } | 1616 } |
OLD | NEW |