Bug 146395 - [ES6] Implement spread for function calls
Summary: [ES6] Implement spread for function calls
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-28 08:29 PDT by Yusuke Suzuki
Modified: 2016-08-30 11:29 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.