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

Unified Diff: test/mjsunit/array-constructor-feedback.js

Issue 2653753007: [tests] Cleanup tests that use assertOptimized()/assertUnoptimized(). (Closed)
Patch Set: Addressing comments Created 3 years, 11 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 | « test/mjsunit/array-bounds-check-removal.js ('k') | test/mjsunit/array-feedback.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-constructor-feedback.js
diff --git a/test/mjsunit/array-constructor-feedback.js b/test/mjsunit/array-constructor-feedback.js
index 865b8ba44fc06bcfcdbe3105fae0c067bf0ba281..45ea0d53e107077bda59080854d9e375cd6ad7b0 100644
--- a/test/mjsunit/array-constructor-feedback.js
+++ b/test/mjsunit/array-constructor-feedback.js
@@ -26,7 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --expose-gc
-// Flags: --noalways-opt
+// Flags: --no-always-opt --crankshaft
// Test element kind of objects.
@@ -72,7 +72,7 @@ function assertKind(expected, obj, name_opt) {
a[0] = 3.5;
b = bar0(Array);
assertKind(elements_kind.fast_double, b);
- %OptimizeFunctionOnNextCall(bar0);
+ %OptimizeFunctionOnNextCall(bar0);
b = bar0(Array);
assertKind(elements_kind.fast_double, b);
assertOptimized(bar0);
@@ -81,18 +81,15 @@ function assertKind(expected, obj, name_opt) {
assertUnoptimized(bar0)
// When it's re-optimized, we should call through the full stub
bar0(Array);
- %OptimizeFunctionOnNextCall(bar0);
+ %OptimizeFunctionOnNextCall(bar0);
b = bar0(Array);
- // This only makes sense to test if we allow crankshafting
- if (4 != %GetOptimizationStatus(bar0)) {
- // We also lost our ability to record kind feedback, as the site
- // is megamorphic now.
- assertKind(elements_kind.fast_smi_only, b);
- assertOptimized(bar0);
- b[0] = 3.5;
- c = bar0(Array);
- assertKind(elements_kind.fast_smi_only, c);
- }
+ // We also lost our ability to record kind feedback, as the site
+ // is megamorphic now.
+ assertKind(elements_kind.fast_smi_only, b);
+ assertOptimized(bar0);
+ b[0] = 3.5;
+ c = bar0(Array);
+ assertKind(elements_kind.fast_smi_only, c);
})();
@@ -106,7 +103,7 @@ function assertKind(expected, obj, name_opt) {
a[0] = "a string";
a = bar(10);
assertKind(elements_kind.fast, a);
- %OptimizeFunctionOnNextCall(bar);
+ %OptimizeFunctionOnNextCall(bar);
a = bar(10);
assertKind(elements_kind.fast, a);
assertOptimized(bar);
@@ -124,7 +121,7 @@ function assertKind(expected, obj, name_opt) {
barn(1, 2, 3);
barn(1, 2, 3);
- %OptimizeFunctionOnNextCall(barn);
+ %OptimizeFunctionOnNextCall(barn);
barn(1, 2, 3);
assertOptimized(barn);
a = barn(1, "oops", 3);
@@ -141,17 +138,14 @@ function assertKind(expected, obj, name_opt) {
}
a = bar();
bar();
- %OptimizeFunctionOnNextCall(bar);
+ %OptimizeFunctionOnNextCall(bar);
b = bar();
- // This only makes sense to test if we allow crankshafting
- if (4 != %GetOptimizationStatus(bar)) {
- assertOptimized(bar);
- %DebugPrint(3);
- b[0] = 3.5;
- c = bar();
- assertKind(elements_kind.fast_smi_only, c);
- assertOptimized(bar);
- }
+ assertOptimized(bar);
+ %DebugPrint(3);
+ b[0] = 3.5;
+ c = bar();
+ assertKind(elements_kind.fast_smi_only, c);
+ assertOptimized(bar);
})();
@@ -161,7 +155,7 @@ function assertKind(expected, obj, name_opt) {
function bar() { return new Array(); }
bar();
bar();
- %OptimizeFunctionOnNextCall(bar);
+ %OptimizeFunctionOnNextCall(bar);
a = bar();
assertTrue(a instanceof Array);
@@ -180,7 +174,7 @@ function assertKind(expected, obj, name_opt) {
function bar(len) { return new Array(len); }
bar(0);
bar(0);
- %OptimizeFunctionOnNextCall(bar);
+ %OptimizeFunctionOnNextCall(bar);
a = bar(0);
assertOptimized(bar);
assertFalse(isHoley(a));
@@ -192,10 +186,8 @@ function assertKind(expected, obj, name_opt) {
a = bar(0);
assertOptimized(bar);
// Crankshafted functions don't use mementos, so feedback still
- // indicates a packed array is desired. (unless --nocrankshaft is in use).
- if (4 != %GetOptimizationStatus(bar)) {
- assertFalse(isHoley(a));
- }
+ // indicates a packed array is desired.
+ assertFalse(isHoley(a));
})();
// Test: Make sure that crankshaft continues with feedback for large arrays.
« no previous file with comments | « test/mjsunit/array-bounds-check-removal.js ('k') | test/mjsunit/array-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698