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