Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
| index a3266fabf9dd230c416e4c4ccdd19f88a2326070..6e8bf299fbf974712a7dfe5d417744ed8c49bd85 100644 |
| --- a/runtime/vm/intermediate_language.h |
| +++ b/runtime/vm/intermediate_language.h |
| @@ -6488,7 +6488,8 @@ class CheckSmiInstr : public TemplateInstruction<1> { |
| class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| public: |
| - CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { |
| + CheckArrayBoundInstr(const Field* field, Value* length, Value* index, |
| + intptr_t deopt_id) : field_(field) { |
|
srdjan
2013/08/27 15:50:33
Why store field instead of guarded_list _length or
|
| SetInputAt(kLengthPos, length); |
| SetInputAt(kIndexPos, index); |
| // Override generated deopt-id. |
| @@ -6508,6 +6509,11 @@ class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| + intptr_t GetGuardedArrayLength() const { |
| + if (field_ == NULL) return Field::kNoFixedLength; |
|
Florian Schneider
2013/08/27 12:51:34
Style suggestion:
return (field_ == NULL) ? Field
|
| + return field_->guarded_list_length(); |
| + } |
| + |
| // Returns the length offset for array and string types. |
| static intptr_t LengthOffsetFor(intptr_t class_id); |
| @@ -6526,6 +6532,7 @@ class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| kLengthPos = 0, |
| kIndexPos = 1 |
| }; |
| + const Field* field_; |
| DISALLOW_COPY_AND_ASSIGN(CheckArrayBoundInstr); |
| }; |