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

Unified Diff: vm/object.h

Issue 10052027: Add fast paths for Smi values in the dart embedding api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 | « vm/dart_api_impl.cc ('k') | vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.h
===================================================================
--- vm/object.h (revision 6600)
+++ vm/object.h (working copy)
@@ -25,6 +25,7 @@
class clazz;
CLASS_LIST(DEFINE_FORWARD_DECLARATION)
#undef DEFINE_FORWARD_DECLARATION
+class Api;
class Assembler;
class Code;
class LocalScope;
@@ -2737,10 +2738,17 @@
return reinterpret_cast<intptr_t>(New(value));
}
- static bool IsValid(intptr_t value);
- static bool IsValid64(int64_t value);
+ static bool IsValid(intptr_t value) {
+ return (value >= kMinValue) && (value <= kMaxValue);
+ }
+ static bool IsValid64(int64_t value) {
+ return (value >= kMinValue) && (value <= kMaxValue);
+ }
+
private:
+ friend class Api; // For ValueFromRaw
cshapiro 2012/04/16 20:32:45 Co-locate this with the other friend classes below
+
static intptr_t ValueFromRaw(uword raw_value) {
intptr_t value = raw_value;
ASSERT((value & kSmiTagMask) == kSmiTag);
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698