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

Unified Diff: runtime/vm/stub_code_x64.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/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 28669)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1086,8 +1086,8 @@
const intptr_t kObjectTypeArgumentsOffset = 2 * kWordSize;
const intptr_t kInstantiatorTypeArgumentsOffset = 1 * kWordSize;
// The generated code is different if the class is parameterized.
- const bool is_cls_parameterized = cls.HasTypeArguments();
- ASSERT(!cls.HasTypeArguments() ||
+ const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
+ ASSERT(!is_cls_parameterized ||
(cls.type_arguments_field_offset() != Class::kNoTypeArguments));
// kInlineInstanceSize is a constant used as a threshold for determining
// when the object initialization should be done as a loop or as
@@ -1260,7 +1260,7 @@
const bool is_implicit_instance_closure =
func.IsImplicitInstanceClosureFunction();
const Class& cls = Class::ZoneHandle(func.signature_class());
- const bool has_type_arguments = cls.HasTypeArguments();
+ const bool has_type_arguments = cls.NumTypeArguments() > 0;
__ EnterStubFrameWithPP(); // Uses pool pointer to refer to function.
__ LoadObject(R12, Object::null_object(), PP);
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698