hannesw@1249: /* hannesw@1249: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. hannesw@1249: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1249: * hannesw@1249: * This code is free software; you can redistribute it and/or modify it hannesw@1249: * under the terms of the GNU General Public License version 2 only, as hannesw@1249: * published by the Free Software Foundation. hannesw@1249: * hannesw@1249: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1249: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1249: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1249: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1249: * accompanied this code). hannesw@1249: * hannesw@1249: * You should have received a copy of the GNU General Public License version hannesw@1249: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1249: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1249: * hannesw@1249: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1249: * or visit www.oracle.com if you need additional information or have any hannesw@1249: * questions. hannesw@1249: */ hannesw@1249: hannesw@1249: /** hannesw@1249: * JDK-8074556: Functions should not share allocator maps hannesw@1249: * hannesw@1249: * @test hannesw@1249: * @run hannesw@1249: */ hannesw@1249: hannesw@1249: function A () { hannesw@1249: return this; hannesw@1249: } hannesw@1249: hannesw@1249: function B() { hannesw@1249: return this; hannesw@1249: } hannesw@1249: hannesw@1249: A.prototype.x = "x"; hannesw@1249: A.prototype.y = "y"; hannesw@1249: B.prototype.y = "y"; // same properties but different order hannesw@1249: B.prototype.x = "x"; hannesw@1249: hannesw@1249: function test(o) { hannesw@1249: Assert.assertEquals(o.x, "x"); hannesw@1249: Assert.assertEquals(o.y, "y"); hannesw@1249: } hannesw@1249: hannesw@1249: test(new A()); hannesw@1249: test(new B()); hannesw@1249: test(new A()); hannesw@1249: test(new B());