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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Check if a heap object can be materialized by loading from the frame, which | 78 // Check if a heap object can be materialized by loading from the frame, which |
79 // is usually way cheaper than materializing the actual heap object constant. | 79 // is usually way cheaper than materializing the actual heap object constant. |
80 bool IsMaterializableFromFrame(Handle<HeapObject> object, int* slot_return); | 80 bool IsMaterializableFromFrame(Handle<HeapObject> object, int* slot_return); |
81 // Check if a heap object can be materialized by loading from a heap root, | 81 // Check if a heap object can be materialized by loading from a heap root, |
82 // which is cheaper on some platforms than materializing the actual heap | 82 // which is cheaper on some platforms than materializing the actual heap |
83 // object constant. | 83 // object constant. |
84 bool IsMaterializableFromRoot(Handle<HeapObject> object, | 84 bool IsMaterializableFromRoot(Handle<HeapObject> object, |
85 Heap::RootListIndex* index_return); | 85 Heap::RootListIndex* index_return); |
86 | 86 |
87 // Assemble code for the specified instruction. | 87 // Assemble code for the specified instruction. |
88 void AssembleInstruction(Instruction* instr); | 88 void AssembleInstruction(Instruction* instr, const InstructionBlock* block); |
89 void AssembleSourcePosition(Instruction* instr); | 89 void AssembleSourcePosition(Instruction* instr); |
90 void AssembleGaps(Instruction* instr); | 90 void AssembleGaps(Instruction* instr); |
91 | 91 |
92 // =========================================================================== | 92 // =========================================================================== |
93 // ============= Architecture-specific code generation methods. ============== | 93 // ============= Architecture-specific code generation methods. ============== |
94 // =========================================================================== | 94 // =========================================================================== |
95 | 95 |
96 void AssembleArchInstruction(Instruction* instr); | 96 void AssembleArchInstruction(Instruction* instr); |
97 void AssembleArchJump(RpoNumber target); | 97 void AssembleArchJump(RpoNumber target); |
98 void AssembleArchBranch(Instruction* instr, BranchInfo* branch); | 98 void AssembleArchBranch(Instruction* instr, BranchInfo* branch); |
99 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); | 99 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); |
100 void AssembleArchLookupSwitch(Instruction* instr); | 100 void AssembleArchLookupSwitch(Instruction* instr); |
101 void AssembleArchTableSwitch(Instruction* instr); | 101 void AssembleArchTableSwitch(Instruction* instr); |
102 | 102 |
103 void AssembleDeoptimizerCall(int deoptimization_id, | 103 void AssembleDeoptimizerCall(int deoptimization_id, |
104 Deoptimizer::BailoutType bailout_type); | 104 Deoptimizer::BailoutType bailout_type); |
105 | 105 |
106 // Generates an architecture-specific, descriptor-specific prologue | 106 // Generates an architecture-specific, descriptor-specific prologue |
107 // to set up a stack frame. | 107 // to set up a stack frame. |
108 void AssemblePrologue(); | 108 void AssemblePrologue(); |
| 109 |
| 110 void AssembleSetupStackPointer(); |
| 111 |
109 // Generates an architecture-specific, descriptor-specific return sequence | 112 // Generates an architecture-specific, descriptor-specific return sequence |
110 // to tear down a stack frame. | 113 // to tear down a stack frame. |
111 void AssembleReturn(); | 114 void AssembleReturn(); |
112 | 115 |
113 // Generates code to deconstruct a the caller's frame, including arguments. | 116 // Generates code to deconstruct a the caller's frame, including arguments. |
114 void AssembleDeconstructActivationRecord(int stack_param_delta); | 117 void AssembleDeconstructActivationRecord(int stack_param_delta); |
115 | 118 |
| 119 void AssembleDeconstructFrame(); |
| 120 |
116 // Generates code to manipulate the stack in preparation for a tail call. | 121 // Generates code to manipulate the stack in preparation for a tail call. |
117 void AssemblePrepareTailCall(int stack_param_delta); | 122 void AssemblePrepareTailCall(int stack_param_delta); |
118 | 123 |
119 // Generates code to pop current frame if it is an arguments adaptor frame. | 124 // Generates code to pop current frame if it is an arguments adaptor frame. |
120 void AssemblePopArgumentsAdaptorFrame(Register args_reg, Register scratch1, | 125 void AssemblePopArgumentsAdaptorFrame(Register args_reg, Register scratch1, |
121 Register scratch2, Register scratch3); | 126 Register scratch2, Register scratch3); |
122 | 127 |
123 // =========================================================================== | 128 // =========================================================================== |
124 // ============== Architecture-specific gap resolver methods. ================ | 129 // ============== Architecture-specific gap resolver methods. ================ |
125 // =========================================================================== | 130 // =========================================================================== |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 JumpTable* jump_tables_; | 232 JumpTable* jump_tables_; |
228 OutOfLineCode* ools_; | 233 OutOfLineCode* ools_; |
229 int osr_pc_offset_; | 234 int osr_pc_offset_; |
230 }; | 235 }; |
231 | 236 |
232 } // namespace compiler | 237 } // namespace compiler |
233 } // namespace internal | 238 } // namespace internal |
234 } // namespace v8 | 239 } // namespace v8 |
235 | 240 |
236 #endif // V8_COMPILER_CODE_GENERATOR_H | 241 #endif // V8_COMPILER_CODE_GENERATOR_H |
OLD | NEW |