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

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: 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
« 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 15244)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -40,6 +40,7 @@
V(_StringBase, get:length, StringBaseLength, 320803993) \
V(_StringBase, get:isEmpty, StringBaseIsEmpty, 1065961093) \
V(_StringBase, charCodeAt, StringBaseCharCodeAt, 984449525) \
+ V(_StringBase, [], StringBaseCharAt, 1062366987) \
V(_IntegerImplementation, toDouble, IntegerToDouble, 1396338041) \
V(_Double, toInt, DoubleToInteger, 362666636) \
V(::, sqrt, MathSqrt, 2232519) \
@@ -266,7 +267,8 @@
M(UnaryMintOp) \
M(CheckArrayBound) \
M(Constraint) \
- M(StringCharCodeAt)
+ M(StringCharCodeAt) \
+ M(StringFromCharCode)
#define FORWARD_DECLARATION(type) class type##Instr;
@@ -2684,6 +2686,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)
« 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