Comments (9)
Hm, I only have a partial overview of the system, but I am not aware of something existing.
My naive approach would be custom built.
I already keep a registry of source sections for each Source
object in my parser. Based on that, I could build a map of lines with/without executable or generally code elements.
IMHO, it would be nice if that would be part of the system. I think it would be useful for many tools to track source sections for each Source
object, even if they don't end up in the AST.
/cc @mlvdv
from graal.
I gave that a go, and I can keep a BitSet
of whether or not I've added the coverage tag to a given line. That works and is pretty low overhead (one bit per line), but it's still a duplication of data that the instrumentation API already has. It's also (a tiny bit of) extra work up front, which could be deferred until coverage is actually used if I could query.
from graal.
@chrisseaton
I guess a SourceListener won't help you because you would need to store the state in the bitset again, right?
What should trigger "exist" for your use-case. First execution or CallTarget creation?
from graal.
Yes a SourceListener
wouldn't help as I'm trying to see if there's way to not store the information in a side data structure when I think it's already being stored by Truffle.
CallTarget
creation, I'm afraid, which I understand is the more difficult for you to implement.
Is being able to eagerly evaluate a query not something that you want in the API for some particular reason? Does it expose too much, or just you'd rather not add yet another interface?
from graal.
CallTarget
creation is not much worse (before CallTarget creation would be quite hard). At the moment I store only executed call targets because we only have execution listeners. I would need to store all CallTargets instead. But I can still just traverse executed ones for execution listeners. So I think performance would not be significantly worse for execution listeners attachement with this additional feature.
No problem with eager evaluation. One has to be careful though it might not be fast.
I'd like to generalize the API a bit. What do you think of:
List<SourceSection> Instrumenter#querySourceSections(SourceSectionFilter filter, int resultLimit)
from graal.
Very slow is fine. I only need this for when a coverage report is being generated. That API looks good.
from graal.
This sounds about right for the Debugger's requirements in this area, discussed previously. CallTarget creation is the right time, not execution. Feedback about whether a breakpoint corresponds to a "known" (i.e. loaded) source location is important before execution.
@smarr Agree that we should add features like the one you have implemented; that's been part of my intention all along: a library of useful, reusable components for tool builders that are only loaded/used when requested. My old instrumentation library had a map that, once registered, automatically maintained a map of locations according to some specification.
from graal.
Reminder that some Debugger functionality is broken until this functionality is restored.
from graal.
The instrumentation framework now allows to you source listeners: https://github.com/graalvm/truffle/blob/fbb6bb30803df787c07b1c8131789c94acfc2761/truffle/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/Instrumenter.java
from graal.
Related Issues (20)
- Native image running error with Springboot 3.1 application HOT 1
- [GR-52267] Can't compile with Onnxruntime library, conflict with svm-enterprise.jar HOT 5
- Native-image compilation fails in windows: with parsing error when the user home dir contains spaces. HOT 3
- [GR-52339] ExitOnOutOfMemoryError not waiting for HeapDumpOnOutOfMemoryError HOT 1
- Add JFR events and track peak usage for native memory tracking (NMT)
- GraalVM error with sbt nativeImage plugin : Registering type as reachable after analysis when using google-cloud-compute library HOT 3
- Static binary compiled with musl reports question mark for (System/getProperty "user.home") HOT 2
- [GR-52400] Native: Introduce flag to favor build time improvements at the cost of using more resources and vice versa HOT 2
- Serialization of float[] or other arrays is not supported in Native Image HOT 8
- docs/getting-started/windows/ has misleading pictures HOT 1
- Caused by: java.lang.IllegalArgumentException: Invalid logger interface org.hibernate.validator.internal.util.logging.Log (implementation not found in jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260) HOT 7
- macOS Native Image libawt fails to load due to JNU_NewStringPlatform failure HOT 2
- Native-image of CLI application is failing with less than 32 GB of virtual memory HOT 3
- reflect-config-schema-v1.0.0.json doesn't mention certain attributes that can actually be supplied
- Problem java.lang.NoClassDefFoundError: sun/misc/Unsafe
- [GR-52454] Native Image shutdown hooks don't run upon SIGINT HOT 2
- [GR-52453] [jfr] jdk.ContainerConfiguration doesn't set hostTotalMemory correctly
- [GR-52484] [jfr] jdk.PhysicalMemory event doesn't set 'usedSize' HOT 3
- Is there any problem with graalvm checking illegal strings? HOT 2
- [GR-52483] Native Image call graph imprecision HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graal.