Index: src/elements.cc |
diff --git a/src/elements.cc b/src/elements.cc |
index 1d043a153e148543b86befcc680605de2fd0da47..0fc3c539acef86284868548c0a18bec6df849717 100644 |
--- a/src/elements.cc |
+++ b/src/elements.cc |
@@ -1326,18 +1326,8 @@ ElementsAccessor* ElementsAccessor::ForArray(FixedArrayBase* array) { |
void ElementsAccessor::InitializeOncePerProcess() { |
- static struct ConcreteElementsAccessors { |
-#define ACCESSOR_STRUCT(Class, Kind, Store) Class* Kind##_handler; |
- ELEMENTS_LIST(ACCESSOR_STRUCT) |
-#undef ACCESSOR_STRUCT |
- } element_accessors = { |
-#define ACCESSOR_INIT(Class, Kind, Store) new Class(#Kind), |
- ELEMENTS_LIST(ACCESSOR_INIT) |
-#undef ACCESSOR_INIT |
- }; |
- |
static ElementsAccessor* accessor_array[] = { |
-#define ACCESSOR_ARRAY(Class, Kind, Store) element_accessors.Kind##_handler, |
+#define ACCESSOR_ARRAY(Class, Kind, Store) new Class(#Kind), |
ELEMENTS_LIST(ACCESSOR_ARRAY) |
#undef ACCESSOR_ARRAY |
}; |
@@ -1349,6 +1339,14 @@ void ElementsAccessor::InitializeOncePerProcess() { |
} |
+void ElementsAccessor::TearDown() { |
+#define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; |
+ ELEMENTS_LIST(ACCESSOR_DELETE) |
+#undef ACCESSOR_DELETE |
+ elements_accessors_ = NULL; |
+} |
+ |
+ |
template <typename ElementsAccessorSubclass, typename ElementsKindTraits> |
MaybeObject* ElementsAccessorBase<ElementsAccessorSubclass, |
ElementsKindTraits>:: |