| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 ZoneList<Handle<JSFunction> > inlined_closures_; | 2159 ZoneList<Handle<JSFunction> > inlined_closures_; |
| 2160 }; | 2160 }; |
| 2161 | 2161 |
| 2162 | 2162 |
| 2163 class LChunkBuilder BASE_EMBEDDED { | 2163 class LChunkBuilder BASE_EMBEDDED { |
| 2164 public: | 2164 public: |
| 2165 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2165 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2166 : chunk_(NULL), | 2166 : chunk_(NULL), |
| 2167 info_(info), | 2167 info_(info), |
| 2168 graph_(graph), | 2168 graph_(graph), |
| 2169 isolate_(graph->isolate()), |
| 2169 status_(UNUSED), | 2170 status_(UNUSED), |
| 2170 current_instruction_(NULL), | 2171 current_instruction_(NULL), |
| 2171 current_block_(NULL), | 2172 current_block_(NULL), |
| 2172 next_block_(NULL), | 2173 next_block_(NULL), |
| 2173 argument_count_(0), | 2174 argument_count_(0), |
| 2174 allocator_(allocator), | 2175 allocator_(allocator), |
| 2175 position_(RelocInfo::kNoPosition), | 2176 position_(RelocInfo::kNoPosition), |
| 2176 instruction_pending_deoptimization_environment_(NULL), | 2177 instruction_pending_deoptimization_environment_(NULL), |
| 2177 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } | 2178 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } |
| 2178 | 2179 |
| 2179 // Build the sequence for the graph. | 2180 // Build the sequence for the graph. |
| 2180 LChunk* Build(); | 2181 LChunk* Build(); |
| 2181 | 2182 |
| 2182 // Declare methods that deal with the individual node types. | 2183 // Declare methods that deal with the individual node types. |
| 2183 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2184 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 2184 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2185 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2185 #undef DECLARE_DO | 2186 #undef DECLARE_DO |
| 2186 | 2187 |
| 2187 private: | 2188 private: |
| 2188 enum Status { | 2189 enum Status { |
| 2189 UNUSED, | 2190 UNUSED, |
| 2190 BUILDING, | 2191 BUILDING, |
| 2191 DONE, | 2192 DONE, |
| 2192 ABORTED | 2193 ABORTED |
| 2193 }; | 2194 }; |
| 2194 | 2195 |
| 2195 LChunk* chunk() const { return chunk_; } | 2196 LChunk* chunk() const { return chunk_; } |
| 2196 CompilationInfo* info() const { return info_; } | 2197 CompilationInfo* info() const { return info_; } |
| 2197 HGraph* graph() const { return graph_; } | 2198 HGraph* graph() const { return graph_; } |
| 2199 Zone* zone() { return isolate_->zone(); } |
| 2198 | 2200 |
| 2199 bool is_unused() const { return status_ == UNUSED; } | 2201 bool is_unused() const { return status_ == UNUSED; } |
| 2200 bool is_building() const { return status_ == BUILDING; } | 2202 bool is_building() const { return status_ == BUILDING; } |
| 2201 bool is_done() const { return status_ == DONE; } | 2203 bool is_done() const { return status_ == DONE; } |
| 2202 bool is_aborted() const { return status_ == ABORTED; } | 2204 bool is_aborted() const { return status_ == ABORTED; } |
| 2203 | 2205 |
| 2204 void Abort(const char* format, ...); | 2206 void Abort(const char* format, ...); |
| 2205 | 2207 |
| 2206 // Methods for getting operands for Use / Define / Temp. | 2208 // Methods for getting operands for Use / Define / Temp. |
| 2207 LRegister* ToOperand(Register reg); | 2209 LRegister* ToOperand(Register reg); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2299 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2301 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
| 2300 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2302 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
| 2301 LInstruction* DoArithmeticD(Token::Value op, | 2303 LInstruction* DoArithmeticD(Token::Value op, |
| 2302 HArithmeticBinaryOperation* instr); | 2304 HArithmeticBinaryOperation* instr); |
| 2303 LInstruction* DoArithmeticT(Token::Value op, | 2305 LInstruction* DoArithmeticT(Token::Value op, |
| 2304 HArithmeticBinaryOperation* instr); | 2306 HArithmeticBinaryOperation* instr); |
| 2305 | 2307 |
| 2306 LChunk* chunk_; | 2308 LChunk* chunk_; |
| 2307 CompilationInfo* info_; | 2309 CompilationInfo* info_; |
| 2308 HGraph* const graph_; | 2310 HGraph* const graph_; |
| 2311 Isolate* isolate_; |
| 2309 Status status_; | 2312 Status status_; |
| 2310 HInstruction* current_instruction_; | 2313 HInstruction* current_instruction_; |
| 2311 HBasicBlock* current_block_; | 2314 HBasicBlock* current_block_; |
| 2312 HBasicBlock* next_block_; | 2315 HBasicBlock* next_block_; |
| 2313 int argument_count_; | 2316 int argument_count_; |
| 2314 LAllocator* allocator_; | 2317 LAllocator* allocator_; |
| 2315 int position_; | 2318 int position_; |
| 2316 LInstruction* instruction_pending_deoptimization_environment_; | 2319 LInstruction* instruction_pending_deoptimization_environment_; |
| 2317 int pending_deoptimization_ast_id_; | 2320 int pending_deoptimization_ast_id_; |
| 2318 | 2321 |
| 2319 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2322 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2320 }; | 2323 }; |
| 2321 | 2324 |
| 2322 #undef DECLARE_HYDROGEN_ACCESSOR | 2325 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2323 #undef DECLARE_CONCRETE_INSTRUCTION | 2326 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2324 | 2327 |
| 2325 } } // namespace v8::internal | 2328 } } // namespace v8::internal |
| 2326 | 2329 |
| 2327 #endif // V8_IA32_LITHIUM_IA32_H_ | 2330 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |