| 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 .ToHandleChecked(); | 747 .ToHandleChecked(); |
| 748 Handle<String> copy_source = isolate->factory() | 748 Handle<String> copy_source = isolate->factory() |
| 749 ->NewStringFromUtf8(CStrVector(source)) | 749 ->NewStringFromUtf8(CStrVector(source)) |
| 750 .ToHandleChecked(); | 750 .ToHandleChecked(); |
| 751 CHECK(!orig_source.is_identical_to(copy_source)); | 751 CHECK(!orig_source.is_identical_to(copy_source)); |
| 752 CHECK(orig_source->Equals(*copy_source)); | 752 CHECK(orig_source->Equals(*copy_source)); |
| 753 | 753 |
| 754 ScriptData* cache = NULL; | 754 ScriptData* cache = NULL; |
| 755 | 755 |
| 756 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 756 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 757 orig_source, Handle<String>(), 0, 0, false, | 757 orig_source, Handle<String>(), 0, 0, false, false, |
| 758 Handle<Context>(isolate->native_context()), NULL, &cache, | 758 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 759 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 759 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 760 | 760 |
| 761 int builtins_count = CountBuiltins(); | 761 int builtins_count = CountBuiltins(); |
| 762 | 762 |
| 763 Handle<SharedFunctionInfo> copy; | 763 Handle<SharedFunctionInfo> copy; |
| 764 { | 764 { |
| 765 DisallowCompilation no_compile_expected(isolate); | 765 DisallowCompilation no_compile_expected(isolate); |
| 766 copy = Compiler::CompileScript( | 766 copy = Compiler::CompileScript( |
| 767 copy_source, Handle<String>(), 0, 0, false, | 767 copy_source, Handle<String>(), 0, 0, false, false, |
| 768 Handle<Context>(isolate->native_context()), NULL, &cache, | 768 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 769 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 769 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 770 } | 770 } |
| 771 | 771 |
| 772 CHECK_NE(*orig, *copy); | 772 CHECK_NE(*orig, *copy); |
| 773 CHECK(Script::cast(copy->script())->source() == *copy_source); | 773 CHECK(Script::cast(copy->script())->source() == *copy_source); |
| 774 | 774 |
| 775 Handle<JSFunction> copy_fun = | 775 Handle<JSFunction> copy_fun = |
| 776 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 776 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 777 copy, isolate->native_context()); | 777 copy, isolate->native_context()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 802 Handle<String> copy_source = isolate->factory() | 802 Handle<String> copy_source = isolate->factory() |
| 803 ->NewStringFromUtf8(CStrVector(source)) | 803 ->NewStringFromUtf8(CStrVector(source)) |
| 804 .ToHandleChecked(); | 804 .ToHandleChecked(); |
| 805 CHECK(!orig_source.is_identical_to(copy_source)); | 805 CHECK(!orig_source.is_identical_to(copy_source)); |
| 806 CHECK(orig_source->Equals(*copy_source)); | 806 CHECK(orig_source->Equals(*copy_source)); |
| 807 | 807 |
| 808 Handle<JSObject> global(isolate->context()->global_object()); | 808 Handle<JSObject> global(isolate->context()->global_object()); |
| 809 ScriptData* cache = NULL; | 809 ScriptData* cache = NULL; |
| 810 | 810 |
| 811 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 811 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 812 orig_source, Handle<String>(), 0, 0, false, | 812 orig_source, Handle<String>(), 0, 0, false, false, |
| 813 Handle<Context>(isolate->native_context()), NULL, &cache, | 813 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 814 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 814 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 815 Handle<JSFunction> orig_fun = | 815 Handle<JSFunction> orig_fun = |
| 816 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 816 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 817 orig, isolate->native_context()); | 817 orig, isolate->native_context()); |
| 818 Handle<Object> orig_result = | 818 Handle<Object> orig_result = |
| 819 Execution::Call(isolate, orig_fun, global, 0, NULL).ToHandleChecked(); | 819 Execution::Call(isolate, orig_fun, global, 0, NULL).ToHandleChecked(); |
| 820 CHECK(orig_result->IsInternalizedString()); | 820 CHECK(orig_result->IsInternalizedString()); |
| 821 | 821 |
| 822 int builtins_count = CountBuiltins(); | 822 int builtins_count = CountBuiltins(); |
| 823 | 823 |
| 824 Handle<SharedFunctionInfo> copy; | 824 Handle<SharedFunctionInfo> copy; |
| 825 { | 825 { |
| 826 DisallowCompilation no_compile_expected(isolate); | 826 DisallowCompilation no_compile_expected(isolate); |
| 827 copy = Compiler::CompileScript( | 827 copy = Compiler::CompileScript( |
| 828 copy_source, Handle<String>(), 0, 0, false, | 828 copy_source, Handle<String>(), 0, 0, false, false, |
| 829 Handle<Context>(isolate->native_context()), NULL, &cache, | 829 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 830 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 830 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 831 } | 831 } |
| 832 CHECK_NE(*orig, *copy); | 832 CHECK_NE(*orig, *copy); |
| 833 CHECK(Script::cast(copy->script())->source() == *copy_source); | 833 CHECK(Script::cast(copy->script())->source() == *copy_source); |
| 834 | 834 |
| 835 Handle<JSFunction> copy_fun = | 835 Handle<JSFunction> copy_fun = |
| 836 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 836 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 837 copy, isolate->native_context()); | 837 copy, isolate->native_context()); |
| 838 CHECK_NE(*orig_fun, *copy_fun); | 838 CHECK_NE(*orig_fun, *copy_fun); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 861 ConstructSource(STATIC_CHAR_VECTOR("var j=1; try { if (j) throw 1;"), | 861 ConstructSource(STATIC_CHAR_VECTOR("var j=1; try { if (j) throw 1;"), |
| 862 STATIC_CHAR_VECTOR("for(var i=0;i<1;i++)j++;"), | 862 STATIC_CHAR_VECTOR("for(var i=0;i<1;i++)j++;"), |
| 863 STATIC_CHAR_VECTOR("} catch (e) { j=7; } j"), 10000); | 863 STATIC_CHAR_VECTOR("} catch (e) { j=7; } j"), 10000); |
| 864 Handle<String> source_str = | 864 Handle<String> source_str = |
| 865 isolate->factory()->NewStringFromOneByte(source).ToHandleChecked(); | 865 isolate->factory()->NewStringFromOneByte(source).ToHandleChecked(); |
| 866 | 866 |
| 867 Handle<JSObject> global(isolate->context()->global_object()); | 867 Handle<JSObject> global(isolate->context()->global_object()); |
| 868 ScriptData* cache = NULL; | 868 ScriptData* cache = NULL; |
| 869 | 869 |
| 870 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 870 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 871 source_str, Handle<String>(), 0, 0, false, | 871 source_str, Handle<String>(), 0, 0, false, false, |
| 872 Handle<Context>(isolate->native_context()), NULL, &cache, | 872 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 873 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 873 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 874 | 874 |
| 875 CHECK(isolate->heap()->InSpace(orig->code(), LO_SPACE)); | 875 CHECK(isolate->heap()->InSpace(orig->code(), LO_SPACE)); |
| 876 | 876 |
| 877 Handle<SharedFunctionInfo> copy; | 877 Handle<SharedFunctionInfo> copy; |
| 878 { | 878 { |
| 879 DisallowCompilation no_compile_expected(isolate); | 879 DisallowCompilation no_compile_expected(isolate); |
| 880 copy = Compiler::CompileScript( | 880 copy = Compiler::CompileScript( |
| 881 source_str, Handle<String>(), 0, 0, false, | 881 source_str, Handle<String>(), 0, 0, false, false, |
| 882 Handle<Context>(isolate->native_context()), NULL, &cache, | 882 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 883 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 883 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 884 } | 884 } |
| 885 CHECK_NE(*orig, *copy); | 885 CHECK_NE(*orig, *copy); |
| 886 | 886 |
| 887 Handle<JSFunction> copy_fun = | 887 Handle<JSFunction> copy_fun = |
| 888 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 888 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 889 copy, isolate->native_context()); | 889 copy, isolate->native_context()); |
| 890 | 890 |
| 891 Handle<Object> copy_result = | 891 Handle<Object> copy_result = |
| (...skipping 25 matching lines...) Expand all Loading... |
| 917 STATIC_CHAR_VECTOR("\"; s + t"), 999999); | 917 STATIC_CHAR_VECTOR("\"; s + t"), 999999); |
| 918 Handle<String> source_str = | 918 Handle<String> source_str = |
| 919 f->NewConsString(f->NewStringFromOneByte(source_s).ToHandleChecked(), | 919 f->NewConsString(f->NewStringFromOneByte(source_s).ToHandleChecked(), |
| 920 f->NewStringFromOneByte(source_t).ToHandleChecked()) | 920 f->NewStringFromOneByte(source_t).ToHandleChecked()) |
| 921 .ToHandleChecked(); | 921 .ToHandleChecked(); |
| 922 | 922 |
| 923 Handle<JSObject> global(isolate->context()->global_object()); | 923 Handle<JSObject> global(isolate->context()->global_object()); |
| 924 ScriptData* cache = NULL; | 924 ScriptData* cache = NULL; |
| 925 | 925 |
| 926 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 926 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 927 source_str, Handle<String>(), 0, 0, false, | 927 source_str, Handle<String>(), 0, 0, false, false, |
| 928 Handle<Context>(isolate->native_context()), NULL, &cache, | 928 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 929 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 929 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 930 | 930 |
| 931 Handle<SharedFunctionInfo> copy; | 931 Handle<SharedFunctionInfo> copy; |
| 932 { | 932 { |
| 933 DisallowCompilation no_compile_expected(isolate); | 933 DisallowCompilation no_compile_expected(isolate); |
| 934 copy = Compiler::CompileScript( | 934 copy = Compiler::CompileScript( |
| 935 source_str, Handle<String>(), 0, 0, false, | 935 source_str, Handle<String>(), 0, 0, false, false, |
| 936 Handle<Context>(isolate->native_context()), NULL, &cache, | 936 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 937 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 937 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 938 } | 938 } |
| 939 CHECK_NE(*orig, *copy); | 939 CHECK_NE(*orig, *copy); |
| 940 | 940 |
| 941 Handle<JSFunction> copy_fun = | 941 Handle<JSFunction> copy_fun = |
| 942 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 942 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 943 copy, isolate->native_context()); | 943 copy, isolate->native_context()); |
| 944 | 944 |
| 945 Handle<Object> copy_result = | 945 Handle<Object> copy_result = |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 | 990 |
| 991 Handle<String> source_str = | 991 Handle<String> source_str = |
| 992 f->NewConsString( | 992 f->NewConsString( |
| 993 f->NewConsString(source_a_str, source_b_str).ToHandleChecked(), | 993 f->NewConsString(source_a_str, source_b_str).ToHandleChecked(), |
| 994 source_c_str).ToHandleChecked(); | 994 source_c_str).ToHandleChecked(); |
| 995 | 995 |
| 996 Handle<JSObject> global(isolate->context()->global_object()); | 996 Handle<JSObject> global(isolate->context()->global_object()); |
| 997 ScriptData* cache = NULL; | 997 ScriptData* cache = NULL; |
| 998 | 998 |
| 999 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 999 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 1000 source_str, Handle<String>(), 0, 0, false, | 1000 source_str, Handle<String>(), 0, 0, false, false, |
| 1001 Handle<Context>(isolate->native_context()), NULL, &cache, | 1001 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1002 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1002 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 1003 | 1003 |
| 1004 Handle<SharedFunctionInfo> copy; | 1004 Handle<SharedFunctionInfo> copy; |
| 1005 { | 1005 { |
| 1006 DisallowCompilation no_compile_expected(isolate); | 1006 DisallowCompilation no_compile_expected(isolate); |
| 1007 copy = Compiler::CompileScript( | 1007 copy = Compiler::CompileScript( |
| 1008 source_str, Handle<String>(), 0, 0, false, | 1008 source_str, Handle<String>(), 0, 0, false, false, |
| 1009 Handle<Context>(isolate->native_context()), NULL, &cache, | 1009 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1010 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1010 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 1011 } | 1011 } |
| 1012 CHECK_NE(*orig, *copy); | 1012 CHECK_NE(*orig, *copy); |
| 1013 | 1013 |
| 1014 Handle<JSFunction> copy_fun = | 1014 Handle<JSFunction> copy_fun = |
| 1015 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1015 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 1016 copy, isolate->native_context()); | 1016 copy, isolate->native_context()); |
| 1017 | 1017 |
| 1018 USE(Execution::Call(isolate, copy_fun, global, 0, NULL)); | 1018 USE(Execution::Call(isolate, copy_fun, global, 0, NULL)); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 "o.two_byte = 8; \n" | 1098 "o.two_byte = 8; \n" |
| 1099 "o.one_byte + o.two_byte; \n"; | 1099 "o.one_byte + o.two_byte; \n"; |
| 1100 Handle<String> source_string = isolate->factory() | 1100 Handle<String> source_string = isolate->factory() |
| 1101 ->NewStringFromUtf8(CStrVector(source)) | 1101 ->NewStringFromUtf8(CStrVector(source)) |
| 1102 .ToHandleChecked(); | 1102 .ToHandleChecked(); |
| 1103 | 1103 |
| 1104 Handle<JSObject> global(isolate->context()->global_object()); | 1104 Handle<JSObject> global(isolate->context()->global_object()); |
| 1105 ScriptData* cache = NULL; | 1105 ScriptData* cache = NULL; |
| 1106 | 1106 |
| 1107 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 1107 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 1108 source_string, Handle<String>(), 0, 0, false, | 1108 source_string, Handle<String>(), 0, 0, false, false, |
| 1109 Handle<Context>(isolate->native_context()), NULL, &cache, | 1109 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1110 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1110 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 1111 | 1111 |
| 1112 Handle<SharedFunctionInfo> copy; | 1112 Handle<SharedFunctionInfo> copy; |
| 1113 { | 1113 { |
| 1114 DisallowCompilation no_compile_expected(isolate); | 1114 DisallowCompilation no_compile_expected(isolate); |
| 1115 copy = Compiler::CompileScript( | 1115 copy = Compiler::CompileScript( |
| 1116 source_string, Handle<String>(), 0, 0, false, | 1116 source_string, Handle<String>(), 0, 0, false, false, |
| 1117 Handle<Context>(isolate->native_context()), NULL, &cache, | 1117 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1118 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1118 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 1119 } | 1119 } |
| 1120 CHECK_NE(*orig, *copy); | 1120 CHECK_NE(*orig, *copy); |
| 1121 | 1121 |
| 1122 Handle<JSFunction> copy_fun = | 1122 Handle<JSFunction> copy_fun = |
| 1123 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1123 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 1124 copy, isolate->native_context()); | 1124 copy, isolate->native_context()); |
| 1125 | 1125 |
| 1126 Handle<Object> copy_result = | 1126 Handle<Object> copy_result = |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 f->NewConsString( | 1160 f->NewConsString( |
| 1161 f->NewConsString(f->NewStringFromAsciiChecked("var "), name) | 1161 f->NewConsString(f->NewStringFromAsciiChecked("var "), name) |
| 1162 .ToHandleChecked(), | 1162 .ToHandleChecked(), |
| 1163 f->NewConsString(f->NewStringFromAsciiChecked(" = 42; "), name) | 1163 f->NewConsString(f->NewStringFromAsciiChecked(" = 42; "), name) |
| 1164 .ToHandleChecked()).ToHandleChecked(); | 1164 .ToHandleChecked()).ToHandleChecked(); |
| 1165 | 1165 |
| 1166 Handle<JSObject> global(isolate->context()->global_object()); | 1166 Handle<JSObject> global(isolate->context()->global_object()); |
| 1167 ScriptData* cache = NULL; | 1167 ScriptData* cache = NULL; |
| 1168 | 1168 |
| 1169 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 1169 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 1170 source_str, Handle<String>(), 0, 0, false, | 1170 source_str, Handle<String>(), 0, 0, false, false, |
| 1171 Handle<Context>(isolate->native_context()), NULL, &cache, | 1171 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1172 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1172 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 1173 | 1173 |
| 1174 Handle<SharedFunctionInfo> copy; | 1174 Handle<SharedFunctionInfo> copy; |
| 1175 { | 1175 { |
| 1176 DisallowCompilation no_compile_expected(isolate); | 1176 DisallowCompilation no_compile_expected(isolate); |
| 1177 copy = Compiler::CompileScript( | 1177 copy = Compiler::CompileScript( |
| 1178 source_str, Handle<String>(), 0, 0, false, | 1178 source_str, Handle<String>(), 0, 0, false, false, |
| 1179 Handle<Context>(isolate->native_context()), NULL, &cache, | 1179 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1180 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1180 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 1181 } | 1181 } |
| 1182 CHECK_NE(*orig, *copy); | 1182 CHECK_NE(*orig, *copy); |
| 1183 | 1183 |
| 1184 Handle<JSFunction> copy_fun = | 1184 Handle<JSFunction> copy_fun = |
| 1185 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); | 1185 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); |
| 1186 | 1186 |
| 1187 Handle<Object> copy_result = | 1187 Handle<Object> copy_result = |
| 1188 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1188 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1214 const SerializerOneByteResource one_byte_resource("one_byte", 8); | 1214 const SerializerOneByteResource one_byte_resource("one_byte", 8); |
| 1215 Handle<String> name = | 1215 Handle<String> name = |
| 1216 f->NewExternalStringFromOneByte(&one_byte_resource).ToHandleChecked(); | 1216 f->NewExternalStringFromOneByte(&one_byte_resource).ToHandleChecked(); |
| 1217 CHECK(name->IsExternalOneByteString()); | 1217 CHECK(name->IsExternalOneByteString()); |
| 1218 CHECK(!name->IsInternalizedString()); | 1218 CHECK(!name->IsInternalizedString()); |
| 1219 | 1219 |
| 1220 Handle<JSObject> global(isolate->context()->global_object()); | 1220 Handle<JSObject> global(isolate->context()->global_object()); |
| 1221 ScriptData* cache = NULL; | 1221 ScriptData* cache = NULL; |
| 1222 | 1222 |
| 1223 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 1223 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
| 1224 source_string, name, 0, 0, false, | 1224 source_string, name, 0, 0, false, false, |
| 1225 Handle<Context>(isolate->native_context()), NULL, &cache, | 1225 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1226 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1226 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
| 1227 | 1227 |
| 1228 Handle<SharedFunctionInfo> copy; | 1228 Handle<SharedFunctionInfo> copy; |
| 1229 { | 1229 { |
| 1230 DisallowCompilation no_compile_expected(isolate); | 1230 DisallowCompilation no_compile_expected(isolate); |
| 1231 copy = Compiler::CompileScript( | 1231 copy = Compiler::CompileScript( |
| 1232 source_string, name, 0, 0, false, | 1232 source_string, name, 0, 0, false, false, |
| 1233 Handle<Context>(isolate->native_context()), NULL, &cache, | 1233 Handle<Context>(isolate->native_context()), NULL, &cache, |
| 1234 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1234 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
| 1235 } | 1235 } |
| 1236 CHECK_NE(*orig, *copy); | 1236 CHECK_NE(*orig, *copy); |
| 1237 | 1237 |
| 1238 Handle<JSFunction> copy_fun = | 1238 Handle<JSFunction> copy_fun = |
| 1239 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); | 1239 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); |
| 1240 | 1240 |
| 1241 Handle<Object> copy_result = | 1241 Handle<Object> copy_result = |
| 1242 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1242 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 { | 1373 { |
| 1374 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1374 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
| 1375 script = v8::ScriptCompiler::CompileUnbound( | 1375 script = v8::ScriptCompiler::CompileUnbound( |
| 1376 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1376 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
| 1377 } | 1377 } |
| 1378 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1378 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
| 1379 CHECK(result->ToString(isolate2)->Equals(v8_str("XY"))); | 1379 CHECK(result->ToString(isolate2)->Equals(v8_str("XY"))); |
| 1380 } | 1380 } |
| 1381 isolate2->Dispose(); | 1381 isolate2->Dispose(); |
| 1382 } | 1382 } |
| OLD | NEW |