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

Unified Diff: src/compiler.h

Issue 2618553004: [compiler] Collect eager inner functions for compilation during renumbering. (Closed)
Patch Set: Address comments and remove field from ParseInfo Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bit-vector.cc ('k') | 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 4c008d2e23891cc30b16d43801bbdfc40147220f..dfbd520f9d6508290fa565b35d7cee7e96286d88 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -22,8 +22,10 @@ class CompilationJob;
class JavaScriptFrame;
class ParseInfo;
class ScriptData;
-
-enum class LazyCompilationMode { kAlways, kIfRequested };
+template <typename T>
+class ThreadedList;
+template <typename T>
+class ThreadedListZoneEntry;
// The V8 compiler API.
//
@@ -53,11 +55,9 @@ class Compiler : public AllStatic {
static bool CompileDebugCode(Handle<SharedFunctionInfo> shared);
static MaybeHandle<JSArray> CompileForLiveEdit(Handle<Script> script);
- // Prepare a compilation job for unoptimized code. If |mode| is
- // LazyCompilationMode::kAlways, the returned job will not compile any inner
- // functions. Requires ParseAndAnalyse.
+ // Prepare a compilation job for unoptimized code. Requires ParseAndAnalyse.
static CompilationJob* PrepareUnoptimizedCompilationJob(
- CompilationInfo* info, LazyCompilationMode mode);
+ CompilationInfo* info);
// Generate and install code from previously queued compilation job.
static bool FinalizeCompilationJob(CompilationJob* job);
@@ -67,10 +67,15 @@ class Compiler : public AllStatic {
// offer this chance, optimized closure instantiation will not call this.
static void PostInstantiation(Handle<JSFunction> function, PretenureFlag);
+ typedef ThreadedList<ThreadedListZoneEntry<FunctionLiteral*>>
+ EagerInnerFunctionLiterals;
+
// Parser::Parse, then Compiler::Analyze.
static bool ParseAndAnalyze(ParseInfo* info);
- // Rewrite, analyze scopes, and renumber.
- static bool Analyze(ParseInfo* info);
+ // Rewrite, analyze scopes, and renumber. If |eager_literals| is non-null, it
+ // is appended with inner function literals which should be eagerly compiled.
+ static bool Analyze(ParseInfo* info,
+ EagerInnerFunctionLiterals* eager_literals = nullptr);
// Adds deoptimization support, requires ParseAndAnalyze.
static bool EnsureDeoptimizationSupport(CompilationInfo* info);
// Ensures that bytecode is generated, calls ParseAndAnalyze internally.
@@ -119,8 +124,7 @@ 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,
- LazyCompilationMode mode = LazyCompilationMode::kIfRequested);
+ FunctionLiteral* node, Handle<Script> script, CompilationInfo* outer);
// Create a shared function info object for a native function literal.
static Handle<SharedFunctionInfo> GetSharedFunctionInfoForNative(
« no previous file with comments | « src/bit-vector.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698