Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 811b2f9c8776de4613a1ece5b2f62deef2415204..eeb2c9de42bdece8c8c9d607e525173c76179e64 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1031,7 +1031,6 @@ bool Object::IsNaN() { |
} |
-// static |
Handle<Object> Object::ToSmi(Isolate* isolate, Handle<Object> object) { |
if (object->IsSmi()) return object; |
if (object->IsHeapNumber()) { |
@@ -1662,6 +1661,18 @@ MaybeObject* JSObject::EnsureCanContainElements(Object** objects, |
} |
+// TODO(ishell): Temporary wrapper until handlified. |
+void JSObject::EnsureCanContainElements(Handle<JSObject> object, |
+ Handle<FixedArrayBase> elements, |
+ uint32_t length, |
+ EnsureElementsMode mode) { |
+ CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), |
+ object->EnsureCanContainElements(*elements, |
+ length, |
+ mode)); |
+} |
+ |
+ |
MaybeObject* JSObject::EnsureCanContainElements(FixedArrayBase* elements, |
uint32_t length, |
EnsureElementsMode mode) { |
@@ -6568,19 +6579,19 @@ bool JSArray::AllowsSetElementsLength() { |
} |
-MaybeObject* JSArray::SetContent(FixedArrayBase* storage) { |
- MaybeObject* maybe_result = EnsureCanContainElements( |
- storage, storage->length(), ALLOW_COPIED_DOUBLE_ELEMENTS); |
- if (maybe_result->IsFailure()) return maybe_result; |
- ASSERT((storage->map() == GetHeap()->fixed_double_array_map() && |
- IsFastDoubleElementsKind(GetElementsKind())) || |
- ((storage->map() != GetHeap()->fixed_double_array_map()) && |
- (IsFastObjectElementsKind(GetElementsKind()) || |
- (IsFastSmiElementsKind(GetElementsKind()) && |
- FixedArray::cast(storage)->ContainsOnlySmisOrHoles())))); |
- set_elements(storage); |
- set_length(Smi::FromInt(storage->length())); |
- return this; |
+void JSArray::SetContent(Handle<JSArray> array, |
+ Handle<FixedArrayBase> storage) { |
+ EnsureCanContainElements(array, storage, storage->length(), |
+ ALLOW_COPIED_DOUBLE_ELEMENTS); |
+ |
+ ASSERT((storage->map() == array->GetHeap()->fixed_double_array_map() && |
+ IsFastDoubleElementsKind(array->GetElementsKind())) || |
+ ((storage->map() != array->GetHeap()->fixed_double_array_map()) && |
+ (IsFastObjectElementsKind(array->GetElementsKind()) || |
+ (IsFastSmiElementsKind(array->GetElementsKind()) && |
+ Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles())))); |
+ array->set_elements(*storage); |
+ array->set_length(Smi::FromInt(storage->length())); |
} |