5 #include "src/objects/embedder-data-array.h" 6 #include "src/objects/embedder-data-array-inl.h" 12 Handle<EmbedderDataArray> EmbedderDataArray::EnsureCapacity(
13 Isolate* isolate, Handle<EmbedderDataArray> array,
int index) {
14 if (index < array->length())
return array;
15 DCHECK_LT(index, kMaxLength);
16 Handle<EmbedderDataArray> new_array =
17 isolate->factory()->NewEmbedderDataArray(index + 1);
18 DisallowHeapAllocation no_gc;
20 size_t size = array->length() * kEmbedderDataSlotSize;
21 MemCopy(reinterpret_cast<void*>(new_array->slots_start()),
22 reinterpret_cast<void*>(array->slots_start()), size);