Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index e1cf7d808035bc4ac41a6187c2fdda76c7f60cc9..b5a2e52231c77d31b975e932e53d7dd08a0bf700 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -11451,7 +11451,8 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { |
HConstant::cast(right)->handle(isolate())->IsJSFunction()) { |
Handle<JSFunction> constructor = |
Handle<JSFunction>::cast(HConstant::cast(right)->handle(isolate())); |
- if (!constructor->map()->has_non_instance_prototype()) { |
+ if (constructor->IsConstructor() && |
+ !constructor->map()->has_non_instance_prototype()) { |
JSFunction::EnsureHasInitialMap(constructor); |
DCHECK(constructor->has_initial_map()); |
Handle<Map> initial_map(constructor->initial_map(), isolate()); |