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

Unified Diff: runtime/vm/flags.cc

Issue 898093003: Make instruction counter in simulators 64-bit (issue 22302). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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/vm/flags.h ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flags.cc
===================================================================
--- runtime/vm/flags.cc (revision 43658)
+++ runtime/vm/flags.cc (working copy)
@@ -26,6 +26,7 @@
enum FlagType {
kBoolean,
kInteger,
+ kUint64,
kString,
kFunc,
kNumFlagTypes
@@ -53,6 +54,10 @@
OS::Print("%s: %d (%s)\n", name_, *this->int_ptr_, comment_);
break;
}
+ case kUint64: {
+ OS::Print("%s: %"Pu64" (%s)\n", name_, *this->uint64_ptr_, comment_);
+ break;
+ }
case kString: {
if (*this->charp_ptr_ != NULL) {
OS::Print("%s: '%s' (%s)\n", name_, *this->charp_ptr_, comment_);
@@ -81,6 +86,7 @@
void* addr_;
bool* bool_ptr_;
int* int_ptr_;
+ uint64_t* uint64_ptr_;
charp* charp_ptr_;
FlagHandler handler_;
};
@@ -158,6 +164,19 @@
}
+uint64_t Flags::Register_uint64_t(uint64_t* addr,
+ const char* name,
+ uint64_t default_value,
+ const char* comment) {
+ ASSERT(Lookup(name) == NULL);
+
+ Flag* flag = new Flag(name, comment, addr, Flag::kUint64);
+ AddFlag(flag);
+
+ return default_value;
+}
+
+
const char* Flags::Register_charp(charp* addr,
const char* name,
const char* default_value,
@@ -221,6 +240,21 @@
}
break;
}
+ case Flag::kUint64: {
+ char* endptr = NULL;
+ const intptr_t len = strlen(argument);
+ int base = 10;
+ if ((len > 2) && (argument[0] == '0') && (argument[1] == 'x')) {
+ base = 16;
+ }
+ int64_t val = strtoll(argument, &endptr, base);
+ if (endptr == argument + len) {
+ *flag->uint64_ptr_ = static_cast<uint64_t>(val);
+ } else {
+ return false;
+ }
+ break;
+ }
case Flag::kFunc: {
if (strcmp(argument, "true") == 0) {
(flag->handler_)(true);
@@ -405,6 +439,11 @@
jsflag.AddPropertyF("valueAsString", "%d", *flag->int_ptr_);
break;
}
+ case Flag::kUint64: {
+ jsflag.AddProperty("flagType", "uint64_t");
+ jsflag.AddPropertyF("valueAsString", "%"Pu64, *flag->uint64_ptr_);
+ break;
+ }
case Flag::kString: {
jsflag.AddProperty("flagType", "string");
if (flag->charp_ptr_ != NULL) {
« no previous file with comments | « runtime/vm/flags.h ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698