OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_LITHIUM_H_ | 5 #ifndef V8_LITHIUM_H_ |
6 #define V8_LITHIUM_H_ | 6 #define V8_LITHIUM_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 658 } |
659 | 659 |
660 void AddInlinedFunction(Handle<SharedFunctionInfo> closure) { | 660 void AddInlinedFunction(Handle<SharedFunctionInfo> closure) { |
661 inlined_functions_.Add(closure, zone()); | 661 inlined_functions_.Add(closure, zone()); |
662 } | 662 } |
663 | 663 |
664 void AddDeprecationDependency(Handle<Map> map) { | 664 void AddDeprecationDependency(Handle<Map> map) { |
665 DCHECK(!map->is_deprecated()); | 665 DCHECK(!map->is_deprecated()); |
666 if (!map->CanBeDeprecated()) return; | 666 if (!map->CanBeDeprecated()) return; |
667 DCHECK(!info_->IsStub()); | 667 DCHECK(!info_->IsStub()); |
668 deprecation_dependencies_.insert(map); | 668 deprecation_dependencies_.Add(map, zone()); |
669 } | 669 } |
670 | 670 |
671 void AddStabilityDependency(Handle<Map> map) { | 671 void AddStabilityDependency(Handle<Map> map) { |
672 DCHECK(map->is_stable()); | 672 DCHECK(map->is_stable()); |
673 if (!map->CanTransition()) return; | 673 if (!map->CanTransition()) return; |
674 DCHECK(!info_->IsStub()); | 674 DCHECK(!info_->IsStub()); |
675 stability_dependencies_.insert(map); | 675 stability_dependencies_.Add(map, zone()); |
676 } | 676 } |
677 | 677 |
678 Zone* zone() const { return info_->zone(); } | 678 Zone* zone() const { return info_->zone(); } |
679 | 679 |
680 Handle<Code> Codegen(); | 680 Handle<Code> Codegen(); |
681 | 681 |
682 void set_allocated_double_registers(BitVector* allocated_registers); | 682 void set_allocated_double_registers(BitVector* allocated_registers); |
683 BitVector* allocated_double_registers() { | 683 BitVector* allocated_double_registers() { |
684 return allocated_double_registers_; | 684 return allocated_double_registers_; |
685 } | 685 } |
686 | 686 |
687 protected: | 687 protected: |
688 LChunk(CompilationInfo* info, HGraph* graph); | 688 LChunk(CompilationInfo* info, HGraph* graph); |
689 | 689 |
690 int spill_slot_count_; | 690 int spill_slot_count_; |
691 | 691 |
692 private: | 692 private: |
693 typedef std::less<Handle<Map> > MapLess; | |
694 typedef zone_allocator<Handle<Map> > MapAllocator; | |
695 typedef std::set<Handle<Map>, MapLess, MapAllocator> MapSet; | |
696 | |
697 void RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const; | 693 void RegisterWeakObjectsInOptimizedCode(Handle<Code> code) const; |
698 void CommitDependencies(Handle<Code> code) const; | 694 void CommitDependencies(Handle<Code> code) const; |
699 | 695 |
700 CompilationInfo* info_; | 696 CompilationInfo* info_; |
701 HGraph* const graph_; | 697 HGraph* const graph_; |
702 BitVector* allocated_double_registers_; | 698 BitVector* allocated_double_registers_; |
703 ZoneList<LInstruction*> instructions_; | 699 ZoneList<LInstruction*> instructions_; |
704 ZoneList<LPointerMap*> pointer_maps_; | 700 ZoneList<LPointerMap*> pointer_maps_; |
705 ZoneList<Handle<SharedFunctionInfo>> inlined_functions_; | 701 ZoneList<Handle<SharedFunctionInfo>> inlined_functions_; |
706 MapSet deprecation_dependencies_; | 702 ZoneList<Handle<Map>> deprecation_dependencies_; |
707 MapSet stability_dependencies_; | 703 ZoneList<Handle<Map>> stability_dependencies_; |
708 }; | 704 }; |
709 | 705 |
710 | 706 |
711 class LChunkBuilderBase BASE_EMBEDDED { | 707 class LChunkBuilderBase BASE_EMBEDDED { |
712 public: | 708 public: |
713 explicit LChunkBuilderBase(CompilationInfo* info, HGraph* graph) | 709 explicit LChunkBuilderBase(CompilationInfo* info, HGraph* graph) |
714 : argument_count_(0), | 710 : argument_count_(0), |
715 chunk_(NULL), | 711 chunk_(NULL), |
716 info_(info), | 712 info_(info), |
717 graph_(graph), | 713 graph_(graph), |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 private: | 831 private: |
836 InputIterator input_iterator_; | 832 InputIterator input_iterator_; |
837 DeepIterator env_iterator_; | 833 DeepIterator env_iterator_; |
838 }; | 834 }; |
839 | 835 |
840 class LInstruction; | 836 class LInstruction; |
841 class LCodeGen; | 837 class LCodeGen; |
842 } } // namespace v8::internal | 838 } } // namespace v8::internal |
843 | 839 |
844 #endif // V8_LITHIUM_H_ | 840 #endif // V8_LITHIUM_H_ |
OLD | NEW |