Index: test/mjsunit/regress/regress-crbug-125148.js |
diff --git a/test/mjsunit/regress/regress-2030.js b/test/mjsunit/regress/regress-crbug-125148.js |
similarity index 80% |
copy from test/mjsunit/regress/regress-2030.js |
copy to test/mjsunit/regress/regress-crbug-125148.js |
index fb5a3d0c4633e2350f6ff0185f13416248296c29..ed884652dd0eb90baf029fe3a8533c5b311446d2 100644 |
--- a/test/mjsunit/regress/regress-2030.js |
+++ b/test/mjsunit/regress/regress-crbug-125148.js |
@@ -25,29 +25,26 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
- |
-function a() { |
- this.x = 1; |
+var A = { |
+ foo: function() { assertUnreachable(); } |
} |
-var aa = new a(); |
-%DebugPrint(aa); |
-function b() { |
- this.z = 23; |
- this.x = 2; |
+var B = { |
+ b: 2, |
+ foo: function() { return 1; } |
} |
-var bb = new b(); |
-%DebugPrint(bb); |
+B.__proto__ = A; |
+ |
+var C = {}; |
+C.__proto__ = B; |
-function f(o) { |
- return o.x; |
+function bar(x) { |
+ return x.foo(); |
} |
-assertSame(1, f(aa)); |
-assertSame(1, f(aa)); |
-assertSame(2, f(bb)); |
-assertSame(2, f(bb)); |
-%OptimizeFunctionOnNextCall(f); |
-assertSame(1, f(aa)); |
-assertSame(2, f(bb)); |
+for (var i = 0; i < 3; i++) { |
+ assertEquals(1, bar(C)); |
+} |
+%OptimizeObjectForAddingMultipleProperties(B, 100); // Force dictionary mode. |
+%OptimizeFunctionOnNextCall(bar); |
+assertEquals(1, bar(C)); |