Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: src/compiler.cc

Issue 2241783002: [interpreter] Compiler shortcut when bytecode present. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-code-assembler
Patch Set: Rebased. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698