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

Unified Diff: src/compiler.h

Issue 2579973002: Don't compile inner functions when compiling via the dispatcher (Closed)
Patch Set: added comment Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index 03c6f8199fe105e0cec8480db71f79fd6cf4143a..e7110fe36a74185e830cfa3543fc28b0e47ff64f 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -23,6 +23,8 @@ class JavaScriptFrame;
class ParseInfo;
class ScriptData;
+enum class LazyCompilationMode { kAlways, kIfRequested };
rmcilroy 2016/12/16 12:51:17 I find the name confusing, I parse the kAlways as
+
// The V8 compiler API.
//
// This is the central hub for dispatching to the various compilers within V8.
@@ -51,9 +53,11 @@ class Compiler : public AllStatic {
static bool CompileDebugCode(Handle<SharedFunctionInfo> shared);
static MaybeHandle<JSArray> CompileForLiveEdit(Handle<Script> script);
- // Prepare a compilation job for unoptimized code. Requires ParseAndAnalyse.
+ // Prepare a compilation job for unoptimized code. If |mode| is
+ // LazyCompilationMode::kAlways, the returned job will not compile any inner
+ // functions. Requires ParseAndAnalyse.
static CompilationJob* PrepareUnoptimizedCompilationJob(
- CompilationInfo* info);
+ CompilationInfo* info, LazyCompilationMode mode);
// Generate and install code from previously queued compilation job.
static bool FinalizeCompilationJob(CompilationJob* job);
@@ -115,7 +119,8 @@ class Compiler : public AllStatic {
// Create a shared function info object (the code may be lazily compiled).
static Handle<SharedFunctionInfo> GetSharedFunctionInfo(
- FunctionLiteral* node, Handle<Script> script, CompilationInfo* outer);
+ FunctionLiteral* node, Handle<Script> script, CompilationInfo* outer,
+ LazyCompilationMode mode = LazyCompilationMode::kIfRequested);
// Create a shared function info object for a native function literal.
static Handle<SharedFunctionInfo> GetSharedFunctionInfoForNative(
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698