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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11970038: Remove StringCharCodeAtInstr and handle it as part of LoadIndexed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 17219)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -272,7 +272,6 @@
M(UnaryMintOp) \
M(CheckArrayBound) \
M(Constraint) \
- M(StringCharCodeAt) \
M(StringFromCharCode)
@@ -511,7 +510,6 @@
friend class CheckSmiInstr;
friend class CheckArrayBoundInstr;
friend class CheckEitherNonSmiInstr;
- friend class StringCharCodeAtInstr;
friend class LICM;
friend class DoubleToSmiInstr;
friend class DoubleToDoubleInstr;
@@ -2677,22 +2675,20 @@
};
-class StringCharCodeAtInstr : public TemplateDefinition<2> {
+class LoadIndexedInstr : public TemplateDefinition<2> {
public:
- StringCharCodeAtInstr(Value* receiver,
- Value* index,
- intptr_t class_id)
+ LoadIndexedInstr(Value* array, Value* index, intptr_t class_id)
: class_id_(class_id) {
- ASSERT(receiver != NULL);
+ ASSERT(array != NULL);
ASSERT(index != NULL);
- inputs_[0] = receiver;
+ inputs_[0] = array;
inputs_[1] = index;
}
- DECLARE_INSTRUCTION(StringCharCodeAt)
+ DECLARE_INSTRUCTION(LoadIndexed)
virtual RawAbstractType* CompileType() const;
- Value* receiver() const { return inputs_[0]; }
+ Value* array() const { return inputs_[0]; }
Value* index() const { return inputs_[1]; }
intptr_t class_id() const { return class_id_; }
@@ -2702,6 +2698,8 @@
virtual intptr_t ResultCid() const;
+ virtual Representation representation() const;
+
virtual bool AttributesEqual(Instruction* other) const;
virtual bool AffectedBySideEffect() const { return true; }
@@ -2711,7 +2709,7 @@
private:
const intptr_t class_id_;
- DISALLOW_COPY_AND_ASSIGN(StringCharCodeAtInstr);
+ DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
};
@@ -2720,8 +2718,8 @@
explicit StringFromCharCodeInstr(Value* char_code,
intptr_t cid) : cid_(cid) {
ASSERT(char_code != NULL);
- ASSERT(char_code->definition()->IsStringCharCodeAt() &&
- (char_code->definition()->AsStringCharCodeAt()->class_id() ==
+ ASSERT(char_code->definition()->IsLoadIndexed() &&
+ (char_code->definition()->AsLoadIndexed()->class_id() ==
kOneByteStringCid));
inputs_[0] = char_code;
}
@@ -2748,44 +2746,6 @@
};
-class LoadIndexedInstr : public TemplateDefinition<2> {
- public:
- LoadIndexedInstr(Value* array, Value* index, intptr_t class_id)
- : class_id_(class_id) {
- ASSERT(array != NULL);
- ASSERT(index != NULL);
- inputs_[0] = array;
- inputs_[1] = index;
- }
-
- DECLARE_INSTRUCTION(LoadIndexed)
- virtual RawAbstractType* CompileType() const;
-
- Value* array() const { return inputs_[0]; }
- Value* index() const { return inputs_[1]; }
- intptr_t class_id() const { return class_id_; }
-
- virtual bool CanDeoptimize() const { return false; }
-
- virtual bool HasSideEffect() const { return false; }
-
- virtual intptr_t ResultCid() const;
-
- virtual Representation representation() const;
-
- virtual bool AttributesEqual(Instruction* other) const;
-
- virtual bool AffectedBySideEffect() const { return true; }
-
- virtual void InferRange();
-
- private:
- const intptr_t class_id_;
-
- DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
-};
-
-
class StoreIndexedInstr : public TemplateDefinition<3> {
public:
StoreIndexedInstr(Value* array,
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698