Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index bdfa23cde59d32626192b08ec182f5e2784550e6..545d681e825b39f581d76bf5da1fb6a96957ac07 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -4857,28 +4857,9 @@ void JSObject::TransformToFastProperties(Handle<JSObject> object, |
void JSObject::ResetElements(Handle<JSObject> object) { |
- if (object->map()->is_observed()) { |
- // Maintain invariant that observed elements are always in dictionary mode. |
- Isolate* isolate = object->GetIsolate(); |
- Factory* factory = isolate->factory(); |
- Handle<SeededNumberDictionary> dictionary = |
- SeededNumberDictionary::New(isolate, 0); |
- if (object->map() == *factory->sloppy_arguments_elements_map()) { |
- FixedArray::cast(object->elements())->set(1, *dictionary); |
- } else { |
- object->set_elements(*dictionary); |
- } |
- return; |
- } |
- |
- ElementsKind elements_kind = GetInitialFastElementsKind(); |
- if (!FLAG_smi_only_arrays) { |
- elements_kind = FastSmiToObjectElementsKind(elements_kind); |
- } |
- Handle<Map> map = JSObject::GetElementsTransitionMap(object, elements_kind); |
- DisallowHeapAllocation no_gc; |
- Handle<FixedArrayBase> elements(map->GetInitialElements()); |
- JSObject::SetMapAndElements(object, map, elements); |
+ Heap* heap = object->GetIsolate()->heap(); |
+ CHECK(object->map() != heap->sloppy_arguments_elements_map()); |
+ object->set_elements(object->map()->GetInitialElements()); |
} |