Chromium Code Reviews| 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 LChunkBase(CompilationInfo* info, HGraph* graph) |
| 633 : spill_slot_count_(0), | 634 : spill_slot_count_(0), |
| 634 info_(info), | 635 info_(info), |
| 635 graph_(graph), | 636 graph_(graph), |
| 636 instructions_(32, graph->zone()), | 637 instructions_(32, graph->zone()), |
| 637 pointer_maps_(8, graph->zone()), | 638 pointer_maps_(8, graph->zone()), |
| 638 inlined_closures_(1, graph->zone()) { } | 639 inlined_closures_(1, graph->zone()) { } |
| 639 | 640 |
| 641 static LChunk* NewChunk(HGraph* graph); | |
| 642 | |
| 640 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 643 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
| 641 LConstantOperand* DefineConstantOperand(HConstant* constant); | 644 LConstantOperand* DefineConstantOperand(HConstant* constant); |
| 642 HConstant* LookupConstant(LConstantOperand* operand) const; | 645 HConstant* LookupConstant(LConstantOperand* operand) const; |
| 643 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 646 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
| 644 | 647 |
| 645 int ParameterAt(int index); | 648 int ParameterAt(int index); |
| 646 int GetParameterStackSlot(int index) const; | 649 int GetParameterStackSlot(int index) const; |
| 647 int spill_slot_count() const { return spill_slot_count_; } | 650 int spill_slot_count() const { return spill_slot_count_; } |
| 648 CompilationInfo* info() const { return info_; } | 651 CompilationInfo* info() const { return info_; } |
| 649 HGraph* graph() const { return graph_; } | 652 HGraph* graph() const { return graph_; } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 663 } | 666 } |
| 664 | 667 |
| 665 void AddInlinedClosure(Handle<JSFunction> closure) { | 668 void AddInlinedClosure(Handle<JSFunction> closure) { |
| 666 inlined_closures_.Add(closure, zone()); | 669 inlined_closures_.Add(closure, zone()); |
| 667 } | 670 } |
| 668 | 671 |
| 669 Zone* zone() const { return info_->zone(); } | 672 Zone* zone() const { return info_->zone(); } |
| 670 | 673 |
| 671 protected: | 674 protected: |
| 672 int spill_slot_count_; | 675 int spill_slot_count_; |
| 676 static Handle<Code> Codegen(LChunk* chunk); | |
|
danno
2012/07/12 08:38:03
Why do you need to make this static? If you make i
sanjoy
2012/07/12 09:06:49
As I mentioned, LCodeGen specifically needs an LCh
| |
| 673 | 677 |
| 674 private: | 678 private: |
| 675 CompilationInfo* info_; | 679 CompilationInfo* info_; |
| 676 HGraph* const graph_; | 680 HGraph* const graph_; |
| 677 ZoneList<LInstruction*> instructions_; | 681 ZoneList<LInstruction*> instructions_; |
| 678 ZoneList<LPointerMap*> pointer_maps_; | 682 ZoneList<LPointerMap*> pointer_maps_; |
| 679 ZoneList<Handle<JSFunction> > inlined_closures_; | 683 ZoneList<Handle<JSFunction> > inlined_closures_; |
| 680 }; | 684 }; |
| 681 | 685 |
| 682 | 686 |
| 683 int ElementsKindToShiftSize(ElementsKind elements_kind); | 687 int ElementsKindToShiftSize(ElementsKind elements_kind); |
| 684 | 688 |
| 685 | 689 |
| 686 } } // namespace v8::internal | 690 } } // namespace v8::internal |
| 687 | 691 |
| 688 #endif // V8_LITHIUM_H_ | 692 #endif // V8_LITHIUM_H_ |
| OLD | NEW |