nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java
equal
deleted
inserted
replaced
72 private int[] nextFreeSlots = new int[16]; |
72 private int[] nextFreeSlots = new int[16]; |
73 |
73 |
74 /** size of next free slot vector */ |
74 /** size of next free slot vector */ |
75 private int nextFreeSlotsSize; |
75 private int nextFreeSlotsSize; |
76 |
76 |
77 private boolean isWithBoundary(final LexicalContextNode node) { |
77 private boolean isWithBoundary(final Object node) { |
78 return node instanceof Block && !isEmpty() && peek() instanceof WithNode; |
78 return node instanceof Block && !isEmpty() && peek() instanceof WithNode; |
79 } |
79 } |
80 |
80 |
81 @Override |
81 @Override |
82 public <T extends LexicalContextNode> T push(final T node) { |
82 public <T extends LexicalContextNode> T push(final T node) { |
100 final int count = splitNodes.decrementAndGet(); |
100 final int count = splitNodes.decrementAndGet(); |
101 assert count >= 0; |
101 assert count >= 0; |
102 } |
102 } |
103 |
103 |
104 @Override |
104 @Override |
105 public <T extends LexicalContextNode> T pop(final T node) { |
105 public <T extends Node> T pop(final T node) { |
106 final T popped = super.pop(node); |
106 final T popped = super.pop(node); |
107 if (isWithBoundary(node)) { |
107 if (isWithBoundary(node)) { |
108 dynamicScopeCount--; |
108 dynamicScopeCount--; |
109 assert dynamicScopeCount >= 0; |
109 assert dynamicScopeCount >= 0; |
110 } else if (node instanceof FunctionNode) { |
110 } else if (node instanceof FunctionNode) { |