| Index: src/ic.cc
|
| diff --git a/src/ic.cc b/src/ic.cc
|
| index f1e3c5539d64fbd9f74cc0de671edc62a2cb3db6..ea3cb5f84a35e2ae073ad856585a3a2d4cacbdf4 100644
|
| --- a/src/ic.cc
|
| +++ b/src/ic.cc
|
| @@ -1234,26 +1234,6 @@ MaybeObject* StoreIC::Store(Handle<Object> object,
|
| return *result;
|
| }
|
|
|
| - // Use specialized code for setting the length of arrays with fast
|
| - // properties. Slow properties might indicate redefinition of the length
|
| - // property. Note that when redefined using Object.freeze, it's possible
|
| - // to have fast properties but a read-only length.
|
| - if (FLAG_use_ic &&
|
| - receiver->IsJSArray() &&
|
| - name->Equals(isolate()->heap()->length_string()) &&
|
| - Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() &&
|
| - receiver->HasFastProperties() &&
|
| - !receiver->map()->is_frozen()) {
|
| - Handle<Code> stub =
|
| - StoreArrayLengthStub(kind(), strict_mode()).GetCode(isolate());
|
| - set_target(*stub);
|
| - TRACE_IC("StoreIC", name);
|
| - Handle<Object> result = JSReceiver::SetProperty(
|
| - receiver, name, value, NONE, strict_mode(), store_mode);
|
| - RETURN_IF_EMPTY_HANDLE(isolate(), result);
|
| - return *result;
|
| - }
|
| -
|
| LookupResult lookup(isolate());
|
| bool can_store = LookupForWrite(receiver, name, value, &lookup, this);
|
| if (!can_store &&
|
| @@ -1404,6 +1384,17 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
|
| // TODO(dcarney): Handle correctly.
|
| if (callback->IsDeclaredAccessorInfo()) break;
|
| ASSERT(callback->IsForeign());
|
| +
|
| + // Use specialized code for setting the length of arrays with fast
|
| + // properties. Slow properties might indicate redefinition of the length
|
| + // property.
|
| + if (receiver->IsJSArray() &&
|
| + name->Equals(isolate()->heap()->length_string()) &&
|
| + Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() &&
|
| + receiver->HasFastProperties()) {
|
| + return compiler.CompileStoreArrayLength(receiver, lookup, name);
|
| + }
|
| +
|
| // No IC support for old-style native accessors.
|
| break;
|
| }
|
|
|