OLD | NEW |
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 // general contract is that failures will be reported by returning {false}, | 581 // general contract is that failures will be reported by returning {false}, |
582 // whereas successful compilation ensures the {is_compiled} predicate on the | 582 // whereas successful compilation ensures the {is_compiled} predicate on the |
583 // given function holds. | 583 // given function holds. |
584 | 584 |
585 static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag); | 585 static bool Compile(Handle<JSFunction> function, ClearExceptionFlag flag); |
586 static bool CompileOptimized(Handle<JSFunction> function, ConcurrencyMode); | 586 static bool CompileOptimized(Handle<JSFunction> function, ConcurrencyMode); |
587 static bool CompileDebugCode(Handle<JSFunction> function); | 587 static bool CompileDebugCode(Handle<JSFunction> function); |
588 static bool CompileDebugCode(Handle<SharedFunctionInfo> shared); | 588 static bool CompileDebugCode(Handle<SharedFunctionInfo> shared); |
589 static void CompileForLiveEdit(Handle<Script> script); | 589 static void CompileForLiveEdit(Handle<Script> script); |
590 | 590 |
| 591 // Generate and install code from previously queued optimization job. |
| 592 static void FinalizeOptimizedCompileJob(OptimizedCompileJob* job); |
| 593 |
591 // Give the compiler a chance to perform low-latency initialization tasks of | 594 // Give the compiler a chance to perform low-latency initialization tasks of |
592 // the given {function} on its instantiation. Note that only the runtime will | 595 // the given {function} on its instantiation. Note that only the runtime will |
593 // offer this chance, optimized closure instantiation will not call this. | 596 // offer this chance, optimized closure instantiation will not call this. |
594 static void PostInstantiation(Handle<JSFunction> function, PretenureFlag); | 597 static void PostInstantiation(Handle<JSFunction> function, PretenureFlag); |
595 | 598 |
596 // Parser::Parse, then Compiler::Analyze. | 599 // Parser::Parse, then Compiler::Analyze. |
597 static bool ParseAndAnalyze(ParseInfo* info); | 600 static bool ParseAndAnalyze(ParseInfo* info); |
598 // Rewrite, analyze scopes, and renumber. | 601 // Rewrite, analyze scopes, and renumber. |
599 static bool Analyze(ParseInfo* info); | 602 static bool Analyze(ParseInfo* info); |
600 // Adds deoptimization support, requires ParseAndAnalyze. | 603 // Adds deoptimization support, requires ParseAndAnalyze. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 // returned directly to the caller. | 647 // returned directly to the caller. |
645 // | 648 // |
646 // Please note this interface is the only part dealing with {Code} objects | 649 // Please note this interface is the only part dealing with {Code} objects |
647 // directly. Other methods are agnostic to {Code} and can use an interpreter | 650 // directly. Other methods are agnostic to {Code} and can use an interpreter |
648 // instead of generating JIT code for a function at all. | 651 // instead of generating JIT code for a function at all. |
649 | 652 |
650 // Generate and return optimized code for OSR, or empty handle on failure. | 653 // Generate and return optimized code for OSR, or empty handle on failure. |
651 MUST_USE_RESULT static MaybeHandle<Code> GetOptimizedCodeForOSR( | 654 MUST_USE_RESULT static MaybeHandle<Code> GetOptimizedCodeForOSR( |
652 Handle<JSFunction> function, BailoutId osr_ast_id, | 655 Handle<JSFunction> function, BailoutId osr_ast_id, |
653 JavaScriptFrame* osr_frame); | 656 JavaScriptFrame* osr_frame); |
654 | |
655 // Generate and return code from previously queued optimization job. | |
656 // On failure, return the empty handle. | |
657 MUST_USE_RESULT static MaybeHandle<Code> GetConcurrentlyOptimizedCode( | |
658 OptimizedCompileJob* job); | |
659 }; | 657 }; |
660 | 658 |
661 } // namespace internal | 659 } // namespace internal |
662 } // namespace v8 | 660 } // namespace v8 |
663 | 661 |
664 #endif // V8_COMPILER_H_ | 662 #endif // V8_COMPILER_H_ |
OLD | NEW |