| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Please note this interface is the only part dealing with {Code} objects | 113 // Please note this interface is the only part dealing with {Code} objects |
| 114 // directly. Other methods are agnostic to {Code} and can use an interpreter | 114 // directly. Other methods are agnostic to {Code} and can use an interpreter |
| 115 // instead of generating JIT code for a function at all. | 115 // instead of generating JIT code for a function at all. |
| 116 | 116 |
| 117 // Generate and return optimized code for OSR, or empty handle on failure. | 117 // Generate and return optimized code for OSR, or empty handle on failure. |
| 118 MUST_USE_RESULT static MaybeHandle<Code> GetOptimizedCodeForOSR( | 118 MUST_USE_RESULT static MaybeHandle<Code> GetOptimizedCodeForOSR( |
| 119 Handle<JSFunction> function, BailoutId osr_ast_id, | 119 Handle<JSFunction> function, BailoutId osr_ast_id, |
| 120 JavaScriptFrame* osr_frame); | 120 JavaScriptFrame* osr_frame); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 // TODO(mstarzinger): Move this into the "crankshaft" directory. |
| 123 struct InlinedFunctionInfo { | 124 struct InlinedFunctionInfo { |
| 124 InlinedFunctionInfo(int parent_id, SourcePosition inline_position, | 125 explicit InlinedFunctionInfo(int start_position) |
| 125 int script_id, int start_position) | 126 : start_position(start_position) {} |
| 126 : parent_id(parent_id), | |
| 127 inline_position(inline_position), | |
| 128 script_id(script_id), | |
| 129 start_position(start_position) {} | |
| 130 int parent_id; | |
| 131 SourcePosition inline_position; | |
| 132 int script_id; | |
| 133 int start_position; | 127 int start_position; |
| 134 | |
| 135 static const int kNoParentId = -1; | |
| 136 }; | 128 }; |
| 137 | 129 |
| 138 | 130 |
| 139 // CompilationInfo encapsulates some information known at compile time. It | 131 // CompilationInfo encapsulates some information known at compile time. It |
| 140 // is constructed based on the resources available at compile-time. | 132 // is constructed based on the resources available at compile-time. |
| 141 class CompilationInfo final { | 133 class CompilationInfo final { |
| 142 public: | 134 public: |
| 143 // Various configuration flags for a compilation, as well as some properties | 135 // Various configuration flags for a compilation, as well as some properties |
| 144 // of the compiled code produced by a compilation. | 136 // of the compiled code produced by a compilation. |
| 145 enum Flag { | 137 enum Flag { |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 MUST_USE_RESULT Status SetLastStatus(Status status) { | 598 MUST_USE_RESULT Status SetLastStatus(Status status) { |
| 607 last_status_ = status; | 599 last_status_ = status; |
| 608 return last_status_; | 600 return last_status_; |
| 609 } | 601 } |
| 610 }; | 602 }; |
| 611 | 603 |
| 612 } // namespace internal | 604 } // namespace internal |
| 613 } // namespace v8 | 605 } // namespace v8 |
| 614 | 606 |
| 615 #endif // V8_COMPILER_H_ | 607 #endif // V8_COMPILER_H_ |
| OLD | NEW |