Bug 146395

Summary: [ES6] Implement spread for function calls
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED INVALID    
Severity: Normal CC: sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Yusuke Suzuki 2015-06-28 08:29:32 PDT
Let's do that.
Comment 1 Yusuke Suzuki 2015-07-13 11:46:54 PDT
Let's consider several things.

1. currently, var args are specially optimized. this optimization does not work fine for iterators. (since we cannot get length).
2. optimized var args are mainly used in @call.

So, my proposal is,

1. the current @call case is transformed into bytecode intrinsic way to keep the current optimization.
2. use var args optimization. so before calling the function, once extract the iterator into the newly allocated array and pass it to var args.
Comment 2 Yusuke Suzuki 2015-07-22 17:21:32 PDT
One problem is that, when just using the JS implemented Promise, the class info of the generated Promise becomes the usual JSFinalObject's info.
If we would like not to break the current

jsDynamicCast<JSPromise*>(promise)

and

promise.inherits(JSPromise::info())

We need to notify the class info into the ObjectAllocationProfile.
And at that time, we need to take care for DFG because DFG assumes that CreateThis results is always JSFinalObject.
Comment 3 Yusuke Suzuki 2015-07-22 17:54:39 PDT
(In reply to comment #2)
> One problem is that, when just using the JS implemented Promise, the class
> info of the generated Promise becomes the usual JSFinalObject's info.
> If we would like not to break the current
> 
> jsDynamicCast<JSPromise*>(promise)
> 
> and
> 
> promise.inherits(JSPromise::info())
> 
> We need to notify the class info into the ObjectAllocationProfile.
> And at that time, we need to take care for DFG because DFG assumes that
> CreateThis results is always JSFinalObject.

oops, I posted it to the wrong issue.