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

Unified Diff: runtime/vm/intermediate_language.h

Issue 27192005: Add new style of string interpolation optimization: new nodes, working constant folding. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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_type_propagator.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 28731)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -302,6 +302,9 @@
// Create non-nullable Int type.
static CompileType Int();
+ // Create non-nullable String type.
+ static CompileType String();
+
// Perform a join operation over the type lattice.
void Union(CompileType* other);
@@ -650,6 +653,7 @@
M(CheckArrayBound) \
M(Constraint) \
M(StringFromCharCode) \
+ M(StringInterpolate) \
M(InvokeMathCFunction) \
M(GuardField) \
M(IfThenElse) \
@@ -3649,6 +3653,34 @@
};
+class StringInterpolateInstr : public TemplateDefinition<1> {
+ public:
+ StringInterpolateInstr(Value* value, intptr_t token_pos)
+ : token_pos_(token_pos), function_(Function::Handle()) {
+ SetInputAt(0, value);
+ }
+
+ Value* value() const { return inputs_[0]; }
+ intptr_t token_pos() const { return token_pos_; }
+
+ virtual CompileType ComputeType() const;
+ // Issues a static call to Dart code whihc calls toString on objects.
+ virtual EffectSet Effects() const { return EffectSet::All(); }
+ virtual bool CanDeoptimize() const { return true; }
+ virtual bool MayThrow() const { return true; }
+
+ const Function& CallFunction() const;
+
+ DECLARE_INSTRUCTION(StringInterpolate)
+
+ private:
+ const intptr_t token_pos_;
+ Function& function_;
+
+ DISALLOW_COPY_AND_ASSIGN(StringInterpolateInstr);
+};
+
+
class StoreIndexedInstr : public TemplateDefinition<3> {
public:
StoreIndexedInstr(Value* array,
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698