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
parent 3f1fc779
...@@ -7169,10 +7169,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderConcat) { ...@@ -7169,10 +7169,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderConcat) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 3); DCHECK(args.length() == 3);
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); 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()); THROW_NEW_ERROR_RETURN_FAILURE(isolate, NewInvalidStringLengthError());
} }
CONVERT_SMI_ARG_CHECKED(array_length, 1);
CONVERT_ARG_HANDLE_CHECKED(String, special, 2); CONVERT_ARG_HANDLE_CHECKED(String, special, 2);
size_t actual_array_length = 0; size_t actual_array_length = 0;
...@@ -7243,10 +7243,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderJoin) { ...@@ -7243,10 +7243,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderJoin) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 3); DCHECK(args.length() == 3);
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); 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()); THROW_NEW_ERROR_RETURN_FAILURE(isolate, NewInvalidStringLengthError());
} }
CONVERT_SMI_ARG_CHECKED(array_length, 1);
CONVERT_ARG_HANDLE_CHECKED(String, separator, 2); CONVERT_ARG_HANDLE_CHECKED(String, separator, 2);
RUNTIME_ASSERT(array->HasFastObjectElements()); RUNTIME_ASSERT(array->HasFastObjectElements());
RUNTIME_ASSERT(array_length >= 0); RUNTIME_ASSERT(array_length >= 0);
......
...@@ -67,13 +67,6 @@ ...@@ -67,13 +67,6 @@
'debug-references': [PASS, NO_VARIANTS], 'debug-references': [PASS, NO_VARIANTS],
'regress/regress-263': [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. # TODO(mstarzinger): Causes crash in generated code, needs investigation.
'array-sort': [PASS, NO_VARIANTS], 'array-sort': [PASS, NO_VARIANTS],
'dehoisted-array-index': [PASS, NO_VARIANTS], 'dehoisted-array-index': [PASS, NO_VARIANTS],
...@@ -182,7 +175,7 @@ ...@@ -182,7 +175,7 @@
# Skip long running tests that time out in debug mode. # Skip long running tests that time out in debug mode.
'generated-transition-stub': [PASS, ['mode == debug', SKIP]], 'generated-transition-stub': [PASS, ['mode == debug', SKIP]],
'migrations': [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 # This test sets the umask on a per-process basis and hence cannot be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment