Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8026292

Megamorphic setter fails with boolean value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P2
    • Resolution: Fixed
    • None
    • 8
    • core-libs
    • None
    • b113
    • Verified

    Description

      Running this script:

      function megamorphic(o) {
         o.w = true;
      }

      for (var i = 0; i < 10; i++) {
          megamorphic({a: 1});
          megamorphic({b: 2});
          megamorphic({c: 3});
          megamorphic({d: 4});
          megamorphic({e: 5});
          megamorphic({f: 6});
          megamorphic({g: 7});
          megamorphic({h: 1});
          megamorphic({i: 1});
          megamorphic({j: 1});
          megamorphic({k: 1});
      }

      fails with this:

      Exception in thread "main" jdk.nashorn.internal.lookup.MethodHandleFactory$LookupException: java.lang.NoSuchMethodException: no such method: jdk.nashorn.internal.runtime.ScriptObject.set(Object,boolean,boolean)void/invokeVirtual
      at jdk.nashorn.internal.lookup.MethodHandleFactory$StandardMethodHandleFunctionality.findVirtual(MethodHandleFactory.java:415)
      at jdk.nashorn.internal.runtime.ScriptObject.findOwnMH(ScriptObject.java:3243)
      at jdk.nashorn.internal.runtime.ScriptObject.findSetIndexMethod(ScriptObject.java:1956)
      at jdk.nashorn.internal.runtime.ScriptObject.findMegaMorphicSetMethod(ScriptObject.java:1934)
      at jdk.nashorn.internal.runtime.ScriptObject.findSetMethod(ScriptObject.java:1813)
      at jdk.nashorn.internal.runtime.ScriptObject.lookup(ScriptObject.java:1634)
      at jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:75)
      at jdk.internal.dynalink.support.CompositeTypeBasedGuardingDynamicLinker.getGuardedInvocation(CompositeTypeBasedGuardingDynamicLinker.java:176)
      at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
      at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:138)
      at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:232)
      at jdk.nashorn.internal.scripts.Script$mega.megamorphic(mega.js:3)
      at jdk.nashorn.internal.scripts.Script$mega.scopeCall(mega.js)
      at jdk.nashorn.internal.scripts.Script$mega.runScript(mega.js:7)
      at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:499)
      at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:204)
      at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:367)
      at jdk.nashorn.tools.Shell.apply(Shell.java:381)
      at jdk.nashorn.tools.Shell.runScripts(Shell.java:310)
      at jdk.nashorn.tools.Shell.run(Shell.java:166)
      at jdk.nashorn.tools.Shell.main(Shell.java:130)
      at jdk.nashorn.tools.Shell.main(Shell.java:109)
      Caused by: java.lang.NoSuchMethodException: no such method: jdk.nashorn.internal.runtime.ScriptObject.set(Object,boolean,boolean)void/invokeVirtual
      at java.lang.invoke.MemberName.makeAccessException(MemberName.java:765)
      at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:882)
      at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1019)
      at java.lang.invoke.MethodHandles$Lookup.findVirtual(MethodHandles.java:640)
      at jdk.nashorn.internal.lookup.MethodHandleFactory$StandardMethodHandleFunctionality.findVirtual(MethodHandleFactory.java:413)
      ... 21 more
      Caused by: java.lang.NoSuchFieldError: method resolution failed
      at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
      at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:854)
      at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:879)
      ... 24 more

      Attachments

        Activity

          People

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: