mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-31 07:48:49 +00:00
8009146: Eliminate some dead code in preparation for immutable AST
Reviewed-by: hannesw, lagergren
This commit is contained in:
parent
a1ade22dc0
commit
5b7d451617
@ -46,7 +46,6 @@ import static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor;
|
||||
import static jdk.nashorn.internal.ir.Symbol.IS_INTERNAL;
|
||||
import static jdk.nashorn.internal.ir.Symbol.IS_TEMP;
|
||||
import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_FAST_SCOPE;
|
||||
import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_FUNCTION_DECLARATION;
|
||||
import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_SCOPE;
|
||||
import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_STRICT;
|
||||
|
||||
@ -2052,9 +2051,6 @@ final class CodeGenerator extends NodeOperatorVisitor {
|
||||
|
||||
if (needsScope) {
|
||||
int flags = CALLSITE_SCOPE | getCallSiteFlags();
|
||||
if (varNode.isFunctionVarNode()) {
|
||||
flags |= CALLSITE_FUNCTION_DECLARATION;
|
||||
}
|
||||
final IdentNode identNode = varNode.getName();
|
||||
final Type type = identNode.getType();
|
||||
if (varSymbol.isFastScope(getCurrentFunctionNode())) {
|
||||
|
||||
@ -46,18 +46,4 @@ public interface Assignment<D extends Node> {
|
||||
* @return get the assignment source node
|
||||
*/
|
||||
public Node getAssignmentSource();
|
||||
|
||||
/**
|
||||
* Reset the assignment source
|
||||
*
|
||||
* @param newSource new source node
|
||||
*/
|
||||
public void setAssignmentSource(final Node newSource);
|
||||
|
||||
/**
|
||||
* Reset the assignment destination
|
||||
*
|
||||
* @param newDest new destination node
|
||||
*/
|
||||
public void setAssignmentDest(final D newDest);
|
||||
}
|
||||
|
||||
@ -108,16 +108,6 @@ public class UnaryNode extends Node implements Assignment<Node> {
|
||||
return getAssignmentDest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAssignmentSource(final Node source) {
|
||||
setAssignmentDest(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAssignmentDest(final Node source) {
|
||||
setRHS(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object other) {
|
||||
if (!super.equals(other)) {
|
||||
|
||||
@ -82,21 +82,11 @@ public class VarNode extends Node implements Assignment<IdentNode> {
|
||||
return isAssignment() ? name : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAssignmentDest(final IdentNode node) {
|
||||
setName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAssignmentSource() {
|
||||
return isAssignment() ? getInit() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAssignmentSource(final Node source) {
|
||||
setInit(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this variable declaration have an init value
|
||||
* @return true if an init exists, false otherwise
|
||||
|
||||
@ -43,8 +43,6 @@ public class NashornCallSiteDescriptor extends AbstractCallSiteDescriptor {
|
||||
public static final int CALLSITE_SCOPE = 0x01;
|
||||
/** Flags that the call site is in code that uses ECMAScript strict mode. */
|
||||
public static final int CALLSITE_STRICT = 0x02;
|
||||
/** Flags that a property setter call site is part of a function declaration that assigns the function object to a name. */
|
||||
public static final int CALLSITE_FUNCTION_DECLARATION = 0x04;
|
||||
/** Flags that a property getter or setter call site references a scope variable that is not in the global scope
|
||||
* (it is in a function lexical scope), and the function's scope object class is fixed and known in advance. Such
|
||||
* getters and setters can often be linked more optimally using these assumptions. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user