Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index eeebcad62e945ad0a7f871a5e7d9b5f0a826d866..8ace1736005d987cb7a7a090d1618711a03eb72d 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -9072,16 +9072,16 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall( |
HConstant* inline_threshold = Add<HConstant>(static_cast<int32_t>(16)); |
Drop(args_count_no_receiver); |
- HValue* receiver = Pop(); |
- Drop(1); // Function. |
HValue* result; |
+ HValue* receiver = Pop(); |
+ HValue* checked_object = AddCheckMap(receiver, receiver_map); |
+ HValue* length = Add<HLoadNamedField>( |
+ receiver, checked_object, HObjectAccess::ForArrayLength(kind)); |
+ Drop(1); // Function. |
{ |
NoObservableSideEffectsScope scope(this); |
- HValue* length = Add<HLoadNamedField>( |
- receiver, nullptr, HObjectAccess::ForArrayLength(kind)); |
- |
IfBuilder if_lengthiszero(this); |
HValue* lengthiszero = if_lengthiszero.If<HCompareNumericAndBranch>( |
length, graph()->GetConstant0(), Token::EQ); |