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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 } | 1026 } |
1027 DCHECK(function->shared()->is_compiled()); | 1027 DCHECK(function->shared()->is_compiled()); |
1028 return cached_code; | 1028 return cached_code; |
1029 } | 1029 } |
1030 } | 1030 } |
1031 | 1031 |
1032 if (function->shared()->is_compiled()) { | 1032 if (function->shared()->is_compiled()) { |
1033 return Handle<Code>(function->shared()->code()); | 1033 return Handle<Code>(function->shared()->code()); |
1034 } | 1034 } |
1035 | 1035 |
| 1036 if (function->shared()->HasBytecodeArray()) { |
| 1037 Handle<Code> entry = isolate->builtins()->InterpreterEntryTrampoline(); |
| 1038 function->shared()->ReplaceCode(*entry); |
| 1039 return entry; |
| 1040 } |
| 1041 |
1036 Zone zone(isolate->allocator()); | 1042 Zone zone(isolate->allocator()); |
1037 ParseInfo parse_info(&zone, function); | 1043 ParseInfo parse_info(&zone, function); |
1038 CompilationInfo info(&parse_info, function); | 1044 CompilationInfo info(&parse_info, function); |
1039 Handle<Code> result; | 1045 Handle<Code> result; |
1040 ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCode(&info), Code); | 1046 ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCode(&info), Code); |
1041 | 1047 |
1042 if (FLAG_always_opt) { | 1048 if (FLAG_always_opt) { |
1043 Handle<Code> opt_code; | 1049 Handle<Code> opt_code; |
1044 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) | 1050 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) |
1045 .ToHandle(&opt_code)) { | 1051 .ToHandle(&opt_code)) { |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1953 DCHECK(shared->is_compiled()); | 1959 DCHECK(shared->is_compiled()); |
1954 function->set_literals(cached.literals); | 1960 function->set_literals(cached.literals); |
1955 } else if (shared->is_compiled()) { | 1961 } else if (shared->is_compiled()) { |
1956 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1962 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1957 JSFunction::EnsureLiterals(function); | 1963 JSFunction::EnsureLiterals(function); |
1958 } | 1964 } |
1959 } | 1965 } |
1960 | 1966 |
1961 } // namespace internal | 1967 } // namespace internal |
1962 } // namespace v8 | 1968 } // namespace v8 |
OLD | NEW |