Smi element fixes in Builtins.

R=jkummerow@chromium.org
BUG=none
TEST=dromaeo-object-array-array-deconstruction-pop doesn't regress

Review URL: http://codereview.chromium.org/8054007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
danno@chromium.org 2011-09-27 11:16:39 +00:00
parent 0df7441668
commit ebc3010ca3

View File

@ -660,7 +660,7 @@ BUILTIN(ArraySlice) {
int len = -1; int len = -1;
if (receiver->IsJSArray()) { if (receiver->IsJSArray()) {
JSArray* array = JSArray::cast(receiver); JSArray* array = JSArray::cast(receiver);
if (!array->HasFastElements() || if (!array->HasFastTypeElements() ||
!IsJSArrayFastElementMovingAllowed(heap, array)) { !IsJSArrayFastElementMovingAllowed(heap, array)) {
return CallJsBuiltin(isolate, "ArraySlice", args); return CallJsBuiltin(isolate, "ArraySlice", args);
} }
@ -676,7 +676,7 @@ BUILTIN(ArraySlice) {
bool is_arguments_object_with_fast_elements = bool is_arguments_object_with_fast_elements =
receiver->IsJSObject() receiver->IsJSObject()
&& JSObject::cast(receiver)->map() == arguments_map && JSObject::cast(receiver)->map() == arguments_map
&& JSObject::cast(receiver)->HasFastElements(); && JSObject::cast(receiver)->HasFastTypeElements();
if (!is_arguments_object_with_fast_elements) { if (!is_arguments_object_with_fast_elements) {
return CallJsBuiltin(isolate, "ArraySlice", args); return CallJsBuiltin(isolate, "ArraySlice", args);
} }
@ -963,7 +963,7 @@ BUILTIN(ArrayConcat) {
int result_len = 0; int result_len = 0;
for (int i = 0; i < n_arguments; i++) { for (int i = 0; i < n_arguments; i++) {
Object* arg = args[i]; Object* arg = args[i];
if (!arg->IsJSArray() || !JSArray::cast(arg)->HasFastElements() if (!arg->IsJSArray() || !JSArray::cast(arg)->HasFastTypeElements()
|| JSArray::cast(arg)->GetPrototype() != array_proto) { || JSArray::cast(arg)->GetPrototype() != array_proto) {
return CallJsBuiltin(isolate, "ArrayConcat", args); return CallJsBuiltin(isolate, "ArrayConcat", args);
} }