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

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

Issue 266633007: Merge ConstantInstr -> UnboxDouble to UnboxedConstant. Reduces register usage and allows for variou… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 M(CheckStackOverflow) \ 714 M(CheckStackOverflow) \
715 M(SmiToDouble) \ 715 M(SmiToDouble) \
716 M(DoubleToInteger) \ 716 M(DoubleToInteger) \
717 M(DoubleToSmi) \ 717 M(DoubleToSmi) \
718 M(DoubleToDouble) \ 718 M(DoubleToDouble) \
719 M(DoubleToFloat) \ 719 M(DoubleToFloat) \
720 M(FloatToDouble) \ 720 M(FloatToDouble) \
721 M(CheckClass) \ 721 M(CheckClass) \
722 M(CheckSmi) \ 722 M(CheckSmi) \
723 M(Constant) \ 723 M(Constant) \
724 M(UnboxedConstant) \
724 M(CheckEitherNonSmi) \ 725 M(CheckEitherNonSmi) \
725 M(BinaryDoubleOp) \ 726 M(BinaryDoubleOp) \
726 M(MathUnary) \ 727 M(MathUnary) \
727 M(MathMinMax) \ 728 M(MathMinMax) \
728 M(UnboxDouble) \ 729 M(UnboxDouble) \
729 M(BoxDouble) \ 730 M(BoxDouble) \
730 M(BoxFloat32x4) \ 731 M(BoxFloat32x4) \
731 M(UnboxFloat32x4) \ 732 M(UnboxFloat32x4) \
732 M(BoxInt32x4) \ 733 M(BoxInt32x4) \
733 M(UnboxInt32x4) \ 734 M(UnboxInt32x4) \
(...skipping 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 2739
2739 virtual bool MayThrow() const { return false; } 2740 virtual bool MayThrow() const { return false; }
2740 2741
2741 private: 2742 private:
2742 const Object& value_; 2743 const Object& value_;
2743 2744
2744 DISALLOW_COPY_AND_ASSIGN(ConstantInstr); 2745 DISALLOW_COPY_AND_ASSIGN(ConstantInstr);
2745 }; 2746 };
2746 2747
2747 2748
2749 // Merged ConstantInstr -> UnboxedXXX into UnboxedConstantInstr.
2750 // TODO(srdjan): Implemented currently for doubles only, should implement
2751 // for other unboxing instructions.
2752 class UnboxedConstantInstr : public ConstantInstr {
2753 public:
2754 explicit UnboxedConstantInstr(const Object& value);
2755
2756 virtual Representation representation() const {
2757 return kUnboxedDouble;
2758 }
2759
2760 // Either NULL or the address of the unboxed constant.
2761 uword constant_address() const { return constant_address_; }
2762
2763 DECLARE_INSTRUCTION(UnboxedConstant)
2764
2765 private:
2766 uword constant_address_; // Either NULL or points to the untagged constant.
2767
2768 DISALLOW_COPY_AND_ASSIGN(UnboxedConstantInstr);
2769 };
2770
2771
2748 class AssertAssignableInstr : public TemplateDefinition<3> { 2772 class AssertAssignableInstr : public TemplateDefinition<3> {
2749 public: 2773 public:
2750 AssertAssignableInstr(intptr_t token_pos, 2774 AssertAssignableInstr(intptr_t token_pos,
2751 Value* value, 2775 Value* value,
2752 Value* instantiator, 2776 Value* instantiator,
2753 Value* instantiator_type_arguments, 2777 Value* instantiator_type_arguments,
2754 const AbstractType& dst_type, 2778 const AbstractType& dst_type,
2755 const String& dst_name) 2779 const String& dst_name)
2756 : token_pos_(token_pos), 2780 : token_pos_(token_pos),
2757 dst_type_(AbstractType::ZoneHandle(dst_type.raw())), 2781 dst_type_(AbstractType::ZoneHandle(dst_type.raw())),
(...skipping 5158 matching lines...) Expand 10 before | Expand all | Expand 10 after
7916 ForwardInstructionIterator* current_iterator_; 7940 ForwardInstructionIterator* current_iterator_;
7917 7941
7918 private: 7942 private:
7919 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7943 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7920 }; 7944 };
7921 7945
7922 7946
7923 } // namespace dart 7947 } // namespace dart
7924 7948
7925 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7949 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698