| 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 info.SetScope(literal->scope()); | 710 info.SetScope(literal->scope()); |
| 711 info.SetLanguageMode(literal->scope()->language_mode()); | 711 info.SetLanguageMode(literal->scope()->language_mode()); |
| 712 | 712 |
| 713 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal); | 713 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal); |
| 714 // Determine if the function can be lazily compiled. This is necessary to | 714 // Determine if the function can be lazily compiled. This is necessary to |
| 715 // allow some of our builtin JS files to be lazily compiled. These | 715 // allow some of our builtin JS files to be lazily compiled. These |
| 716 // builtins cannot be handled lazily by the parser, since we have to know | 716 // builtins cannot be handled lazily by the parser, since we have to know |
| 717 // if a function uses the special natives syntax, which is something the | 717 // if a function uses the special natives syntax, which is something the |
| 718 // parser records. | 718 // parser records. |
| 719 bool allow_lazy = literal->AllowsLazyCompilation() && | 719 bool allow_lazy = literal->AllowsLazyCompilation() && |
| 720 !LiveEditFunctionTracker::IsActive(info.isolate()); | 720 !LiveEditFunctionTracker::IsActive(info.isolate()) && |
| 721 (!info.is_native() || literal->AllowsLazyCompilationForNative()); |
| 721 | 722 |
| 722 Handle<ScopeInfo> scope_info(ScopeInfo::Empty()); | 723 Handle<ScopeInfo> scope_info(ScopeInfo::Empty()); |
| 723 | 724 |
| 724 // Generate code | 725 // Generate code |
| 725 if (FLAG_lazy && allow_lazy) { | 726 if (FLAG_lazy && allow_lazy) { |
| 726 Handle<Code> code = info.isolate()->builtins()->LazyCompile(); | 727 Handle<Code> code = info.isolate()->builtins()->LazyCompile(); |
| 727 info.SetCode(code); | 728 info.SetCode(code); |
| 728 } else if ((V8::UseCrankshaft() && MakeCrankshaftCode(&info)) || | 729 } else if ((V8::UseCrankshaft() && MakeCrankshaftCode(&info)) || |
| 729 (!V8::UseCrankshaft() && FullCodeGenerator::MakeCode(&info))) { | 730 (!V8::UseCrankshaft() && FullCodeGenerator::MakeCode(&info))) { |
| 730 ASSERT(!info.code().is_null()); | 731 ASSERT(!info.code().is_null()); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 } | 818 } |
| 818 } | 819 } |
| 819 | 820 |
| 820 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 821 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 821 Handle<Script>(info->script()), | 822 Handle<Script>(info->script()), |
| 822 Handle<Code>(info->code()), | 823 Handle<Code>(info->code()), |
| 823 info)); | 824 info)); |
| 824 } | 825 } |
| 825 | 826 |
| 826 } } // namespace v8::internal | 827 } } // namespace v8::internal |
| OLD | NEW |