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

Unified Diff: test/mjsunit/allocation-site-info.js

Issue 17091002: Hydrogen array constructor cleanup and improvements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nit Created 7 years, 6 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 | « src/x64/lithium-x64.cc ('k') | test/mjsunit/array-constructor-feedback.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/allocation-site-info.js
diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js
index 542f874f334c7a5bf70cc067662c4d2b595a7641..86c28aac63afed2a8c24da2f1fc30e220266adda 100644
--- a/test/mjsunit/allocation-site-info.js
+++ b/test/mjsunit/allocation-site-info.js
@@ -89,7 +89,6 @@ function assertNotHoley(obj, name_opt) {
}
if (support_smi_only_arrays) {
-
obj = [];
assertNotHoley(obj);
assertKind(elements_kind.fast_smi_only, obj);
@@ -305,9 +304,26 @@ if (support_smi_only_arrays) {
var realmBArray = Realm.eval(realmB, "Array");
instanceof_check(Array);
instanceof_check(realmBArray);
- %OptimizeFunctionOnNextCall(instanceof_check);
+ %OptimizeFunctionOnNextCall(instanceof_check);
+
+ // No de-opt will occur because HCallNewArray wasn't selected, on account of
+ // the call site not being monomorphic to Array.
+ instanceof_check(Array);
+ assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+ instanceof_check(realmBArray);
+ assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+
+ // Try to optimize again, but first clear all type feedback, and allow it
+ // to be monomorphic on first call. Only after crankshafting do we introduce
+ // realmBArray. This should deopt the method.
+ %DeoptimizeFunction(instanceof_check);
+ %ClearFunctionTypeFeedback(instanceof_check);
+ instanceof_check(Array);
+ instanceof_check(Array);
+ %OptimizeFunctionOnNextCall(instanceof_check);
instanceof_check(Array);
assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+
instanceof_check(realmBArray);
assertTrue(1 != %GetOptimizationStatus(instanceof_check));
}
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | test/mjsunit/array-constructor-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698