本文整理汇总了Java中jdk.nashorn.internal.codegen.CompileUnit类的典型用法代码示例。如果您正苦于以下问题:Java CompileUnit类的具体用法?Java CompileUnit怎么用?Java CompileUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompileUnit类属于jdk.nashorn.internal.codegen包,在下文中一共展示了CompileUnit类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setCompileUnit
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
/**
* Reset the compile unit used to compile this function
* @see Compiler
* @param lc lexical context
* @param compileUnit the compile unit
* @return function node or a new one if state was changed
*/
public FunctionNode setCompileUnit(final LexicalContext lc, final CompileUnit compileUnit) {
if (this.compileUnit == compileUnit) {
return this;
}
return Node.replaceInLexicalContext(
lc,
this,
new FunctionNode(
this,
lastToken,
endParserState,
flags,
name,
returnType,
compileUnit,
compilationState,
body,
parameters,
thisProperties,
rootClass, source, namespace));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:FunctionNode.java
示例2: setCompileUnit
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
/**
* Reset the compile unit used to compile this function
* @see Compiler
* @param lc lexical context
* @param compileUnit the compile unit
* @return function node or a new one if state was changed
*/
public FunctionNode setCompileUnit(final LexicalContext lc, final CompileUnit compileUnit) {
if (this.compileUnit == compileUnit) {
return this;
}
return Node.replaceInLexicalContext(
lc,
this,
new FunctionNode(
this,
lastToken,
endParserState,
flags,
name,
returnType,
compileUnit,
body,
parameters,
thisProperties,
rootClass, source, namespace));
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:FunctionNode.java
示例3: FunctionNode
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
private FunctionNode(
final FunctionNode functionNode,
final long lastToken,
final Object endParserState,
final int flags,
final String name,
final Type returnType,
final CompileUnit compileUnit,
final EnumSet<CompilationState> compilationState,
final Block body,
final List<IdentNode> parameters,
final int thisProperties,
final Class<?> rootClass,
final Source source, Namespace namespace) {
super(functionNode);
this.endParserState = endParserState;
this.lineNumber = functionNode.lineNumber;
this.flags = flags;
this.name = name;
this.returnType = returnType;
this.compileUnit = compileUnit;
this.lastToken = lastToken;
this.compilationState = compilationState;
this.body = body;
this.parameters = parameters;
this.thisProperties = thisProperties;
this.rootClass = rootClass;
this.source = source;
this.namespace = namespace;
// the fields below never change - they are final and assigned in constructor
this.ident = functionNode.ident;
this.kind = functionNode.kind;
this.firstToken = functionNode.firstToken;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:FunctionNode.java
示例4: setCompileUnit
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
/**
* Set the compile unit for this split node
* @param lc lexical context
* @param compileUnit compile unit
* @return new node if changed, otherwise same node
*/
public SplitNode setCompileUnit(final LexicalContext lc, final CompileUnit compileUnit) {
if (this.compileUnit == compileUnit) {
return this;
}
return Node.replaceInLexicalContext(lc, this, new SplitNode(this, body, compileUnit));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:SplitNode.java
示例5: FunctionNode
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
private FunctionNode(
final FunctionNode functionNode,
final long lastToken,
final Object endParserState,
final int flags,
final String name,
final Type returnType,
final CompileUnit compileUnit,
final Block body,
final List<IdentNode> parameters,
final int thisProperties,
final Class<?> rootClass,
final Source source, final Namespace namespace) {
super(functionNode);
this.endParserState = endParserState;
this.lineNumber = functionNode.lineNumber;
this.flags = flags;
this.name = name;
this.returnType = returnType;
this.compileUnit = compileUnit;
this.lastToken = lastToken;
this.body = body;
this.parameters = parameters;
this.parameterExpressions = functionNode.parameterExpressions;
this.thisProperties = thisProperties;
this.rootClass = rootClass;
this.source = source;
this.namespace = namespace;
// the fields below never change - they are final and assigned in constructor
this.ident = functionNode.ident;
this.kind = functionNode.kind;
this.firstToken = functionNode.firstToken;
this.module = functionNode.module;
this.debugFlags = functionNode.debugFlags;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:FunctionNode.java
示例6: FunctionNode
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
private FunctionNode(
final FunctionNode functionNode,
final long lastToken,
final Object endParserState,
final int flags,
final String name,
final Type returnType,
final CompileUnit compileUnit,
final Block body,
final List<IdentNode> parameters,
final int thisProperties,
final Class<?> rootClass,
final Source source, final Namespace namespace) {
super(functionNode);
this.endParserState = endParserState;
this.lineNumber = functionNode.lineNumber;
this.flags = flags;
this.name = name;
this.returnType = returnType;
this.compileUnit = compileUnit;
this.lastToken = lastToken;
this.body = body;
this.parameters = parameters;
this.thisProperties = thisProperties;
this.rootClass = rootClass;
this.source = source;
this.namespace = namespace;
// the fields below never change - they are final and assigned in constructor
this.ident = functionNode.ident;
this.kind = functionNode.kind;
this.firstToken = functionNode.firstToken;
this.module = functionNode.module;
this.debugFlags = functionNode.debugFlags;
}
开发者ID:campolake,项目名称:openjdk9,代码行数:37,代码来源:FunctionNode.java
示例7: FunctionNode
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
private FunctionNode(
final FunctionNode functionNode,
final long lastToken,
final Object endParserState,
final int flags,
final String name,
final Type returnType,
final CompileUnit compileUnit,
final Block body,
final List<IdentNode> parameters,
final int thisProperties,
final Class<?> rootClass,
final Source source, final Namespace namespace) {
super(functionNode);
this.endParserState = endParserState;
this.lineNumber = functionNode.lineNumber;
this.flags = flags;
this.name = name;
this.returnType = returnType;
this.compileUnit = compileUnit;
this.lastToken = lastToken;
this.body = body;
this.parameters = parameters;
this.thisProperties = thisProperties;
this.rootClass = rootClass;
this.source = source;
this.namespace = namespace;
// the fields below never change - they are final and assigned in constructor
this.ident = functionNode.ident;
this.kind = functionNode.kind;
this.firstToken = functionNode.firstToken;
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:35,代码来源:FunctionNode.java
示例8: FunctionNode
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
private FunctionNode(
final FunctionNode functionNode,
final long lastToken,
final int flags,
final String name,
final Type returnType,
final CompileUnit compileUnit,
final EnumSet<CompilationState> compilationState,
final Block body,
final List<IdentNode> parameters,
final FunctionNode snapshot,
final Compiler.Hints hints) {
super(functionNode);
this.lineNumber = functionNode.lineNumber;
this.flags = flags;
this.name = name;
this.returnType = returnType;
this.compileUnit = compileUnit;
this.lastToken = lastToken;
this.compilationState = compilationState;
this.body = body;
this.parameters = parameters;
this.snapshot = snapshot;
this.hints = hints;
// the fields below never change - they are final and assigned in constructor
this.source = functionNode.source;
this.ident = functionNode.ident;
this.namespace = functionNode.namespace;
this.declaredSymbols = functionNode.declaredSymbols;
this.kind = functionNode.kind;
this.firstToken = functionNode.firstToken;
this.thisProperties = functionNode.thisProperties;
}
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:35,代码来源:FunctionNode.java
示例9: SplitNode
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
private SplitNode(final SplitNode splitNode, final Block body, final CompileUnit compileUnit) {
super(splitNode);
this.name = splitNode.name;
this.body = body;
this.compileUnit = compileUnit;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:SplitNode.java
示例10: getCompileUnit
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
/**
* Get the compile unit for this split node
* @return compile unit
*/
@Override
public CompileUnit getCompileUnit() {
return compileUnit;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:SplitNode.java
示例11: getCompileUnit
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
/**
* The array compile unit
* @return array compile unit
*/
@Override
public CompileUnit getCompileUnit() {
return compileUnit;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:LiteralNode.java
示例12: get
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
@Override
public String get() {
final long t = System.nanoTime();
long knownTime = 0L;
int maxKeyLength = 0;
int maxValueLength = 0;
for (final Map.Entry<String, LongAdder> entry : timings.entrySet()) {
maxKeyLength = Math.max(maxKeyLength, entry.getKey().length());
maxValueLength = Math.max(maxValueLength, toMillisPrint(entry.getValue().longValue()).length());
}
maxKeyLength++;
final StringBuilder sb = new StringBuilder();
sb.append("Accumulated compilation phase timings:\n\n");
for (final String timingName: orderedTimingNames) {
int len;
len = sb.length();
sb.append(timingName);
len = sb.length() - len;
while (len++ < maxKeyLength) {
sb.append(' ');
}
final long duration = timings.get(timingName).longValue();
final String strDuration = toMillisPrint(duration);
len = strDuration.length();
for (int i = 0; i < maxValueLength - len; i++) {
sb.append(' ');
}
sb.append(strDuration).
append(" ms\n");
knownTime += duration;
}
final long total = t - startTime;
return sb.append("\nTotal runtime: ").
append(toMillisPrint(total)).
append(" ms (Non-runtime: ").
append(toMillisPrint(knownTime)).
append(" ms [").
append((int)(knownTime * 100.0 / total)).
append("%])").
append("\n\nEmitted compile units: ").
append(CompileUnit.getEmittedUnitCount()).
append("\nCompile units installed as named classes: ").
append(Context.getNamedInstalledScriptCount()).
append("\nCompile units installed as anonymous classes: ").
append(Context.getAnonymousInstalledScriptCount()).
toString();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:57,代码来源:Timing.java
示例13: get
import jdk.nashorn.internal.codegen.CompileUnit; //导入依赖的package包/类
@Override
public String get() {
final long t = System.nanoTime();
long knownTime = 0L;
int maxKeyLength = 0;
int maxValueLength = 0;
for (final Map.Entry<String, LongAdder> entry : timings.entrySet()) {
maxKeyLength = Math.max(maxKeyLength, entry.getKey().length());
maxValueLength = Math.max(maxValueLength, toMillisPrint(entry.getValue().longValue()).length());
}
maxKeyLength++;
final StringBuilder sb = new StringBuilder();
sb.append("Accumulated compilation phase timings:\n\n");
for (final String timingName: orderedTimingNames) {
int len;
len = sb.length();
sb.append(timingName);
len = sb.length() - len;
while (len++ < maxKeyLength) {
sb.append(' ');
}
final long duration = timings.get(timingName).longValue();
final String strDuration = toMillisPrint(duration);
len = strDuration.length();
for (int i = 0; i < maxValueLength - len; i++) {
sb.append(' ');
}
sb.append(strDuration).
append(" ms\n");
knownTime += duration;
}
final long total = t - startTime;
sb.append('\n');
sb.append("Total runtime: ").
append(toMillisPrint(total)).
append(" ms (Non-runtime: ").
append(toMillisPrint(knownTime)).
append(" ms [").
append((int)(knownTime * 100.0 / total)).
append("%])");
sb.append("\n\nEmitted compile units: ").
append(CompileUnit.getEmittedUnitCount());
return sb.toString();
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:56,代码来源:Timing.java
注:本文中的jdk.nashorn.internal.codegen.CompileUnit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论