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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11416129: Inline [] operator on one-byte strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: removed unnecessary change Created 8 years, 1 month 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
===================================================================
--- runtime/vm/intermediate_language.h (revision 15197)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -38,6 +38,7 @@
V(_StringBase, get:length, StringBaseLength) \
V(_StringBase, get:isEmpty, StringBaseIsEmpty) \
V(_StringBase, charCodeAt, StringBaseCharCodeAt) \
+ V(_StringBase, [], StringBaseCharAt) \
V(_IntegerImplementation, toDouble, IntegerToDouble) \
V(_Double, toInt, DoubleToInteger) \
V(::, sqrt, MathSqrt) \
@@ -264,7 +265,8 @@
M(UnaryMintOp) \
M(CheckArrayBound) \
M(Constraint) \
- M(StringCharCodeAt)
+ M(StringCharCodeAt) \
+ M(StringFromCharCode)
#define FORWARD_DECLARATION(type) class type##Instr;
@@ -2682,6 +2684,36 @@
};
+class StringFromCharCodeInstr : public TemplateDefinition<1> {
+ public:
+ explicit StringFromCharCodeInstr(Value* char_code) {
+ ASSERT(char_code != NULL);
+ ASSERT(char_code->definition()->IsStringCharCodeAt() &&
+ (char_code->definition()->AsStringCharCodeAt()->class_id() ==
+ kOneByteStringCid));
+ inputs_[0] = char_code;
+ }
+
+ DECLARE_INSTRUCTION(StringFromCharCode)
+ virtual RawAbstractType* CompileType() const;
+
+ Value* char_code() const { return inputs_[0]; }
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool HasSideEffect() const { return false; }
+
+ virtual intptr_t ResultCid() const;
+
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+ virtual bool AffectedBySideEffect() const { return false; }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr);
+};
+
+
class LoadIndexedInstr : public TemplateDefinition<2> {
public:
LoadIndexedInstr(Value* array, Value* index, intptr_t class_id)

Powered by Google App Engine
This is Rietveld 408576698