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

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

Issue 2655223003: Revert of [tests] Make assertOptimized()/assertUnoptimized() great again. (Closed)
Patch Set: 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-literal-transitions.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 7c75a597e569c5f45b787f992884908c262d5ce8..865b8ba44fc06bcfcdbe3105fae0c067bf0ba281 100644
--- a/test/mjsunit/array-constructor-feedback.js
+++ b/test/mjsunit/array-constructor-feedback.js
@@ -26,10 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --expose-gc
-// Flags: --no-always-opt --crankshaft
-
-assertFalse(isNeverOptimize());
-assertFalse(isAlwaysOptimize());
+// Flags: --noalways-opt
// Test element kind of objects.
@@ -75,7 +72,7 @@
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);
@@ -84,16 +81,18 @@
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
- // 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);
+ 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);
+ }
})();
@@ -142,15 +141,17 @@
}
a = bar();
bar();
- %OptimizeFunctionOnNextCall(bar);
+ %OptimizeFunctionOnNextCall(bar);
b = bar();
// This only makes sense to test if we allow crankshafting
- assertOptimized(bar);
- %DebugPrint(3);
- b[0] = 3.5;
- c = bar();
- assertKind(elements_kind.fast_smi_only, c);
- assertOptimized(bar);
+ if (4 != %GetOptimizationStatus(bar)) {
+ assertOptimized(bar);
+ %DebugPrint(3);
+ b[0] = 3.5;
+ c = bar();
+ assertKind(elements_kind.fast_smi_only, c);
+ assertOptimized(bar);
+ }
})();
@@ -179,7 +180,7 @@
function bar(len) { return new Array(len); }
bar(0);
bar(0);
- %OptimizeFunctionOnNextCall(bar);
+ %OptimizeFunctionOnNextCall(bar);
a = bar(0);
assertOptimized(bar);
assertFalse(isHoley(a));
@@ -191,8 +192,10 @@
a = bar(0);
assertOptimized(bar);
// Crankshafted functions don't use mementos, so feedback still
- // indicates a packed array is desired.
- assertFalse(isHoley(a));
+ // indicates a packed array is desired. (unless --nocrankshaft is in use).
+ if (4 != %GetOptimizationStatus(bar)) {
+ 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-literal-transitions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698