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 LChunk; |
625 class LGap; | 626 class LGap; |
626 class LLabel; | 627 class LLabel; |
627 | 628 |
628 // Superclass providing data and behavior common to all the | 629 // Superclass providing data and behavior common to all the |
629 // arch-specific LChunk classes. | 630 // arch-specific LChunk classes. |
630 class LChunkBase: public ZoneObject { | 631 class LChunkBase: public ZoneObject { |
631 public: | 632 public: |
632 LChunkBase(CompilationInfo* info, HGraph* graph) | 633 static LChunk* NewChunk(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 | 634 |
640 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 635 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
641 LConstantOperand* DefineConstantOperand(HConstant* constant); | 636 LConstantOperand* DefineConstantOperand(HConstant* constant); |
642 HConstant* LookupConstant(LConstantOperand* operand) const; | 637 HConstant* LookupConstant(LConstantOperand* operand) const; |
643 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 638 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
644 | 639 |
645 int ParameterAt(int index); | 640 int ParameterAt(int index); |
646 int GetParameterStackSlot(int index) const; | 641 int GetParameterStackSlot(int index) const; |
647 int spill_slot_count() const { return spill_slot_count_; } | 642 int spill_slot_count() const { return spill_slot_count_; } |
648 CompilationInfo* info() const { return info_; } | 643 CompilationInfo* info() const { return info_; } |
(...skipping 12 matching lines...) Expand all Loading... |
661 const ZoneList<Handle<JSFunction> >* inlined_closures() const { | 656 const ZoneList<Handle<JSFunction> >* inlined_closures() const { |
662 return &inlined_closures_; | 657 return &inlined_closures_; |
663 } | 658 } |
664 | 659 |
665 void AddInlinedClosure(Handle<JSFunction> closure) { | 660 void AddInlinedClosure(Handle<JSFunction> closure) { |
666 inlined_closures_.Add(closure, zone()); | 661 inlined_closures_.Add(closure, zone()); |
667 } | 662 } |
668 | 663 |
669 Zone* zone() const { return info_->zone(); } | 664 Zone* zone() const { return info_->zone(); } |
670 | 665 |
| 666 Handle<Code> Codegen(); |
| 667 |
671 protected: | 668 protected: |
| 669 LChunkBase(CompilationInfo* info, HGraph* graph) |
| 670 : spill_slot_count_(0), |
| 671 info_(info), |
| 672 graph_(graph), |
| 673 instructions_(32, graph->zone()), |
| 674 pointer_maps_(8, graph->zone()), |
| 675 inlined_closures_(1, graph->zone()) { } |
| 676 |
672 int spill_slot_count_; | 677 int spill_slot_count_; |
673 | 678 |
674 private: | 679 private: |
675 CompilationInfo* info_; | 680 CompilationInfo* info_; |
676 HGraph* const graph_; | 681 HGraph* const graph_; |
677 ZoneList<LInstruction*> instructions_; | 682 ZoneList<LInstruction*> instructions_; |
678 ZoneList<LPointerMap*> pointer_maps_; | 683 ZoneList<LPointerMap*> pointer_maps_; |
679 ZoneList<Handle<JSFunction> > inlined_closures_; | 684 ZoneList<Handle<JSFunction> > inlined_closures_; |
680 }; | 685 }; |
681 | 686 |
682 | 687 |
683 int ElementsKindToShiftSize(ElementsKind elements_kind); | 688 int ElementsKindToShiftSize(ElementsKind elements_kind); |
684 | 689 |
685 | 690 |
686 } } // namespace v8::internal | 691 } } // namespace v8::internal |
687 | 692 |
688 #endif // V8_LITHIUM_H_ | 693 #endif // V8_LITHIUM_H_ |
OLD | NEW |