| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_CODE_GENERATOR_H_ | 5 #ifndef V8_COMPILER_CODE_GENERATOR_H_ |
| 6 #define V8_COMPILER_CODE_GENERATOR_H_ | 6 #define V8_COMPILER_CODE_GENERATOR_H_ |
| 7 | 7 |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/instruction.h" | 9 #include "src/compiler/instruction.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 struct BranchInfo { | 22 struct BranchInfo { |
| 23 FlagsCondition condition; | 23 FlagsCondition condition; |
| 24 Label* true_label; | 24 Label* true_label; |
| 25 Label* false_label; | 25 Label* false_label; |
| 26 bool fallthru; | 26 bool fallthru; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 | 29 |
| 30 // Generates native code for a sequence of instructions. | 30 // Generates native code for a sequence of instructions. |
| 31 class CodeGenerator FINAL : public GapResolver::Assembler { | 31 class CodeGenerator final : public GapResolver::Assembler { |
| 32 public: | 32 public: |
| 33 explicit CodeGenerator(Frame* frame, Linkage* linkage, | 33 explicit CodeGenerator(Frame* frame, Linkage* linkage, |
| 34 InstructionSequence* code, CompilationInfo* info); | 34 InstructionSequence* code, CompilationInfo* info); |
| 35 | 35 |
| 36 // Generate native code. | 36 // Generate native code. |
| 37 Handle<Code> GenerateCode(); | 37 Handle<Code> GenerateCode(); |
| 38 | 38 |
| 39 InstructionSequence* code() const { return code_; } | 39 InstructionSequence* code() const { return code_; } |
| 40 Frame* frame() const { return frame_; } | 40 Frame* frame() const { return frame_; } |
| 41 Isolate* isolate() const { return info_->isolate(); } | 41 Isolate* isolate() const { return info_->isolate(); } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Generates an architecture-specific, descriptor-specific return sequence | 92 // Generates an architecture-specific, descriptor-specific return sequence |
| 93 // to tear down a stack frame. | 93 // to tear down a stack frame. |
| 94 void AssembleReturn(); | 94 void AssembleReturn(); |
| 95 | 95 |
| 96 // =========================================================================== | 96 // =========================================================================== |
| 97 // ============== Architecture-specific gap resolver methods. ================ | 97 // ============== Architecture-specific gap resolver methods. ================ |
| 98 // =========================================================================== | 98 // =========================================================================== |
| 99 | 99 |
| 100 // Interface used by the gap resolver to emit moves and swaps. | 100 // Interface used by the gap resolver to emit moves and swaps. |
| 101 void AssembleMove(InstructionOperand* source, | 101 void AssembleMove(InstructionOperand* source, |
| 102 InstructionOperand* destination) FINAL; | 102 InstructionOperand* destination) final; |
| 103 void AssembleSwap(InstructionOperand* source, | 103 void AssembleSwap(InstructionOperand* source, |
| 104 InstructionOperand* destination) FINAL; | 104 InstructionOperand* destination) final; |
| 105 | 105 |
| 106 // =========================================================================== | 106 // =========================================================================== |
| 107 // =================== Jump table construction methods. ====================== | 107 // =================== Jump table construction methods. ====================== |
| 108 // =========================================================================== | 108 // =========================================================================== |
| 109 | 109 |
| 110 class JumpTable; | 110 class JumpTable; |
| 111 // Adds a jump table that is emitted after the actual code. Returns label | 111 // Adds a jump table that is emitted after the actual code. Returns label |
| 112 // pointing to the beginning of the table. {targets} is assumed to be static | 112 // pointing to the beginning of the table. {targets} is assumed to be static |
| 113 // or zone allocated. | 113 // or zone allocated. |
| 114 Label* AddJumpTable(Label** targets, size_t target_count); | 114 Label* AddJumpTable(Label** targets, size_t target_count); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 JumpTable* jump_tables_; | 181 JumpTable* jump_tables_; |
| 182 OutOfLineCode* ools_; | 182 OutOfLineCode* ools_; |
| 183 int osr_pc_offset_; | 183 int osr_pc_offset_; |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 } // namespace compiler | 186 } // namespace compiler |
| 187 } // namespace internal | 187 } // namespace internal |
| 188 } // namespace v8 | 188 } // namespace v8 |
| 189 | 189 |
| 190 #endif // V8_COMPILER_CODE_GENERATOR_H | 190 #endif // V8_COMPILER_CODE_GENERATOR_H |
| OLD | NEW |