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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 26682003: Cache number of type arguments in class object instead of recalculating it. (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/dart_api_impl.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 28669)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -2078,7 +2078,7 @@
// pass the type arguments of the instantiator.
const Class& cls = Class::ZoneHandle(function.signature_class());
ASSERT(!cls.IsNull());
- const bool requires_type_arguments = cls.HasTypeArguments();
+ const bool requires_type_arguments = cls.NumTypeArguments() > 0;
Value* type_arguments = NULL;
if (requires_type_arguments) {
ASSERT(cls.type_arguments_field_offset() ==
@@ -2157,7 +2157,7 @@
// pass the type arguments of the instantiator. Otherwise, pass null object.
const Class& cls = Class::Handle(function.signature_class());
ASSERT(!cls.IsNull());
- const bool requires_type_arguments = cls.HasTypeArguments();
+ const bool requires_type_arguments = cls.NumTypeArguments() > 0;
Value* type_arguments = NULL;
if (requires_type_arguments) {
const Class& instantiator_class = Class::Handle(
@@ -2305,7 +2305,7 @@
Value* EffectGraphVisitor::BuildObjectAllocation(
ConstructorCallNode* node) {
const Class& cls = Class::ZoneHandle(node->constructor().Owner());
- const bool requires_type_arguments = cls.HasTypeArguments();
+ const bool requires_type_arguments = cls.NumTypeArguments() > 0;
// In checked mode, if the type arguments are uninstantiated, they may need to
// be checked against declared bounds at run time.
@@ -2558,7 +2558,7 @@
ConstructorCallNode* node,
ZoneGrowableArray<PushArgumentInstr*>* call_arguments) {
const Class& cls = Class::ZoneHandle(node->constructor().Owner());
- ASSERT(cls.HasTypeArguments() && !node->constructor().IsFactory());
+ ASSERT((cls.NumTypeArguments() > 0) && !node->constructor().IsFactory());
if (node->type_arguments().IsNull() ||
node->type_arguments().IsInstantiated()) {
Value* type_arguments_val = Bind(new ConstantInstr(node->type_arguments()));
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698