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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 void SkipUninteresting() { | 615 void SkipUninteresting() { |
616 while (current_iterator_.env() != NULL && current_iterator_.Done()) { | 616 while (current_iterator_.env() != NULL && current_iterator_.Done()) { |
617 current_iterator_ = ShallowIterator(current_iterator_.env()->outer()); | 617 current_iterator_ = ShallowIterator(current_iterator_.env()->outer()); |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 ShallowIterator current_iterator_; | 621 ShallowIterator current_iterator_; |
622 }; | 622 }; |
623 | 623 |
624 | 624 |
| 625 class LGap; |
| 626 class LLabel; |
| 627 |
| 628 // Superclass providing data and behavior common to all the |
| 629 // arch-specific LChunk classes. |
| 630 class LChunkBase: public ZoneObject { |
| 631 public: |
| 632 LChunkBase(CompilationInfo* info, HGraph* graph) |
| 633 : spill_slot_count_(0), |
| 634 info_(info), |
| 635 graph_(graph), |
| 636 instructions_(32, graph->zone()), |
| 637 pointer_maps_(8, graph->zone()), |
| 638 inlined_closures_(1, graph->zone()) { } |
| 639 |
| 640 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
| 641 LConstantOperand* DefineConstantOperand(HConstant* constant); |
| 642 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
| 643 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
| 644 |
| 645 int ParameterAt(int index); |
| 646 int GetParameterStackSlot(int index) const; |
| 647 int spill_slot_count() const { return spill_slot_count_; } |
| 648 CompilationInfo* info() const { return info_; } |
| 649 HGraph* graph() const { return graph_; } |
| 650 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } |
| 651 void AddGapMove(int index, LOperand* from, LOperand* to); |
| 652 LGap* GetGapAt(int index) const; |
| 653 bool IsGapAt(int index) const; |
| 654 int NearestGapPos(int index) const; |
| 655 void MarkEmptyBlocks(); |
| 656 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } |
| 657 LLabel* GetLabel(int block_id) const; |
| 658 int LookupDestination(int block_id) const; |
| 659 Label* GetAssemblyLabel(int block_id) const; |
| 660 |
| 661 const ZoneList<Handle<JSFunction> >* inlined_closures() const { |
| 662 return &inlined_closures_; |
| 663 } |
| 664 |
| 665 void AddInlinedClosure(Handle<JSFunction> closure) { |
| 666 inlined_closures_.Add(closure, zone()); |
| 667 } |
| 668 |
| 669 Zone* zone() const { return info_->zone(); } |
| 670 |
| 671 protected: |
| 672 int spill_slot_count_; |
| 673 |
| 674 private: |
| 675 CompilationInfo* info_; |
| 676 HGraph* const graph_; |
| 677 ZoneList<LInstruction*> instructions_; |
| 678 ZoneList<LPointerMap*> pointer_maps_; |
| 679 ZoneList<Handle<JSFunction> > inlined_closures_; |
| 680 }; |
| 681 |
| 682 |
625 int ElementsKindToShiftSize(ElementsKind elements_kind); | 683 int ElementsKindToShiftSize(ElementsKind elements_kind); |
626 | 684 |
627 | 685 |
628 } } // namespace v8::internal | 686 } } // namespace v8::internal |
629 | 687 |
630 #endif // V8_LITHIUM_H_ | 688 #endif // V8_LITHIUM_H_ |
OLD | NEW |