OpenJDK / jdk / jdk10
changeset 24784:ed11bdcc878a
8044816: On-demand compiled top-level program doesn't need :createProgramFunction
Reviewed-by: jlaskey, lagergren, sundar
author | attila |
---|---|
date | Thu, 05 Jun 2014 12:16:09 +0200 |
parents | b5c31bfe1496 |
children | 681b70d49d8d |
files | nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Thu Jun 05 12:15:45 2014 +0200 +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Thu Jun 05 12:16:09 2014 +0200 @@ -4312,8 +4312,7 @@ assert data != null : functionNode.getName() + " has no data"; - final FunctionNode parentFn = lc.getParentFunction(functionNode); - if (parentFn == null && functionNode.isProgram()) { + if (functionNode.isProgram() && !compiler.isOnDemandCompilation()) { final CompileUnit fnUnit = functionNode.getCompileUnit(); final MethodEmitter createFunction = fnUnit.getClassEmitter().method( EnumSet.of(Flag.PUBLIC, Flag.STATIC), CREATE_PROGRAM_FUNCTION.symbolName(),