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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 VMState<COMPILER> state(isolate); | 720 VMState<COMPILER> state(isolate); |
721 DCHECK(!isolate->has_pending_exception()); | 721 DCHECK(!isolate->has_pending_exception()); |
722 PostponeInterruptsScope postpone(isolate); | 722 PostponeInterruptsScope postpone(isolate); |
723 bool use_turbofan = UseTurboFan(shared); | 723 bool use_turbofan = UseTurboFan(shared); |
724 base::SmartPointer<CompilationJob> job( | 724 base::SmartPointer<CompilationJob> job( |
725 use_turbofan ? compiler::Pipeline::NewCompilationJob(function) | 725 use_turbofan ? compiler::Pipeline::NewCompilationJob(function) |
726 : new HCompilationJob(function)); | 726 : new HCompilationJob(function)); |
727 CompilationInfo* info = job->info(); | 727 CompilationInfo* info = job->info(); |
728 ParseInfo* parse_info = info->parse_info(); | 728 ParseInfo* parse_info = info->parse_info(); |
729 | 729 |
730 info->SetOptimizingForOsr(osr_ast_id); | 730 info->SetOptimizingForOsr(osr_ast_id, osr_frame); |
731 | 731 |
732 // Do not use Crankshaft/TurboFan if we need to be able to set break points. | 732 // Do not use Crankshaft/TurboFan if we need to be able to set break points. |
733 if (info->shared_info()->HasDebugInfo()) { | 733 if (info->shared_info()->HasDebugInfo()) { |
734 info->AbortOptimization(kFunctionBeingDebugged); | 734 info->AbortOptimization(kFunctionBeingDebugged); |
735 return MaybeHandle<Code>(); | 735 return MaybeHandle<Code>(); |
736 } | 736 } |
737 | 737 |
738 // Do not use Crankshaft/TurboFan on a generator function. | 738 // Do not use Crankshaft/TurboFan on a generator function. |
739 // TODO(neis): Eventually enable for Turbofan. | 739 // TODO(neis): Eventually enable for Turbofan. |
740 if (IsGeneratorFunction(info->shared_info()->kind())) { | 740 if (IsGeneratorFunction(info->shared_info()->kind())) { |
(...skipping 26 matching lines...) Expand all Loading... |
767 parse_info->set_allow_lazy_parsing(false); | 767 parse_info->set_allow_lazy_parsing(false); |
768 parse_info->set_lazy(false); | 768 parse_info->set_lazy(false); |
769 } | 769 } |
770 | 770 |
771 if (mode == Compiler::CONCURRENT) { | 771 if (mode == Compiler::CONCURRENT) { |
772 if (GetOptimizedCodeLater(job.get())) { | 772 if (GetOptimizedCodeLater(job.get())) { |
773 job.Detach(); // The background recompile job owns this now. | 773 job.Detach(); // The background recompile job owns this now. |
774 return isolate->builtins()->InOptimizationQueue(); | 774 return isolate->builtins()->InOptimizationQueue(); |
775 } | 775 } |
776 } else { | 776 } else { |
777 info->set_osr_frame(osr_frame); | |
778 if (GetOptimizedCodeNow(job.get())) return info->code(); | 777 if (GetOptimizedCodeNow(job.get())) return info->code(); |
779 } | 778 } |
780 | 779 |
781 if (isolate->has_pending_exception()) isolate->clear_pending_exception(); | 780 if (isolate->has_pending_exception()) isolate->clear_pending_exception(); |
782 return MaybeHandle<Code>(); | 781 return MaybeHandle<Code>(); |
783 } | 782 } |
784 | 783 |
785 class InterpreterActivationsFinder : public ThreadVisitor, | 784 class InterpreterActivationsFinder : public ThreadVisitor, |
786 public OptimizedFunctionVisitor { | 785 public OptimizedFunctionVisitor { |
787 public: | 786 public: |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 MaybeHandle<Code> code; | 1742 MaybeHandle<Code> code; |
1744 if (cached.code != nullptr) code = handle(cached.code); | 1743 if (cached.code != nullptr) code = handle(cached.code); |
1745 Handle<Context> native_context(function->context()->native_context()); | 1744 Handle<Context> native_context(function->context()->native_context()); |
1746 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1745 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1747 literals, BailoutId::None()); | 1746 literals, BailoutId::None()); |
1748 } | 1747 } |
1749 } | 1748 } |
1750 | 1749 |
1751 } // namespace internal | 1750 } // namespace internal |
1752 } // namespace v8 | 1751 } // namespace v8 |
OLD | NEW |