Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 6bf082d86c9da8dc0a924ebf4270f63fc5725c32..608d8f21bedddd7a064c7da21601efb841834ec8 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5890,6 +5890,12 @@ void HGraphBuilder::VisitCallNew(CallNew* expr) { |
Handle<JSFunction> constructor = expr->target(); |
AddInstruction(new(zone()) HCheckFunction(function, constructor)); |
+ // Force completion of inobject slack tracking before generating |
+ // allocation code to finalize instance size. |
+ if (constructor->shared()->IsInobjectSlackTrackingInProgress()) { |
+ constructor->shared()->CompleteInobjectSlackTracking(); |
+ } |
+ |
// Replace the constructor function with a newly allocated receiver. |
HInstruction* receiver = new(zone()) HAllocateObject(context, constructor); |
// Index of the receiver from the top of the expression stack. |