Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| =================================================================== |
| --- runtime/vm/intermediate_language.h (revision 22689) |
| +++ runtime/vm/intermediate_language.h (working copy) |
| @@ -6152,13 +6152,13 @@ |
| intptr_t array_type, |
| InstanceCallInstr* instance_call) |
| : array_type_(array_type) { |
| - SetInputAt(0, length); |
| - SetInputAt(1, index); |
| + SetInputAt(locLength, length); |
| + SetInputAt(locIndex, index); |
| deopt_id_ = instance_call->deopt_id(); |
| } |
| - Value* length() const { return inputs_[0]; } |
| - Value* index() const { return inputs_[1]; } |
| + Value* length() const { return inputs_[locLength]; } |
| + Value* index() const { return inputs_[locIndex]; } |
| intptr_t array_type() const { return array_type_; } |
| @@ -6170,6 +6170,8 @@ |
| bool IsRedundant(RangeBoundary length); |
| + virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| + |
| // Returns the length offset for array and string types. |
| static intptr_t LengthOffsetFor(intptr_t class_id); |
| @@ -6183,6 +6185,11 @@ |
| virtual bool MayThrow() const { return false; } |
| private: |
| + // Give a name to the location/input indices. |
| + enum { |
| + locLength = 0, |
| + locIndex = 1 |
|
srdjan
2013/05/14 18:11:47
Optional: prefix constant with k, call it kLengthP
Ivan Posva
2013/05/14 18:30:30
Done + simplified the code where we use the length
|
| + }; |
| intptr_t array_type_; |
| DISALLOW_COPY_AND_ASSIGN(CheckArrayBoundInstr); |