Code Monkey home page Code Monkey logo

Comments (5)

rahulmutt avatar rahulmutt commented on May 20, 2024

How was the code above generated?

from eta.

klapaucius avatar klapaucius commented on May 20, 2024

ghc -O2 -ddump-simpl -dsuppress-all -ddump-to-file

ghc 8.0.1

from

primes = 2:3:filter isPrime [5,7..] :: [Int]
isPrime x = all (/= 0) . map (rem x) . takeWhile ((<= x) . (^2)) $ primes
main = print . length . takeWhile (<= 2^24) $ primes

edited, core -> haskell

from eta.

rahulmutt avatar rahulmutt commented on May 20, 2024

I am unable to reproduce that bug. Instead, I get this exception:

Exception in thread "main" java.util.NoSuchElementException
    at java.util.Vector$Itr.next(Vector.java:1136)
    at ghcvm.runtime.thunk.UpdateFrame.doRaiseAsync(UpdateFrame.java:28)
    at ghcvm.runtime.stg.Capability.raiseAsync(Capability.java:952)
    at ghcvm.runtime.stg.Capability.throwToSingleThreaded__(Capability.java:870)
    at ghcvm.runtime.stg.Capability.throwToSingleThreaded(Capability.java:854)
    at ghcvm.runtime.stg.Capability.detectDeadlock(Capability.java:493)
    at ghcvm.runtime.stg.Capability.schedule(Capability.java:156)
    at ghcvm.runtime.RtsScheduler.scheduleWaitThread(RtsScheduler.java:57)
    at ghcvm.runtime.Rts.evalLazyIO(Rts.java:91)
    at ghcvm.runtime.Rts.hsMain(Rts.java:36)
    at ghcvm.main.main(Unknown Source)

Can you make sure that you are the most recent commit and do a ./cleaninstall.sh and let me know the result?

from eta.

klapaucius avatar klapaucius commented on May 20, 2024
klapaucius@u1604:~/sievej/dist/build/sievej$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
klapaucius@u1604:~/sievej/dist/build/sievej$ java -classpath sievej.jar ghcvm.main
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 12
Exception Details:
  Location:
    main/Main$mainzuwgo1zuX7qh.enter(Lghcvm/runtime/stg/StgContext;)V @149: goto
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: 2b05 b600 184d 2b06 b600 184e 2bb6 001e
    0x0000010: 3605 2c2b b600 222b 1505 b600 252b 04b6
    0x0000020: 0018 3a04 1904 c000 29b6 002b 049f 0073
    0x0000030: 1904 c000 0959 b400 303a 0659 b400 343a
    0x0000040: 0757 2bb6 001e 3609 2bb4 0037 59bb 003d
    0x0000050: 5919 06b2 003f b700 42b6 0045 572b 05b2
    0x0000060: 004b b600 50b2 0053 2bb6 002e 2b15 09b6
    0x0000070: 0025 2b04 b600 183a 0819 08c0 0029 b600
    0x0000080: 2b04 9f00 16bb 000c 592d b700 563a 0a19
    0x0000090: 074d 190a 4ea7 ff77 2d2b b600 2ea7 0008
    0x00000a0: 2d2b b600 2eb1                         
  Stackmap Table:
    full_frame(@152,{Object[#4],Object[#22],Object[#28],Object[#28],Object[#28],Integer,Object[#28],Object[#28],Object[#28],Integer},{})
    full_frame(@157,{Object[#4],Object[#22],Object[#28],Object[#28],Object[#28],Integer,Object[#28],Object[#28],Object[#28],Integer},{})
    full_frame(@160,{Object[#4],Object[#22],Object[#28],Object[#28],Object[#28],Integer},{})
    full_frame(@165,{Object[#4],Object[#22],Object[#28],Object[#28],Object[#28],Integer},{})

    at main.Main.<clinit>(Unknown Source)
    at ghcvm.main.main(Unknown Source)

from eta.

rahulmutt avatar rahulmutt commented on May 20, 2024

@klapaucius I have added a patch to codec-jvm that may fix this bytecode error - can you pull the new commits to master and do a ./cleaninstall.sh and let me know if it fixes your problem?

from eta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.