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 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 } | 2312 } |
2313 | 2313 |
2314 LOperand* object() { return inputs_[0]; } | 2314 LOperand* object() { return inputs_[0]; } |
2315 LOperand* index() { return inputs_[1]; } | 2315 LOperand* index() { return inputs_[1]; } |
2316 | 2316 |
2317 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2317 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
2318 }; | 2318 }; |
2319 | 2319 |
2320 | 2320 |
2321 class LChunkBuilder; | 2321 class LChunkBuilder; |
2322 class LChunk: public LChunkBase { | 2322 class LPlatformChunk: public LChunk { |
2323 public: | 2323 public: |
2324 LChunk(CompilationInfo* info, HGraph* graph) | 2324 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
2325 : LChunkBase(info, graph), | 2325 : LChunk(info, graph), |
2326 num_double_slots_(0) { } | 2326 num_double_slots_(0) { } |
2327 | 2327 |
2328 int GetNextSpillIndex(bool is_double); | 2328 int GetNextSpillIndex(bool is_double); |
2329 LOperand* GetNextSpillSlot(bool is_double); | 2329 LOperand* GetNextSpillSlot(bool is_double); |
2330 | 2330 |
2331 int num_double_slots() const { return num_double_slots_; } | 2331 int num_double_slots() const { return num_double_slots_; } |
2332 | 2332 |
2333 private: | 2333 private: |
2334 int num_double_slots_; | 2334 int num_double_slots_; |
2335 }; | 2335 }; |
(...skipping 10 matching lines...) Expand all Loading... |
2346 current_instruction_(NULL), | 2346 current_instruction_(NULL), |
2347 current_block_(NULL), | 2347 current_block_(NULL), |
2348 next_block_(NULL), | 2348 next_block_(NULL), |
2349 argument_count_(0), | 2349 argument_count_(0), |
2350 allocator_(allocator), | 2350 allocator_(allocator), |
2351 position_(RelocInfo::kNoPosition), | 2351 position_(RelocInfo::kNoPosition), |
2352 instruction_pending_deoptimization_environment_(NULL), | 2352 instruction_pending_deoptimization_environment_(NULL), |
2353 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } | 2353 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } |
2354 | 2354 |
2355 // Build the sequence for the graph. | 2355 // Build the sequence for the graph. |
2356 LChunk* Build(); | 2356 LPlatformChunk* Build(); |
2357 | 2357 |
2358 // Declare methods that deal with the individual node types. | 2358 // Declare methods that deal with the individual node types. |
2359 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2359 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2360 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2360 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2361 #undef DECLARE_DO | 2361 #undef DECLARE_DO |
2362 | 2362 |
2363 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); | 2363 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); |
2364 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); | 2364 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); |
2365 | 2365 |
2366 private: | 2366 private: |
2367 enum Status { | 2367 enum Status { |
2368 UNUSED, | 2368 UNUSED, |
2369 BUILDING, | 2369 BUILDING, |
2370 DONE, | 2370 DONE, |
2371 ABORTED | 2371 ABORTED |
2372 }; | 2372 }; |
2373 | 2373 |
2374 LChunk* chunk() const { return chunk_; } | 2374 LPlatformChunk* chunk() const { return chunk_; } |
2375 CompilationInfo* info() const { return info_; } | 2375 CompilationInfo* info() const { return info_; } |
2376 HGraph* graph() const { return graph_; } | 2376 HGraph* graph() const { return graph_; } |
2377 Zone* zone() const { return zone_; } | 2377 Zone* zone() const { return zone_; } |
2378 | 2378 |
2379 bool is_unused() const { return status_ == UNUSED; } | 2379 bool is_unused() const { return status_ == UNUSED; } |
2380 bool is_building() const { return status_ == BUILDING; } | 2380 bool is_building() const { return status_ == BUILDING; } |
2381 bool is_done() const { return status_ == DONE; } | 2381 bool is_done() const { return status_ == DONE; } |
2382 bool is_aborted() const { return status_ == ABORTED; } | 2382 bool is_aborted() const { return status_ == ABORTED; } |
2383 | 2383 |
2384 void Abort(const char* format, ...); | 2384 void Abort(const char* format, ...); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 | 2468 |
2469 void VisitInstruction(HInstruction* current); | 2469 void VisitInstruction(HInstruction* current); |
2470 | 2470 |
2471 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2471 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2472 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2472 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2473 LInstruction* DoArithmeticD(Token::Value op, | 2473 LInstruction* DoArithmeticD(Token::Value op, |
2474 HArithmeticBinaryOperation* instr); | 2474 HArithmeticBinaryOperation* instr); |
2475 LInstruction* DoArithmeticT(Token::Value op, | 2475 LInstruction* DoArithmeticT(Token::Value op, |
2476 HArithmeticBinaryOperation* instr); | 2476 HArithmeticBinaryOperation* instr); |
2477 | 2477 |
2478 LChunk* chunk_; | 2478 LPlatformChunk* chunk_; |
2479 CompilationInfo* info_; | 2479 CompilationInfo* info_; |
2480 HGraph* const graph_; | 2480 HGraph* const graph_; |
2481 Zone* zone_; | 2481 Zone* zone_; |
2482 Status status_; | 2482 Status status_; |
2483 HInstruction* current_instruction_; | 2483 HInstruction* current_instruction_; |
2484 HBasicBlock* current_block_; | 2484 HBasicBlock* current_block_; |
2485 HBasicBlock* next_block_; | 2485 HBasicBlock* next_block_; |
2486 int argument_count_; | 2486 int argument_count_; |
2487 LAllocator* allocator_; | 2487 LAllocator* allocator_; |
2488 int position_; | 2488 int position_; |
2489 LInstruction* instruction_pending_deoptimization_environment_; | 2489 LInstruction* instruction_pending_deoptimization_environment_; |
2490 int pending_deoptimization_ast_id_; | 2490 int pending_deoptimization_ast_id_; |
2491 | 2491 |
2492 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2492 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2493 }; | 2493 }; |
2494 | 2494 |
2495 #undef DECLARE_HYDROGEN_ACCESSOR | 2495 #undef DECLARE_HYDROGEN_ACCESSOR |
2496 #undef DECLARE_CONCRETE_INSTRUCTION | 2496 #undef DECLARE_CONCRETE_INSTRUCTION |
2497 | 2497 |
2498 } } // namespace v8::internal | 2498 } } // namespace v8::internal |
2499 | 2499 |
2500 #endif // V8_IA32_LITHIUM_IA32_H_ | 2500 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |