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

Unified Diff: runtime/platform/utils.h

Issue 1007863003: Allow Observatory debugger to switch isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « runtime/observatory/test/isolate_lifecycle_test.dart ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/utils.h
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 8eff2f47062049572ef32b983763daa8f6f04343..796fbbe33a7248776b8e9df7e46bdcf7eaac0a0e 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -201,6 +201,19 @@ class Utils {
static bool DoublesBitEqual(const double a, const double b) {
return bit_cast<int64_t, double>(a) == bit_cast<int64_t, double>(b);
}
+
+ // dart2js represents integers as double precision floats, which can
+ // represent anything in the range -2^53 ... 2^53.
+ static bool IsJavascriptInt(int64_t value) {
+ return ((-0x20000000000000LL <= value) && (value <= 0x20000000000000LL));
+ }
+ static bool IsJavascriptInt(intptr_t value) {
+#if defined(ARCH_IS_64BIT)
+ return ((-0x20000000000000LL <= value) && (value <= 0x20000000000000LL));
+#else
+ return true;
+#endif
+ }
};
} // namespace dart
« no previous file with comments | « runtime/observatory/test/isolate_lifecycle_test.dart ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698