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

Unified Diff: runtime/vm/object.cc

Issue 11970043: Improve function lookup speed by working with raw objects only. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 17231)
+++ runtime/vm/object.cc (working copy)
@@ -2271,19 +2271,19 @@
// This can occur, e.g., for Null classes.
return Function::null();
}
- Function& function = Function::Handle(isolate, Function::null());
+ const intptr_t len = funcs.Length();
if (name.IsSymbol()) {
// Quick Symbol compare.
- intptr_t len = funcs.Length();
+ NoGCScope no_gc;
for (intptr_t i = 0; i < len; i++) {
- function ^= funcs.At(i);
- if (function.name() == name.raw()) {
- return function.raw();
+ RawFunction* raw_func = reinterpret_cast<RawFunction*>(funcs.At(i));
+ if (raw_func->ptr()->name_ == name.raw()) {
+ return raw_func;
}
}
} else {
+ Function& function = Function::Handle(isolate, Function::null());
String& function_name = String::Handle(isolate, String::null());
- intptr_t len = funcs.Length();
for (intptr_t i = 0; i < len; i++) {
function ^= funcs.At(i);
function_name ^= function.name();
« no previous file with comments | « no previous file | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698