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

Unified Diff: runtime/vm/stub_code_ia32.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_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 28669)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1095,8 +1095,8 @@
const Immediate& raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
// 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
@@ -1272,7 +1272,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;
const intptr_t kTypeArgumentsOffset = 1 * kWordSize;
const intptr_t kReceiverOffset = 2 * kWordSize;
const intptr_t closure_size = Closure::InstanceSize();
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698