OK, I introduced an %Apply native function to handle it. For that, I also had to
extend Execution::Call to do receiver rewriting if necessary.


http://codereview.chromium.org/7623011/diff/6001/src/ia32/builtins-ia32.cc
File src/ia32/builtins-ia32.cc (right):

http://codereview.chromium.org/7623011/diff/6001/src/ia32/builtins-ia32.cc#newcode705
src/ia32/builtins-ia32.cc:705: __ pop(edx);
On 2011/09/08 17:30:40, Kevin Millikin wrote:
This is return address, right?  It needs a // return address. comment.

Done (here and in -x64).

http://codereview.chromium.org/7623011/diff/6001/src/ia32/builtins-ia32.cc#newcode780
src/ia32/builtins-ia32.cc:780: __ mov(ebx, Operand(ebp, 3 *
kPointerSize));
On 2011/09/08 17:30:40, Kevin Millikin wrote:
I guess you should name '3' and '4' in this code since you're changing
it.

Done.

http://codereview.chromium.org/7623011/diff/6001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/7623011/diff/6001/src/runtime.cc#newcode639
src/runtime.cc:639: ? isolate->heap()->true_value() :
isolate->heap()->false_value();
On 2011/09/08 17:30:40, Kevin Millikin wrote:
return isolate->heap()->ToBoolean(obj->IsJSFunctionProxy());

Done.

http://codereview.chromium.org/7623011/diff/6001/src/runtime.js
File src/runtime.js (right):

http://codereview.chromium.org/7623011/diff/6001/src/runtime.js#newcode408
src/runtime.js:408: if (%IsJSFunctionProxy(this)) {
On 2011/09/08 17:30:40, Kevin Millikin wrote:
Can we get into this case, where CALL_NON_FUNCTION is invoked on a
function
proxy?  If so, another design is to have %GetFunctionDelegate return
the call
trap.  I don't know if that makes things simpler, or less simple, or
about the
same.

Done (subsuming part of change 7849021).

http://codereview.chromium.org/7623011/diff/6001/src/runtime.js#newcode433
src/runtime.js:433: var proxy = arguments[arity];  // The proxy comes in
as an additional arg.
On 2011/09/08 17:30:40, Kevin Millikin wrote:
You can also use %_Arguments(arity) to get the arguments without
allocating the
arguments object.

Done (although we have to materialize the arguments object anyway).

http://codereview.chromium.org/7623011/diff/6001/src/runtime.js#newcode437
src/runtime.js:437: return global.Function.prototype.apply.call(
On 2011/09/08 17:30:40, Kevin Millikin wrote:
You can't, the JS builtins are called with the context of their caller
(and
don't depend on it).  I think you'll have to implement a runtime
function to do
some of the work here.

I implemented an %Apply native.

http://codereview.chromium.org/7623011/

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

Reply via email to