OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 if (shared->is_compiled()) { | 840 if (shared->is_compiled()) { |
841 shared->code()->set_profiler_ticks(0); | 841 shared->code()->set_profiler_ticks(0); |
842 } | 842 } |
843 | 843 |
844 // TODO(mstarzinger): We cannot properly deserialize a scope chain containing | 844 // TODO(mstarzinger): We cannot properly deserialize a scope chain containing |
845 // an eval scope and hence would fail at parsing the eval source again. | 845 // an eval scope and hence would fail at parsing the eval source again. |
846 if (shared->disable_optimization_reason() == kEval) { | 846 if (shared->disable_optimization_reason() == kEval) { |
847 return MaybeHandle<Code>(); | 847 return MaybeHandle<Code>(); |
848 } | 848 } |
849 | 849 |
850 // TODO(mstarzinger): We cannot properly deserialize a scope chain for the | |
851 // builtin context, hence Genesis::InstallExperimentalNatives would fail. | |
852 if (shared->is_toplevel() && isolate->bootstrapper()->IsActive()) { | |
853 return MaybeHandle<Code>(); | |
854 } | |
855 | |
856 base::SmartPointer<CompilationInfo> info( | 850 base::SmartPointer<CompilationInfo> info( |
857 new CompilationInfoWithZone(function)); | 851 new CompilationInfoWithZone(function)); |
858 VMState<COMPILER> state(isolate); | 852 VMState<COMPILER> state(isolate); |
859 DCHECK(!isolate->has_pending_exception()); | 853 DCHECK(!isolate->has_pending_exception()); |
860 PostponeInterruptsScope postpone(isolate); | 854 PostponeInterruptsScope postpone(isolate); |
861 | 855 |
862 info->SetOptimizingForOsr(osr_ast_id); | 856 info->SetOptimizingForOsr(osr_ast_id); |
863 | 857 |
864 if (mode == Compiler::CONCURRENT) { | 858 if (mode == Compiler::CONCURRENT) { |
865 if (GetOptimizedCodeLater(info.get())) { | 859 if (GetOptimizedCodeLater(info.get())) { |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 MaybeHandle<Code> code; | 1685 MaybeHandle<Code> code; |
1692 if (cached.code != nullptr) code = handle(cached.code); | 1686 if (cached.code != nullptr) code = handle(cached.code); |
1693 Handle<Context> native_context(function->context()->native_context()); | 1687 Handle<Context> native_context(function->context()->native_context()); |
1694 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1688 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1695 literals, BailoutId::None()); | 1689 literals, BailoutId::None()); |
1696 } | 1690 } |
1697 } | 1691 } |
1698 | 1692 |
1699 } // namespace internal | 1693 } // namespace internal |
1700 } // namespace v8 | 1694 } // namespace v8 |
OLD | NEW |