| Index: src/crankshaft/hydrogen.cc
|
| diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
|
| index d0a079d4057defd1af60886dacb2124d414d08d0..95a334a9a66a0215625cff256e5f2ed9505152f0 100644
|
| --- a/src/crankshaft/hydrogen.cc
|
| +++ b/src/crankshaft/hydrogen.cc
|
| @@ -9993,18 +9993,21 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
|
| instr = prev_instr;
|
| } while (instr != check);
|
| environment()->SetExpressionStackAt(receiver_index, function);
|
| - HInstruction* call =
|
| - PreProcessCall(New<HCallNew>(function, argument_count));
|
| - return ast_context()->ReturnInstruction(call, expr->id());
|
| } else {
|
| // The constructor function is both an operand to the instruction and an
|
| // argument to the construct call.
|
| if (TryHandleArrayCallNew(expr, function)) return;
|
| -
|
| - HInstruction* call =
|
| - PreProcessCall(New<HCallNew>(function, argument_count));
|
| - return ast_context()->ReturnInstruction(call, expr->id());
|
| }
|
| +
|
| + HValue* arity = Add<HConstant>(argument_count - 1);
|
| + HValue* op_vals[] = {context(), function, function, arity};
|
| + Callable callable = CodeFactory::Construct(isolate());
|
| + HConstant* stub = Add<HConstant>(callable.code());
|
| + PushArgumentsFromEnvironment(argument_count);
|
| + HInstruction* construct =
|
| + New<HCallWithDescriptor>(stub, argument_count, callable.descriptor(),
|
| + Vector<HValue*>(op_vals, arraysize(op_vals)));
|
| + return ast_context()->ReturnInstruction(construct, expr->id());
|
| }
|
|
|
|
|
|
|