Re: [v8-dev] What is purpose of Builtins::Generate_Adaptor?

2016-10-12 Thread Dmitriy -
CallICStub belongs this "print(1)" because when we emit call in FullCodegen 
we call:
VisitCall -> EmitCallWithLoadIC -> CallLoadIC -> Call CallIC

On Wednesday, October 12, 2016 at 6:53:20 PM UTC+7, Ben Noordhuis wrote:
>
> On Wed, Oct 12, 2016 at 1:25 PM, Dmitriy -  > wrote: 
> > Hi, 
> > I try to run "print(1)" on d8 and I get following calls: 
> > 
> > (in runtime) 
> > ... -> LoadICStub -> CallICStub -> Builtin::Generate_Call -> ... -> 
> > Builtins::Generate_Adaptor 
> > 
> > I don't understand who and why calls Generate_Adaptor. 
>
> V8 generates an arguments adapter stack frame when you call a JS 
> function with more or fewer arguments than it expects. 
>
> print.length === 0 so print(1) needs an adapter frame, in theory. 
> It's a native function and those use a different calling convention so 
> I suspect that the CallIC in your example is something else; 
> --trace_ic should tell you. 
>

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-dev] What is purpose of Builtins::Generate_Adaptor?

2016-10-12 Thread Ben Noordhuis
On Wed, Oct 12, 2016 at 1:25 PM, Dmitriy -  wrote:
> Hi,
> I try to run "print(1)" on d8 and I get following calls:
>
> (in runtime)
> ... -> LoadICStub -> CallICStub -> Builtin::Generate_Call -> ... ->
> Builtins::Generate_Adaptor
>
> I don't understand who and why calls Generate_Adaptor.

V8 generates an arguments adapter stack frame when you call a JS
function with more or fewer arguments than it expects.

print.length === 0 so print(1) needs an adapter frame, in theory.
It's a native function and those use a different calling convention so
I suspect that the CallIC in your example is something else;
--trace_ic should tell you.

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-dev] What is purpose of Builtins::Generate_Adaptor?

2016-10-12 Thread Dmitriy -
Hi, 
I try to run "print(1)" on d8 and I get following calls:

(in runtime)
... -> LoadICStub -> CallICStub -> Builtin::Generate_Call -> ... -> 
Builtins::Generate_Adaptor

I don't understand who and why calls Generate_Adaptor.

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.