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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 1868973002: Fix representation issue in FastArrayPushStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: moa Created 4 years, 8 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-599089-array-push.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index f1b4cb41771a7a76ba59d7f08b87747e87977f44..1d2fb811fbb2c2f007c00ed36ddbcf70e2842afa 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -794,9 +794,15 @@ HValue* CodeStubGraphBuilderBase::BuildPushElement(HValue* object, HValue* argc,
{
HInstruction* argument =
Add<HAccessArgumentsAt>(argument_elements, argc, key);
- Representation r = IsFastSmiElementsKind(kind) ? Representation::Smi()
- : Representation::Double();
- AddUncasted<HForceRepresentation>(argument, r);
+ IfBuilder can_store(this);
+ can_store.IfNot<HIsSmiAndBranch>(argument);
+ if (IsFastDoubleElementsKind(kind)) {
+ can_store.And();
+ can_store.IfNot<HCompareMap>(argument,
+ isolate()->factory()->heap_number_map());
+ }
+ can_store.ThenDeopt(Deoptimizer::kFastArrayPushFailed);
+ can_store.End();
}
builder.EndBody();
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-599089-array-push.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698