Allow more runtime functions to accept Int32s instead of Smis.
authormstarzinger@chromium.org <mstarzinger@chromium.org>
Fri, 12 Sep 2014 10:43:27 +0000 (10:43 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org>
Fri, 12 Sep 2014 10:43:27 +0000 (10:43 +0000)
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

src/runtime.cc
test/mjsunit/mjsunit.status

index f0c1d95..2a1df1e 100644 (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);
index 4200749..651273e 100644 (file)
   '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],
   # 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