| 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 <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
| 11 #include "src/compiler/instruction.h" | 11 #include "src/compiler/instruction.h" |
| 12 #include "src/deoptimizer.h" | 12 #include "src/deoptimizer.h" |
| 13 #include "src/macro-assembler.h" | 13 #include "src/macro-assembler.h" |
| 14 #include "src/safepoint-table.h" | 14 #include "src/safepoint-table.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 namespace compiler { | 18 namespace compiler { |
| 19 | 19 |
| 20 // Generates native code for a sequence of instructions. | 20 // Generates native code for a sequence of instructions. |
| 21 class CodeGenerator FINAL : public GapResolver::Assembler { | 21 class CodeGenerator FINAL : public GapResolver::Assembler { |
| 22 public: | 22 public: |
| 23 explicit CodeGenerator(InstructionSequence* code); | 23 explicit CodeGenerator(InstructionSequence* code); |
| 24 | 24 |
| 25 // Generate native code. | 25 // Generate native code. |
| 26 Handle<Code> GenerateCode(); | 26 Handle<Code> GenerateCode(); |
| 27 | 27 |
| 28 InstructionSequence* code() const { return code_; } | 28 InstructionSequence* code() const { return code_; } |
| 29 Frame* frame() const { return code()->frame(); } | 29 Frame* frame() const { return code()->frame(); } |
| 30 Graph* graph() const { return code()->graph(); } | |
| 31 Isolate* isolate() const { return zone()->isolate(); } | 30 Isolate* isolate() const { return zone()->isolate(); } |
| 32 Linkage* linkage() const { return code()->linkage(); } | 31 Linkage* linkage() const { return code()->linkage(); } |
| 33 Schedule* schedule() const { return code()->schedule(); } | 32 Schedule* schedule() const { return code()->schedule(); } |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 MacroAssembler* masm() { return &masm_; } | 35 MacroAssembler* masm() { return &masm_; } |
| 37 GapResolver* resolver() { return &resolver_; } | 36 GapResolver* resolver() { return &resolver_; } |
| 38 SafepointTableBuilder* safepoints() { return &safepoints_; } | 37 SafepointTableBuilder* safepoints() { return &safepoints_; } |
| 39 Zone* zone() const { return code()->zone(); } | 38 Zone* zone() const { return code()->zone(); } |
| 40 | 39 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ZoneDeque<Handle<Object> > deoptimization_literals_; | 128 ZoneDeque<Handle<Object> > deoptimization_literals_; |
| 130 TranslationBuffer translations_; | 129 TranslationBuffer translations_; |
| 131 int last_lazy_deopt_pc_; | 130 int last_lazy_deopt_pc_; |
| 132 }; | 131 }; |
| 133 | 132 |
| 134 } // namespace compiler | 133 } // namespace compiler |
| 135 } // namespace internal | 134 } // namespace internal |
| 136 } // namespace v8 | 135 } // namespace v8 |
| 137 | 136 |
| 138 #endif // V8_COMPILER_CODE_GENERATOR_H | 137 #endif // V8_COMPILER_CODE_GENERATOR_H |
| OLD | NEW |