Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 10832126: Store pointer instead of reference to LocalVariable in ast and flow graph. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 const Array& argument_names_; 752 const Array& argument_names_;
753 ZoneGrowableArray<PushArgumentInstr*>* arguments_; 753 ZoneGrowableArray<PushArgumentInstr*>* arguments_;
754 MethodRecognizer::Kind recognized_; 754 MethodRecognizer::Kind recognized_;
755 755
756 DISALLOW_COPY_AND_ASSIGN(StaticCallComp); 756 DISALLOW_COPY_AND_ASSIGN(StaticCallComp);
757 }; 757 };
758 758
759 759
760 class LoadLocalComp : public TemplateComputation<0> { 760 class LoadLocalComp : public TemplateComputation<0> {
761 public: 761 public:
762 LoadLocalComp(const LocalVariable& local, intptr_t context_level) 762 LoadLocalComp(const LocalVariable* local, intptr_t context_level)
763 : local_(local), 763 : local_(local),
764 context_level_(context_level) { } 764 context_level_(context_level) {
765 ASSERT(local_ != NULL);
766 }
765 767
766 DECLARE_COMPUTATION(LoadLocal) 768 DECLARE_COMPUTATION(LoadLocal)
767 769
768 const LocalVariable& local() const { return local_; } 770 const LocalVariable* local() const { return local_; }
769 intptr_t context_level() const { return context_level_; } 771 intptr_t context_level() const { return context_level_; }
770 772
771 virtual void PrintOperandsTo(BufferFormatter* f) const; 773 virtual void PrintOperandsTo(BufferFormatter* f) const;
772 774
773 virtual bool CanDeoptimize() const { return false; } 775 virtual bool CanDeoptimize() const { return false; }
774 776
775 private: 777 private:
776 const LocalVariable& local_; 778 const LocalVariable* local_;
777 const intptr_t context_level_; 779 const intptr_t context_level_;
778 780
779 DISALLOW_COPY_AND_ASSIGN(LoadLocalComp); 781 DISALLOW_COPY_AND_ASSIGN(LoadLocalComp);
780 }; 782 };
781 783
782 784
783 class StoreLocalComp : public TemplateComputation<1> { 785 class StoreLocalComp : public TemplateComputation<1> {
784 public: 786 public:
785 StoreLocalComp(const LocalVariable& local, 787 StoreLocalComp(const LocalVariable* local,
786 Value* value, 788 Value* value,
787 intptr_t context_level) 789 intptr_t context_level)
788 : local_(local), 790 : local_(local),
789 context_level_(context_level) { 791 context_level_(context_level) {
792 ASSERT(local_ != NULL);
790 inputs_[0] = value; 793 inputs_[0] = value;
791 } 794 }
792 795
793 DECLARE_COMPUTATION(StoreLocal) 796 DECLARE_COMPUTATION(StoreLocal)
794 797
795 const LocalVariable& local() const { return local_; } 798 const LocalVariable* local() const { return local_; }
796 Value* value() const { return inputs_[0]; } 799 Value* value() const { return inputs_[0]; }
797 intptr_t context_level() const { return context_level_; } 800 intptr_t context_level() const { return context_level_; }
798 801
799 virtual void RecordAssignedVars(BitVector* assigned_vars, 802 virtual void RecordAssignedVars(BitVector* assigned_vars,
800 intptr_t fixed_parameter_count); 803 intptr_t fixed_parameter_count);
801 804
802 virtual void PrintOperandsTo(BufferFormatter* f) const; 805 virtual void PrintOperandsTo(BufferFormatter* f) const;
803 806
804 virtual bool CanDeoptimize() const { return false; } 807 virtual bool CanDeoptimize() const { return false; }
805 808
806 private: 809 private:
807 const LocalVariable& local_; 810 const LocalVariable* local_;
808 const intptr_t context_level_; 811 const intptr_t context_level_;
809 812
810 DISALLOW_COPY_AND_ASSIGN(StoreLocalComp); 813 DISALLOW_COPY_AND_ASSIGN(StoreLocalComp);
811 }; 814 };
812 815
813 816
814 class NativeCallComp : public TemplateComputation<0> { 817 class NativeCallComp : public TemplateComputation<0> {
815 public: 818 public:
816 NativeCallComp(NativeBodyNode* node, intptr_t try_index) 819 NativeCallComp(NativeBodyNode* node, intptr_t try_index)
817 : ast_node_(*node), try_index_(try_index) {} 820 : ast_node_(*node), try_index_(try_index) {}
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 private: 1561 private:
1559 const intptr_t token_pos_; 1562 const intptr_t token_pos_;
1560 const intptr_t try_index_; 1563 const intptr_t try_index_;
1561 1564
1562 DISALLOW_COPY_AND_ASSIGN(CloneContextComp); 1565 DISALLOW_COPY_AND_ASSIGN(CloneContextComp);
1563 }; 1566 };
1564 1567
1565 1568
1566 class CatchEntryComp : public TemplateComputation<0> { 1569 class CatchEntryComp : public TemplateComputation<0> {
1567 public: 1570 public:
1568 CatchEntryComp(const LocalVariable& exception_var, 1571 CatchEntryComp(const LocalVariable* exception_var,
1569 const LocalVariable& stacktrace_var) 1572 const LocalVariable* stacktrace_var)
1570 : exception_var_(exception_var), stacktrace_var_(stacktrace_var) {} 1573 : exception_var_(exception_var), stacktrace_var_(stacktrace_var) {
1574 ASSERT(exception_var_ != NULL);
1575 ASSERT(stacktrace_var_ != NULL);
1576 }
1571 1577
1572 const LocalVariable& exception_var() const { return exception_var_; } 1578 const LocalVariable* exception_var() const { return exception_var_; }
1573 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } 1579 const LocalVariable* stacktrace_var() const { return stacktrace_var_; }
1574 1580
1575 DECLARE_COMPUTATION(CatchEntry) 1581 DECLARE_COMPUTATION(CatchEntry)
1576 1582
1577 virtual void PrintOperandsTo(BufferFormatter* f) const; 1583 virtual void PrintOperandsTo(BufferFormatter* f) const;
1578 1584
1579 virtual bool CanDeoptimize() const { return false; } 1585 virtual bool CanDeoptimize() const { return false; }
1580 1586
1581 private: 1587 private:
1582 const LocalVariable& exception_var_; 1588 const LocalVariable* exception_var_;
1583 const LocalVariable& stacktrace_var_; 1589 const LocalVariable* stacktrace_var_;
1584 1590
1585 DISALLOW_COPY_AND_ASSIGN(CatchEntryComp); 1591 DISALLOW_COPY_AND_ASSIGN(CatchEntryComp);
1586 }; 1592 };
1587 1593
1588 1594
1589 class BinaryOpComp : public TemplateComputation<2> { 1595 class BinaryOpComp : public TemplateComputation<2> {
1590 public: 1596 public:
1591 enum OperandsType { 1597 enum OperandsType {
1592 kDynamicOperands, 1598 kDynamicOperands,
1593 kSmiOperands, 1599 kSmiOperands,
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 const GrowableArray<BlockEntryInstr*>& block_order_; 2828 const GrowableArray<BlockEntryInstr*>& block_order_;
2823 2829
2824 private: 2830 private:
2825 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2831 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2826 }; 2832 };
2827 2833
2828 2834
2829 } // namespace dart 2835 } // namespace dart
2830 2836
2831 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2837 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698