| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private volatile MethodHandle | |
| private transient RubyModule | |
| private DynamicScope | |
| protected StaticScope | |
| private String | |
| private IRScope | |
| private boolean | |
| private boolean | |
| private volatile Collection | |
| private BitSet | |
| public static final int | |
| private static final String[] | |
| private RubyModule | |
| private StaticScope | |
| protected IRScopeType | |
| private static final long | |
| private Signature | |
| private StaticScope. | |
| private String[] | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | StaticScope(StaticScope.
the type of scope type,the lexically containing scope. enclosingScope)Construct a new static scope. |
| protected | StaticScope(StaticScope.
the type of scope type,the lexically containing scope. enclosingScope, String[] The list of interned String variable names. names, int firstKeywordIndex)Construct a new static scope. |
| protected | StaticScope(StaticScope.
|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized MethodHandle | |
| public AssignableNode | |
| public int | Returns: index+depth merged location of scopeof new variable name)Add a new variable to this (current) scope unless it is already defined in any reachable scope. |
| public int | Returns: index of variableof new variable name)Add a new variable to this (current) scope unless it is already defined in the current scope. |
| public AssignableNode | assign(int line, RubySymbol name, Node value)
Make a DASgn or LocalAsgn node based on scope logic Note: This is private code made public only for parser. |
| public AssignableNode | |
| public AssignableNode | assignKeyword(int line, RubySymbol symbolID, Node value)
Register a keyword argument with this staticScope. |
| public void | captureParentRefinements(ThreadContext context)
Duplicate the parent scope's refinements overlay to get a moment-in-time snapshot. |
| public <T> T | |
| public < resulting collection type T> T | Returns: populated collectionused to construct the collection collectionFactory, BiConsumer<T, String> used to pass values into the collection collectionPopulator)Populate a deduplicated collection of variable names in scope using the given functions. |
| public DynamicScope | |
| public Node | |
| public Node | Returns: a DVarNode or LocalVarNode Note: This is private code made public only for parser.the location that in the source that the new node will come from line, RubySymbol of the variable to be created is named symbolID)Make a DVar or LocalVar node based on scoping logic |
| public RubyModule | Returns: the current cref, though this is largely an implementation detailUpdate current scoping structure to populate with proper cref scoping values. |
| public StaticScope | |
| public int | |
| private int | |
| public String[] | Returns: a list of all names (sans $~ and $_ which are special names)Get all visible variables that we can see from this scope that have been assigned (e.g. seen so far) |
| public IRubyObject | |
| public IRubyObject | |
| public IRubyObject | |
| public IRubyObject | getConstantDefined(ThreadContext context, String internedName)
Gets a constant back from lexical search from the cref in this scope. |
| public IRubyObject | |
| private IRubyObject | |
| public IRubyObject | |
| private IRubyObject | |
| public DynamicScope | |
| public StaticScope | |
| public String | |
| public int | |
| public Collection | |
| public IRScope | |
| public BitSet | |
| public StaticScope | |
| public RubyArray | |
| public RubyArray | Returns: populated RubyArraythe current context context)Get a Ruby Array of all local variables. |
| public RubyModule | |
| public int | |
| public RubyModule | |
| public RubyModule | |
| public StaticScope | |
| public IRubyObject | |
| public IRScopeType | |
| public Signature | getSignature()
For all block or method associated with static scopes this will return the signature for that signature-providing scope. |
| public StaticScope. | |
| public String[] | |
| private void | |
| public boolean | |
| public boolean | |
| public int | |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setSignature(Signature signature)
This happens in when first defining ArgsNodes or when reifying a method from AOT. |
| public void | |
| public String |
| constructor | back to summary |
|---|---|
| private volatile MethodHandle constructor | |
| cref | back to summary |
|---|---|
| private transient RubyModule cref | |
| dummyScope | back to summary |
|---|---|
| private DynamicScope dummyScope | |
| enclosingScope | back to summary |
|---|---|
| protected StaticScope enclosingScope | |
| file | back to summary |
|---|---|
| private String file | |
| irScope | back to summary |
|---|---|
| private IRScope irScope | |
| isArgumentScope | back to summary |
|---|---|
| private boolean isArgumentScope | |
| isBlockOrEval | back to summary |
|---|---|
| private boolean isBlockOrEval | |
| ivarNames | back to summary |
|---|---|
| private volatile Collection<String> ivarNames | |
| keywordIndices | back to summary |
|---|---|
| private BitSet keywordIndices | |
| MAX_SPECIALIZED_SIZE | back to summary |
|---|---|
| public static final int MAX_SPECIALIZED_SIZE | |
| NO_NAMES | back to summary |
|---|---|
| private static final String[] NO_NAMES | |
| overlayModule | back to summary |
|---|---|
| private RubyModule overlayModule | |
| previousCRefScope | back to summary |
|---|---|
| private StaticScope previousCRefScope | |
| scopeType | back to summary |
|---|---|
| protected IRScopeType scopeType | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| signature | back to summary |
|---|---|
| private Signature signature | |
| type | back to summary |
|---|---|
| private StaticScope. | |
| variableNames | back to summary |
|---|---|
| private String[] variableNames | |
| variableNamesLength | back to summary |
|---|---|
| private int variableNamesLength | |
| StaticScope | back to summary |
|---|---|
| protected StaticScope(StaticScope. | |
| StaticScope | back to summary |
|---|---|
| protected StaticScope(StaticScope. Construct a new static scope.
| |
| StaticScope | back to summary |
|---|---|
| protected StaticScope(StaticScope. Construct a new static scope. The array of strings should all be the interned versions, since several other optimizations depend on being able to do object equality checks.
| |
| StaticScope | back to summary |
|---|---|
| protected StaticScope(StaticScope. | |
| StaticScope | back to summary |
|---|---|
| protected StaticScope(StaticScope. | |
| acquireConstructor | back to summary |
|---|---|
| private synchronized MethodHandle acquireConstructor() | |
| addAssign | back to summary |
|---|---|
| public AssignableNode addAssign(int line, RubySymbol symbolID, Node value) | |
| addVariable | back to summary |
|---|---|
| public int addVariable(String name) Add a new variable to this (current) scope unless it is already defined in any reachable scope.
| |
| addVariableThisScope | back to summary |
|---|---|
| public int addVariableThisScope(String name) Add a new variable to this (current) scope unless it is already defined in the current scope.
| |
| assign | back to summary |
|---|---|
| public AssignableNode assign(int line, RubySymbol name, Node value) Make a DASgn or LocalAsgn node based on scope logic Note: This is private code made public only for parser. | |
| assign | back to summary |
|---|---|
| public AssignableNode assign(int line, RubySymbol symbolID, Node value, StaticScope topScope, int depth) | |
| assignKeyword | back to summary |
|---|---|
| public AssignableNode assignKeyword(int line, RubySymbol symbolID, Node value) Register a keyword argument with this staticScope. It additionally will track where the first keyword argument started so we can test and tell whether we have a kwarg or an ordinary variable during live execution (See keywordExists). | |
| captureParentRefinements | back to summary |
|---|---|
| public void captureParentRefinements(ThreadContext context) Duplicate the parent scope's refinements overlay to get a moment-in-time snapshot. Caller must decide whether this scope is using (or maybe) using refinements. | |
| collectVariables | back to summary |
|---|---|
| public <T> T collectVariables(IntFunction<T> collectionFactory, BiConsumer<T, String> collectionPopulator) | |
| collectVariables | back to summary |
|---|---|
| public <T> T collectVariables(ThreadContext context, BiFunction<ThreadContext, Integer, T> collectionFactory, BiConsumer<T, String> collectionPopulator) Populate a deduplicated collection of variable names in scope using the given functions. This may include variables that are not strictly Ruby local variable names, so the consumer should validate names as appropriate.
| |
| construct | back to summary |
|---|---|
| public DynamicScope construct(DynamicScope parent) | |
| declare | back to summary |
|---|---|
| public Node declare(int line, RubySymbol symbolID, int depth) | |
| declare | back to summary |
|---|---|
| public Node declare(int line, RubySymbol symbolID) Make a DVar or LocalVar node based on scoping logic
| |
| determineModule | back to summary |
|---|---|
| public RubyModule determineModule() Update current scoping structure to populate with proper cref scoping values. This should be called at any point when you reference a scope for the first time. For the interpreter this is done in a small number of places (defnNode, defsNode, and getBlock). The compiler does this in the same places.
| |
| duplicate | back to summary |
|---|---|
| public StaticScope duplicate() | |
| exists | back to summary |
|---|---|
| public int exists(String name) Does the variable exist?
| |
| findVariableName | back to summary |
|---|---|
| private int findVariableName(String name) | |
| getAllNamesInScope | back to summary |
|---|---|
| public String[] getAllNamesInScope() Get all visible variables that we can see from this scope that have been assigned (e.g. seen so far)
| |
| getConstant | back to summary |
|---|---|
| public IRubyObject getConstant(String internedName)
Deprecated since 10.0.
| |
| getConstant | back to summary |
|---|---|
| public IRubyObject getConstant(ThreadContext context, String internedName) | |
| getConstantDefined | back to summary |
|---|---|
| public IRubyObject getConstantDefined(String internedName)
Deprecated since 10.0.
| |
| getConstantDefined | back to summary |
|---|---|
| public IRubyObject getConstantDefined(ThreadContext context, String internedName) Gets a constant back from lexical search from the cref in this scope. As it is for defined? we will not forced resolution of autoloads nor call const_defined | |
| getConstantDefinedNoObject | back to summary |
|---|---|
| public IRubyObject getConstantDefinedNoObject(String internedName)
Deprecated since 10.0.
| |
| getConstantDefinedNoObject | back to summary |
|---|---|
| private IRubyObject getConstantDefinedNoObject(ThreadContext context, String internedName) | |
| getConstantInner | back to summary |
|---|---|
| public IRubyObject getConstantInner(String internedName)
Deprecated since 10.0.
| |
| getConstantInnerNoObject | back to summary |
|---|---|
| private IRubyObject getConstantInnerNoObject(ThreadContext context, String internedName) | |
| getDummyScope | back to summary |
|---|---|
| public DynamicScope getDummyScope() | |
| getEnclosingScope | back to summary |
|---|---|
| public StaticScope getEnclosingScope() Next outer most scope in list of scopes. An enclosing scope may have no direct scoping relationship to its child. If I am in a localScope and then I enter something which creates another localScope the enclosing scope will be the first scope, but there are no valid scoping relationships between the two. Methods which walk the enclosing scopes are responsible for enforcing appropriate scoping relationships.
| |
| getFile | back to summary |
|---|---|
| public String getFile() | |
| getFirstKeywordIndex | back to summary |
|---|---|
| public int getFirstKeywordIndex() | |
| getInstanceVariableNames | back to summary |
|---|---|
| public Collection | |
| getIRScope | back to summary |
|---|---|
| public IRScope getIRScope() | |
| getKeywordIndices | back to summary |
|---|---|
| public BitSet getKeywordIndices() | |
| getLocalScope | back to summary |
|---|---|
| public StaticScope getLocalScope() Gets the Local Scope relative to the current Scope. For LocalScopes this will be itself. Blocks will contain the LocalScope it contains.
| |
| getLocalVariables | back to summary |
|---|---|
| public RubyArray Deprecated since 10.0.
| |
| getLocalVariables | back to summary |
|---|---|
| public RubyArray Get a Ruby Array of all local variables.
| |
| getModule | back to summary |
|---|---|
| public RubyModule getModule() Get the live CRef module associated with this scope.
| |
| getNumberOfVariables | back to summary |
|---|---|
| public int getNumberOfVariables() | |
| getOverlayModuleForRead | back to summary |
|---|---|
| public RubyModule getOverlayModuleForRead() | |
| getOverlayModuleForWrite | back to summary |
|---|---|
| public RubyModule getOverlayModuleForWrite(ThreadContext context) | |
| getPreviousCRefScope | back to summary |
|---|---|
| public StaticScope getPreviousCRefScope() | |
| getScopedConstant | back to summary |
|---|---|
| public IRubyObject getScopedConstant(ThreadContext context, String internedName) | |
| getScopeType | back to summary |
|---|---|
| public IRScopeType getScopeType() | |
| getSignature | back to summary |
|---|---|
| public Signature getSignature() For all block or method associated with static scopes this will return the signature for that signature-providing scope. module bodies and other non-arity specific code will return null. | |
| getType | back to summary |
|---|---|
| public StaticScope. | |
| getVariables | back to summary |
|---|---|
| public String[] getVariables() | |
| growVariableNames | back to summary |
|---|---|
| private void growVariableNames(String name) | |
| isArgumentScope | back to summary |
|---|---|
| public boolean isArgumentScope() Argument scopes represent scopes which contain arguments for zsuper. All LocalStaticScopes are argument scopes and BlockStaticScopes can be when they are used by define_method. | |
| isBlockScope | back to summary |
|---|---|
| public boolean isBlockScope() | |
| isDefined | back to summary |
|---|---|
| public int isDefined(String name) Is this name in the visible to the current scope
| |
| isDefined | back to summary |
|---|---|
| public int isDefined(String name, int depth) | |
| isRuby2Keywords | back to summary |
|---|---|
| public boolean isRuby2Keywords() | |
| isWithinMethod | back to summary |
|---|---|
| public boolean isWithinMethod() Determine if we happen to be within a method definition.
| |
| keywordExists | back to summary |
|---|---|
| public boolean keywordExists(String name) | |
| makeArgumentScope | back to summary |
|---|---|
| public void makeArgumentScope() | |
| setEnclosingScope | back to summary |
|---|---|
| public void setEnclosingScope(StaticScope parent) | |
| setFile | back to summary |
|---|---|
| public void setFile(String file) | |
| setInstanceVariableNames | back to summary |
|---|---|
| public void setInstanceVariableNames(Collection<String> ivarWrites) | |
| setIRScope | back to summary |
|---|---|
| public void setIRScope(IRScope irScope) | |
| setKeywordIndices | back to summary |
|---|---|
| public void setKeywordIndices(BitSet keywordIndices) | |
| setModule | back to summary |
|---|---|
| public void setModule(RubyModule module) | |
| setPreviousCRefScope | back to summary |
|---|---|
| public void setPreviousCRefScope(StaticScope crefScope) | |
| setScopeType | back to summary |
|---|---|
| public void setScopeType(IRScopeType scopeType) | |
| setSignature | back to summary |
|---|---|
| public void setSignature(Signature signature) This happens in when first defining ArgsNodes or when reifying a method from AOT. | |
| setVariables | back to summary |
|---|---|
| public void setVariables(String[] names) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| public static final StaticScope. | |
| public static final StaticScope. | |
| public static final StaticScope. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static StaticScope. | |
| public static StaticScope. | |
| public static StaticScope. |
| BLOCK | back to summary |
|---|---|
| public static final StaticScope. | |
| EVAL | back to summary |
|---|---|
| public static final StaticScope. | |
| LOCAL | back to summary |
|---|---|
| public static final StaticScope. | |
| Type | back to summary |
|---|---|
| private Type() | |
| fromOrdinal | back to summary |
|---|---|
| public static StaticScope. | |
| valueOf | back to summary |
|---|---|
| public static StaticScope. | |
| values | back to summary |
|---|---|
| public static StaticScope. | |