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

Side by Side Diff: src/compiler.cc

Issue 2437043002: [compiler] Mark shared functions for optimization (Closed)
Patch Set: Save the files you actually changed, dummy Created 4 years, 2 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 | « src/builtins/x87/builtins-x87.cc ('k') | src/objects.h » ('j') | 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698