| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index e25e6c2c3584a0a8fcfe9c1f4c8df1cabc7ec7f2..70565faadae3ef5499dbe6b4ec3a5696f935dff1 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -1632,12 +1632,15 @@ Handle<JSObject> Factory::NewJSObjectFromMap(
|
|
|
|
|
| Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind,
|
| + ObjectStrength strength,
|
| PretenureFlag pretenure) {
|
| - Context* native_context = isolate()->context()->native_context();
|
| - JSFunction* array_function = native_context->array_function();
|
| - Map* map = array_function->initial_map();
|
| - Map* transition_map = isolate()->get_initial_js_array_map(elements_kind);
|
| - if (transition_map != NULL) map = transition_map;
|
| + Map* map = isolate()->get_initial_js_array_map(elements_kind, strength);
|
| + if (map == nullptr) {
|
| + DCHECK(strength == WEAK);
|
| + Context* native_context = isolate()->context()->native_context();
|
| + JSFunction* array_function = native_context->array_function();
|
| + map = array_function->initial_map();
|
| + }
|
| return Handle<JSArray>::cast(NewJSObjectFromMap(handle(map), pretenure));
|
| }
|
|
|
| @@ -1645,9 +1648,10 @@ Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind,
|
| Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind,
|
| int length,
|
| int capacity,
|
| + ObjectStrength strength,
|
| ArrayStorageAllocationMode mode,
|
| PretenureFlag pretenure) {
|
| - Handle<JSArray> array = NewJSArray(elements_kind, pretenure);
|
| + Handle<JSArray> array = NewJSArray(elements_kind, strength, pretenure);
|
| NewJSArrayStorage(array, length, capacity, mode);
|
| return array;
|
| }
|
| @@ -1656,9 +1660,10 @@ Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind,
|
| Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArrayBase> elements,
|
| ElementsKind elements_kind,
|
| int length,
|
| + ObjectStrength strength,
|
| PretenureFlag pretenure) {
|
| DCHECK(length <= elements->length());
|
| - Handle<JSArray> array = NewJSArray(elements_kind, pretenure);
|
| + Handle<JSArray> array = NewJSArray(elements_kind, strength, pretenure);
|
|
|
| array->set_elements(*elements);
|
| array->set_length(Smi::FromInt(length));
|
|
|