OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 } | 2181 } |
2182 | 2182 |
2183 LOperand* object() { return inputs_[0]; } | 2183 LOperand* object() { return inputs_[0]; } |
2184 LOperand* index() { return inputs_[1]; } | 2184 LOperand* index() { return inputs_[1]; } |
2185 | 2185 |
2186 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2186 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
2187 }; | 2187 }; |
2188 | 2188 |
2189 | 2189 |
2190 class LChunkBuilder; | 2190 class LChunkBuilder; |
2191 class LChunk: public LChunkBase { | 2191 class LPlatformChunk: public LChunk { |
2192 public: | 2192 public: |
2193 explicit LChunk(CompilationInfo* info, HGraph* graph) | 2193 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
2194 : LChunkBase(info, graph) { } | 2194 : LChunk(info, graph) { } |
2195 | 2195 |
2196 int GetNextSpillIndex(bool is_double); | 2196 int GetNextSpillIndex(bool is_double); |
2197 LOperand* GetNextSpillSlot(bool is_double); | 2197 LOperand* GetNextSpillSlot(bool is_double); |
2198 }; | 2198 }; |
2199 | 2199 |
2200 | 2200 |
2201 class LChunkBuilder BASE_EMBEDDED { | 2201 class LChunkBuilder BASE_EMBEDDED { |
2202 public: | 2202 public: |
2203 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2203 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2204 : chunk_(NULL), | 2204 : chunk_(NULL), |
2205 info_(info), | 2205 info_(info), |
2206 graph_(graph), | 2206 graph_(graph), |
2207 zone_(graph->zone()), | 2207 zone_(graph->zone()), |
2208 status_(UNUSED), | 2208 status_(UNUSED), |
2209 current_instruction_(NULL), | 2209 current_instruction_(NULL), |
2210 current_block_(NULL), | 2210 current_block_(NULL), |
2211 next_block_(NULL), | 2211 next_block_(NULL), |
2212 argument_count_(0), | 2212 argument_count_(0), |
2213 allocator_(allocator), | 2213 allocator_(allocator), |
2214 position_(RelocInfo::kNoPosition), | 2214 position_(RelocInfo::kNoPosition), |
2215 instruction_pending_deoptimization_environment_(NULL), | 2215 instruction_pending_deoptimization_environment_(NULL), |
2216 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } | 2216 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } |
2217 | 2217 |
2218 // Build the sequence for the graph. | 2218 // Build the sequence for the graph. |
2219 LChunk* Build(); | 2219 LPlatformChunk* Build(); |
2220 | 2220 |
2221 // Declare methods that deal with the individual node types. | 2221 // Declare methods that deal with the individual node types. |
2222 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2222 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2223 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2223 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2224 #undef DECLARE_DO | 2224 #undef DECLARE_DO |
2225 | 2225 |
2226 private: | 2226 private: |
2227 enum Status { | 2227 enum Status { |
2228 UNUSED, | 2228 UNUSED, |
2229 BUILDING, | 2229 BUILDING, |
2230 DONE, | 2230 DONE, |
2231 ABORTED | 2231 ABORTED |
2232 }; | 2232 }; |
2233 | 2233 |
2234 LChunk* chunk() const { return chunk_; } | 2234 LPlatformChunk* chunk() const { return chunk_; } |
2235 CompilationInfo* info() const { return info_; } | 2235 CompilationInfo* info() const { return info_; } |
2236 HGraph* graph() const { return graph_; } | 2236 HGraph* graph() const { return graph_; } |
2237 Zone* zone() const { return zone_; } | 2237 Zone* zone() const { return zone_; } |
2238 | 2238 |
2239 bool is_unused() const { return status_ == UNUSED; } | 2239 bool is_unused() const { return status_ == UNUSED; } |
2240 bool is_building() const { return status_ == BUILDING; } | 2240 bool is_building() const { return status_ == BUILDING; } |
2241 bool is_done() const { return status_ == DONE; } | 2241 bool is_done() const { return status_ == DONE; } |
2242 bool is_aborted() const { return status_ == ABORTED; } | 2242 bool is_aborted() const { return status_ == ABORTED; } |
2243 | 2243 |
2244 void Abort(const char* format, ...); | 2244 void Abort(const char* format, ...); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2325 void VisitInstruction(HInstruction* current); | 2325 void VisitInstruction(HInstruction* current); |
2326 | 2326 |
2327 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2327 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2328 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 2328 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
2329 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2329 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2330 LInstruction* DoArithmeticD(Token::Value op, | 2330 LInstruction* DoArithmeticD(Token::Value op, |
2331 HArithmeticBinaryOperation* instr); | 2331 HArithmeticBinaryOperation* instr); |
2332 LInstruction* DoArithmeticT(Token::Value op, | 2332 LInstruction* DoArithmeticT(Token::Value op, |
2333 HArithmeticBinaryOperation* instr); | 2333 HArithmeticBinaryOperation* instr); |
2334 | 2334 |
2335 LChunk* chunk_; | 2335 LPlatformChunk* chunk_; |
2336 CompilationInfo* info_; | 2336 CompilationInfo* info_; |
2337 HGraph* const graph_; | 2337 HGraph* const graph_; |
2338 Zone* zone_; | 2338 Zone* zone_; |
2339 Status status_; | 2339 Status status_; |
2340 HInstruction* current_instruction_; | 2340 HInstruction* current_instruction_; |
2341 HBasicBlock* current_block_; | 2341 HBasicBlock* current_block_; |
2342 HBasicBlock* next_block_; | 2342 HBasicBlock* next_block_; |
2343 int argument_count_; | 2343 int argument_count_; |
2344 LAllocator* allocator_; | 2344 LAllocator* allocator_; |
2345 int position_; | 2345 int position_; |
2346 LInstruction* instruction_pending_deoptimization_environment_; | 2346 LInstruction* instruction_pending_deoptimization_environment_; |
2347 int pending_deoptimization_ast_id_; | 2347 int pending_deoptimization_ast_id_; |
2348 | 2348 |
2349 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2349 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2350 }; | 2350 }; |
2351 | 2351 |
2352 #undef DECLARE_HYDROGEN_ACCESSOR | 2352 #undef DECLARE_HYDROGEN_ACCESSOR |
2353 #undef DECLARE_CONCRETE_INSTRUCTION | 2353 #undef DECLARE_CONCRETE_INSTRUCTION |
2354 | 2354 |
2355 } } // namespace v8::internal | 2355 } } // namespace v8::internal |
2356 | 2356 |
2357 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2357 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |