Allow more runtime functions to accept Int32s instead of Smis.

R=yangguo@chromium.org
TEST=mjsunit/array-join

Review URL: https://codereview.chromium.org/563223002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23908 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2014-09-12 10:43:27 +00:00
parent 3f1fc7796c
commit ab27b867c5
2 changed files with 5 additions and 12 deletions

View File

@ -7169,10 +7169,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderConcat) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0);
if (!args[1]->IsSmi()) {
int32_t array_length;
if (!args[1]->ToInt32(&array_length)) {
THROW_NEW_ERROR_RETURN_FAILURE(isolate, NewInvalidStringLengthError());
}
CONVERT_SMI_ARG_CHECKED(array_length, 1);
CONVERT_ARG_HANDLE_CHECKED(String, special, 2);
size_t actual_array_length = 0;
@ -7243,10 +7243,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderJoin) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0);
if (!args[1]->IsSmi()) {
int32_t array_length;
if (!args[1]->ToInt32(&array_length)) {
THROW_NEW_ERROR_RETURN_FAILURE(isolate, NewInvalidStringLengthError());
}
CONVERT_SMI_ARG_CHECKED(array_length, 1);
CONVERT_ARG_HANDLE_CHECKED(String, separator, 2);
RUNTIME_ASSERT(array->HasFastObjectElements());
RUNTIME_ASSERT(array_length >= 0);

View File

@ -67,13 +67,6 @@
'debug-references': [PASS, NO_VARIANTS],
'regress/regress-263': [PASS, NO_VARIANTS],
# TODO(mstarzinger): Some runtime functions expect Smi but get HeapNumber.
# TODO(mstarzinger): Note that there is a second entry further down below for
# "array-functions-prototype-misc", make sure to reenable it again!
'array-functions-prototype-misc': [PASS, NO_VARIANTS, ['mode == debug', SKIP]],
'array-join': [PASS, NO_VARIANTS],
'sparse-array-reverse': [PASS, NO_VARIANTS],
# TODO(mstarzinger): Causes crash in generated code, needs investigation.
'array-sort': [PASS, NO_VARIANTS],
'dehoisted-array-index': [PASS, NO_VARIANTS],
@ -182,7 +175,7 @@
# Skip long running tests that time out in debug mode.
'generated-transition-stub': [PASS, ['mode == debug', SKIP]],
'migrations': [SKIP],
#'array-functions-prototype-misc': [PASS, ['mode == debug', SKIP]],
'array-functions-prototype-misc': [PASS, ['mode == debug', SKIP]],
##############################################################################
# This test sets the umask on a per-process basis and hence cannot be