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

Unified Diff: runtime/vm/intermediate_language.h

Issue 9635016: Support compilation of ArrayNode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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_compiler_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 28e2da0e86948f076ef2a6cbca4dad05ab6b70bc..c6796ab7c84e8230f29568e8363a04c65bc71b4b 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -65,7 +65,8 @@ class LocalVariable;
M(LoadStaticField, LoadStaticFieldComp) \
M(StoreStaticField, StoreStaticFieldComp) \
M(BooleanNegate, BooleanNegateComp) \
- M(InstanceOf, InstanceOfComp)
+ M(InstanceOf, InstanceOfComp) \
+ M(CreateArray, CreateArrayComp) \
#define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
@@ -305,7 +306,7 @@ class LoadInstanceFieldComp : public Computation {
ASSERT(instance_ != NULL);
}
- DECLARE_COMPUTATION(LoadInstanceFieldComp)
+ DECLARE_COMPUTATION(LoadInstanceField)
const Field& field() const { return ast_node_.field(); }
@@ -329,7 +330,7 @@ class StoreInstanceFieldComp : public Computation {
ASSERT(value_ != NULL);
}
- DECLARE_COMPUTATION(StoreInstanceFieldComp)
+ DECLARE_COMPUTATION(StoreInstanceField)
intptr_t node_id() const { return ast_node_.id(); }
intptr_t token_index() const { return ast_node_.token_index(); }
@@ -351,7 +352,7 @@ class LoadStaticFieldComp : public Computation {
public:
explicit LoadStaticFieldComp(const Field& field) : field_(field) {}
- DECLARE_COMPUTATION(LoadStaticFieldComp);
+ DECLARE_COMPUTATION(LoadStaticField);
const Field& field() const { return field_; }
@@ -371,7 +372,7 @@ class StoreStaticFieldComp : public Computation {
ASSERT(value != NULL);
}
- DECLARE_COMPUTATION(StoreStaticFieldComp);
+ DECLARE_COMPUTATION(StoreStaticField);
const Field& field() const { return field_; }
Value* value() const { return value_; }
@@ -457,7 +458,7 @@ class BooleanNegateComp : public Computation {
public:
explicit BooleanNegateComp(Value* value) : value_(value) {}
- DECLARE_COMPUTATION(BooleanNegateComp)
+ DECLARE_COMPUTATION(BooleanNegate)
Value* value() const { return value_; }
@@ -481,7 +482,7 @@ class InstanceOfComp : public Computation {
type_(type),
negate_result_(negate_result) {}
- DECLARE_COMPUTATION(InstanceOfComp)
+ DECLARE_COMPUTATION(InstanceOf)
Value* value() const { return value_; }
bool negate_result() const { return negate_result_; }
@@ -498,6 +499,28 @@ class InstanceOfComp : public Computation {
};
+class CreateArrayComp : public Computation {
+ public:
+ CreateArrayComp(ArrayNode* node, ZoneGrowableArray<Value*>* elements)
+ : ast_node_(*node), elements_(elements) { }
+
+ DECLARE_COMPUTATION(CreateArray)
+
+ intptr_t token_index() const { return ast_node_.token_index(); }
+ const AbstractTypeArguments& type_arguments() const {
+ return ast_node_.type_arguments();
+ }
+ intptr_t ElementCount() const { return elements_->length(); }
+ Value* ElementAt(intptr_t i) const { return (*elements_)[i]; }
+
+ private:
+ const ArrayNode& ast_node_;
+ ZoneGrowableArray<Value*>* const elements_;
+
+ DISALLOW_COPY_AND_ASSIGN(CreateArrayComp);
+};
+
+
#undef DECLARE_COMPUTATION
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698