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

Unified Diff: runtime/vm/stub_code_arm.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/raw_object_snapshot.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm.cc
===================================================================
--- runtime/vm/stub_code_arm.cc (revision 28669)
+++ runtime/vm/stub_code_arm.cc (working copy)
@@ -1067,8 +1067,8 @@
void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
const Class& cls) {
// 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
@@ -1239,7 +1239,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;
__ EnterStubFrame(true); // Uses pool pointer to refer to function.
const intptr_t kTypeArgumentsFPOffset = 3 * kWordSize;
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698