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

Unified Diff: runtime/vm/intermediate_language.h

Issue 105143011: Optimize one byte string comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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_type_propagator.cc ('k') | runtime/vm/intermediate_language_arm.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 31338)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -669,6 +669,7 @@
M(UnaryMintOp) \
M(CheckArrayBound) \
M(Constraint) \
+ M(StringToCharCode) \
M(StringFromCharCode) \
M(StringInterpolate) \
M(InvokeMathCFunction) \
@@ -3697,6 +3698,36 @@
};
+class StringToCharCodeInstr : public TemplateDefinition<1> {
+ public:
+ StringToCharCodeInstr(Value* str, intptr_t cid) : cid_(cid) {
+ ASSERT(str != NULL);
+ SetInputAt(0, str);
+ }
+
+ DECLARE_INSTRUCTION(StringToCharCode)
+ virtual CompileType ComputeType() const;
+
+ Value* str() const { return inputs_[0]; }
+
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+ virtual bool AttributesEqual(Instruction* other) const {
+ return other->AsStringToCharCode()->cid_ == cid_;
+ }
+
+ virtual bool MayThrow() const { return false; }
+
+ private:
+ const intptr_t cid_;
+
+ DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr);
+};
+
+
class StringInterpolateInstr : public TemplateDefinition<1> {
public:
StringInterpolateInstr(Value* value, intptr_t token_pos)
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698