Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
| index 1f3050235109efdb33afc82c33aa39d1fd9594da..1bb9b81d1bddbe2d83d7d16dc8076eefd4900804 100644 |
| --- a/runtime/vm/intermediate_language.h |
| +++ b/runtime/vm/intermediate_language.h |
| @@ -42,6 +42,7 @@ class LocationSummary; |
| M(StrictCompare, StrictCompareComp) \ |
| M(EqualityCompare, EqualityCompareComp) \ |
| M(NativeCall, NativeCallComp) \ |
| + M(LoadIndexed, LoadIndexedComp) \ |
| M(StoreIndexed, StoreIndexedComp) \ |
| M(InstanceSetter, InstanceSetterComp) \ |
| M(StaticSetter, StaticSetterComp) \ |
| @@ -781,6 +782,43 @@ class StoreStaticFieldComp : public TemplateComputation<1> { |
| }; |
| +class LoadIndexedComp : public TemplateComputation<2> { |
| + public: |
| + LoadIndexedComp(intptr_t token_index, |
| + intptr_t try_index, |
| + Value* array, |
| + Value* index) |
| + : token_index_(token_index), |
| + try_index_(try_index), |
| + receiver_type_(kIllegalObjectKind) { |
|
srdjan
2012/06/08 19:16:08
ASSERT array and index are not NULL.
Vyacheslav Egorov (Google)
2012/06/08 19:23:33
Done.
|
| + inputs_[0] = array; |
| + inputs_[1] = index; |
| + } |
| + |
| + DECLARE_COMPUTATION(LoadIndexed) |
| + |
| + intptr_t token_index() const { return token_index_; } |
| + intptr_t try_index() const { return try_index_; } |
| + Value* array() const { return inputs_[0]; } |
| + Value* index() const { return inputs_[1]; } |
| + |
| + void set_receiver_type(ObjectKind receiver_type) { |
| + receiver_type_ = receiver_type; |
| + } |
| + |
| + ObjectKind receiver_type() const { |
| + return receiver_type_; |
| + } |
| + |
| + private: |
| + const intptr_t token_index_; |
| + const intptr_t try_index_; |
| + ObjectKind receiver_type_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LoadIndexedComp); |
| +}; |
| + |
| + |
| // Not simply an InstanceCall because it has somewhat more complicated |
| // semantics: the value operand is preserved before the call. |
| class StoreIndexedComp : public TemplateComputation<3> { |