Reviewers: Mads Ager,

Message:
Mads,

may you have a look?

Warning: it's ugly.  Let me explain the reason for current ugliness.

Alas, ECMAScript requires that ToInteger conversion of first two arguments to be
performed /after/ fetching the array (see 15.4.4.10).  I am afraid that this
conversion might perform any kind of code and thus could turn formerly fast
element JSArray into not fast element JSArray.  That's why I compile a code
which goes fast case only if both arguments passed are SMIs or undefined.

Alas, I didn't find nice mechanism to do it with the current infrastructure. I
can see two approaches:

1) (my personal favorite): enable parameterization of builtins be generators:
into BUILTIN_LIST_C instead of second argument being a number passed into
Generator_Adaptor, let it be a generator function itself. That would allow to
generate special code for array slice builtin.

2) extend special function info with additional flags for both compilation and
CallIC miss.

What would you recommend?

Description:
Introduce builtin for Array.slice function.

Please review this at http://codereview.chromium.org/604059

Affected files:
  M src/bootstrapper.cc
  M src/builtins.h
  M src/builtins.cc
  M src/ia32/stub-cache-ia32.cc
  M src/ic.cc
  M src/stub-cache.h
  M src/stub-cache.cc
  A test/mjsunit/array-slice.js


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to