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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11886044: Set statically known ResultCid for AllocateObject. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 9ef1368179d8d2769d4b58de2029e2652c8c71ec..d765869c779c07b74b1dbcb7d2a2eb058f809d22 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2912,7 +2912,9 @@ class AllocateObjectInstr : public TemplateDefinition<0> {
public:
AllocateObjectInstr(ConstructorCallNode* node,
ZoneGrowableArray<PushArgumentInstr*>* arguments)
- : ast_node_(*node), arguments_(arguments) {
+ : ast_node_(*node),
+ arguments_(arguments),
+ cid_(Class::Handle(node->constructor().Owner()).id()) {
// Either no arguments or one type-argument and one instantiator.
ASSERT(arguments->is_empty() || (arguments->length() == 2));
}
@@ -2934,11 +2936,12 @@ class AllocateObjectInstr : public TemplateDefinition<0> {
virtual bool HasSideEffect() const { return true; }
- virtual intptr_t ResultCid() const { return kDynamicCid; }
+ virtual intptr_t ResultCid() const { return cid_; }
private:
const ConstructorCallNode& ast_node_;
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
+ const intptr_t cid_;
DISALLOW_COPY_AND_ASSIGN(AllocateObjectInstr);
};

Powered by Google App Engine
This is Rietveld 408576698