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

Unified Diff: runtime/vm/object.h

Issue 421913010: Avoid linear search for function lookup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 | « no previous file | 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 39092)
+++ runtime/vm/object.h (working copy)
@@ -949,6 +949,7 @@
// Returns true if non-static fields are defined.
bool HasInstanceFields() const;
+ // TODO(koda): Avoid VM service indexing into this array; unite w/ hash table.
RawArray* functions() const { return raw_ptr()->functions_; }
void SetFunctions(const Array& value) const;
void AddFunction(const Function& function) const;
@@ -1211,6 +1212,9 @@
void CalculateFieldOffsets() const;
+ // functions_hash_table is in use iff there are at least this many functions.
+ static const intptr_t kFunctionLookupHashTreshold = 16;
+
// Initial value for the cached number of type arguments.
static const intptr_t kUnknownNumTypeArguments = -1;
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698