OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 if (natives == NATIVES_CODE) { | 718 if (natives == NATIVES_CODE) { |
719 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 719 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
720 } | 720 } |
721 if (!script_name.is_null()) { | 721 if (!script_name.is_null()) { |
722 script->set_name(*script_name); | 722 script->set_name(*script_name); |
723 script->set_line_offset(Smi::FromInt(line_offset)); | 723 script->set_line_offset(Smi::FromInt(line_offset)); |
724 script->set_column_offset(Smi::FromInt(column_offset)); | 724 script->set_column_offset(Smi::FromInt(column_offset)); |
725 } | 725 } |
726 script->set_is_shared_cross_origin(is_shared_cross_origin); | 726 script->set_is_shared_cross_origin(is_shared_cross_origin); |
727 | 727 |
728 script->set_data(script_data.is_null() ? HEAP->undefined_value() | 728 script->set_data(script_data.is_null() ? isolate->heap()->undefined_value() |
729 : *script_data); | 729 : *script_data); |
730 | 730 |
731 // Compile the function and add it to the cache. | 731 // Compile the function and add it to the cache. |
732 CompilationInfoWithZone info(script); | 732 CompilationInfoWithZone info(script); |
733 info.MarkAsGlobal(); | 733 info.MarkAsGlobal(); |
734 info.SetExtension(extension); | 734 info.SetExtension(extension); |
735 info.SetPreParseData(pre_data); | 735 info.SetPreParseData(pre_data); |
736 info.SetContext(context); | 736 info.SetContext(context); |
737 if (FLAG_use_strict) { | 737 if (FLAG_use_strict) { |
738 info.SetLanguageMode(FLAG_harmony_scoping ? EXTENDED_MODE : STRICT_MODE); | 738 info.SetLanguageMode(FLAG_harmony_scoping ? EXTENDED_MODE : STRICT_MODE); |
739 } | 739 } |
740 result = MakeFunctionInfo(&info); | 740 result = MakeFunctionInfo(&info); |
741 if (extension == NULL && !result.is_null() && !result->dont_cache()) { | 741 if (extension == NULL && !result.is_null() && !result->dont_cache()) { |
742 compilation_cache->PutScript(source, context, result); | 742 compilation_cache->PutScript(source, context, result); |
743 } | 743 } |
744 } else { | 744 } else { |
745 if (result->ic_age() != HEAP->global_ic_age()) { | 745 if (result->ic_age() != isolate->heap()->global_ic_age()) { |
746 result->ResetForNewContext(HEAP->global_ic_age()); | 746 result->ResetForNewContext(isolate->heap()->global_ic_age()); |
747 } | 747 } |
748 } | 748 } |
749 | 749 |
750 if (result.is_null()) isolate->ReportPendingMessages(); | 750 if (result.is_null()) isolate->ReportPendingMessages(); |
751 return result; | 751 return result; |
752 } | 752 } |
753 | 753 |
754 | 754 |
755 Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source, | 755 Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source, |
756 Handle<Context> context, | 756 Handle<Context> context, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 // If caller is in extended mode, the result must also be in | 798 // If caller is in extended mode, the result must also be in |
799 // extended mode. | 799 // extended mode. |
800 ASSERT(language_mode != EXTENDED_MODE || | 800 ASSERT(language_mode != EXTENDED_MODE || |
801 result->is_extended_mode()); | 801 result->is_extended_mode()); |
802 if (!result->dont_cache()) { | 802 if (!result->dont_cache()) { |
803 compilation_cache->PutEval( | 803 compilation_cache->PutEval( |
804 source, context, is_global, result, scope_position); | 804 source, context, is_global, result, scope_position); |
805 } | 805 } |
806 } | 806 } |
807 } else { | 807 } else { |
808 if (result->ic_age() != HEAP->global_ic_age()) { | 808 if (result->ic_age() != isolate->heap()->global_ic_age()) { |
809 result->ResetForNewContext(HEAP->global_ic_age()); | 809 result->ResetForNewContext(isolate->heap()->global_ic_age()); |
810 } | 810 } |
811 } | 811 } |
812 | 812 |
813 return result; | 813 return result; |
814 } | 814 } |
815 | 815 |
816 | 816 |
817 static bool InstallFullCode(CompilationInfo* info) { | 817 static bool InstallFullCode(CompilationInfo* info) { |
818 // Update the shared function info with the compiled code and the | 818 // Update the shared function info with the compiled code and the |
819 // scope info. Please note, that the order of the shared function | 819 // scope info. Please note, that the order of the shared function |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 AllowHandleDereference allow_deref; | 1442 AllowHandleDereference allow_deref; |
1443 bool tracing_on = info()->IsStub() | 1443 bool tracing_on = info()->IsStub() |
1444 ? FLAG_trace_hydrogen_stubs | 1444 ? FLAG_trace_hydrogen_stubs |
1445 : (FLAG_trace_hydrogen && | 1445 : (FLAG_trace_hydrogen && |
1446 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1446 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1447 return (tracing_on && | 1447 return (tracing_on && |
1448 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1448 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1449 } | 1449 } |
1450 | 1450 |
1451 } } // namespace v8::internal | 1451 } } // namespace v8::internal |
OLD | NEW |