Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index c59c8e5337afe750648fd5c50154e505f3fc672c..0c96427e4a023202fc4b8f975825314b27af1cf6 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -12543,6 +12543,18 @@ void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { |
return ast_context()->ReturnInstruction(result, call->id()); |
} |
+// Support for direct creation of new objects. |
+void HOptimizedGraphBuilder::GenerateNewObject(CallRuntime* call) { |
+ DCHECK_EQ(2, call->arguments()->length()); |
+ CHECK_ALIVE(VisitExpressions(call->arguments())); |
+ FastNewObjectStub stub(isolate()); |
+ FastNewObjectDescriptor descriptor(isolate()); |
+ HValue* values[] = {context(), Pop(), Pop()}; |
+ HConstant* stub_value = Add<HConstant>(stub.GetCode()); |
+ HInstruction* result = New<HCallWithDescriptor>( |
+ stub_value, 0, descriptor, Vector<HValue*>(values, arraysize(values))); |
+ return ast_context()->ReturnInstruction(result, call->id()); |
+} |
// Support for direct calls from JavaScript to native RegExp code. |
void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) { |