Added a workaroung for a GCC visibility bug.

Movef a helper class to the top level to avoid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40145.

TBR=ulan@chromium.org

Review URL: https://codereview.chromium.org/11194050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9dc2c5b8
......@@ -16179,6 +16179,28 @@ TEST(DontDeleteCellLoadICAPI) {
}
class Visitor42 : public v8::PersistentHandleVisitor {
public:
explicit Visitor42(v8::Persistent<v8::Object> object)
: counter_(0), object_(object) { }
virtual void VisitPersistentHandle(Persistent<Value> value,
uint16_t class_id) {
if (class_id == 42) {
CHECK(value->IsObject());
v8::Persistent<v8::Object> visited =
v8::Persistent<v8::Object>::Cast(value);
CHECK_EQ(42, visited.WrapperClassId());
CHECK_EQ(object_, visited);
++counter_;
}
}
int counter_;
v8::Persistent<v8::Object> object_;
};
TEST(PersistentHandleVisitor) {
v8::HandleScope scope;
LocalContext context;
......@@ -16188,27 +16210,7 @@ TEST(PersistentHandleVisitor) {
object.SetWrapperClassId(42);
CHECK_EQ(42, object.WrapperClassId());
class Visitor : public v8::PersistentHandleVisitor {
public:
explicit Visitor(v8::Persistent<v8::Object> object)
: counter_(0), object_(object) { }
virtual void VisitPersistentHandle(Persistent<Value> value,
uint16_t class_id) {
if (class_id == 42) {
CHECK(value->IsObject());
v8::Persistent<v8::Object> visited =
v8::Persistent<v8::Object>::Cast(value);
CHECK_EQ(42, visited.WrapperClassId());
CHECK_EQ(object_, visited);
++counter_;
}
}
int counter_;
v8::Persistent<v8::Object> object_;
} visitor(object);
Visitor42 visitor(object);
v8::V8::VisitHandlesWithClassIds(&visitor);
CHECK_EQ(1, visitor.counter_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment