From: mstarzinger@chromium.org Date: Fri, 12 Sep 2014 10:43:27 +0000 (+0000) Subject: Allow more runtime functions to accept Int32s instead of Smis. X-Git-Tag: upstream/4.7.83~6951 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab27b867c5bb80aea9749c6bc4660862b6b6a951;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/src/runtime.cc b/src/runtime.cc index f0c1d95..2a1df1e 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -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); diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index 4200749..651273e 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -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