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

Side by Side Diff: src/compiler.h

Issue 2156753002: [Intepreter] Always use BytecodeGraphBuilder when --turbo-from-bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments 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/compiler.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 #ifndef V8_COMPILER_H_ 5 #ifndef V8_COMPILER_H_
6 #define V8_COMPILER_H_ 6 #define V8_COMPILER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 19 matching lines...) Expand all
30 // the object heap should be kept inside this class. 30 // the object heap should be kept inside this class.
31 // 31 //
32 // General strategy: Scripts are translated into anonymous functions w/o 32 // General strategy: Scripts are translated into anonymous functions w/o
33 // parameters which then can be executed. If the source code contains other 33 // 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 34 // 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. 35 // of the source code or deferred for lazy compilation at a later point.
36 class Compiler : public AllStatic { 36 class Compiler : public AllStatic {
37 public: 37 public:
38 enum ClearExceptionFlag { KEEP_EXCEPTION, CLEAR_EXCEPTION }; 38 enum ClearExceptionFlag { KEEP_EXCEPTION, CLEAR_EXCEPTION };
39 enum ConcurrencyMode { NOT_CONCURRENT, CONCURRENT }; 39 enum ConcurrencyMode { NOT_CONCURRENT, CONCURRENT };
40 enum CompilationTier { INTERPRETED, BASELINE, OPTIMIZED };
40 41
41 // =========================================================================== 42 // ===========================================================================
42 // The following family of methods ensures a given function is compiled. The 43 // The following family of methods ensures a given function is compiled. The
43 // general contract is that failures will be reported by returning {false}, 44 // general contract is that failures will be reported by returning {false},
44 // whereas successful compilation ensures the {is_compiled} predicate on the 45 // whereas successful compilation ensures the {is_compiled} predicate on the
45 // given function holds (except for live-edit, which compiles the world). 46 // given function holds (except for live-edit, which compiles the world).
46 47
47 static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag); 48 static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag);
48 static bool CompileBaseline(Handle<JSFunction> function); 49 static bool CompileBaseline(Handle<JSFunction> function);
49 static bool CompileOptimized(Handle<JSFunction> function, ConcurrencyMode); 50 static bool CompileOptimized(Handle<JSFunction> function, ConcurrencyMode);
50 static bool CompileDebugCode(Handle<JSFunction> function); 51 static bool CompileDebugCode(Handle<JSFunction> function);
51 static bool CompileDebugCode(Handle<SharedFunctionInfo> shared); 52 static bool CompileDebugCode(Handle<SharedFunctionInfo> shared);
52 static MaybeHandle<JSArray> CompileForLiveEdit(Handle<Script> script); 53 static MaybeHandle<JSArray> CompileForLiveEdit(Handle<Script> script);
53 54
54 // Generate and install code from previously queued compilation job. 55 // Generate and install code from previously queued compilation job.
55 static void FinalizeCompilationJob(CompilationJob* job); 56 static void FinalizeCompilationJob(CompilationJob* job);
56 57
57 // Give the compiler a chance to perform low-latency initialization tasks of 58 // Give the compiler a chance to perform low-latency initialization tasks of
58 // the given {function} on its instantiation. Note that only the runtime will 59 // the given {function} on its instantiation. Note that only the runtime will
59 // offer this chance, optimized closure instantiation will not call this. 60 // offer this chance, optimized closure instantiation will not call this.
60 static void PostInstantiation(Handle<JSFunction> function, PretenureFlag); 61 static void PostInstantiation(Handle<JSFunction> function, PretenureFlag);
61 62
62 // Parser::Parse, then Compiler::Analyze. 63 // Parser::Parse, then Compiler::Analyze.
63 static bool ParseAndAnalyze(ParseInfo* info); 64 static bool ParseAndAnalyze(ParseInfo* info);
64 // Rewrite, analyze scopes, and renumber. 65 // Rewrite, analyze scopes, and renumber.
65 static bool Analyze(ParseInfo* info); 66 static bool Analyze(ParseInfo* info);
66 // Adds deoptimization support, requires ParseAndAnalyze. 67 // Adds deoptimization support, requires ParseAndAnalyze.
67 static bool EnsureDeoptimizationSupport(CompilationInfo* info); 68 static bool EnsureDeoptimizationSupport(CompilationInfo* info);
69 // Ensures that bytecode is generated, calls ParseAndAnalyze internally.
70 static bool EnsureBytecode(CompilationInfo* info);
71
72 // The next compilation tier which the function should be compiled to for
73 // optimization. This is used as a hint by the runtime profiler.
74 static CompilationTier NextCompilationTier(JSFunction* function);
68 75
69 // =========================================================================== 76 // ===========================================================================
70 // The following family of methods instantiates new functions for scripts or 77 // The following family of methods instantiates new functions for scripts or
71 // function literals. The decision whether those functions will be compiled, 78 // function literals. The decision whether those functions will be compiled,
72 // is left to the discretion of the compiler. 79 // is left to the discretion of the compiler.
73 // 80 //
74 // Please note this interface returns shared function infos. This means you 81 // Please note this interface returns shared function infos. This means you
75 // need to call Factory::NewFunctionFromSharedFunctionInfo before you have a 82 // need to call Factory::NewFunctionFromSharedFunctionInfo before you have a
76 // real function with a context. 83 // real function with a context.
77 84
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 MUST_USE_RESULT Status SetLastStatus(Status status) { 584 MUST_USE_RESULT Status SetLastStatus(Status status) {
578 last_status_ = status; 585 last_status_ = status;
579 return last_status_; 586 return last_status_;
580 } 587 }
581 }; 588 };
582 589
583 } // namespace internal 590 } // namespace internal
584 } // namespace v8 591 } // namespace v8
585 592
586 #endif // V8_COMPILER_H_ 593 #endif // V8_COMPILER_H_
OLDNEW
« 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