Reviewers: Yang,
Description:
Remove cpp hack to avoid link failures on Windows
[email protected]
BUG=
Please review this at https://codereview.chromium.org/298133005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+30, -13 lines):
M src/types.h
M test/cctest/test-types.cc
Index: src/types.h
diff --git a/src/types.h b/src/types.h
index
451ad1add948fe5119775715e0147243df5f9dbf..9adb59d578b7364a9ca0b89ca1bff7186f452bbd
100644
--- a/src/types.h
+++ b/src/types.h
@@ -469,7 +469,7 @@ class TypeImpl : public Config::Base {
template<class Config>
class TypeImpl<Config>::BitsetType : public TypeImpl<Config> {
- private:
+ protected:
friend class TypeImpl<Config>;
enum {
Index: test/cctest/test-types.cc
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc
index
4eeeec4e49997e581a9d8cc8280e0909f28b3f1a..d2f9b9a004b9fc5c7a8a8cc7bb3d4708c04398ad
100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -27,13 +27,8 @@
#include <vector>
-#define private public /* To test private methods :) */
-#define protected public
-#include "types.h"
-#undef private
-#undef protected
-
#include "cctest.h"
+#include "types.h"
#include "utils/random-number-generator.h"
using namespace v8::internal;
@@ -76,6 +71,13 @@ struct ZoneRep {
}
static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
+
+ struct BitsetType : Type::BitsetType {
+ using Type::BitsetType::New;
+ using Type::BitsetType::Glb;
+ using Type::BitsetType::Lub;
+ using Type::BitsetType::InherentLub;
+ };
};
@@ -108,6 +110,16 @@ struct HeapRep {
static int Length(Struct* structured) { return structured->length() - 1;
}
static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate;
}
+
+ struct BitsetType : HeapType::BitsetType {
+ using HeapType::BitsetType::New;
+ using HeapType::BitsetType::Glb;
+ using HeapType::BitsetType::Lub;
+ using HeapType::BitsetType::InherentLub;
+ static int Glb(Handle<HeapType> type) { return Glb(*type); }
+ static int Lub(Handle<HeapType> type) { return Lub(*type); }
+ static int InherentLub(Handle<HeapType> type) { return
InherentLub(*type); }
+ };
};
@@ -739,31 +751,36 @@ struct Tests : Rep {
// Ordering: (T->BitsetGlb())->Is(T->BitsetLub())
for (TypeIterator it = T.types.begin(); it != T.types.end(); ++it) {
TypeHandle type = *it;
- TypeHandle glb = Type::BitsetType::New(type->BitsetGlb(),
T.region());
- TypeHandle lub = Type::BitsetType::New(type->BitsetLub(),
T.region());
+ TypeHandle glb =
+ Rep::BitsetType::New(Rep::BitsetType::Glb(type), T.region());
+ TypeHandle lub =
+ Rep::BitsetType::New(Rep::BitsetType::Lub(type), T.region());
CHECK(glb->Is(lub));
}
// Lower bound: (T->BitsetGlb())->Is(T)
for (TypeIterator it = T.types.begin(); it != T.types.end(); ++it) {
TypeHandle type = *it;
- TypeHandle glb = Type::BitsetType::New(type->BitsetGlb(),
T.region());
+ TypeHandle glb =
+ Rep::BitsetType::New(Rep::BitsetType::Glb(type), T.region());
CHECK(glb->Is(type));
}
// Upper bound: T->Is(T->BitsetLub())
for (TypeIterator it = T.types.begin(); it != T.types.end(); ++it) {
TypeHandle type = *it;
- TypeHandle lub = Type::BitsetType::New(type->BitsetLub(),
T.region());
+ TypeHandle lub =
+ Rep::BitsetType::New(Rep::BitsetType::Lub(type), T.region());
CHECK(type->Is(lub));
}
// Inherent bound: (T->BitsetLub())->Is(T->InherentBitsetLub())
for (TypeIterator it = T.types.begin(); it != T.types.end(); ++it) {
TypeHandle type = *it;
- TypeHandle lub = Type::BitsetType::New(type->BitsetLub(),
T.region());
+ TypeHandle lub =
+ Rep::BitsetType::New(Rep::BitsetType::Lub(type), T.region());
TypeHandle inherent =
- Type::BitsetType::New(type->InherentBitsetLub(), T.region());
+ Rep::BitsetType::New(Rep::BitsetType::InherentLub(type),
T.region());
CHECK(lub->Is(inherent));
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.