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

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

Issue 304703002: Split GuardField into GuardFieldType and GuardFieldLength instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 6 years, 6 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) 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 M(BinaryMintOp) \ 740 M(BinaryMintOp) \
741 M(ShiftMintOp) \ 741 M(ShiftMintOp) \
742 M(UnaryMintOp) \ 742 M(UnaryMintOp) \
743 M(CheckArrayBound) \ 743 M(CheckArrayBound) \
744 M(Constraint) \ 744 M(Constraint) \
745 M(StringToCharCode) \ 745 M(StringToCharCode) \
746 M(StringFromCharCode) \ 746 M(StringFromCharCode) \
747 M(StringInterpolate) \ 747 M(StringInterpolate) \
748 M(InvokeMathCFunction) \ 748 M(InvokeMathCFunction) \
749 M(MergedMath) \ 749 M(MergedMath) \
750 M(GuardField) \ 750 M(GuardFieldClass) \
751 M(GuardFieldLength) \
751 M(IfThenElse) \ 752 M(IfThenElse) \
752 M(BinaryFloat32x4Op) \ 753 M(BinaryFloat32x4Op) \
753 M(Simd32x4Shuffle) \ 754 M(Simd32x4Shuffle) \
754 M(Simd32x4ShuffleMix) \ 755 M(Simd32x4ShuffleMix) \
755 M(Simd32x4GetSignMask) \ 756 M(Simd32x4GetSignMask) \
756 M(Float32x4Constructor) \ 757 M(Float32x4Constructor) \
757 M(Float32x4Zero) \ 758 M(Float32x4Zero) \
758 M(Float32x4Splat) \ 759 M(Float32x4Splat) \
759 M(Float32x4Comparison) \ 760 M(Float32x4Comparison) \
760 M(Float32x4MinMax) \ 761 M(Float32x4MinMax) \
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3808 intptr_t deopt_id) 3809 intptr_t deopt_id)
3809 : field_(field) { 3810 : field_(field) {
3810 deopt_id_ = deopt_id; 3811 deopt_id_ = deopt_id;
3811 SetInputAt(0, value); 3812 SetInputAt(0, value);
3812 } 3813 }
3813 3814
3814 Value* value() const { return inputs_[0]; } 3815 Value* value() const { return inputs_[0]; }
3815 3816
3816 const Field& field() const { return field_; } 3817 const Field& field() const { return field_; }
3817 3818
3818 DECLARE_INSTRUCTION(GuardField)
3819
3820 virtual intptr_t ArgumentCount() const { return 0; } 3819 virtual intptr_t ArgumentCount() const { return 0; }
3821 3820
3822 virtual bool CanDeoptimize() const { return true; } 3821 virtual bool CanDeoptimize() const { return true; }
3823 3822 virtual bool CanBecomeDeoptimizationTarget() const {
3824 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 3823 // Ensure that we record kDeopt PC descriptor in unoptimized code.
3825 3824 return true;
3826 virtual void PrintOperandsTo(BufferFormatter* f) const; 3825 }
3827 3826
3828 virtual bool AllowsCSE() const { return true; } 3827 virtual bool AllowsCSE() const { return true; }
3829 virtual EffectSet Effects() const { return EffectSet::None(); } 3828 virtual EffectSet Effects() const { return EffectSet::None(); }
3830 virtual EffectSet Dependencies() const { return EffectSet::None(); } 3829 virtual EffectSet Dependencies() const { return EffectSet::None(); }
3831 virtual bool AttributesEqual(Instruction* other) const;
3832 3830
3833 virtual bool MayThrow() const { return false; } 3831 virtual bool MayThrow() const { return false; }
3834 3832
3833 virtual void PrintOperandsTo(BufferFormatter* f) const;
3834
3835 private: 3835 private:
3836 const Field& field_; 3836 const Field& field_;
3837 3837
3838 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); 3838 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr);
3839 }; 3839 };
3840 3840
3841 3841
3842 class GuardFieldClassInstr : public GuardFieldInstr {
3843 public:
3844 GuardFieldClassInstr(Value* value,
3845 const Field& field,
3846 intptr_t deopt_id)
3847 : GuardFieldInstr(value, field, deopt_id) { }
3848
3849 DECLARE_INSTRUCTION(GuardFieldClass)
3850
3851 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
3852
3853 virtual bool AttributesEqual(Instruction* other) const;
3854
3855 private:
3856 DISALLOW_COPY_AND_ASSIGN(GuardFieldClassInstr);
3857 };
3858
3859
3860 class GuardFieldLengthInstr : public GuardFieldInstr {
3861 public:
3862 GuardFieldLengthInstr(Value* value,
3863 const Field& field,
3864 intptr_t deopt_id)
3865 : GuardFieldInstr(value, field, deopt_id) { }
3866
3867 DECLARE_INSTRUCTION(GuardFieldLength)
3868
3869 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
3870
3871 virtual bool AttributesEqual(Instruction* other) const;
3872
3873 private:
3874 DISALLOW_COPY_AND_ASSIGN(GuardFieldLengthInstr);
3875 };
3876
3877
3842 class LoadStaticFieldInstr : public TemplateDefinition<1> { 3878 class LoadStaticFieldInstr : public TemplateDefinition<1> {
3843 public: 3879 public:
3844 explicit LoadStaticFieldInstr(Value* field_value) { 3880 explicit LoadStaticFieldInstr(Value* field_value) {
3845 ASSERT(field_value->BindsToConstant()); 3881 ASSERT(field_value->BindsToConstant());
3846 SetInputAt(0, field_value); 3882 SetInputAt(0, field_value);
3847 } 3883 }
3848 3884
3849 DECLARE_INSTRUCTION(LoadStaticField) 3885 DECLARE_INSTRUCTION(LoadStaticField)
3850 virtual CompileType ComputeType() const; 3886 virtual CompileType ComputeType() const;
3851 3887
(...skipping 4096 matching lines...) Expand 10 before | Expand all | Expand 10 after
7948 ForwardInstructionIterator* current_iterator_; 7984 ForwardInstructionIterator* current_iterator_;
7949 7985
7950 private: 7986 private:
7951 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7987 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7952 }; 7988 };
7953 7989
7954 7990
7955 } // namespace dart 7991 } // namespace dart
7956 7992
7957 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7993 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698