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

Unified Diff: runtime/vm/dart_entry.h

Issue 11773008: - Preallocate non-named ArgumentsDescriptors with a small amount of parameters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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
Index: runtime/vm/dart_entry.h
===================================================================
--- runtime/vm/dart_entry.h (revision 16642)
+++ runtime/vm/dart_entry.h (working copy)
@@ -57,6 +57,9 @@
// arguments. All arguments are positional.
static RawArray* New(intptr_t count);
+ // Initialize the preallocated fixed length arguments descriptors cache.
+ static void InitOnce();
+
private:
// Absolute indexes into the array.
enum {
@@ -72,13 +75,22 @@
kNamedEntrySize,
};
+ enum {
+ kCachedDescriptors = 32
regis 2013/01/05 01:05:29 kCachedDescriptorCount?
Ivan Posva 2013/01/07 18:27:12 Done.
+ };
+
static intptr_t LengthFor(intptr_t count) {
// Add 1 for the terminating null.
return kFirstNamedEntryIndex + (kNamedEntrySize * count) + 1;
}
+ static RawArray* NewNonCached(intptr_t count, bool canonicalize = true);
+
const Array& array_;
+ // A cache of VM heap allocated arguments descriptors.
+ static RawArray* cached_args_descriptors_[kCachedDescriptors];
+
DISALLOW_COPY_AND_ASSIGN(ArgumentsDescriptor);
};
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/dart_entry.cc » ('j') | runtime/vm/dart_entry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698