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 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 Handle<Code> code; | 1163 Handle<Code> code; |
1164 if (!GetBaselineCode(function).ToHandle(&code)) { | 1164 if (!GetBaselineCode(function).ToHandle(&code)) { |
1165 // Baseline generation failed, get unoptimized code. | 1165 // Baseline generation failed, get unoptimized code. |
1166 DCHECK(function->shared()->is_compiled()); | 1166 DCHECK(function->shared()->is_compiled()); |
1167 code = handle(function->shared()->code()); | 1167 code = handle(function->shared()->code()); |
1168 isolate->clear_pending_exception(); | 1168 isolate->clear_pending_exception(); |
1169 } | 1169 } |
1170 | 1170 |
1171 // Install code on closure. | 1171 // Install code on closure. |
1172 function->ReplaceCode(*code); | 1172 function->ReplaceCode(*code); |
| 1173 JSFunction::EnsureLiterals(function); |
1173 | 1174 |
1174 // Check postconditions on success. | 1175 // Check postconditions on success. |
1175 DCHECK(!isolate->has_pending_exception()); | 1176 DCHECK(!isolate->has_pending_exception()); |
1176 DCHECK(function->shared()->is_compiled()); | 1177 DCHECK(function->shared()->is_compiled()); |
1177 DCHECK(function->is_compiled()); | 1178 DCHECK(function->is_compiled()); |
1178 return true; | 1179 return true; |
1179 } | 1180 } |
1180 | 1181 |
1181 bool Compiler::CompileOptimized(Handle<JSFunction> function, | 1182 bool Compiler::CompileOptimized(Handle<JSFunction> function, |
1182 ConcurrencyMode mode) { | 1183 ConcurrencyMode mode) { |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 DCHECK(shared->is_compiled()); | 1787 DCHECK(shared->is_compiled()); |
1787 function->set_literals(cached.literals); | 1788 function->set_literals(cached.literals); |
1788 } else if (shared->is_compiled()) { | 1789 } else if (shared->is_compiled()) { |
1789 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1790 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1790 JSFunction::EnsureLiterals(function); | 1791 JSFunction::EnsureLiterals(function); |
1791 } | 1792 } |
1792 } | 1793 } |
1793 | 1794 |
1794 } // namespace internal | 1795 } // namespace internal |
1795 } // namespace v8 | 1796 } // namespace v8 |
OLD | NEW |