Commit 077809fc authored by rossberg@chromium.org's avatar rossberg@chromium.org

Fix incorrect private access

(I'm puzzled why GCC did not report this error.)

TBR=bmeurer@chromium.org
BUG=

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24776 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8330178b
......@@ -14,36 +14,33 @@ namespace internal {
// ---------------------------------------------------------------------------
// Initialization.
struct Interface::ValueCreate {
static void Construct(Interface* ptr) {
::new (ptr) Interface(VALUE + FROZEN);
}
};
struct Interface::ConstCreate {
static void Construct(Interface* ptr) {
::new (ptr) Interface(VALUE + CONST + FROZEN);
}
struct Interface::Cache {
template<int flags>
struct Create {
static void Construct(Interface* ptr) { ::new (ptr) Interface(flags); }
};
typedef Create<VALUE + FROZEN> ValueCreate;
typedef Create<VALUE + CONST + FROZEN> ConstCreate;
static base::LazyInstance<Interface, ValueCreate>::type value_interface;
static base::LazyInstance<Interface, ConstCreate>::type const_interface;
};
namespace {
base::LazyInstance<Interface, Interface::ValueCreate>::type value_interface =
LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<Interface, Interface::Cache::ValueCreate>::type
Interface::Cache::value_interface = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<Interface, Interface::ConstCreate>::type const_interface =
LAZY_INSTANCE_INITIALIZER;
}
base::LazyInstance<Interface, Interface::Cache::ConstCreate>::type
Interface::Cache::const_interface = LAZY_INSTANCE_INITIALIZER;
Interface* Interface::NewValue() {
return value_interface.Pointer(); // Cached.
return Cache::value_interface.Pointer(); // Cached.
}
Interface* Interface::NewConst() {
return const_interface.Pointer(); // Cached.
return Cache::const_interface.Pointer(); // Cached.
}
......
......@@ -172,8 +172,7 @@ class Interface : public ZoneObject {
// ---------------------------------------------------------------------------
// Implementation.
private:
struct ValueCreate;
struct ConstCreate;
struct Cache;
enum Flags { // All flags are monotonic
NONE = 0,
......
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