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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 .ToHandleChecked(); | 717 .ToHandleChecked(); |
718 Handle<String> copy_source = isolate->factory() | 718 Handle<String> copy_source = isolate->factory() |
719 ->NewStringFromUtf8(CStrVector(source)) | 719 ->NewStringFromUtf8(CStrVector(source)) |
720 .ToHandleChecked(); | 720 .ToHandleChecked(); |
721 CHECK(!orig_source.is_identical_to(copy_source)); | 721 CHECK(!orig_source.is_identical_to(copy_source)); |
722 CHECK(orig_source->Equals(*copy_source)); | 722 CHECK(orig_source->Equals(*copy_source)); |
723 | 723 |
724 ScriptData* cache = NULL; | 724 ScriptData* cache = NULL; |
725 | 725 |
726 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 726 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
727 orig_source, Handle<String>(), 0, 0, false, | 727 orig_source, Handle<String>(), 0, 0, false, false, |
728 Handle<Context>(isolate->native_context()), NULL, &cache, | 728 Handle<Context>(isolate->native_context()), NULL, &cache, |
729 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 729 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
730 | 730 |
731 int builtins_count = CountBuiltins(); | 731 int builtins_count = CountBuiltins(); |
732 | 732 |
733 Handle<SharedFunctionInfo> copy; | 733 Handle<SharedFunctionInfo> copy; |
734 { | 734 { |
735 DisallowCompilation no_compile_expected(isolate); | 735 DisallowCompilation no_compile_expected(isolate); |
736 copy = Compiler::CompileScript( | 736 copy = Compiler::CompileScript( |
737 copy_source, Handle<String>(), 0, 0, false, | 737 copy_source, Handle<String>(), 0, 0, false, false, |
738 Handle<Context>(isolate->native_context()), NULL, &cache, | 738 Handle<Context>(isolate->native_context()), NULL, &cache, |
739 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 739 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
740 } | 740 } |
741 | 741 |
742 CHECK_NE(*orig, *copy); | 742 CHECK_NE(*orig, *copy); |
743 CHECK(Script::cast(copy->script())->source() == *copy_source); | 743 CHECK(Script::cast(copy->script())->source() == *copy_source); |
744 | 744 |
745 Handle<JSFunction> copy_fun = | 745 Handle<JSFunction> copy_fun = |
746 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 746 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
747 copy, isolate->native_context()); | 747 copy, isolate->native_context()); |
(...skipping 24 matching lines...) Expand all Loading... |
772 Handle<String> copy_source = isolate->factory() | 772 Handle<String> copy_source = isolate->factory() |
773 ->NewStringFromUtf8(CStrVector(source)) | 773 ->NewStringFromUtf8(CStrVector(source)) |
774 .ToHandleChecked(); | 774 .ToHandleChecked(); |
775 CHECK(!orig_source.is_identical_to(copy_source)); | 775 CHECK(!orig_source.is_identical_to(copy_source)); |
776 CHECK(orig_source->Equals(*copy_source)); | 776 CHECK(orig_source->Equals(*copy_source)); |
777 | 777 |
778 Handle<JSObject> global(isolate->context()->global_object()); | 778 Handle<JSObject> global(isolate->context()->global_object()); |
779 ScriptData* cache = NULL; | 779 ScriptData* cache = NULL; |
780 | 780 |
781 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 781 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
782 orig_source, Handle<String>(), 0, 0, false, | 782 orig_source, Handle<String>(), 0, 0, false, false, |
783 Handle<Context>(isolate->native_context()), NULL, &cache, | 783 Handle<Context>(isolate->native_context()), NULL, &cache, |
784 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 784 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
785 Handle<JSFunction> orig_fun = | 785 Handle<JSFunction> orig_fun = |
786 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 786 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
787 orig, isolate->native_context()); | 787 orig, isolate->native_context()); |
788 Handle<Object> orig_result = | 788 Handle<Object> orig_result = |
789 Execution::Call(isolate, orig_fun, global, 0, NULL).ToHandleChecked(); | 789 Execution::Call(isolate, orig_fun, global, 0, NULL).ToHandleChecked(); |
790 CHECK(orig_result->IsInternalizedString()); | 790 CHECK(orig_result->IsInternalizedString()); |
791 | 791 |
792 int builtins_count = CountBuiltins(); | 792 int builtins_count = CountBuiltins(); |
793 | 793 |
794 Handle<SharedFunctionInfo> copy; | 794 Handle<SharedFunctionInfo> copy; |
795 { | 795 { |
796 DisallowCompilation no_compile_expected(isolate); | 796 DisallowCompilation no_compile_expected(isolate); |
797 copy = Compiler::CompileScript( | 797 copy = Compiler::CompileScript( |
798 copy_source, Handle<String>(), 0, 0, false, | 798 copy_source, Handle<String>(), 0, 0, false, false, |
799 Handle<Context>(isolate->native_context()), NULL, &cache, | 799 Handle<Context>(isolate->native_context()), NULL, &cache, |
800 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 800 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
801 } | 801 } |
802 CHECK_NE(*orig, *copy); | 802 CHECK_NE(*orig, *copy); |
803 CHECK(Script::cast(copy->script())->source() == *copy_source); | 803 CHECK(Script::cast(copy->script())->source() == *copy_source); |
804 | 804 |
805 Handle<JSFunction> copy_fun = | 805 Handle<JSFunction> copy_fun = |
806 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 806 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
807 copy, isolate->native_context()); | 807 copy, isolate->native_context()); |
808 CHECK_NE(*orig_fun, *copy_fun); | 808 CHECK_NE(*orig_fun, *copy_fun); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 ConstructSource(STATIC_CHAR_VECTOR("var j=1; try { if (j) throw 1;"), | 848 ConstructSource(STATIC_CHAR_VECTOR("var j=1; try { if (j) throw 1;"), |
849 STATIC_CHAR_VECTOR("for(var i=0;i<1;i++)j++;"), | 849 STATIC_CHAR_VECTOR("for(var i=0;i<1;i++)j++;"), |
850 STATIC_CHAR_VECTOR("} catch (e) { j=7; } j"), 10000); | 850 STATIC_CHAR_VECTOR("} catch (e) { j=7; } j"), 10000); |
851 Handle<String> source_str = | 851 Handle<String> source_str = |
852 isolate->factory()->NewStringFromOneByte(source).ToHandleChecked(); | 852 isolate->factory()->NewStringFromOneByte(source).ToHandleChecked(); |
853 | 853 |
854 Handle<JSObject> global(isolate->context()->global_object()); | 854 Handle<JSObject> global(isolate->context()->global_object()); |
855 ScriptData* cache = NULL; | 855 ScriptData* cache = NULL; |
856 | 856 |
857 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 857 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
858 source_str, Handle<String>(), 0, 0, false, | 858 source_str, Handle<String>(), 0, 0, false, false, |
859 Handle<Context>(isolate->native_context()), NULL, &cache, | 859 Handle<Context>(isolate->native_context()), NULL, &cache, |
860 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 860 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
861 | 861 |
862 CHECK(isolate->heap()->InSpace(orig->code(), LO_SPACE)); | 862 CHECK(isolate->heap()->InSpace(orig->code(), LO_SPACE)); |
863 | 863 |
864 Handle<SharedFunctionInfo> copy; | 864 Handle<SharedFunctionInfo> copy; |
865 { | 865 { |
866 DisallowCompilation no_compile_expected(isolate); | 866 DisallowCompilation no_compile_expected(isolate); |
867 copy = Compiler::CompileScript( | 867 copy = Compiler::CompileScript( |
868 source_str, Handle<String>(), 0, 0, false, | 868 source_str, Handle<String>(), 0, 0, false, false, |
869 Handle<Context>(isolate->native_context()), NULL, &cache, | 869 Handle<Context>(isolate->native_context()), NULL, &cache, |
870 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 870 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
871 } | 871 } |
872 CHECK_NE(*orig, *copy); | 872 CHECK_NE(*orig, *copy); |
873 | 873 |
874 Handle<JSFunction> copy_fun = | 874 Handle<JSFunction> copy_fun = |
875 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 875 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
876 copy, isolate->native_context()); | 876 copy, isolate->native_context()); |
877 | 877 |
878 Handle<Object> copy_result = | 878 Handle<Object> copy_result = |
(...skipping 25 matching lines...) Expand all Loading... |
904 STATIC_CHAR_VECTOR("\"; s + t"), 999999); | 904 STATIC_CHAR_VECTOR("\"; s + t"), 999999); |
905 Handle<String> source_str = | 905 Handle<String> source_str = |
906 f->NewConsString(f->NewStringFromOneByte(source_s).ToHandleChecked(), | 906 f->NewConsString(f->NewStringFromOneByte(source_s).ToHandleChecked(), |
907 f->NewStringFromOneByte(source_t).ToHandleChecked()) | 907 f->NewStringFromOneByte(source_t).ToHandleChecked()) |
908 .ToHandleChecked(); | 908 .ToHandleChecked(); |
909 | 909 |
910 Handle<JSObject> global(isolate->context()->global_object()); | 910 Handle<JSObject> global(isolate->context()->global_object()); |
911 ScriptData* cache = NULL; | 911 ScriptData* cache = NULL; |
912 | 912 |
913 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 913 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
914 source_str, Handle<String>(), 0, 0, false, | 914 source_str, Handle<String>(), 0, 0, false, false, |
915 Handle<Context>(isolate->native_context()), NULL, &cache, | 915 Handle<Context>(isolate->native_context()), NULL, &cache, |
916 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 916 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
917 | 917 |
918 Handle<SharedFunctionInfo> copy; | 918 Handle<SharedFunctionInfo> copy; |
919 { | 919 { |
920 DisallowCompilation no_compile_expected(isolate); | 920 DisallowCompilation no_compile_expected(isolate); |
921 copy = Compiler::CompileScript( | 921 copy = Compiler::CompileScript( |
922 source_str, Handle<String>(), 0, 0, false, | 922 source_str, Handle<String>(), 0, 0, false, false, |
923 Handle<Context>(isolate->native_context()), NULL, &cache, | 923 Handle<Context>(isolate->native_context()), NULL, &cache, |
924 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 924 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
925 } | 925 } |
926 CHECK_NE(*orig, *copy); | 926 CHECK_NE(*orig, *copy); |
927 | 927 |
928 Handle<JSFunction> copy_fun = | 928 Handle<JSFunction> copy_fun = |
929 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 929 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
930 copy, isolate->native_context()); | 930 copy, isolate->native_context()); |
931 | 931 |
932 Handle<Object> copy_result = | 932 Handle<Object> copy_result = |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 | 977 |
978 Handle<String> source_str = | 978 Handle<String> source_str = |
979 f->NewConsString( | 979 f->NewConsString( |
980 f->NewConsString(source_a_str, source_b_str).ToHandleChecked(), | 980 f->NewConsString(source_a_str, source_b_str).ToHandleChecked(), |
981 source_c_str).ToHandleChecked(); | 981 source_c_str).ToHandleChecked(); |
982 | 982 |
983 Handle<JSObject> global(isolate->context()->global_object()); | 983 Handle<JSObject> global(isolate->context()->global_object()); |
984 ScriptData* cache = NULL; | 984 ScriptData* cache = NULL; |
985 | 985 |
986 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 986 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
987 source_str, Handle<String>(), 0, 0, false, | 987 source_str, Handle<String>(), 0, 0, false, false, |
988 Handle<Context>(isolate->native_context()), NULL, &cache, | 988 Handle<Context>(isolate->native_context()), NULL, &cache, |
989 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 989 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
990 | 990 |
991 Handle<SharedFunctionInfo> copy; | 991 Handle<SharedFunctionInfo> copy; |
992 { | 992 { |
993 DisallowCompilation no_compile_expected(isolate); | 993 DisallowCompilation no_compile_expected(isolate); |
994 copy = Compiler::CompileScript( | 994 copy = Compiler::CompileScript( |
995 source_str, Handle<String>(), 0, 0, false, | 995 source_str, Handle<String>(), 0, 0, false, false, |
996 Handle<Context>(isolate->native_context()), NULL, &cache, | 996 Handle<Context>(isolate->native_context()), NULL, &cache, |
997 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 997 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
998 } | 998 } |
999 CHECK_NE(*orig, *copy); | 999 CHECK_NE(*orig, *copy); |
1000 | 1000 |
1001 Handle<JSFunction> copy_fun = | 1001 Handle<JSFunction> copy_fun = |
1002 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1002 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1003 copy, isolate->native_context()); | 1003 copy, isolate->native_context()); |
1004 | 1004 |
1005 USE(Execution::Call(isolate, copy_fun, global, 0, NULL)); | 1005 USE(Execution::Call(isolate, copy_fun, global, 0, NULL)); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 "o.two_byte = 8; \n" | 1085 "o.two_byte = 8; \n" |
1086 "o.one_byte + o.two_byte; \n"; | 1086 "o.one_byte + o.two_byte; \n"; |
1087 Handle<String> source_string = isolate->factory() | 1087 Handle<String> source_string = isolate->factory() |
1088 ->NewStringFromUtf8(CStrVector(source)) | 1088 ->NewStringFromUtf8(CStrVector(source)) |
1089 .ToHandleChecked(); | 1089 .ToHandleChecked(); |
1090 | 1090 |
1091 Handle<JSObject> global(isolate->context()->global_object()); | 1091 Handle<JSObject> global(isolate->context()->global_object()); |
1092 ScriptData* cache = NULL; | 1092 ScriptData* cache = NULL; |
1093 | 1093 |
1094 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 1094 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
1095 source_string, Handle<String>(), 0, 0, false, | 1095 source_string, Handle<String>(), 0, 0, false, false, |
1096 Handle<Context>(isolate->native_context()), NULL, &cache, | 1096 Handle<Context>(isolate->native_context()), NULL, &cache, |
1097 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1097 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
1098 | 1098 |
1099 Handle<SharedFunctionInfo> copy; | 1099 Handle<SharedFunctionInfo> copy; |
1100 { | 1100 { |
1101 DisallowCompilation no_compile_expected(isolate); | 1101 DisallowCompilation no_compile_expected(isolate); |
1102 copy = Compiler::CompileScript( | 1102 copy = Compiler::CompileScript( |
1103 source_string, Handle<String>(), 0, 0, false, | 1103 source_string, Handle<String>(), 0, 0, false, false, |
1104 Handle<Context>(isolate->native_context()), NULL, &cache, | 1104 Handle<Context>(isolate->native_context()), NULL, &cache, |
1105 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1105 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
1106 } | 1106 } |
1107 CHECK_NE(*orig, *copy); | 1107 CHECK_NE(*orig, *copy); |
1108 | 1108 |
1109 Handle<JSFunction> copy_fun = | 1109 Handle<JSFunction> copy_fun = |
1110 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1110 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1111 copy, isolate->native_context()); | 1111 copy, isolate->native_context()); |
1112 | 1112 |
1113 Handle<Object> copy_result = | 1113 Handle<Object> copy_result = |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 f->NewConsString( | 1147 f->NewConsString( |
1148 f->NewConsString(f->NewStringFromAsciiChecked("var "), name) | 1148 f->NewConsString(f->NewStringFromAsciiChecked("var "), name) |
1149 .ToHandleChecked(), | 1149 .ToHandleChecked(), |
1150 f->NewConsString(f->NewStringFromAsciiChecked(" = 42; "), name) | 1150 f->NewConsString(f->NewStringFromAsciiChecked(" = 42; "), name) |
1151 .ToHandleChecked()).ToHandleChecked(); | 1151 .ToHandleChecked()).ToHandleChecked(); |
1152 | 1152 |
1153 Handle<JSObject> global(isolate->context()->global_object()); | 1153 Handle<JSObject> global(isolate->context()->global_object()); |
1154 ScriptData* cache = NULL; | 1154 ScriptData* cache = NULL; |
1155 | 1155 |
1156 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 1156 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
1157 source_str, Handle<String>(), 0, 0, false, | 1157 source_str, Handle<String>(), 0, 0, false, false, |
1158 Handle<Context>(isolate->native_context()), NULL, &cache, | 1158 Handle<Context>(isolate->native_context()), NULL, &cache, |
1159 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1159 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
1160 | 1160 |
1161 Handle<SharedFunctionInfo> copy; | 1161 Handle<SharedFunctionInfo> copy; |
1162 { | 1162 { |
1163 DisallowCompilation no_compile_expected(isolate); | 1163 DisallowCompilation no_compile_expected(isolate); |
1164 copy = Compiler::CompileScript( | 1164 copy = Compiler::CompileScript( |
1165 source_str, Handle<String>(), 0, 0, false, | 1165 source_str, Handle<String>(), 0, 0, false, false, |
1166 Handle<Context>(isolate->native_context()), NULL, &cache, | 1166 Handle<Context>(isolate->native_context()), NULL, &cache, |
1167 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1167 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
1168 } | 1168 } |
1169 CHECK_NE(*orig, *copy); | 1169 CHECK_NE(*orig, *copy); |
1170 | 1170 |
1171 Handle<JSFunction> copy_fun = | 1171 Handle<JSFunction> copy_fun = |
1172 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); | 1172 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); |
1173 | 1173 |
1174 Handle<Object> copy_result = | 1174 Handle<Object> copy_result = |
1175 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1175 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
(...skipping 25 matching lines...) Expand all Loading... |
1201 const SerializerOneByteResource one_byte_resource("one_byte", 8); | 1201 const SerializerOneByteResource one_byte_resource("one_byte", 8); |
1202 Handle<String> name = | 1202 Handle<String> name = |
1203 f->NewExternalStringFromOneByte(&one_byte_resource).ToHandleChecked(); | 1203 f->NewExternalStringFromOneByte(&one_byte_resource).ToHandleChecked(); |
1204 CHECK(name->IsExternalOneByteString()); | 1204 CHECK(name->IsExternalOneByteString()); |
1205 CHECK(!name->IsInternalizedString()); | 1205 CHECK(!name->IsInternalizedString()); |
1206 | 1206 |
1207 Handle<JSObject> global(isolate->context()->global_object()); | 1207 Handle<JSObject> global(isolate->context()->global_object()); |
1208 ScriptData* cache = NULL; | 1208 ScriptData* cache = NULL; |
1209 | 1209 |
1210 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( | 1210 Handle<SharedFunctionInfo> orig = Compiler::CompileScript( |
1211 source_string, name, 0, 0, false, | 1211 source_string, name, 0, 0, false, false, |
1212 Handle<Context>(isolate->native_context()), NULL, &cache, | 1212 Handle<Context>(isolate->native_context()), NULL, &cache, |
1213 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); | 1213 v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE); |
1214 | 1214 |
1215 Handle<SharedFunctionInfo> copy; | 1215 Handle<SharedFunctionInfo> copy; |
1216 { | 1216 { |
1217 DisallowCompilation no_compile_expected(isolate); | 1217 DisallowCompilation no_compile_expected(isolate); |
1218 copy = Compiler::CompileScript( | 1218 copy = Compiler::CompileScript( |
1219 source_string, name, 0, 0, false, | 1219 source_string, name, 0, 0, false, false, |
1220 Handle<Context>(isolate->native_context()), NULL, &cache, | 1220 Handle<Context>(isolate->native_context()), NULL, &cache, |
1221 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); | 1221 v8::ScriptCompiler::kConsumeCodeCache, NOT_NATIVES_CODE); |
1222 } | 1222 } |
1223 CHECK_NE(*orig, *copy); | 1223 CHECK_NE(*orig, *copy); |
1224 | 1224 |
1225 Handle<JSFunction> copy_fun = | 1225 Handle<JSFunction> copy_fun = |
1226 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); | 1226 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); |
1227 | 1227 |
1228 Handle<Object> copy_result = | 1228 Handle<Object> copy_result = |
1229 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1229 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 { | 1360 { |
1361 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1361 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
1362 script = v8::ScriptCompiler::CompileUnbound( | 1362 script = v8::ScriptCompiler::CompileUnbound( |
1363 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1363 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1364 } | 1364 } |
1365 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1365 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1366 CHECK(result->ToString(isolate2)->Equals(v8_str("XY"))); | 1366 CHECK(result->ToString(isolate2)->Equals(v8_str("XY"))); |
1367 } | 1367 } |
1368 isolate2->Dispose(); | 1368 isolate2->Dispose(); |
1369 } | 1369 } |
OLD | NEW |