| Index: src/compiler/ast-graph-builder.cc
|
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
|
| index 5a87e328ace2b419caf9a6d131eaad61600bb1e2..118a7dbc7715463f6a229d36ca49e9432198ae07 100644
|
| --- a/src/compiler/ast-graph-builder.cc
|
| +++ b/src/compiler/ast-graph-builder.cc
|
| @@ -449,6 +449,11 @@ bool AstGraphBuilder::CreateGraph() {
|
| // Build the arguments object if it is used.
|
| BuildArgumentsObject(scope->arguments());
|
|
|
| + // Build rest arguments array if it is used.
|
| + int rest_index;
|
| + Variable* rest_parameter = scope->rest_parameter(&rest_index);
|
| + BuildRestArgumentsArray(rest_parameter, rest_index);
|
| +
|
| // Emit tracing call if requested to do so.
|
| if (FLAG_trace) {
|
| NewNode(javascript()->CallRuntime(Runtime::kTraceEnter, 0));
|
| @@ -2468,6 +2473,22 @@ Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) {
|
| }
|
|
|
|
|
| +Node* AstGraphBuilder::BuildRestArgumentsArray(Variable* rest, int index) {
|
| + if (rest == NULL) return NULL;
|
| +
|
| + DCHECK(index >= 0);
|
| + const Operator* op = javascript()->CallRuntime(Runtime::kNewRestParamSlow, 1);
|
| + Node* object = NewNode(op, jsgraph()->SmiConstant(index));
|
| +
|
| + // Assign the object to the rest array
|
| + DCHECK(rest->IsContextSlot() || rest->IsStackAllocated());
|
| + // This should never lazy deopt, so it is fine to send invalid bailout id.
|
| + BuildVariableAssignment(rest, object, Token::ASSIGN, BailoutId::None());
|
| +
|
| + return object;
|
| +}
|
| +
|
| +
|
| Node* AstGraphBuilder::BuildHoleCheckSilent(Node* value, Node* for_hole,
|
| Node* not_hole) {
|
| IfBuilder hole_check(this);
|
|
|