Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1099)

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2161943002: [crankshaft] Guard against side effects in Array.prototype.shift lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-614644.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-614644.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698