 Chromium Code Reviews
 Chromium Code Reviews Issue 2446673002:
  [compiler] Put shared function marking behind a flag  (Closed)
    
  
    Issue 2446673002:
  [compiler] Put shared function marking behind a flag  (Closed) 
  | 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 966 .ToHandle(&cached_code)) { | 966 .ToHandle(&cached_code)) { | 
| 967 if (FLAG_trace_opt) { | 967 if (FLAG_trace_opt) { | 
| 968 PrintF("[found optimized code for "); | 968 PrintF("[found optimized code for "); | 
| 969 function->ShortPrint(); | 969 function->ShortPrint(); | 
| 970 PrintF(" during unoptimized compile]\n"); | 970 PrintF(" during unoptimized compile]\n"); | 
| 971 } | 971 } | 
| 972 DCHECK(function->shared()->is_compiled()); | 972 DCHECK(function->shared()->is_compiled()); | 
| 973 return cached_code; | 973 return cached_code; | 
| 974 } | 974 } | 
| 975 | 975 | 
| 976 if (function->shared()->was_marked_for_optimization()) { | 976 if (FLAG_mark_shared_functions && | 
| 977 function->shared()->was_marked_for_optimization()) { | |
| 
Michael Starzinger
2016/10/25 10:38:24
nit: This should actually never happen when the fl
 
Leszek Swirski
2016/10/25 10:56:10
Good point, done.
 | |
| 977 function->shared()->set_was_marked_for_optimization(false); | 978 function->shared()->set_was_marked_for_optimization(false); | 
| 978 | 979 | 
| 979 if (FLAG_trace_opt) { | 980 if (FLAG_trace_opt) { | 
| 980 PrintF("[optimizing function "); | 981 PrintF("[optimizing function "); | 
| 981 function->PrintName(); | 982 function->PrintName(); | 
| 982 PrintF(" eagerly because shared function was previously marked]\n"); | 983 PrintF(" eagerly because shared function was previously marked]\n"); | 
| 983 } | 984 } | 
| 984 | 985 | 
| 985 Handle<Code> opt_code; | 986 Handle<Code> opt_code; | 
| 986 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) | 987 if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) | 
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1824 DCHECK(shared->is_compiled()); | 1825 DCHECK(shared->is_compiled()); | 
| 1825 function->set_literals(cached.literals); | 1826 function->set_literals(cached.literals); | 
| 1826 } else if (shared->is_compiled()) { | 1827 } else if (shared->is_compiled()) { | 
| 1827 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1828 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 
| 1828 JSFunction::EnsureLiterals(function); | 1829 JSFunction::EnsureLiterals(function); | 
| 1829 } | 1830 } | 
| 1830 } | 1831 } | 
| 1831 | 1832 | 
| 1832 } // namespace internal | 1833 } // namespace internal | 
| 1833 } // namespace v8 | 1834 } // namespace v8 | 
| OLD | NEW |