src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java
changeset 48247 fa5a47cad0c9
parent 47216 71c04702a3d5
child 48380 597f69e5f1e3
equal deleted inserted replaced
48246:aadc02050d3b 48247:fa5a47cad0c9
   182      * @param symbol the symbol
   182      * @param symbol the symbol
   183      * @param valueType the value type of the symbol
   183      * @param valueType the value type of the symbol
   184      * @param returnType the return type
   184      * @param returnType the return type
   185      * @param paramTypes the parameter types
   185      * @param paramTypes the parameter types
   186      * @param flags the callsite flags
   186      * @param flags the callsite flags
       
   187      * @param isOptimistic is this an optimistic call
   187      * @return an object representing a shared scope call
   188      * @return an object representing a shared scope call
   188      */
   189      */
   189     SharedScopeCall getScopeCall(final CompileUnit unit, final Symbol symbol, final Type valueType, final Type returnType, final Type[] paramTypes, final int flags) {
   190     SharedScopeCall getScopeCall(final CompileUnit unit, final Symbol symbol, final Type valueType,
   190         final SharedScopeCall scopeCall = new SharedScopeCall(symbol, valueType, returnType, paramTypes, flags);
   191                                  final Type returnType, final Type[] paramTypes, final int flags,
       
   192                                  final boolean isOptimistic) {
       
   193         final SharedScopeCall scopeCall = new SharedScopeCall(symbol, valueType, returnType, paramTypes, flags,
       
   194                 isOptimistic);
   191         if (scopeCalls.containsKey(scopeCall)) {
   195         if (scopeCalls.containsKey(scopeCall)) {
   192             return scopeCalls.get(scopeCall);
   196             return scopeCalls.get(scopeCall);
   193         }
   197         }
   194         scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName(":scopeCall"));
   198         scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName(":scopeCall"));
   195         scopeCalls.put(scopeCall, scopeCall);
   199         scopeCalls.put(scopeCall, scopeCall);
   201      *
   205      *
   202      * @param unit current compile unit
   206      * @param unit current compile unit
   203      * @param symbol the symbol
   207      * @param symbol the symbol
   204      * @param valueType the type of the variable
   208      * @param valueType the type of the variable
   205      * @param flags the callsite flags
   209      * @param flags the callsite flags
   206      * @return an object representing a shared scope call
   210      * @param isOptimistic is this an optimistic get
       
   211      * @return an object representing a shared scope get
   207      */
   212      */
   208     SharedScopeCall getScopeGet(final CompileUnit unit, final Symbol symbol, final Type valueType, final int flags) {
   213     SharedScopeCall getScopeGet(final CompileUnit unit, final Symbol symbol, final Type valueType, final int flags,
   209         return getScopeCall(unit, symbol, valueType, valueType, null, flags);
   214                                 final boolean isOptimistic) {
       
   215         return getScopeCall(unit, symbol, valueType, valueType, null, flags, isOptimistic);
   210     }
   216     }
   211 
   217 
   212     void onEnterBlock(final Block block) {
   218     void onEnterBlock(final Block block) {
   213         pushFreeSlots(assignSlots(block, isFunctionBody() ? 0 : getUsedSlotCount()));
   219         pushFreeSlots(assignSlots(block, isFunctionBody() ? 0 : getUsedSlotCount()));
   214     }
   220     }