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

Unified Diff: test/mjsunit/regress/regress-hoist-load-named-field.js

Issue 22880004: Merged r16139 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add test Created 7 years, 4 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/version.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-hoist-load-named-field.js
diff --git a/test/mjsunit/regress/regress-int32-truncation.js b/test/mjsunit/regress/regress-hoist-load-named-field.js
similarity index 76%
copy from test/mjsunit/regress/regress-int32-truncation.js
copy to test/mjsunit/regress/regress-hoist-load-named-field.js
index dec4ac1195a6c4928d84eac8cc8dc9496bf66600..7df07a04ce32ac858bcfd680be072953df0fa4b8 100644
--- a/test/mjsunit/regress/regress-int32-truncation.js
+++ b/test/mjsunit/regress/regress-hoist-load-named-field.js
@@ -27,35 +27,40 @@
// Flags: --allow-natives-syntax
-function f(i, b) {
- var a = 0;
- if (b) {
- var c = 1 << i;
- a = c + c;
+// Load fields should not be hoisted beyond their check maps when the check maps
+// cannot be hoisted due to changes in elements kinds.
+function f(o, a) {
+ var v;
+ var i = 1;
+ while (i < 2) {
+ v = o.y;
+ a[0] = 1.5;
+ i++;
}
- var x = a >> 3;
- return a;
+ return v;
}
-f(1, false);
-f(1, true);
+f({y:1.4}, [1]);
+f({y:1.6}, [1]);
%OptimizeFunctionOnNextCall(f);
-assertEquals((1 << 30) * 2, f(30, true));
+f({x:1}, [1]);
-
-var global = 1;
-
-function f2(b) {
- var a = 0;
- if (b) {
- a = global;
+// Polymorphic loads should not be hoisted beyond their compare maps.
+function f2(o) {
+ var i = 0;
+ var v;
+ while (i < 1) {
+ v = o.x;
+ i++;
}
- var x = a >> 3;
- return a;
+ return v;
}
-f2(false);
-f2(true);
+var o1 = { x: 1.5 };
+var o2 = { y: 1, x: 1 };
+
+f2(o1);
+f2(o1);
+f2(o2);
%OptimizeFunctionOnNextCall(f2);
-global = 2.5;
-assertEquals(global, f2(true));
+f2(o2);
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698