Chromium Code Reviews| Index: src/builtins.cc |
| diff --git a/src/builtins.cc b/src/builtins.cc |
| index 37ba1e5301a9e17a9e5f4f026e0ad902bb03fd9d..8a4ae71ff0a229daa97dfed558eb1da94716328f 100644 |
| --- a/src/builtins.cc |
| +++ b/src/builtins.cc |
| @@ -209,15 +209,25 @@ RUNTIME_FUNCTION(MaybeObject*, ArrayConstructor_StubFailure) { |
| Handle<Object> type_info = args.at<Object>(parameters_start + 1); |
| bool holey = false; |
| - if (caller_args->length() == 1 && (*caller_args)[0]->IsSmi()) { |
| - int value = Smi::cast((*caller_args)[0])->value(); |
| - holey = (value > 0 && value < JSObject::kInitialMaxFastElementArray); |
| + bool ignore_advice = false; |
|
danno
2013/06/04 16:29:47
ignore_type_feedback is probably more accurate.
mvstanton
2013/06/05 08:47:07
Done.
|
| + if (caller_args->length() == 1) { |
| + Object* argument_one = (*caller_args)[0]; |
| + if (argument_one->IsSmi()) { |
| + int value = Smi::cast(argument_one)->value(); |
| + holey = (value > 0 && value < JSObject::kInitialMaxFastElementArray); |
|
danno
2013/06/04 16:29:47
Don't you mean >= 0? Or is the distinction importa
mvstanton
2013/06/05 08:47:07
I think it's important because if someone calls ne
|
| + } |
| + |
| + // If we have a single argument, and we failed to set holey above, |
| + // then we'll be forced down the dictionary path. In this case it's |
| + // useless to consume allocation site info advice, even if we have it. |
| + ignore_advice = !holey; |
| } |
| JSArray* array; |
| MaybeObject* maybe_array; |
| if (*type_info != isolate->heap()->undefined_value() && |
| - JSGlobalPropertyCell::cast(*type_info)->value()->IsSmi()) { |
| + JSGlobalPropertyCell::cast(*type_info)->value()->IsSmi() && |
| + !ignore_advice) { |
| JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(*type_info); |
| Smi* smi = Smi::cast(cell->value()); |
| ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); |