Use rand not random
Should make VS happier. R=bmeurer@chromium.org BUG= Review URL: https://codereview.chromium.org/145173012 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
c19d55f801
commit
fa0f929fee
@ -125,14 +125,14 @@ class Types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TypeHandle Fuzz(int depth = 5) {
|
TypeHandle Fuzz(int depth = 5) {
|
||||||
switch (random() % (depth == 0 ? 3 : 20)) {
|
switch (rand() % (depth == 0 ? 3 : 20)) {
|
||||||
case 0: { // bitset
|
case 0: { // bitset
|
||||||
int n = 0
|
int n = 0
|
||||||
#define COUNT_BITSET_TYPES(type, value) + 1
|
#define COUNT_BITSET_TYPES(type, value) + 1
|
||||||
BITSET_TYPE_LIST(COUNT_BITSET_TYPES)
|
BITSET_TYPE_LIST(COUNT_BITSET_TYPES)
|
||||||
#undef COUNT_BITSET_TYPES
|
#undef COUNT_BITSET_TYPES
|
||||||
;
|
;
|
||||||
int i = random() % n;
|
int i = rand() % n;
|
||||||
#define PICK_BITSET_TYPE(type, value) \
|
#define PICK_BITSET_TYPE(type, value) \
|
||||||
if (i-- == 0) return Type::type(region_);
|
if (i-- == 0) return Type::type(region_);
|
||||||
BITSET_TYPE_LIST(PICK_BITSET_TYPE)
|
BITSET_TYPE_LIST(PICK_BITSET_TYPE)
|
||||||
@ -140,13 +140,13 @@ class Types {
|
|||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
case 1: // class
|
case 1: // class
|
||||||
switch (random() % 2) {
|
switch (rand() % 2) {
|
||||||
case 0: return ObjectClass;
|
case 0: return ObjectClass;
|
||||||
case 1: return ArrayClass;
|
case 1: return ArrayClass;
|
||||||
}
|
}
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
case 2: // constant
|
case 2: // constant
|
||||||
switch (random() % 6) {
|
switch (rand() % 6) {
|
||||||
case 0: return SmiConstant;
|
case 0: return SmiConstant;
|
||||||
case 1: return Signed32Constant;
|
case 1: return Signed32Constant;
|
||||||
case 2: return ObjectConstant1;
|
case 2: return ObjectConstant1;
|
||||||
@ -156,7 +156,7 @@ class Types {
|
|||||||
}
|
}
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
default: { // union
|
default: { // union
|
||||||
int n = random() % 10;
|
int n = rand() % 10;
|
||||||
TypeHandle type = None;
|
TypeHandle type = None;
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
type = Type::Union(type, Fuzz(depth - 1), region_);
|
type = Type::Union(type, Fuzz(depth - 1), region_);
|
||||||
|
Loading…
Reference in New Issue
Block a user