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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()) { | 980 if (function->shared()->was_marked_for_optimization()) { |
| 981 DCHECK(FLAG_optimize_shared_functions); |
| 982 |
981 function->shared()->set_was_marked_for_optimization(false); | 983 function->shared()->set_was_marked_for_optimization(false); |
982 | 984 |
983 if (FLAG_trace_opt) { | 985 if (FLAG_trace_opt) { |
984 PrintF("[optimizing function "); | 986 PrintF("[optimizing function "); |
985 function->PrintName(); | 987 function->PrintName(); |
986 PrintF(" eagerly because shared function was previously marked]\n"); | 988 PrintF(" eagerly because shared function was previously marked]\n"); |
987 } | 989 } |
988 | 990 |
989 Handle<Code> opt_code; | 991 Handle<Code> opt_code; |
990 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) | 992 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 DCHECK(shared->is_compiled()); | 1830 DCHECK(shared->is_compiled()); |
1829 function->set_literals(cached.literals); | 1831 function->set_literals(cached.literals); |
1830 } else if (shared->is_compiled()) { | 1832 } else if (shared->is_compiled()) { |
1831 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1833 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1832 JSFunction::EnsureLiterals(function); | 1834 JSFunction::EnsureLiterals(function); |
1833 } | 1835 } |
1834 } | 1836 } |
1835 | 1837 |
1836 } // namespace internal | 1838 } // namespace internal |
1837 } // namespace v8 | 1839 } // namespace v8 |
OLD | NEW |