-
-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 2686 #2688
Issue 2686 #2688
Conversation
d1acdfa
to
deebf4c
Compare
deebf4c
to
4e5863d
Compare
Having one map per range seems excessive, memory-wise. Am I assuming correctly that the underlying issue was that the same debug info reference cannot be reused on multiple output expressions, hence there must be multiple copies? If so, is there perhaps a better way to make such copies? |
yeah, logically same range can generate multi ** debug info insert trace ** ->
I suppose it is better to correct the data structure of
|
Hmm, what if we'd instead clone the range when calling |
yeah, explicit producer and consumer mode is doable, that means functions should manage their range reference and process sequence carefully. |
@dcodeIO
Above is the solutions I can imagine, can you help to figure out which direction we should follow and if you have comments for the direction, please let me know. |
Perhaps, would a change like this achieve the desired result? /** Adds the debug location of the specified expression at the specified range to the source map. */
addDebugLocation(expr: ExpressionRef, range: Range): void {
let targetFunction = this.currentFlow.targetFunction;
let source = range.source;
if (source.debugInfoIndex < 0) source.debugInfoIndex = this.module.addDebugInfoFile(source.normalizedPath);
- range.debugInfoRef = expr;
- targetFunction.debugLocations.push(range);
+ targetFunction.debugLocations.set(expr, range);
} So there is no longer a |
If debugLocations is changed to Map, the debugInfoRef of Range can also be remove. |
@dcodeIO |
d1cbff2
to
05c63d0
Compare
Fixes #2686
Changes proposed in this pull request:
range
andexpressRef
,range 1 --> n expressionRef
.