Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index 239cd60a7229fc925840abeb14792a9f61e91b1f..1578af20c2848b53d6a618ced641d4b7c3d4f653 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -8361,6 +8361,11 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target, |
CompilationInfo target_info(&parse_info); |
Handle<SharedFunctionInfo> target_shared(target->shared()); |
+ |
+ if (IsClassConstructor(target_shared->kind())) { |
+ TraceInline(target, caller, "target is classConstructor"); |
+ return false; |
+ } |
if (target_shared->HasDebugInfo()) { |
TraceInline(target, caller, "target is being debugged"); |
return false; |
@@ -9357,6 +9362,7 @@ bool HOptimizedGraphBuilder::TryIndirectCall(Call* expr) { |
} |
+// f.apply(...) |
void HOptimizedGraphBuilder::BuildFunctionApply(Call* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
CHECK_ALIVE(VisitForValue(args->at(0))); |
@@ -9758,7 +9764,8 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) { |
Push(graph()->GetConstantUndefined()); |
CHECK_ALIVE(VisitExpressions(expr->arguments())); |
- if (expr->IsMonomorphic()) { |
+ if (expr->IsMonomorphic() && |
+ !IsClassConstructor(expr->target()->shared()->kind())) { |
Add<HCheckValue>(function, expr->target()); |
// Patch the global object on the stack by the expected receiver. |