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

Side by Side Diff: src/compiler.cc

Issue 2145683003: Flush the optimizing compilejob queue when doing memory pressure GCs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 5 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 | src/heap/heap.cc » ('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 8
9 #include "src/asmjs/asm-js.h" 9 #include "src/asmjs/asm-js.h"
10 #include "src/asmjs/typing-asm.h" 10 #include "src/asmjs/typing-asm.h"
11 #include "src/ast/ast-numbering.h" 11 #include "src/ast/ast-numbering.h"
12 #include "src/ast/prettyprinter.h" 12 #include "src/ast/prettyprinter.h"
13 #include "src/ast/scopeinfo.h" 13 #include "src/ast/scopeinfo.h"
14 #include "src/ast/scopes.h" 14 #include "src/ast/scopes.h"
15 #include "src/bootstrapper.h" 15 #include "src/bootstrapper.h"
16 #include "src/codegen.h" 16 #include "src/codegen.h"
17 #include "src/compilation-cache.h" 17 #include "src/compilation-cache.h"
18 #include "src/compiler/pipeline.h" 18 #include "src/compiler/pipeline.h"
19 #include "src/crankshaft/hydrogen.h" 19 #include "src/crankshaft/hydrogen.h"
20 #include "src/debug/debug.h" 20 #include "src/debug/debug.h"
21 #include "src/debug/liveedit.h" 21 #include "src/debug/liveedit.h"
22 #include "src/deoptimizer.h" 22 #include "src/deoptimizer.h"
23 #include "src/frames-inl.h" 23 #include "src/frames-inl.h"
24 #include "src/full-codegen/full-codegen.h" 24 #include "src/full-codegen/full-codegen.h"
25 #include "src/globals.h" 25 #include "src/globals.h"
26 #include "src/heap/heap.h"
26 #include "src/interpreter/interpreter.h" 27 #include "src/interpreter/interpreter.h"
27 #include "src/isolate-inl.h" 28 #include "src/isolate-inl.h"
28 #include "src/log-inl.h" 29 #include "src/log-inl.h"
29 #include "src/messages.h" 30 #include "src/messages.h"
30 #include "src/parsing/parser.h" 31 #include "src/parsing/parser.h"
31 #include "src/parsing/rewriter.h" 32 #include "src/parsing/rewriter.h"
32 #include "src/parsing/scanner-character-streams.h" 33 #include "src/parsing/scanner-character-streams.h"
33 #include "src/runtime-profiler.h" 34 #include "src/runtime-profiler.h"
34 #include "src/snapshot/code-serializer.h" 35 #include "src/snapshot/code-serializer.h"
35 #include "src/vm-state-inl.h" 36 #include "src/vm-state-inl.h"
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 699
699 if (!isolate->optimizing_compile_dispatcher()->IsQueueAvailable()) { 700 if (!isolate->optimizing_compile_dispatcher()->IsQueueAvailable()) {
700 if (FLAG_trace_concurrent_recompilation) { 701 if (FLAG_trace_concurrent_recompilation) {
701 PrintF(" ** Compilation queue full, will retry optimizing "); 702 PrintF(" ** Compilation queue full, will retry optimizing ");
702 info->closure()->ShortPrint(); 703 info->closure()->ShortPrint();
703 PrintF(" later.\n"); 704 PrintF(" later.\n");
704 } 705 }
705 return false; 706 return false;
706 } 707 }
707 708
709 if (isolate->heap()->HighMemoryPressure()) {
710 if (FLAG_trace_concurrent_recompilation) {
711 PrintF(" ** High memory pressure, will retry optimizing ");
712 info->closure()->ShortPrint();
713 PrintF(" later.\n");
714 }
715 return false;
716 }
717
708 // All handles below this point will be allocated in a deferred handle scope 718 // All handles below this point will be allocated in a deferred handle scope
709 // that is detached and handed off to the background thread when we return. 719 // that is detached and handed off to the background thread when we return.
710 CompilationHandleScope handle_scope(info); 720 CompilationHandleScope handle_scope(info);
711 721
712 // Parsing is not required when optimizing from existing bytecode. 722 // Parsing is not required when optimizing from existing bytecode.
713 if (!info->is_optimizing_from_bytecode()) { 723 if (!info->is_optimizing_from_bytecode()) {
714 if (!Compiler::ParseAndAnalyze(info->parse_info())) return false; 724 if (!Compiler::ParseAndAnalyze(info->parse_info())) return false;
715 EnsureFeedbackMetadata(info); 725 EnsureFeedbackMetadata(info);
716 } 726 }
717 727
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 DCHECK(shared->is_compiled()); 1848 DCHECK(shared->is_compiled());
1839 function->set_literals(cached.literals); 1849 function->set_literals(cached.literals);
1840 } else if (shared->is_compiled()) { 1850 } else if (shared->is_compiled()) {
1841 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. 1851 // TODO(mvstanton): pass pretenure flag to EnsureLiterals.
1842 JSFunction::EnsureLiterals(function); 1852 JSFunction::EnsureLiterals(function);
1843 } 1853 }
1844 } 1854 }
1845 1855
1846 } // namespace internal 1856 } // namespace internal
1847 } // namespace v8 1857 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698