Chromium Code Reviews| Index: src/scopes.cc |
| diff --git a/src/scopes.cc b/src/scopes.cc |
| index 9835108751a14c564a12caba8eb9bac92a1ee75a..f06e663c29c4e5fe6410a4cb4ef366bccf6f0be4 100644 |
| --- a/src/scopes.cc |
| +++ b/src/scopes.cc |
| @@ -31,6 +31,7 @@ |
| #include "bootstrapper.h" |
| #include "compiler.h" |
| +#include "lazy-instance.h" |
| #include "messages.h" |
| #include "scopeinfo.h" |
| @@ -56,7 +57,14 @@ class ZoneAllocator: public Allocator { |
| }; |
| -static ZoneAllocator* LocalsMapAllocator = ::new ZoneAllocator(); |
| +struct CreateZoneAllocator { |
| + static ZoneAllocator* Create() { |
| + return ::new ZoneAllocator(); |
| + } |
| +}; |
| + |
| +static LazyDynamicInstance<ZoneAllocator, CreateZoneAllocator>::type |
| + LocalsMapAllocator = LAZY_DYNAMIC_INSTANCE_INITIALIZER; |
| // ---------------------------------------------------------------------------- |
| @@ -77,7 +85,7 @@ static bool Match(void* key1, void* key2) { |
| } |
| -VariableMap::VariableMap() : HashMap(Match, LocalsMapAllocator, 8) {} |
| +VariableMap::VariableMap() : HashMap(Match, LocalsMapAllocator.Pointer(), 8) {} |
|
fschneider
2012/02/28 16:54:48
Not needed anymore because HashMap is already refa
|
| VariableMap::~VariableMap() {} |