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

Side by Side Diff: src/compiler/code-generator.h

Issue 745633002: [turbofan] Clean up and factor out branch generation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix IA32 fall through. Created 6 years, 1 month 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 | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/code-generator.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 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 class Linkage; 20 class Linkage;
21 21
22 struct BranchInfo {
23 FlagsCondition condition;
24 Label* true_label;
25 Label* false_label;
26 bool fallthru;
27 };
28
29
22 // Generates native code for a sequence of instructions. 30 // Generates native code for a sequence of instructions.
23 class CodeGenerator FINAL : public GapResolver::Assembler { 31 class CodeGenerator FINAL : public GapResolver::Assembler {
24 public: 32 public:
25 explicit CodeGenerator(Frame* frame, Linkage* linkage, 33 explicit CodeGenerator(Frame* frame, Linkage* linkage,
26 InstructionSequence* code, CompilationInfo* info); 34 InstructionSequence* code, CompilationInfo* info);
27 35
28 // Generate native code. 36 // Generate native code.
29 Handle<Code> GenerateCode(); 37 Handle<Code> GenerateCode();
30 38
31 InstructionSequence* code() const { return code_; } 39 InstructionSequence* code() const { return code_; }
(...skipping 21 matching lines...) Expand all
53 // Assemble code for the specified instruction. 61 // Assemble code for the specified instruction.
54 void AssembleInstruction(Instruction* instr); 62 void AssembleInstruction(Instruction* instr);
55 void AssembleSourcePosition(SourcePositionInstruction* instr); 63 void AssembleSourcePosition(SourcePositionInstruction* instr);
56 void AssembleGap(GapInstruction* gap); 64 void AssembleGap(GapInstruction* gap);
57 65
58 // =========================================================================== 66 // ===========================================================================
59 // ============= Architecture-specific code generation methods. ============== 67 // ============= Architecture-specific code generation methods. ==============
60 // =========================================================================== 68 // ===========================================================================
61 69
62 void AssembleArchInstruction(Instruction* instr); 70 void AssembleArchInstruction(Instruction* instr);
63 void AssembleArchBranch(Instruction* instr, FlagsCondition condition); 71 void AssembleArchJump(BasicBlock::RpoNumber target);
72 void AssembleArchBranch(Instruction* instr, BranchInfo* branch);
64 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); 73 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition);
65 74
66 void AssembleDeoptimizerCall(int deoptimization_id); 75 void AssembleDeoptimizerCall(int deoptimization_id);
67 76
68 // Generates an architecture-specific, descriptor-specific prologue 77 // Generates an architecture-specific, descriptor-specific prologue
69 // to set up a stack frame. 78 // to set up a stack frame.
70 void AssemblePrologue(); 79 void AssemblePrologue();
71 // Generates an architecture-specific, descriptor-specific return sequence 80 // Generates an architecture-specific, descriptor-specific return sequence
72 // to tear down a stack frame. 81 // to tear down a stack frame.
73 void AssembleReturn(); 82 void AssembleReturn();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 ZoneDeque<Handle<Object> > deoptimization_literals_; 143 ZoneDeque<Handle<Object> > deoptimization_literals_;
135 TranslationBuffer translations_; 144 TranslationBuffer translations_;
136 int last_lazy_deopt_pc_; 145 int last_lazy_deopt_pc_;
137 }; 146 };
138 147
139 } // namespace compiler 148 } // namespace compiler
140 } // namespace internal 149 } // namespace internal
141 } // namespace v8 150 } // namespace v8
142 151
143 #endif // V8_COMPILER_CODE_GENERATOR_H 152 #endif // V8_COMPILER_CODE_GENERATOR_H
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698