Skip to content

Commit 16f62ce

Browse files
committed
Add option to force initialization of source sections in PBytecodeRootNodes
1 parent 3b18909 commit 16f62ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,9 @@ private PBytecodeRootNode(PythonLanguage language, FrameDescriptor fd, Signature
697697
}
698698
}
699699
this.selfIndex = selfIndexValue;
700+
if (language.getEngineOption(PythonOptions.ForceInitializeSourceSections)) {
701+
getSourceSection();
702+
}
700703
}
701704

702705
@Override

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ private PythonOptions() {
252252
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Expose internal sources as normal sources, so they will show up in the debugger and stacks", usageSyntax = "true|false") //
253253
public static final OptionKey<Boolean> ExposeInternalSources = new OptionKey<>(false);
254254

255+
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Eagerly initialize source sections.", usageSyntax = "true|false") //
256+
public static final OptionKey<Boolean> ForceInitializeSourceSections = new OptionKey<>(false);
257+
255258
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Print the java stacktrace. Possible modes:" +
256259
" 1 Print Java stacktrace for Java exceptions only." +
257260
" 2 Print Java stacktrace for Python exceptions only (ATTENTION: this will have a notable performance impact)." +

0 commit comments

Comments
 (0)