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

Unified Diff: test/mjsunit/regress/regress-2717.js

Issue 16735003: Fix re-initialization of existing double field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/objects.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-2717.js
diff --git a/test/mjsunit/regress/regress-crbug-245424.js b/test/mjsunit/regress/regress-2717.js
similarity index 75%
copy from test/mjsunit/regress/regress-crbug-245424.js
copy to test/mjsunit/regress/regress-2717.js
index 005c8baba9492dd339b4fbdc3b48f7577b9c308a..4f8f7915b1c43e48235e7bd6bcb79f89957223cf 100644
--- a/test/mjsunit/regress/regress-crbug-245424.js
+++ b/test/mjsunit/regress/regress-2717.js
@@ -25,17 +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.
-// Flags: --allow-natives-syntax
+// Test re-initializing existing field which is already being tracked as
+// having double representation.
+(function() {
+ function test1(a) {
+ return { x: 1.5, x: a };
+ };
+
+ assertEquals({}, test1({}).x);
+})();
+
+// Test initializing new field which follows an existing transition to a
+// map that tracks it as having double representation.
+(function() {
+ function test1(a) {
+ return { y: a };
+ };
-function boom() {
- var a = {
- foo: "bar",
- foo: "baz"
+ function test2(a) {
+ return { y: a };
};
- return a;
-}
-assertEquals("baz", boom().foo);
-assertEquals("baz", boom().foo);
-%OptimizeFunctionOnNextCall(boom);
-assertEquals("baz", boom().foo);
+ assertEquals(1.5, test1(1.5).y);
+ assertEquals({}, test2({}).y);
+})();
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698