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 if (FLAG_global_var_shortcuts) { |
| 632 CHECK_EQ(5, outdated_contexts->length()); |
| 633 } else { |
| 634 CHECK_EQ(3, outdated_contexts->length()); |
| 635 } |
632 CHECK(root->IsContext()); | 636 CHECK(root->IsContext()); |
633 Handle<Context> context = Handle<Context>::cast(root); | 637 Handle<Context> context = Handle<Context>::cast(root); |
634 CHECK(context->global_proxy() == *global_proxy); | 638 CHECK(context->global_proxy() == *global_proxy); |
635 Handle<String> o = isolate->factory()->NewStringFromAsciiChecked("o"); | 639 Handle<String> o = isolate->factory()->NewStringFromAsciiChecked("o"); |
636 Handle<JSObject> global_object(context->global_object(), isolate); | 640 Handle<JSObject> global_object(context->global_object(), isolate); |
637 Handle<Object> property = JSReceiver::GetDataProperty(global_object, o); | 641 Handle<Object> property = JSReceiver::GetDataProperty(global_object, o); |
638 CHECK(property.is_identical_to(global_proxy)); | 642 CHECK(property.is_identical_to(global_proxy)); |
639 | 643 |
640 v8::Handle<v8::Context> v8_context = v8::Utils::ToLocal(context); | 644 v8::Handle<v8::Context> v8_context = v8::Utils::ToLocal(context); |
641 v8::Context::Scope context_scope(v8_context); | 645 v8::Context::Scope context_scope(v8_context); |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 delete script_data; | 1686 delete script_data; |
1683 } | 1687 } |
1684 | 1688 |
1685 | 1689 |
1686 TEST(SerializationMemoryStats) { | 1690 TEST(SerializationMemoryStats) { |
1687 FLAG_profile_deserialization = true; | 1691 FLAG_profile_deserialization = true; |
1688 FLAG_always_opt = false; | 1692 FLAG_always_opt = false; |
1689 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 1693 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
1690 delete[] blob.data; | 1694 delete[] blob.data; |
1691 } | 1695 } |
OLD | NEW |