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

Unified Diff: test/mjsunit/regress/regress-crbug-631917.js

Issue 2191663004: [fullcode][mips][mips64][ppc][s390] Avoid trashing of a home object when doing a count operation wi… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes Created 4 years, 5 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/full-codegen/s390/full-codegen-s390.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-crbug-631917.js
diff --git a/test/mjsunit/regress/regress-crbug-631917.js b/test/mjsunit/regress/regress-crbug-631917.js
new file mode 100644
index 0000000000000000000000000000000000000000..ca7a94c844390e076a12cf1a2f7d89111464eeb1
--- /dev/null
+++ b/test/mjsunit/regress/regress-crbug-631917.js
@@ -0,0 +1,38 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var b = { toString: function() { return "b"; } };
+var c = { toString: function() { return "c"; } };
+
+(function() {
+ var expected_receiver;
+ var obj1 = {
+ a: 100,
+ b_: 200,
+ get b() { assertEquals(expected_receiver, this); return this.b_; },
+ set b(v) { assertEquals(expected_receiver, this); this.b_ = v; },
+ c_: 300,
+ get c() { assertEquals(expected_receiver, this); return this.c_; },
+ set c(v) { assertEquals(expected_receiver, this); this.c_ = v; },
+ };
+ var obj2 = {
+ boom() {
+ super.a++;
+ super[b]++;
+ super[c]++;
+ },
+ }
+ Object.setPrototypeOf(obj2, obj1);
+
+ expected_receiver = obj2;
+ obj2.boom();
+ assertEquals(101, obj2.a);
+ assertEquals(201, obj2[b]);
+ assertEquals(301, obj2[c]);
+
+ expected_receiver = obj1;
+ assertEquals(100, obj1.a);
+ assertEquals(200, obj1[b]);
+ assertEquals(300, obj1[c]);
+}());
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698