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

Unified Diff: runtime/vm/intermediate_language.h

Issue 9703080: Split the computation of uninstantiated type arguments between the factory case (Closed) Base URL: http://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
===================================================================
--- runtime/vm/intermediate_language.h (revision 5536)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -43,7 +43,9 @@
// | Throw <Value>
// | ReThrow <Value> <Value>
// | NativeLoadField <Value> <intptr_t>
-// | ExtractTypeArgumentsComp <ConstructorCallNode> <Value>
+// | ExtractFactoryTypeArgumentsComp <ConstructorCallNode> <Value>
+// | ExtractConstructorTypeArgumentsComp <ConstructorCallNode> <Value>
+// | ExtractConstructorInstantiatorComp <ConstructorCallNode> <Value> <Value>
//
// <Value> ::=
// Temp <int>
@@ -83,7 +85,9 @@
M(Throw, ThrowComp) \
M(ReThrow, ReThrowComp) \
M(NativeLoadField, NativeLoadFieldComp) \
- M(ExtractTypeArguments, ExtractTypeArgumentsComp) \
+ M(ExtractFactoryTypeArguments, ExtractFactoryTypeArgumentsComp) \
+ M(ExtractConstructorTypeArguments, ExtractConstructorTypeArgumentsComp) \
+ M(ExtractConstructorInstantiator, ExtractConstructorInstantiatorComp) \
#define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
@@ -705,7 +709,7 @@
ASSERT(value != NULL);
}
- DECLARE_COMPUTATION(NativeLoadFieldComp)
+ DECLARE_COMPUTATION(NativeLoadField)
Value* value() const { return value_; }
intptr_t offset_in_bytes() const { return offset_in_bytes_; }
@@ -718,19 +722,46 @@
};
-class ExtractTypeArgumentsComp : public Computation {
+class ExtractFactoryTypeArgumentsComp : public Computation {
public:
- ExtractTypeArgumentsComp(ConstructorCallNode* ast_node, Value* instantiator)
+ ExtractFactoryTypeArgumentsComp(ConstructorCallNode* ast_node,
+ Value* instantiator)
: ast_node_(*ast_node), instantiator_(instantiator) {
ASSERT(instantiator_ != NULL);
}
- DECLARE_COMPUTATION(ExtractTypeArgumentsComp)
+ DECLARE_COMPUTATION(ExtractFactoryTypeArguments)
Value* instantiator() const { return instantiator_; }
const AbstractTypeArguments& type_arguments() const {
return ast_node_.type_arguments();
}
+ const Function& factory() const { return ast_node_.constructor(); }
+ intptr_t node_id() const { return ast_node_.id(); }
+ intptr_t token_index() const { return ast_node_.token_index(); }
+
+ private:
+ const ConstructorCallNode& ast_node_;
+ Value* instantiator_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtractFactoryTypeArgumentsComp);
+};
+
+
+class ExtractConstructorTypeArgumentsComp : public Computation {
+ public:
+ ExtractConstructorTypeArgumentsComp(ConstructorCallNode* ast_node,
+ Value* instantiator)
+ : ast_node_(*ast_node), instantiator_(instantiator) {
+ ASSERT(instantiator_ != NULL);
+ }
+
+ DECLARE_COMPUTATION(ExtractConstructorTypeArguments)
+
+ Value* instantiator() const { return instantiator_; }
+ const AbstractTypeArguments& type_arguments() const {
+ return ast_node_.type_arguments();
+ }
const Function& constructor() const { return ast_node_.constructor(); }
intptr_t node_id() const { return ast_node_.id(); }
intptr_t token_index() const { return ast_node_.token_index(); }
@@ -739,10 +770,41 @@
const ConstructorCallNode& ast_node_;
Value* instantiator_;
- DISALLOW_COPY_AND_ASSIGN(ExtractTypeArgumentsComp);
+ DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsComp);
};
+class ExtractConstructorInstantiatorComp : public Computation {
+ public:
+ ExtractConstructorInstantiatorComp(ConstructorCallNode* ast_node,
+ Value* instantiator,
+ Value* discard_value)
+ : ast_node_(*ast_node),
+ instantiator_(instantiator),
+ discard_value_(discard_value) {
+ ASSERT(instantiator_ != NULL);
+ }
+
+ DECLARE_COMPUTATION(ExtractConstructorInstantiator)
+
+ Value* instantiator() const { return instantiator_; }
+ Value* discard_value() const { return discard_value_; }
+ const AbstractTypeArguments& type_arguments() const {
+ return ast_node_.type_arguments();
+ }
+ const Function& constructor() const { return ast_node_.constructor(); }
+ intptr_t node_id() const { return ast_node_.id(); }
+ intptr_t token_index() const { return ast_node_.token_index(); }
+
+ private:
+ const ConstructorCallNode& ast_node_;
+ Value* instantiator_;
+ Value* discard_value_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorComp);
+};
+
+
#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