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

Unified Diff: src/flags.cc

Issue 875053005: Revert of Fix --max_old_space_size=4096 integer overflow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/flags.cc
diff --git a/src/flags.cc b/src/flags.cc
index 15836da7826acdefb55d00edda470a63252386d2..2aa4e6bd48587e2a267f4eb1563c7a1fb428d6d5 100644
--- a/src/flags.cc
+++ b/src/flags.cc
@@ -30,8 +30,8 @@
// to the actual flag, default value, comment, etc. This is designed to be POD
// initialized as to avoid requiring static constructors.
struct Flag {
- enum FlagType { TYPE_BOOL, TYPE_MAYBE_BOOL, TYPE_INT, TYPE_INTPTR,
- TYPE_FLOAT, TYPE_STRING, TYPE_ARGS };
+ enum FlagType { TYPE_BOOL, TYPE_MAYBE_BOOL, TYPE_INT, TYPE_FLOAT,
+ TYPE_STRING, TYPE_ARGS };
FlagType type_; // What type of flag, bool, int, or string.
const char* name_; // Name of the flag, ex "my_flag".
@@ -61,11 +61,6 @@
return reinterpret_cast<int*>(valptr_);
}
- intptr_t* intptr_variable() const {
- DCHECK(type_ == TYPE_INTPTR);
- return reinterpret_cast<intptr_t*>(valptr_);
- }
-
double* float_variable() const {
DCHECK(type_ == TYPE_FLOAT);
return reinterpret_cast<double*>(valptr_);
@@ -97,11 +92,6 @@
int int_default() const {
DCHECK(type_ == TYPE_INT);
return *reinterpret_cast<const int*>(defptr_);
- }
-
- int intptr_default() const {
- DCHECK(type_ == TYPE_INTPTR);
- return *reinterpret_cast<const intptr_t*>(defptr_);
}
double float_default() const {
@@ -128,8 +118,6 @@
return maybe_bool_variable()->has_value == false;
case TYPE_INT:
return *int_variable() == int_default();
- case TYPE_INTPTR:
- return *intptr_variable() == intptr_default();
case TYPE_FLOAT:
return *float_variable() == float_default();
case TYPE_STRING: {
@@ -158,9 +146,6 @@
case TYPE_INT:
*int_variable() = int_default();
break;
- case TYPE_INTPTR:
- *intptr_variable() = intptr_default();
- break;
case TYPE_FLOAT:
*float_variable() = float_default();
break;
@@ -189,7 +174,6 @@
case Flag::TYPE_BOOL: return "bool";
case Flag::TYPE_MAYBE_BOOL: return "maybe_bool";
case Flag::TYPE_INT: return "int";
- case Flag::TYPE_INTPTR: return "intptr_t";
case Flag::TYPE_FLOAT: return "float";
case Flag::TYPE_STRING: return "string";
case Flag::TYPE_ARGS: return "arguments";
@@ -211,9 +195,6 @@
break;
case Flag::TYPE_INT:
os << *flag.int_variable();
- break;
- case Flag::TYPE_INTPTR:
- os << *flag.intptr_variable();
break;
case Flag::TYPE_FLOAT:
os << *flag.float_variable();
@@ -414,11 +395,6 @@
break;
case Flag::TYPE_INT:
*flag->int_variable() = strtol(value, &endp, 10); // NOLINT
- break;
- case Flag::TYPE_INTPTR:
- // TODO(bnoordhuis) Use strtoll()? C++11 library feature
- // that may not be available everywhere yet.
- *flag->intptr_variable() = strtol(value, &endp, 10); // NOLINT
break;
case Flag::TYPE_FLOAT:
*flag->float_variable() = strtod(value, &endp);
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698