Code Monkey home page Code Monkey logo

Comments (7)

chumer avatar chumer commented on May 18, 2024

Thanks for this suggestion. Its already on the way. We are , very likely, going to deprecate SourceSection#createUnavailalble and replace it with Source#createUnavailableSection() including a SourceSection#isUnavailable().

We are also going to shrink SourceSection to just charIndex with length. lines and columns indices are going to be computed lazily. All of this we are doing to minimize the footprint of source sections.

BTW.: You can also compute source sections lazily in Node#getSourceSection() by storing the indices in the Node directly and the Source object in the RootNode.

from graal.

smarr avatar smarr commented on May 18, 2024

@chumer: If I remember correctly, the instrumentation API checks for source sections to be available as a precondition for checking tags. Is that going to be removed as part of the change you mentioned?

from graal.

chumer avatar chumer commented on May 18, 2024

No not due to this change. Source sections are only queried if instrumentations are actually installed (does not yet apply for root nodes, but that will change). We optimize for the fast case where we only execute but not instrument the application.

The source section restriction might change, as soon as we add support for dynamic changes in tags. Its on the TODO list, but not yet appeared on top.

from graal.

smarr avatar smarr commented on May 18, 2024

Sorry for getting off-topic for this issue here:

@chumer ok, but this means instrumentation usage force lazy source section creation? That's how I'd read https://github.com/graalvm/truffle/blob/master/truffle/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/InstrumentationHandler.java#L908

from graal.

chumer avatar chumer commented on May 18, 2024

Yes in this case we would need to request the source section atm. We could remove the call to #getSourceSection if we lift the source section restriction, which i am not yet sure if its going to happen.

from graal.

mlvdv avatar mlvdv commented on May 18, 2024

Source sections are only queried if instrumentations are actually installed

Won't there be a need for source information when a language implementation prints a stack trace?

Also: some languages offer features that depend on instrumentation, where the line between language and tool support is blurry.

from graal.

chumer avatar chumer commented on May 18, 2024

Michael is right that the source information might also be materialized when the stack trace is printed. It still can be deferred until when it is actually printed.

The discussed method SourceSection#createUnavailable was already removed from the API.

from graal.

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.