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

Side by Side Diff: vm/intermediate_language.h

Issue 10825176: Refactor our IL instruction for static setters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 M(StaticCall, StaticCallComp) \ 69 M(StaticCall, StaticCallComp) \
70 M(LoadLocal, LoadLocalComp) \ 70 M(LoadLocal, LoadLocalComp) \
71 M(StoreLocal, StoreLocalComp) \ 71 M(StoreLocal, StoreLocalComp) \
72 M(StrictCompare, StrictCompareComp) \ 72 M(StrictCompare, StrictCompareComp) \
73 M(EqualityCompare, EqualityCompareComp) \ 73 M(EqualityCompare, EqualityCompareComp) \
74 M(RelationalOp, RelationalOpComp) \ 74 M(RelationalOp, RelationalOpComp) \
75 M(NativeCall, NativeCallComp) \ 75 M(NativeCall, NativeCallComp) \
76 M(LoadIndexed, LoadIndexedComp) \ 76 M(LoadIndexed, LoadIndexedComp) \
77 M(StoreIndexed, StoreIndexedComp) \ 77 M(StoreIndexed, StoreIndexedComp) \
78 M(InstanceSetter, InstanceSetterComp) \ 78 M(InstanceSetter, InstanceSetterComp) \
79 M(StaticSetter, StaticSetterComp) \
80 M(LoadInstanceField, LoadInstanceFieldComp) \ 79 M(LoadInstanceField, LoadInstanceFieldComp) \
81 M(StoreInstanceField, StoreInstanceFieldComp) \ 80 M(StoreInstanceField, StoreInstanceFieldComp) \
82 M(LoadStaticField, LoadStaticFieldComp) \ 81 M(LoadStaticField, LoadStaticFieldComp) \
83 M(StoreStaticField, StoreStaticFieldComp) \ 82 M(StoreStaticField, StoreStaticFieldComp) \
84 M(BooleanNegate, BooleanNegateComp) \ 83 M(BooleanNegate, BooleanNegateComp) \
85 M(InstanceOf, InstanceOfComp) \ 84 M(InstanceOf, InstanceOfComp) \
86 M(CreateArray, CreateArrayComp) \ 85 M(CreateArray, CreateArrayComp) \
87 M(CreateClosure, CreateClosureComp) \ 86 M(CreateClosure, CreateClosureComp) \
88 M(AllocateObject, AllocateObjectComp) \ 87 M(AllocateObject, AllocateObjectComp) \
89 M(AllocateObjectWithBoundsCheck, AllocateObjectWithBoundsCheckComp) \ 88 M(AllocateObjectWithBoundsCheck, AllocateObjectWithBoundsCheckComp) \
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 private: 1071 private:
1073 const intptr_t token_pos_; 1072 const intptr_t token_pos_;
1074 const intptr_t try_index_; 1073 const intptr_t try_index_;
1075 const String& field_name_; 1074 const String& field_name_;
1076 ZoneGrowableArray<PushArgumentInstr*>* arguments_; 1075 ZoneGrowableArray<PushArgumentInstr*>* arguments_;
1077 1076
1078 DISALLOW_COPY_AND_ASSIGN(InstanceSetterComp); 1077 DISALLOW_COPY_AND_ASSIGN(InstanceSetterComp);
1079 }; 1078 };
1080 1079
1081 1080
1082 // Not simply a StaticCall because it has somewhat more complicated
1083 // semantics: the value operand is preserved before the call.
1084 class StaticSetterComp : public TemplateComputation<1> {
1085 public:
1086 StaticSetterComp(intptr_t token_pos,
1087 intptr_t try_index,
1088 const Function& setter_function,
1089 Value* value)
1090 : token_pos_(token_pos),
1091 try_index_(try_index),
1092 setter_function_(setter_function) {
1093 inputs_[0] = value;
1094 }
1095
1096 DECLARE_COMPUTATION(StaticSetter)
1097
1098 intptr_t token_pos() const { return token_pos_; }
1099 intptr_t try_index() const { return try_index_; }
1100 const Function& setter_function() const { return setter_function_; }
1101 Value* value() const { return inputs_[0]; }
1102
1103 virtual bool CanDeoptimize() const { return false; }
1104
1105 private:
1106 const intptr_t token_pos_;
1107 const intptr_t try_index_;
1108 const Function& setter_function_;
1109
1110 DISALLOW_COPY_AND_ASSIGN(StaticSetterComp);
1111 };
1112
1113
1114 // Note overrideable, built-in: value? false : true. 1081 // Note overrideable, built-in: value? false : true.
1115 class BooleanNegateComp : public TemplateComputation<1> { 1082 class BooleanNegateComp : public TemplateComputation<1> {
1116 public: 1083 public:
1117 explicit BooleanNegateComp(Value* value) { 1084 explicit BooleanNegateComp(Value* value) {
1118 inputs_[0] = value; 1085 inputs_[0] = value;
1119 } 1086 }
1120 1087
1121 DECLARE_COMPUTATION(BooleanNegate) 1088 DECLARE_COMPUTATION(BooleanNegate)
1122 1089
1123 Value* value() const { return inputs_[0]; } 1090 Value* value() const { return inputs_[0]; }
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 const GrowableArray<BlockEntryInstr*>& block_order_; 2789 const GrowableArray<BlockEntryInstr*>& block_order_;
2823 2790
2824 private: 2791 private:
2825 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2792 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2826 }; 2793 };
2827 2794
2828 2795
2829 } // namespace dart 2796 } // namespace dart
2830 2797
2831 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2798 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « vm/flow_graph_builder.cc ('k') | vm/intermediate_language.cc » ('j') | vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698