| 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 } | 783 } |
| 784 return true; | 784 return true; |
| 785 } | 785 } |
| 786 | 786 |
| 787 MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, | 787 MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, |
| 788 Compiler::ConcurrencyMode mode, | 788 Compiler::ConcurrencyMode mode, |
| 789 BailoutId osr_ast_id = BailoutId::None(), | 789 BailoutId osr_ast_id = BailoutId::None(), |
| 790 JavaScriptFrame* osr_frame = nullptr) { | 790 JavaScriptFrame* osr_frame = nullptr) { |
| 791 Isolate* isolate = function->GetIsolate(); | 791 Isolate* isolate = function->GetIsolate(); |
| 792 Handle<SharedFunctionInfo> shared(function->shared(), isolate); | 792 Handle<SharedFunctionInfo> shared(function->shared(), isolate); |
| 793 if (shared->HasDebugInfo()) return MaybeHandle<Code>(); | |
| 794 | 793 |
| 795 Handle<Code> cached_code; | 794 Handle<Code> cached_code; |
| 796 if (GetCodeFromOptimizedCodeMap(function, osr_ast_id) | 795 if (GetCodeFromOptimizedCodeMap(function, osr_ast_id) |
| 797 .ToHandle(&cached_code)) { | 796 .ToHandle(&cached_code)) { |
| 798 if (FLAG_trace_opt) { | 797 if (FLAG_trace_opt) { |
| 799 PrintF("[found optimized code for "); | 798 PrintF("[found optimized code for "); |
| 800 function->ShortPrint(); | 799 function->ShortPrint(); |
| 801 if (!osr_ast_id.IsNone()) { | 800 if (!osr_ast_id.IsNone()) { |
| 802 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); | 801 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); |
| 803 } | 802 } |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1678 MaybeHandle<Code> code; | 1677 MaybeHandle<Code> code; |
| 1679 if (cached.code != nullptr) code = handle(cached.code); | 1678 if (cached.code != nullptr) code = handle(cached.code); |
| 1680 Handle<Context> native_context(function->context()->native_context()); | 1679 Handle<Context> native_context(function->context()->native_context()); |
| 1681 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1680 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1682 literals, BailoutId::None()); | 1681 literals, BailoutId::None()); |
| 1683 } | 1682 } |
| 1684 } | 1683 } |
| 1685 | 1684 |
| 1686 } // namespace internal | 1685 } // namespace internal |
| 1687 } // namespace v8 | 1686 } // namespace v8 |
| OLD | NEW |