Skip to content

Commit

Permalink
[GR-61076] Only set TrackNodeSourcePosition if OptimizationLevel is O0.
Browse files Browse the repository at this point in the history
PullRequest: graal/19807
  • Loading branch information
boris-spas committed Jan 22, 2025
2 parents 9e8bf8e + 6c793fd commit 06907ee
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,20 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, String ol
OptimizationLevel newLevel = parseOptimizationLevel(newValue);

// `-g -O0` is recommended for a better debugging experience
GraalOptions.TrackNodeSourcePosition.update(values, newLevel == OptimizationLevel.O0);
SubstrateOptions.IncludeNodeSourcePositions.update(values, newLevel == OptimizationLevel.O0);
SubstrateOptions.SourceLevelDebug.update(values, newLevel == OptimizationLevel.O0);
SubstrateOptions.AOTTrivialInline.update(values, newLevel != OptimizationLevel.O0);
if (newLevel == OptimizationLevel.O0) {
// TrackNodeSourcePosition is needed as a prerequisite for the debuginfo generator
// to ensure the compiler provides node source positions in the first place
GraalOptions.TrackNodeSourcePosition.update(values, true);
// Needed for runtime compiled code (e.g. debuginfo for runtime compiled code,
// tracing deoptimizations)
SubstrateOptions.IncludeNodeSourcePositions.update(values, true);
// SourceLevelDebug persists info about local vars and methods for step-by-step
// debugging
SubstrateOptions.SourceLevelDebug.update(values, true);
// AOTTrivialInline turned off to ensure that trivial methods are not inlined and
// can be stepped into
SubstrateOptions.AOTTrivialInline.update(values, false);
}

/*
* We do not want to enable this optimization yet by default, because it reduces the
Expand Down

0 comments on commit 06907ee

Please sign in to comment.