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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 if (obj->IsCode() && Code::cast(obj)->kind() == Code::BUILTIN) counter++; | 801 if (obj->IsCode() && Code::cast(obj)->kind() == Code::BUILTIN) counter++; |
802 } | 802 } |
803 return counter; | 803 return counter; |
804 } | 804 } |
805 | 805 |
806 | 806 |
807 static Handle<SharedFunctionInfo> CompileScript( | 807 static Handle<SharedFunctionInfo> CompileScript( |
808 Isolate* isolate, Handle<String> source, Handle<String> name, | 808 Isolate* isolate, Handle<String> source, Handle<String> name, |
809 ScriptData** cached_data, v8::ScriptCompiler::CompileOptions options) { | 809 ScriptData** cached_data, v8::ScriptCompiler::CompileOptions options) { |
810 return Compiler::CompileScript( | 810 return Compiler::CompileScript( |
811 source, name, 0, 0, false, false, Handle<Object>(), | 811 source, name, 0, 0, v8::ScriptOriginOptions(), Handle<Object>(), |
812 Handle<Context>(isolate->native_context()), NULL, cached_data, options, | 812 Handle<Context>(isolate->native_context()), NULL, cached_data, options, |
813 NOT_NATIVES_CODE, false); | 813 NOT_NATIVES_CODE, false); |
814 } | 814 } |
815 | 815 |
816 | 816 |
817 TEST(SerializeToplevelOnePlusOne) { | 817 TEST(SerializeToplevelOnePlusOne) { |
818 FLAG_serialize_toplevel = true; | 818 FLAG_serialize_toplevel = true; |
819 LocalContext context; | 819 LocalContext context; |
820 Isolate* isolate = CcTest::i_isolate(); | 820 Isolate* isolate = CcTest::i_isolate(); |
821 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. | 821 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 ScriptData* cache = NULL; | 880 ScriptData* cache = NULL; |
881 | 881 |
882 CompileScript(isolate, src, src, &cache, | 882 CompileScript(isolate, src, src, &cache, |
883 v8::ScriptCompiler::kProduceCodeCache); | 883 v8::ScriptCompiler::kProduceCodeCache); |
884 | 884 |
885 DisallowCompilation no_compile_expected(isolate); | 885 DisallowCompilation no_compile_expected(isolate); |
886 Handle<SharedFunctionInfo> copy = CompileScript( | 886 Handle<SharedFunctionInfo> copy = CompileScript( |
887 isolate, src, src, &cache, v8::ScriptCompiler::kConsumeCodeCache); | 887 isolate, src, src, &cache, v8::ScriptCompiler::kConsumeCodeCache); |
888 | 888 |
889 CHECK(isolate->compilation_cache() | 889 CHECK(isolate->compilation_cache() |
890 ->LookupScript(src, src, 0, 0, false, false, | 890 ->LookupScript(src, src, 0, 0, v8::ScriptOriginOptions(), |
891 isolate->native_context(), SLOPPY) | 891 isolate->native_context(), SLOPPY) |
892 .ToHandleChecked() | 892 .ToHandleChecked() |
893 .is_identical_to(copy)); | 893 .is_identical_to(copy)); |
894 | 894 |
895 delete cache; | 895 delete cache; |
896 } | 896 } |
897 | 897 |
898 | 898 |
899 TEST(SerializeToplevelInternalizedString) { | 899 TEST(SerializeToplevelInternalizedString) { |
900 FLAG_serialize_toplevel = true; | 900 FLAG_serialize_toplevel = true; |
(...skipping 706 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 |