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

Unified Diff: runtime/vm/intermediate_language.h

Issue 23584002: Replace guarded list length field loads with constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698