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 } |