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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
970 .ToHandle(&cached_code)) { | 970 .ToHandle(&cached_code)) { |
971 if (FLAG_trace_opt) { | 971 if (FLAG_trace_opt) { |
972 PrintF("[found optimized code for "); | 972 PrintF("[found optimized code for "); |
973 function->ShortPrint(); | 973 function->ShortPrint(); |
974 PrintF(" during unoptimized compile]\n"); | 974 PrintF(" during unoptimized compile]\n"); |
975 } | 975 } |
976 DCHECK(function->shared()->is_compiled()); | 976 DCHECK(function->shared()->is_compiled()); |
977 return cached_code; | 977 return cached_code; |
978 } | 978 } |
979 | 979 |
980 if (function->shared()->was_marked_for_optimization()) { | |
Michael Starzinger
2016/10/21 11:37:58
The flag never seems to be cleared. This will mark
Leszek Swirski
2016/10/21 11:44:13
That's a very good point, I hadn't considered opti
| |
981 if (FLAG_trace_opt) { | |
982 PrintF("[optimizing function "); | |
983 function->PrintName(); | |
984 PrintF(" eagerly because shared function was previously marked]\n"); | |
985 } | |
986 | |
987 Handle<Code> opt_code; | |
988 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) | |
989 .ToHandle(&opt_code)) { | |
990 return opt_code; | |
991 } | |
992 } | |
993 | |
980 if (function->shared()->is_compiled()) { | 994 if (function->shared()->is_compiled()) { |
981 return Handle<Code>(function->shared()->code()); | 995 return Handle<Code>(function->shared()->code()); |
982 } | 996 } |
983 | 997 |
984 if (function->shared()->HasBytecodeArray()) { | 998 if (function->shared()->HasBytecodeArray()) { |
985 Handle<Code> entry = isolate->builtins()->InterpreterEntryTrampoline(); | 999 Handle<Code> entry = isolate->builtins()->InterpreterEntryTrampoline(); |
986 function->shared()->ReplaceCode(*entry); | 1000 function->shared()->ReplaceCode(*entry); |
987 return entry; | 1001 return entry; |
988 } | 1002 } |
989 | 1003 |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1812 DCHECK(shared->is_compiled()); | 1826 DCHECK(shared->is_compiled()); |
1813 function->set_literals(cached.literals); | 1827 function->set_literals(cached.literals); |
1814 } else if (shared->is_compiled()) { | 1828 } else if (shared->is_compiled()) { |
1815 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1829 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1816 JSFunction::EnsureLiterals(function); | 1830 JSFunction::EnsureLiterals(function); |
1817 } | 1831 } |
1818 } | 1832 } |
1819 | 1833 |
1820 } // namespace internal | 1834 } // namespace internal |
1821 } // namespace v8 | 1835 } // namespace v8 |
OLD | NEW |