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

Unified Diff: vm/dart_api_impl.h

Issue 10386060: Speed up the Dart_IsBlah functions by checking the class index. This (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | vm/dart_api_impl.cc » ('j') | vm/dart_api_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl.h
===================================================================
--- vm/dart_api_impl.h (revision 7467)
+++ vm/dart_api_impl.h (working copy)
@@ -123,6 +123,14 @@
return Smi::ValueFromRaw(value);
}
+ static intptr_t ClassIndex(Dart_Handle handle) {
Ivan Posva 2012/05/09 23:28:16 There is an inconsistency naming this. In RawObjec
turnidge 2012/05/10 17:49:38 I thought about this some more and decided to go w
+ RawObject* raw = *(reinterpret_cast<RawObject**>(handle));
+ if (!raw->IsHeapObject()) {
+ return kSmi;
+ }
+ return raw->GetClassTag();
+ }
+
// Generates a handle used to designate an error return.
static Dart_Handle NewError(const char* format, ...);
« no previous file with comments | « no previous file | vm/dart_api_impl.cc » ('j') | vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698