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

Unified Diff: runtime/vm/object.h

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/intrinsifier_mips.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 28669)
+++ runtime/vm/object.h (working copy)
@@ -729,7 +729,6 @@
// The type argument vector is flattened and includes the type arguments of
// the super class.
- bool HasTypeArguments() const;
intptr_t NumTypeArguments() const;
// Return the number of type arguments that are specific to this class, i.e.
@@ -949,15 +948,12 @@
}
void set_is_mixin_type_applied() const;
- int num_native_fields() const {
+ uint16_t num_native_fields() const {
return raw_ptr()->num_native_fields_;
}
- void set_num_native_fields(int value) const {
+ void set_num_native_fields(uint16_t value) const {
raw_ptr()->num_native_fields_ = value;
}
- static intptr_t num_native_fields_offset() {
- return OFFSET_OF(RawClass, num_native_fields_);
- }
RawCode* allocation_stub() const {
return raw_ptr()->allocation_stub_;
@@ -1076,6 +1072,19 @@
RawFunction::Kind kind) const;
void CalculateFieldOffsets() const;
+ // Initial value for the cached number of type arguments.
+ static const intptr_t kUnknownNumTypeArguments = -1;
+
+ int16_t num_type_arguments() const {
+ return raw_ptr()->num_type_arguments_;
+ }
+ void set_num_type_arguments(intptr_t value) const;
+
+ int16_t num_own_type_arguments() const {
+ return raw_ptr()->num_own_type_arguments_;
+ }
+ void set_num_own_type_arguments(intptr_t value) const;
+
// Assigns empty array to all raw class array fields.
void InitEmptyFields();
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698