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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 return true; | 738 return true; |
739 } | 739 } |
740 | 740 |
741 MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, | 741 MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, |
742 Compiler::ConcurrencyMode mode, | 742 Compiler::ConcurrencyMode mode, |
743 BailoutId osr_ast_id = BailoutId::None(), | 743 BailoutId osr_ast_id = BailoutId::None(), |
744 JavaScriptFrame* osr_frame = nullptr) { | 744 JavaScriptFrame* osr_frame = nullptr) { |
745 Isolate* isolate = function->GetIsolate(); | 745 Isolate* isolate = function->GetIsolate(); |
746 Handle<SharedFunctionInfo> shared(function->shared(), isolate); | 746 Handle<SharedFunctionInfo> shared(function->shared(), isolate); |
747 | 747 |
| 748 // TODO(4764): Remove this guard once OSR graph construction works. |
| 749 if (!osr_ast_id.IsNone() && osr_frame->is_interpreted()) { |
| 750 return MaybeHandle<Code>(); |
| 751 } |
| 752 |
748 Handle<Code> cached_code; | 753 Handle<Code> cached_code; |
749 if (GetCodeFromOptimizedCodeMap(function, osr_ast_id) | 754 if (GetCodeFromOptimizedCodeMap(function, osr_ast_id) |
750 .ToHandle(&cached_code)) { | 755 .ToHandle(&cached_code)) { |
751 if (FLAG_trace_opt) { | 756 if (FLAG_trace_opt) { |
752 PrintF("[found optimized code for "); | 757 PrintF("[found optimized code for "); |
753 function->ShortPrint(); | 758 function->ShortPrint(); |
754 if (!osr_ast_id.IsNone()) { | 759 if (!osr_ast_id.IsNone()) { |
755 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); | 760 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); |
756 } | 761 } |
757 PrintF("]\n"); | 762 PrintF("]\n"); |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 DCHECK(shared->is_compiled()); | 1916 DCHECK(shared->is_compiled()); |
1912 function->set_literals(cached.literals); | 1917 function->set_literals(cached.literals); |
1913 } else if (shared->is_compiled()) { | 1918 } else if (shared->is_compiled()) { |
1914 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1919 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1915 JSFunction::EnsureLiterals(function); | 1920 JSFunction::EnsureLiterals(function); |
1916 } | 1921 } |
1917 } | 1922 } |
1918 | 1923 |
1919 } // namespace internal | 1924 } // namespace internal |
1920 } // namespace v8 | 1925 } // namespace v8 |
OLD | NEW |