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

Side by Side Diff: src/compiler.h

Issue 2399463008: Create multiple compilation jobs for ignition if compiling multiple literals (Closed)
Patch Set: 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 | « no previous file | src/compiler.cc » ('j') | src/interpreter/interpreter.h » ('J')
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 #ifndef V8_COMPILER_H_ 5 #ifndef V8_COMPILER_H_
6 #define V8_COMPILER_H_ 6 #define V8_COMPILER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector>
9 10
10 #include "src/allocation.h" 11 #include "src/allocation.h"
11 #include "src/bailout-reason.h" 12 #include "src/bailout-reason.h"
12 #include "src/contexts.h" 13 #include "src/contexts.h"
13 #include "src/isolate.h" 14 #include "src/isolate.h"
14 #include "src/zone/zone.h" 15 #include "src/zone/zone.h"
15 16
16 namespace v8 { 17 namespace v8 {
17 namespace internal { 18 namespace internal {
18 19
19 // Forward declarations. 20 // Forward declarations.
20 class CompilationInfo; 21 class CompilationInfo;
21 class CompilationJob; 22 class CompilationJob;
22 class JavaScriptFrame; 23 class JavaScriptFrame;
23 class ParseInfo; 24 class ParseInfo;
24 class ScriptData; 25 class ScriptData;
25 26
27 enum class ShouldCompile { kIfNecessary, kNever };
28
26 // The V8 compiler API. 29 // The V8 compiler API.
27 // 30 //
28 // This is the central hub for dispatching to the various compilers within V8. 31 // This is the central hub for dispatching to the various compilers within V8.
29 // Logic for which compiler to choose and how to wire compilation results into 32 // Logic for which compiler to choose and how to wire compilation results into
30 // the object heap should be kept inside this class. 33 // the object heap should be kept inside this class.
31 // 34 //
32 // General strategy: Scripts are translated into anonymous functions w/o 35 // General strategy: Scripts are translated into anonymous functions w/o
33 // parameters which then can be executed. If the source code contains other 36 // parameters which then can be executed. If the source code contains other
34 // functions, they might be compiled and allocated as part of the compilation 37 // functions, they might be compiled and allocated as part of the compilation
35 // of the source code or deferred for lazy compilation at a later point. 38 // of the source code or deferred for lazy compilation at a later point.
(...skipping 10 matching lines...) Expand all
46 // given function holds (except for live-edit, which compiles the world). 49 // given function holds (except for live-edit, which compiles the world).
47 50
48 static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag); 51 static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag);
49 static bool CompileBaseline(Handle<JSFunction> function); 52 static bool CompileBaseline(Handle<JSFunction> function);
50 static bool CompileOptimized(Handle<JSFunction> function, ConcurrencyMode); 53 static bool CompileOptimized(Handle<JSFunction> function, ConcurrencyMode);
51 static bool CompileDebugCode(Handle<JSFunction> function); 54 static bool CompileDebugCode(Handle<JSFunction> function);
52 static bool CompileDebugCode(Handle<SharedFunctionInfo> shared); 55 static bool CompileDebugCode(Handle<SharedFunctionInfo> shared);
53 static MaybeHandle<JSArray> CompileForLiveEdit(Handle<Script> script); 56 static MaybeHandle<JSArray> CompileForLiveEdit(Handle<Script> script);
54 57
55 // Prepare a compilation job for unoptimized code. Requires ParseAndAnalyse. 58 // Prepare a compilation job for unoptimized code. Requires ParseAndAnalyse.
56 static CompilationJob* PrepareUnoptimizedCompilationJob( 59 static std::vector<std::unique_ptr<CompilationJob>>
57 CompilationInfo* info); 60 PrepareUnoptimizedCompilationJob(CompilationInfo* info);
rmcilroy 2016/10/07 14:26:34 nit - Job->Jobs
58 61
59 // Generate and install code from previously queued compilation job. 62 // Generate and install code from previously queued compilation job.
60 static bool FinalizeCompilationJob(CompilationJob* job); 63 static bool FinalizeCompilationJob(CompilationJob* job);
61 64
62 // Give the compiler a chance to perform low-latency initialization tasks of 65 // Give the compiler a chance to perform low-latency initialization tasks of
63 // the given {function} on its instantiation. Note that only the runtime will 66 // the given {function} on its instantiation. Note that only the runtime will
64 // offer this chance, optimized closure instantiation will not call this. 67 // offer this chance, optimized closure instantiation will not call this.
65 static void PostInstantiation(Handle<JSFunction> function, PretenureFlag); 68 static void PostInstantiation(Handle<JSFunction> function, PretenureFlag);
66 69
67 // Parser::Parse, then Compiler::Analyze. 70 // Parser::Parse, then Compiler::Analyze.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ScriptCompiler::CompileOptions compile_options, 112 ScriptCompiler::CompileOptions compile_options,
110 NativesFlag is_natives_code, bool is_module); 113 NativesFlag is_natives_code, bool is_module);
111 114
112 // Create a shared function info object for a Script that has already been 115 // Create a shared function info object for a Script that has already been
113 // parsed while the script was being loaded from a streamed source. 116 // parsed while the script was being loaded from a streamed source.
114 static Handle<SharedFunctionInfo> GetSharedFunctionInfoForStreamedScript( 117 static Handle<SharedFunctionInfo> GetSharedFunctionInfoForStreamedScript(
115 Handle<Script> script, ParseInfo* info, int source_length); 118 Handle<Script> script, ParseInfo* info, int source_length);
116 119
117 // Create a shared function info object (the code may be lazily compiled). 120 // Create a shared function info object (the code may be lazily compiled).
118 static Handle<SharedFunctionInfo> GetSharedFunctionInfo( 121 static Handle<SharedFunctionInfo> GetSharedFunctionInfo(
119 FunctionLiteral* node, Handle<Script> script, CompilationInfo* outer); 122 FunctionLiteral* node, Handle<Script> script, CompilationInfo* outer,
123 ShouldCompile should_compile = ShouldCompile::kIfNecessary);
120 124
121 // Create a shared function info object for a native function literal. 125 // Create a shared function info object for a native function literal.
122 static Handle<SharedFunctionInfo> GetSharedFunctionInfoForNative( 126 static Handle<SharedFunctionInfo> GetSharedFunctionInfoForNative(
123 v8::Extension* extension, Handle<String> name); 127 v8::Extension* extension, Handle<String> name);
124 128
125 // =========================================================================== 129 // ===========================================================================
126 // The following family of methods provides support for OSR. Code generated 130 // The following family of methods provides support for OSR. Code generated
127 // for entry via OSR might not be suitable for normal entry, hence will be 131 // for entry via OSR might not be suitable for normal entry, hence will be
128 // returned directly to the caller. 132 // returned directly to the caller.
129 // 133 //
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 state_ = State::kFailed; 226 state_ = State::kFailed;
223 } 227 }
224 return status; 228 return status;
225 } 229 }
226 }; 230 };
227 231
228 } // namespace internal 232 } // namespace internal
229 } // namespace v8 233 } // namespace v8
230 234
231 #endif // V8_COMPILER_H_ 235 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/interpreter/interpreter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698