| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_LITHIUM_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_ARM64_H_ |
| 6 #define V8_ARM64_LITHIUM_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_ARM64_H_ |
| 7 | 7 |
| 8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
| 9 #include "src/lithium.h" | 9 #include "src/lithium.h" |
| 10 #include "src/lithium-allocator.h" | 10 #include "src/lithium-allocator.h" |
| (...skipping 3079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3090 : LChunk(info, graph) { } | 3090 : LChunk(info, graph) { } |
| 3091 | 3091 |
| 3092 int GetNextSpillIndex(); | 3092 int GetNextSpillIndex(); |
| 3093 LOperand* GetNextSpillSlot(RegisterKind kind); | 3093 LOperand* GetNextSpillSlot(RegisterKind kind); |
| 3094 }; | 3094 }; |
| 3095 | 3095 |
| 3096 | 3096 |
| 3097 class LChunkBuilder FINAL : public LChunkBuilderBase { | 3097 class LChunkBuilder FINAL : public LChunkBuilderBase { |
| 3098 public: | 3098 public: |
| 3099 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 3099 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 3100 : LChunkBuilderBase(graph->zone()), | 3100 : LChunkBuilderBase(info, graph), |
| 3101 chunk_(NULL), | |
| 3102 info_(info), | |
| 3103 graph_(graph), | |
| 3104 status_(UNUSED), | |
| 3105 current_instruction_(NULL), | 3101 current_instruction_(NULL), |
| 3106 current_block_(NULL), | 3102 current_block_(NULL), |
| 3107 allocator_(allocator) { } | 3103 allocator_(allocator) {} |
| 3108 | 3104 |
| 3109 // Build the sequence for the graph. | 3105 // Build the sequence for the graph. |
| 3110 LPlatformChunk* Build(); | 3106 LPlatformChunk* Build(); |
| 3111 | 3107 |
| 3112 // Declare methods that deal with the individual node types. | 3108 // Declare methods that deal with the individual node types. |
| 3113 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 3109 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 3114 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 3110 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 3115 #undef DECLARE_DO | 3111 #undef DECLARE_DO |
| 3116 | 3112 |
| 3117 LInstruction* DoDivByPowerOf2I(HDiv* instr); | 3113 LInstruction* DoDivByPowerOf2I(HDiv* instr); |
| 3118 LInstruction* DoDivByConstI(HDiv* instr); | 3114 LInstruction* DoDivByConstI(HDiv* instr); |
| 3119 LInstruction* DoDivI(HBinaryOperation* instr); | 3115 LInstruction* DoDivI(HBinaryOperation* instr); |
| 3120 LInstruction* DoModByPowerOf2I(HMod* instr); | 3116 LInstruction* DoModByPowerOf2I(HMod* instr); |
| 3121 LInstruction* DoModByConstI(HMod* instr); | 3117 LInstruction* DoModByConstI(HMod* instr); |
| 3122 LInstruction* DoModI(HMod* instr); | 3118 LInstruction* DoModI(HMod* instr); |
| 3123 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 3119 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
| 3124 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); | 3120 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
| 3125 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 3121 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
| 3126 | 3122 |
| 3127 static bool HasMagicNumberForDivision(int32_t divisor); | 3123 static bool HasMagicNumberForDivision(int32_t divisor); |
| 3128 | 3124 |
| 3129 private: | 3125 private: |
| 3130 enum Status { | |
| 3131 UNUSED, | |
| 3132 BUILDING, | |
| 3133 DONE, | |
| 3134 ABORTED | |
| 3135 }; | |
| 3136 | |
| 3137 HGraph* graph() const { return graph_; } | |
| 3138 Isolate* isolate() const { return info_->isolate(); } | |
| 3139 | |
| 3140 bool is_unused() const { return status_ == UNUSED; } | |
| 3141 bool is_building() const { return status_ == BUILDING; } | |
| 3142 bool is_done() const { return status_ == DONE; } | |
| 3143 bool is_aborted() const { return status_ == ABORTED; } | |
| 3144 | |
| 3145 int argument_count() const { return argument_count_; } | |
| 3146 CompilationInfo* info() const { return info_; } | |
| 3147 Heap* heap() const { return isolate()->heap(); } | |
| 3148 | |
| 3149 void Abort(BailoutReason reason); | |
| 3150 | |
| 3151 // Methods for getting operands for Use / Define / Temp. | 3126 // Methods for getting operands for Use / Define / Temp. |
| 3152 LUnallocated* ToUnallocated(Register reg); | 3127 LUnallocated* ToUnallocated(Register reg); |
| 3153 LUnallocated* ToUnallocated(DoubleRegister reg); | 3128 LUnallocated* ToUnallocated(DoubleRegister reg); |
| 3154 | 3129 |
| 3155 // Methods for setting up define-use relationships. | 3130 // Methods for setting up define-use relationships. |
| 3156 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 3131 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
| 3157 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 3132 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
| 3158 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | 3133 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, |
| 3159 DoubleRegister fixed_register); | 3134 DoubleRegister fixed_register); |
| 3160 | 3135 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3264 LInstruction* DoShiftedBinaryOp(HBinaryOperation* instr, | 3239 LInstruction* DoShiftedBinaryOp(HBinaryOperation* instr, |
| 3265 HValue* left, | 3240 HValue* left, |
| 3266 HBitwiseBinaryOperation* shift); | 3241 HBitwiseBinaryOperation* shift); |
| 3267 | 3242 |
| 3268 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 3243 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
| 3269 LInstruction* DoArithmeticD(Token::Value op, | 3244 LInstruction* DoArithmeticD(Token::Value op, |
| 3270 HArithmeticBinaryOperation* instr); | 3245 HArithmeticBinaryOperation* instr); |
| 3271 LInstruction* DoArithmeticT(Token::Value op, | 3246 LInstruction* DoArithmeticT(Token::Value op, |
| 3272 HBinaryOperation* instr); | 3247 HBinaryOperation* instr); |
| 3273 | 3248 |
| 3274 LPlatformChunk* chunk_; | |
| 3275 CompilationInfo* info_; | |
| 3276 HGraph* const graph_; | |
| 3277 Status status_; | |
| 3278 HInstruction* current_instruction_; | 3249 HInstruction* current_instruction_; |
| 3279 HBasicBlock* current_block_; | 3250 HBasicBlock* current_block_; |
| 3280 LAllocator* allocator_; | 3251 LAllocator* allocator_; |
| 3281 | 3252 |
| 3282 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3253 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 3283 }; | 3254 }; |
| 3284 | 3255 |
| 3285 #undef DECLARE_HYDROGEN_ACCESSOR | 3256 #undef DECLARE_HYDROGEN_ACCESSOR |
| 3286 #undef DECLARE_CONCRETE_INSTRUCTION | 3257 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3287 | 3258 |
| 3288 } } // namespace v8::internal | 3259 } } // namespace v8::internal |
| 3289 | 3260 |
| 3290 #endif // V8_ARM64_LITHIUM_ARM64_H_ | 3261 #endif // V8_ARM64_LITHIUM_ARM64_H_ |
| OLD | NEW |