sundar@1051: /* sundar@1051: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. sundar@1051: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@1051: * sundar@1051: * This code is free software; you can redistribute it and/or modify it sundar@1051: * under the terms of the GNU General Public License version 2 only, as sundar@1051: * published by the Free Software Foundation. sundar@1051: * sundar@1051: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@1051: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@1051: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@1051: * version 2 for more details (a copy is included in the LICENSE file that sundar@1051: * accompanied this code). sundar@1051: * sundar@1051: * You should have received a copy of the GNU General Public License version sundar@1051: * 2 along with this work; if not, write to the Free Software Foundation, sundar@1051: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@1051: * sundar@1051: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@1051: * or visit www.oracle.com if you need additional information or have any sundar@1051: * questions. sundar@1051: */ sundar@1051: sundar@1051: /** sundar@1051: * JDK-8060101: AssertionError: __noSuchProperty__ placeholder called from NativeJavaImporter sundar@1051: * sundar@1051: * @test sundar@1051: * @run sundar@1051: */ sundar@1051: sundar@1051: var constant = 0.50; sundar@1051: var ind = 0.0; sundar@1051: sundar@1051: // make sure callsites are exercised quite a few times sundar@1051: // to induce megamorphic callsite for with/JavaImporter sundar@1051: // combo - which triggered that AssertionError. sundar@1051: for (var i = 0; i < 50; i++) { sundar@1051: var math = new JavaImporter(java.lang.StrictMath); sundar@1051: ind += 10.0; sundar@1051: with (math) { sundar@1051: StrictMath.exp(-constant*ind); sundar@1051: } sundar@1051: } sundar@1051: sundar@1051: for (var i = 0; i < 50; i++) { sundar@1051: var math = new JavaImporter(java.lang.StrictMath); sundar@1051: try { sundar@1051: math.Foo(); sundar@1051: } catch (e) { sundar@1051: if (! (e instanceof TypeError)) { sundar@1051: throw e; sundar@1051: } sundar@1051: } sundar@1051: }