Index: test/mjsunit/compiler/compare_map_elim.js |
diff --git a/test/mjsunit/regress/regress-982.js b/test/mjsunit/compiler/compare_map_elim.js |
similarity index 86% |
copy from test/mjsunit/regress/regress-982.js |
copy to test/mjsunit/compiler/compare_map_elim.js |
index d88543a74d430317bf4a75576b48c497962e14af..288d4811a6811691366841f7693495f6c785da9e 100644 |
--- a/test/mjsunit/regress/regress-982.js |
+++ b/test/mjsunit/compiler/compare_map_elim.js |
@@ -25,21 +25,27 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-function f(a) { |
- return {className: 'xxx'}; |
-}; |
+// Flags: --allow-natives-syntax --check-elimination |
-var x = 1; |
+a = { |
+ f: function() { this.y = 3; } |
+}; |
+b = { |
+ f: function() { this.y = 4; } |
+}; |
-function g(active) { |
- for (i = 1; i <= 20000; i++) { |
- if (i == active) { |
- x = i; |
- if (f("" + i) != null) { } |
- } else { |
- if (f("" + i) != null) { } |
- } |
- } |
+function x(z) { |
+ return z.f(); |
} |
-g(0); |
+x(a); |
+x(b); |
+x(a); |
+x(b); |
+x(a); |
+x(b); |
+ |
+%OptimizeFunctionOnNextCall(x) |
+ |
+x(a); |
+x(b); |