More synthesis refactoring

- Join `TElementReferenceSynth` and `TMethodCallSynth`.
- Move arity and setter information into `MethodCallKind`.
- Add `Synthesis::methodCall` for specifying which method calls need synthesis.
This commit is contained in:
Tom Hvitved
2021-05-31 15:14:42 +02:00
parent e8841e6482
commit 3ffef634d7
8 changed files with 144 additions and 204 deletions

View File

@@ -82,7 +82,7 @@ class MethodCall extends Call, TMethodCall {
*
* the result is `"bar"`.
*/
string getMethodName() { none() }
final string getMethodName() { result = this.(MethodCallImpl).getMethodNameImpl() }
/**
* Gets the block of this method call, if any.
@@ -111,13 +111,7 @@ class MethodCall extends Call, TMethodCall {
* ```
*/
class SetterMethodCall extends MethodCall {
SetterMethodCall() {
this instanceof LhsExpr
or
this = any(Assignment a).getDesugared()
or
this = any(Assignment a).getDesugared().(StmtSequence).getAStmt()
}
SetterMethodCall() { this = TMethodCallSynth(_, _, _, true, _) }
final override string getAPrimaryQlClass() { result = "SetterMethodCall" }
}
@@ -131,8 +125,6 @@ class SetterMethodCall extends MethodCall {
class ElementReference extends MethodCall, TElementReference {
final override string getAPrimaryQlClass() { result = "ElementReference" }
final override string getMethodName() { result = getMethodName(this, "[]") }
final override string toString() { result = "...[...]" }
}

View File

@@ -115,10 +115,7 @@ private module Cached {
TDivExprSynth(AST::AstNode parent, int i) { mkSynthChild(DivExprKind(), parent, i) } or
TDo(Generated::Do g) or
TDoBlock(Generated::DoBlock g) { not g.getParent() instanceof Generated::Lambda } or
TElementReferenceReal(Generated::ElementReference g) or
TElementReferenceSynth(AST::AstNode parent, int i) {
mkSynthChild(ElementReferenceKind(), parent, i)
} or
TElementReference(Generated::ElementReference g) or
TElse(Generated::Else g) or
TElsif(Generated::Elsif g) or
TEmptyStmt(Generated::EmptyStatement g) or
@@ -183,8 +180,8 @@ private module Cached {
} or
TLogicalOrExprSynth(AST::AstNode parent, int i) { mkSynthChild(LogicalOrExprKind(), parent, i) } or
TMethod(Generated::Method g) or
TMethodCallSynth(AST::AstNode parent, int i, string name) {
mkSynthChild(MethodCallKind(name), parent, i)
TMethodCallSynth(AST::AstNode parent, int i, string name, boolean setter, int arity) {
mkSynthChild(MethodCallKind(name, setter, arity), parent, i)
} or
TModuleDeclaration(Generated::Module g) or
TModuloExprReal(Generated::Binary g) { g instanceof @binary_percent } or
@@ -323,7 +320,7 @@ private module Cached {
n = TDivExprReal(result) or
n = TDo(result) or
n = TDoBlock(result) or
n = TElementReferenceReal(result) or
n = TElementReference(result) or
n = TElse(result) or
n = TElsif(result) or
n = TEmptyStmt(result) or
@@ -439,8 +436,6 @@ private module Cached {
or
result = TDivExprSynth(parent, i)
or
result = TElementReferenceSynth(parent, i)
or
result = TExponentExprSynth(parent, i)
or
result = TGlobalVariableAccessSynth(parent, i, _)
@@ -457,7 +452,7 @@ private module Cached {
or
result = TLogicalOrExprSynth(parent, i)
or
result = TMethodCallSynth(parent, i, _)
result = TMethodCallSynth(parent, i, _, _, _)
or
result = TModuloExprSynth(parent, i)
or
@@ -524,8 +519,6 @@ class TMethodCall =
TMethodCallSynth or TIdentifierMethodCall or TScopeResolutionMethodCall or TRegularMethodCall or
TElementReference or TSuperCall;
class TElementReference = TElementReferenceReal or TElementReferenceSynth;
class TSuperCall = TTokenSuperCall or TRegularSuperCall;
class TConstantAccess = TTokenConstantAccess or TScopeResolutionConstantAccess or TNamespace;

View File

@@ -7,37 +7,11 @@ predicate isIdentifierMethodCall(Generated::Identifier g) { vcall(g) and not acc
predicate isRegularMethodCall(Generated::Call g) { not g.getMethod() instanceof Generated::Super }
string regularMethodCallName(Generated::Call g) {
isRegularMethodCall(g) and
(
result = "call" and g.getMethod() instanceof Generated::ArgumentList
or
result = g.getMethod().(Generated::Token).getValue()
or
result = g.getMethod().(Generated::ScopeResolution).getName().(Generated::Token).getValue()
)
}
predicate isScopeResolutionMethodCall(Generated::ScopeResolution g, Generated::Identifier i) {
i = g.getName() and
not exists(Generated::Call c | c.getMethod() = g)
}
string methodCallName(MethodCall mc) {
exists(Generated::AstNode g | g = toGenerated(mc) |
isIdentifierMethodCall(g) and result = g.(Generated::Identifier).getValue()
or
result = regularMethodCallName(g)
or
isScopeResolutionMethodCall(g, any(Generated::Identifier i | result = i.getValue()))
)
}
bindingset[s]
string getMethodName(MethodCall mc, string s) {
if mc instanceof SetterMethodCall then result = s + "=" else result = s
}
abstract class CallImpl extends Call {
abstract Expr getArgumentImpl(int n);
@@ -55,21 +29,16 @@ abstract class CallImpl extends Call {
abstract class MethodCallImpl extends CallImpl, MethodCall {
abstract Expr getReceiverImpl();
}
/**
* Gets the special integer literal used to specify the number of arguments
* in a synthesized call.
*/
private TIntegerLiteralSynth getNumberOfArgumentsSynth(MethodCall mc, int value) {
result = TIntegerLiteralSynth(mc, -2, value)
abstract string getMethodNameImpl();
}
class MethodCallSynth extends MethodCallImpl, TMethodCallSynth {
final override string getMethodName() {
exists(string name |
this = TMethodCallSynth(_, _, name) and
result = getMethodName(this, name)
final override string getMethodNameImpl() {
exists(boolean setter, string name | this = TMethodCallSynth(_, _, name, setter, _) |
setter = true and result = name + "="
or
setter = false and result = name
)
}
@@ -77,14 +46,7 @@ class MethodCallSynth extends MethodCallImpl, TMethodCallSynth {
final override Expr getArgumentImpl(int n) { synthChild(this, n + 1, result) and n >= 0 }
final override int getNumberOfArgumentsImpl() { exists(getNumberOfArgumentsSynth(this, result)) }
final override AstNode getAChild(string pred) {
result = super.getAChild(pred)
or
pred = "getNumberOfArguments" and
result = getNumberOfArgumentsSynth(this, _)
}
final override int getNumberOfArgumentsImpl() { this = TMethodCallSynth(_, _, _, _, result) }
}
class IdentifierMethodCall extends MethodCallImpl, TIdentifierMethodCall {
@@ -92,7 +54,7 @@ class IdentifierMethodCall extends MethodCallImpl, TIdentifierMethodCall {
IdentifierMethodCall() { this = TIdentifierMethodCall(g) }
final override string getMethodName() { result = getMethodName(this, g.getValue()) }
final override string getMethodNameImpl() { result = g.getValue() }
final override Self getReceiverImpl() { result = TSelfSynth(this, 0) }
@@ -107,7 +69,7 @@ class ScopeResolutionMethodCall extends MethodCallImpl, TScopeResolutionMethodCa
ScopeResolutionMethodCall() { this = TScopeResolutionMethodCall(g, i) }
final override string getMethodName() { result = getMethodName(this, i.getValue()) }
final override string getMethodNameImpl() { result = i.getValue() }
final override Expr getReceiverImpl() { toGenerated(result) = g.getScope() }
@@ -130,7 +92,16 @@ class RegularMethodCall extends MethodCallImpl, TRegularMethodCall {
result = TSelfSynth(this, 0)
}
final override string getMethodName() { result = getMethodName(this, regularMethodCallName(g)) }
final override string getMethodNameImpl() {
isRegularMethodCall(g) and
(
result = "call" and g.getMethod() instanceof Generated::ArgumentList
or
result = g.getMethod().(Generated::Token).getValue()
or
result = g.getMethod().(Generated::ScopeResolution).getName().(Generated::Token).getValue()
)
}
final override Expr getArgumentImpl(int n) {
toGenerated(result) = g.getArguments().getChild(n)
@@ -147,39 +118,32 @@ class RegularMethodCall extends MethodCallImpl, TRegularMethodCall {
final override Block getBlock() { toGenerated(result) = g.getBlock() }
}
class ElementReferenceReal extends MethodCallImpl, TElementReferenceReal {
class ElementReferenceImpl extends MethodCallImpl, TElementReference {
private Generated::ElementReference g;
ElementReferenceReal() { this = TElementReferenceReal(g) }
ElementReferenceImpl() { this = TElementReference(g) }
final override Expr getReceiverImpl() { toGenerated(result) = g.getObject() }
final override Expr getArgumentImpl(int n) { toGenerated(result) = g.getChild(n) }
final override int getNumberOfArgumentsImpl() { result = count(g.getChild(_)) }
final override string getMethodNameImpl() { result = "[]" }
}
class ElementReferenceSynth extends MethodCallImpl, TElementReferenceSynth {
final override Expr getReceiverImpl() { synthChild(this, 0, result) }
final override Expr getArgumentImpl(int n) { synthChild(this, n + 1, result) and n >= 0 }
final override int getNumberOfArgumentsImpl() { exists(getNumberOfArgumentsSynth(this, result)) }
final override AstNode getAChild(string pred) {
result = super.getAChild(pred)
or
pred = "getNumberOfArguments" and
result = getNumberOfArgumentsSynth(this, _)
}
}
class TokenSuperCall extends SuperCall, TTokenSuperCall {
class TokenSuperCall extends SuperCall, MethodCallImpl, TTokenSuperCall {
private Generated::Super g;
TokenSuperCall() { this = TTokenSuperCall(g) }
final override string getMethodName() { result = getMethodName(this, g.getValue()) }
final override string getMethodNameImpl() { result = g.getValue() }
final override Expr getReceiverImpl() { none() }
final override Expr getArgumentImpl(int n) { none() }
final override int getNumberOfArgumentsImpl() { result = 0 }
}
class RegularSuperCall extends SuperCall, MethodCallImpl, TRegularSuperCall {
@@ -187,9 +151,7 @@ class RegularSuperCall extends SuperCall, MethodCallImpl, TRegularSuperCall {
RegularSuperCall() { this = TRegularSuperCall(g) }
final override string getMethodName() {
result = getMethodName(this, g.getMethod().(Generated::Super).getValue())
}
final override string getMethodNameImpl() { result = g.getMethod().(Generated::Super).getValue() }
final override Expr getReceiverImpl() { none() }

View File

@@ -17,7 +17,6 @@ newtype SynthKind =
BitwiseXorExprKind() or
ClassVariableAccessKind(ClassVariable v) or
DivExprKind() or
ElementReferenceKind() or
ExponentExprKind() or
GlobalVariableAccessKind(GlobalVariable v) or
InstanceVariableAccessKind(InstanceVariable v) or
@@ -27,12 +26,8 @@ newtype SynthKind =
LocalVariableAccessSynthKind(TLocalVariableSynth v) or
LogicalAndExprKind() or
LogicalOrExprKind() or
MethodCallKind(string name) {
exists(Generated::Identifier g | isIdentifierMethodCall(g) and name = g.getValue())
or
exists(Generated::Identifier i | isScopeResolutionMethodCall(_, i) and name = i.getValue())
or
name = regularMethodCallName(_)
MethodCallKind(string name, boolean setter, int arity) {
any(Synthesis s).methodCall(name, setter, arity)
} or
ModuloExprKind() or
MulExprKind() or
@@ -75,6 +70,11 @@ class Synthesis extends TSynthesis {
*/
predicate localVariable(AstNode n, int i) { none() }
/**
* Holds if a method call to `name` with arity `arity` is needed.
*/
predicate methodCall(string name, boolean setter, int arity) { none() }
/**
* Holds if `n` should be excluded from `ControlFlowTree` in the CFG construction.
*/
@@ -107,11 +107,9 @@ private predicate assign(
)
}
private SynthKind getCallKind(MethodCall mc) {
result = MethodCallKind(methodCallName(mc))
or
mc instanceof ElementReference and
result = ElementReferenceKind()
bindingset[arity, setter]
private SynthKind getCallKind(MethodCall mc, boolean setter, int arity) {
result = MethodCallKind(mc.getMethodName(), setter, arity)
}
private SomeLocation getSomeLocation(AstNode n) {
@@ -169,7 +167,7 @@ private module SetterDesugar {
exists(AstNode seq | seq = getSynthChild(ae, -1) |
parent = seq and
i = 0 and
child = SynthChild(getCallKind(mc)) and
child = SynthChild(getCallKind(mc, true, mc.getNumberOfArguments() + 1)) and
l = getSomeLocation(mc)
or
exists(AstNode call | call = getSynthChild(seq, 0) |
@@ -197,12 +195,6 @@ private module SetterDesugar {
child = RealChild(ae.getRightOperand())
)
)
or
parent = call and
// special "number of arguments argument"; required to avoid non-monotonic recursion
i = -2 and
child = SynthChild(IntegerLiteralKind(mc.getNumberOfArguments() + 1)) and
l = NoneLocation()
)
or
parent = seq and
@@ -221,6 +213,15 @@ private module SetterDesugar {
n.(AssignExpr).getLeftOperand() instanceof MethodCall and
i = 0
}
final override predicate methodCall(string name, boolean setter, int arity) {
exists(AssignExpr ae, MethodCall mc |
mc = ae.getLeftOperand() and
name = mc.getMethodName() and
setter = true and
arity = mc.getNumberOfArguments() + 1
)
}
}
}
@@ -380,7 +381,7 @@ private module AssignOperationDesugar {
exists(AstNode op | op = getSynthChild(assign, 1) |
parent = op and
i = 0 and
child = SynthChild(getCallKind(mc)) and
child = SynthChild(getCallKind(mc, false, mc.getNumberOfArguments())) and
l = getSomeLocation(mc)
or
parent = getSynthChild(op, 0) and
@@ -402,7 +403,7 @@ private module AssignOperationDesugar {
// `__synth__0.[]=(__synth__1, __synth__2);`
parent = seq and
i = opAssignIndex + 1 and
child = SynthChild(getCallKind(mc)) and
child = SynthChild(getCallKind(mc, true, opAssignIndex)) and
l = getSomeLocation(mc)
or
exists(AstNode setter | setter = getSynthChild(seq, opAssignIndex + 1) |
@@ -420,12 +421,6 @@ private module AssignOperationDesugar {
child =
SynthChild(LocalVariableAccessSynthKind(TLocalVariableSynth(ao, opAssignIndex))) and
l = SomeLocation(getAssignOperationLocation(ao))
or
// special "number of arguments argument"; required to avoid non-monotonic recursion
parent = setter and
i = -2 and
child = SynthChild(IntegerLiteralKind(opAssignIndex + 1)) and
l = NoneLocation()
)
or
parent = seq and
@@ -443,6 +438,18 @@ private module AssignOperationDesugar {
)
}
final override predicate methodCall(string name, boolean setter, int arity) {
exists(MethodCall mc | exists(assignOperationMethodCall(mc)) |
name = mc.getMethodName() and
setter = false and
arity = mc.getNumberOfArguments()
or
name = mc.getMethodName() and
setter = true and
arity = mc.getNumberOfArguments() + 1
)
}
final override predicate excludeFromControlFlowTree(AstNode n) {
exists(assignOperationMethodCall(n))
}

View File

@@ -522,22 +522,22 @@ calls/calls.rb:
# 311| getReceiver: [Self] self
# 311| getArgument: [IntegerLiteral] 1
# 314| getStmt: [AssignExpr] ... = ...
# 314| getAnOperand/getLeftOperand: [SetterMethodCall] call to foo=
# 314| getAnOperand/getLeftOperand: [MethodCall] call to foo
# 314| getReceiver: [Self] self
# 314| getAnOperand/getRightOperand: [IntegerLiteral] 10
# 315| getStmt: [AssignExpr] ... = ...
# 315| getAnOperand/getLeftOperand: [ElementReference, SetterMethodCall] ...[...]
# 315| getAnOperand/getLeftOperand: [ElementReference] ...[...]
# 315| getReceiver: [MethodCall] call to foo
# 315| getReceiver: [Self] self
# 315| getArgument: [IntegerLiteral] 0
# 315| getAnOperand/getRightOperand: [IntegerLiteral] 10
# 316| getStmt: [AssignExpr] ... = ...
# 316| getLeftOperand: [TuplePattern] (..., ...)
# 316| getElement: [SetterMethodCall] call to foo=
# 316| getElement: [MethodCall] call to foo
# 316| getReceiver: [Self] self
# 316| getElement: [SetterMethodCall] call to bar=
# 316| getElement: [MethodCall] call to bar
# 316| getReceiver: [Self] self
# 316| getElement: [ElementReference, SetterMethodCall] ...[...]
# 316| getElement: [ElementReference] ...[...]
# 316| getReceiver: [MethodCall] call to foo
# 316| getReceiver: [Self] self
# 316| getArgument: [IntegerLiteral] 4
@@ -549,7 +549,7 @@ calls/calls.rb:
# 317| getStmt: [AssignExpr] ... = ...
# 317| getLeftOperand: [TuplePattern] (..., ...)
# 317| getElement: [LocalVariableAccess] a
# 317| getElement: [ElementReference, SetterMethodCall] ...[...]
# 317| getElement: [ElementReference] ...[...]
# 317| getReceiver: [MethodCall] call to foo
# 317| getReceiver: [Self] self
# 317| getArgument: [IntegerLiteral] 5
@@ -558,17 +558,17 @@ calls/calls.rb:
# 317| getElement: [IntegerLiteral] 2
# 317| getElement: [IntegerLiteral] 3
# 318| getStmt: [AssignAddExpr] ... += ...
# 318| getAnOperand/getLeftOperand: [SetterMethodCall] call to count=
# 318| getAnOperand/getLeftOperand: [MethodCall] call to count
# 318| getReceiver: [Self] self
# 318| getAnOperand/getRightOperand: [IntegerLiteral] 1
# 319| getStmt: [AssignAddExpr] ... += ...
# 319| getAnOperand/getLeftOperand: [ElementReference, SetterMethodCall] ...[...]
# 319| getAnOperand/getLeftOperand: [ElementReference] ...[...]
# 319| getReceiver: [MethodCall] call to foo
# 319| getReceiver: [Self] self
# 319| getArgument: [IntegerLiteral] 0
# 319| getAnOperand/getRightOperand: [IntegerLiteral] 1
# 320| getStmt: [AssignMulExpr] ... *= ...
# 320| getAnOperand/getLeftOperand: [ElementReference, SetterMethodCall] ...[...]
# 320| getAnOperand/getLeftOperand: [ElementReference] ...[...]
# 320| getReceiver: [MethodCall] call to bar
# 320| getReceiver: [MethodCall] call to foo
# 320| getReceiver: [Self] self

View File

@@ -14,16 +14,14 @@ calls/calls.rb:
# 314| [StmtSequence] ...
# 314| getStmt: [SetterMethodCall] call to foo=
# 314| getReceiver: [Self] self
# 314| getNumberOfArguments: [IntegerLiteral] 1
# 314| getArgument: [AssignExpr] ... = ...
# 314| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
# 314| getAnOperand/getRightOperand: [IntegerLiteral] 10
# 314| getStmt: [LocalVariableAccess] __synth__0
# 315| [StmtSequence] ...
# 315| getStmt: [ElementReference, SetterMethodCall] ...[...]
# 315| getStmt: [SetterMethodCall] call to []=
# 315| getReceiver: [MethodCall] call to foo
# 315| getReceiver: [Self] self
# 315| getNumberOfArguments: [IntegerLiteral] 2
# 315| getArgument: [AssignExpr] ... = ...
# 315| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
# 315| getAnOperand/getRightOperand: [IntegerLiteral] 10
@@ -31,7 +29,6 @@ calls/calls.rb:
# 315| getStmt: [LocalVariableAccess] __synth__0
# 318| [StmtSequence] ...
# 318| getStmt: [SetterMethodCall] call to count=
# 318| getNumberOfArguments: [IntegerLiteral] 2
# 318| getReceiver: [LocalVariableAccess] __synth__0
# 318| getArgument: [LocalVariableAccess] __synth__1
# 318| getStmt: [AssignExpr] ... = ...
@@ -45,40 +42,38 @@ calls/calls.rb:
# 318| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__1
# 318| getStmt: [LocalVariableAccess] __synth__1
# 319| [StmtSequence] ...
# 319| getStmt: [SetterMethodCall] call to []=
# 319| getReceiver: [LocalVariableAccess] __synth__0
# 319| getArgument: [LocalVariableAccess] __synth__1
# 319| getArgument: [LocalVariableAccess] __synth__2
# 319| getStmt: [AssignExpr] ... = ...
# 319| getAnOperand/getRightOperand: [MethodCall] call to foo
# 319| getReceiver: [Self] self
# 319| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
# 319| getStmt: [ElementReference, SetterMethodCall] ...[...]
# 319| getNumberOfArguments: [IntegerLiteral] 3
# 319| getReceiver: [LocalVariableAccess] __synth__0
# 319| getArgument: [LocalVariableAccess] __synth__1
# 319| getArgument: [LocalVariableAccess] __synth__2
# 319| getStmt: [AssignExpr] ... = ...
# 319| getAnOperand/getRightOperand: [IntegerLiteral] 0
# 319| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__1
# 319| getStmt: [AssignExpr] ... = ...
# 319| getAnOperand/getRightOperand: [AddExpr] ... + ...
# 319| getAnOperand/getLeftOperand: [ElementReference] ...[...]
# 319| getAnOperand/getLeftOperand: [MethodCall] call to []
# 319| getReceiver: [LocalVariableAccess] __synth__0
# 319| getArgument: [LocalVariableAccess] __synth__1
# 319| getAnOperand/getRightOperand: [IntegerLiteral] 1
# 319| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__2
# 319| getStmt: [LocalVariableAccess] __synth__2
# 320| [StmtSequence] ...
# 320| getStmt: [AssignExpr] ... = ...
# 320| getAnOperand/getRightOperand: [MethodCall] call to bar
# 320| getReceiver: [MethodCall] call to foo
# 320| getReceiver: [Self] self
# 320| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
# 320| getStmt: [ElementReference, SetterMethodCall] ...[...]
# 320| getNumberOfArguments: [IntegerLiteral] 5
# 320| getStmt: [SetterMethodCall] call to []=
# 320| getReceiver: [LocalVariableAccess] __synth__0
# 320| getArgument: [LocalVariableAccess] __synth__1
# 320| getArgument: [LocalVariableAccess] __synth__2
# 320| getArgument: [LocalVariableAccess] __synth__3
# 320| getArgument: [LocalVariableAccess] __synth__4
# 320| getStmt: [AssignExpr] ... = ...
# 320| getAnOperand/getRightOperand: [MethodCall] call to bar
# 320| getReceiver: [MethodCall] call to foo
# 320| getReceiver: [Self] self
# 320| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
# 320| getStmt: [AssignExpr] ... = ...
# 320| getAnOperand/getRightOperand: [IntegerLiteral] 0
# 320| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__1
# 320| getStmt: [AssignExpr] ... = ...
@@ -95,7 +90,7 @@ calls/calls.rb:
# 320| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__3
# 320| getStmt: [AssignExpr] ... = ...
# 320| getAnOperand/getRightOperand: [MulExpr] ... * ...
# 320| getAnOperand/getLeftOperand: [ElementReference] ...[...]
# 320| getAnOperand/getLeftOperand: [MethodCall] call to []
# 320| getReceiver: [LocalVariableAccess] __synth__0
# 320| getArgument: [LocalVariableAccess] __synth__1
# 320| getArgument: [LocalVariableAccess] __synth__2

View File

@@ -32,26 +32,26 @@ callsWithArguments
| calls.rb:293:5:293:33 | call to super | super | 1 | calls.rb:293:14:293:14 | 7 |
| calls.rb:311:1:311:7 | call to call | call | 0 | calls.rb:311:6:311:6 | 1 |
| calls.rb:314:1:314:8 | call to foo= | foo= | 0 | calls.rb:314:1:314:8 | ... = ... |
| calls.rb:315:1:315:6 | ...[...] | []= | 0 | calls.rb:315:5:315:5 | 0 |
| calls.rb:315:1:315:6 | ...[...] | []= | 0 | calls.rb:315:5:315:5 | 0 |
| calls.rb:315:1:315:6 | ...[...] | []= | 1 | calls.rb:315:1:315:6 | ... = ... |
| calls.rb:316:22:316:27 | ...[...] | []= | 0 | calls.rb:316:26:316:26 | 4 |
| calls.rb:317:5:317:10 | ...[...] | []= | 0 | calls.rb:317:9:317:9 | 5 |
| calls.rb:315:1:315:6 | ...[...] | [] | 0 | calls.rb:315:5:315:5 | 0 |
| calls.rb:315:1:315:6 | call to []= | []= | 0 | calls.rb:315:5:315:5 | 0 |
| calls.rb:315:1:315:6 | call to []= | []= | 1 | calls.rb:315:1:315:6 | ... = ... |
| calls.rb:316:22:316:27 | ...[...] | [] | 0 | calls.rb:316:26:316:26 | 4 |
| calls.rb:317:5:317:10 | ...[...] | [] | 0 | calls.rb:317:9:317:9 | 5 |
| calls.rb:318:1:318:10 | call to count= | count= | 1 | calls.rb:318:12:318:13 | __synth__1 |
| calls.rb:319:1:319:6 | ...[...] | [] | 0 | calls.rb:319:5:319:5 | __synth__1 |
| calls.rb:319:1:319:6 | ...[...] | []= | 0 | calls.rb:319:5:319:5 | 0 |
| calls.rb:319:1:319:6 | ...[...] | []= | 0 | calls.rb:319:5:319:5 | __synth__1 |
| calls.rb:319:1:319:6 | ...[...] | []= | 2 | calls.rb:319:8:319:9 | __synth__2 |
| calls.rb:320:1:320:32 | ...[...] | [] | 0 | calls.rb:320:9:320:9 | __synth__1 |
| calls.rb:320:1:320:32 | ...[...] | [] | 1 | calls.rb:320:12:320:18 | __synth__2 |
| calls.rb:320:1:320:32 | ...[...] | [] | 2 | calls.rb:320:21:320:31 | __synth__3 |
| calls.rb:320:1:320:32 | ...[...] | []= | 0 | calls.rb:320:9:320:9 | 0 |
| calls.rb:320:1:320:32 | ...[...] | []= | 0 | calls.rb:320:9:320:9 | __synth__1 |
| calls.rb:320:1:320:32 | ...[...] | []= | 1 | calls.rb:320:12:320:18 | __synth__2 |
| calls.rb:320:1:320:32 | ...[...] | []= | 1 | calls.rb:320:12:320:18 | call to baz |
| calls.rb:320:1:320:32 | ...[...] | []= | 2 | calls.rb:320:21:320:31 | ... + ... |
| calls.rb:320:1:320:32 | ...[...] | []= | 2 | calls.rb:320:21:320:31 | __synth__3 |
| calls.rb:320:1:320:32 | ...[...] | []= | 4 | calls.rb:320:34:320:35 | __synth__4 |
| calls.rb:319:1:319:6 | ...[...] | [] | 0 | calls.rb:319:5:319:5 | 0 |
| calls.rb:319:1:319:6 | call to [] | [] | 0 | calls.rb:319:5:319:5 | __synth__1 |
| calls.rb:319:1:319:6 | call to []= | []= | 0 | calls.rb:319:5:319:5 | __synth__1 |
| calls.rb:319:1:319:6 | call to []= | []= | 2 | calls.rb:319:8:319:9 | __synth__2 |
| calls.rb:320:1:320:32 | ...[...] | [] | 0 | calls.rb:320:9:320:9 | 0 |
| calls.rb:320:1:320:32 | ...[...] | [] | 1 | calls.rb:320:12:320:18 | call to baz |
| calls.rb:320:1:320:32 | ...[...] | [] | 2 | calls.rb:320:21:320:31 | ... + ... |
| calls.rb:320:1:320:32 | call to [] | [] | 0 | calls.rb:320:9:320:9 | __synth__1 |
| calls.rb:320:1:320:32 | call to [] | [] | 1 | calls.rb:320:12:320:18 | __synth__2 |
| calls.rb:320:1:320:32 | call to [] | [] | 2 | calls.rb:320:21:320:31 | __synth__3 |
| calls.rb:320:1:320:32 | call to []= | []= | 0 | calls.rb:320:9:320:9 | __synth__1 |
| calls.rb:320:1:320:32 | call to []= | []= | 1 | calls.rb:320:12:320:18 | __synth__2 |
| calls.rb:320:1:320:32 | call to []= | []= | 2 | calls.rb:320:21:320:31 | __synth__3 |
| calls.rb:320:1:320:32 | call to []= | []= | 4 | calls.rb:320:34:320:35 | __synth__4 |
callsWithReceiver
| calls.rb:2:1:2:5 | call to foo | calls.rb:2:1:2:5 | self |
| calls.rb:5:1:5:10 | call to bar | calls.rb:5:1:5:3 | Foo |
@@ -220,29 +220,29 @@ callsWithReceiver
| calls.rb:310:1:310:6 | call to call | calls.rb:310:1:310:3 | call to foo |
| calls.rb:311:1:311:3 | call to foo | calls.rb:311:1:311:3 | self |
| calls.rb:311:1:311:7 | call to call | calls.rb:311:1:311:3 | call to foo |
| calls.rb:314:1:314:8 | call to foo= | calls.rb:314:1:314:4 | self |
| calls.rb:314:1:314:8 | call to foo | calls.rb:314:1:314:4 | self |
| calls.rb:314:1:314:8 | call to foo= | calls.rb:314:1:314:4 | self |
| calls.rb:315:1:315:3 | call to foo | calls.rb:315:1:315:3 | self |
| calls.rb:315:1:315:6 | ...[...] | calls.rb:315:1:315:3 | call to foo |
| calls.rb:315:1:315:6 | ...[...] | calls.rb:315:1:315:3 | call to foo |
| calls.rb:316:1:316:8 | call to foo= | calls.rb:316:1:316:4 | self |
| calls.rb:316:12:316:19 | call to bar= | calls.rb:316:12:316:15 | self |
| calls.rb:315:1:315:6 | call to []= | calls.rb:315:1:315:3 | call to foo |
| calls.rb:316:1:316:8 | call to foo | calls.rb:316:1:316:4 | self |
| calls.rb:316:12:316:19 | call to bar | calls.rb:316:12:316:15 | self |
| calls.rb:316:22:316:24 | call to foo | calls.rb:316:22:316:24 | self |
| calls.rb:316:22:316:27 | ...[...] | calls.rb:316:22:316:24 | call to foo |
| calls.rb:317:5:317:7 | call to foo | calls.rb:317:5:317:7 | self |
| calls.rb:317:5:317:10 | ...[...] | calls.rb:317:5:317:7 | call to foo |
| calls.rb:318:1:318:10 | call to count | calls.rb:318:1:318:4 | __synth__0 |
| calls.rb:318:1:318:10 | call to count | calls.rb:318:1:318:4 | self |
| calls.rb:318:1:318:10 | call to count= | calls.rb:318:1:318:4 | __synth__0 |
| calls.rb:318:1:318:10 | call to count= | calls.rb:318:1:318:4 | self |
| calls.rb:319:1:319:3 | call to foo | calls.rb:319:1:319:3 | self |
| calls.rb:319:1:319:6 | ...[...] | calls.rb:319:1:319:3 | __synth__0 |
| calls.rb:319:1:319:6 | ...[...] | calls.rb:319:1:319:3 | __synth__0 |
| calls.rb:319:1:319:6 | ...[...] | calls.rb:319:1:319:3 | call to foo |
| calls.rb:319:1:319:6 | call to [] | calls.rb:319:1:319:3 | __synth__0 |
| calls.rb:319:1:319:6 | call to []= | calls.rb:319:1:319:3 | __synth__0 |
| calls.rb:320:1:320:3 | call to foo | calls.rb:320:1:320:3 | self |
| calls.rb:320:1:320:7 | call to bar | calls.rb:320:1:320:3 | call to foo |
| calls.rb:320:1:320:32 | ...[...] | calls.rb:320:1:320:7 | __synth__0 |
| calls.rb:320:1:320:32 | ...[...] | calls.rb:320:1:320:7 | __synth__0 |
| calls.rb:320:1:320:32 | ...[...] | calls.rb:320:1:320:7 | call to bar |
| calls.rb:320:1:320:32 | call to [] | calls.rb:320:1:320:7 | __synth__0 |
| calls.rb:320:1:320:32 | call to []= | calls.rb:320:1:320:7 | __synth__0 |
| calls.rb:320:12:320:14 | call to foo | calls.rb:320:12:320:14 | self |
| calls.rb:320:12:320:18 | call to baz | calls.rb:320:12:320:14 | call to foo |
| calls.rb:320:21:320:23 | call to foo | calls.rb:320:21:320:23 | self |
@@ -286,16 +286,7 @@ superCallsWithBlock
| calls.rb:293:5:293:33 | call to super | calls.rb:293:16:293:33 | do ... end |
setterCalls
| calls.rb:314:1:314:8 | call to foo= |
| calls.rb:314:1:314:8 | call to foo= |
| calls.rb:315:1:315:6 | ...[...] |
| calls.rb:315:1:315:6 | ...[...] |
| calls.rb:316:1:316:8 | call to foo= |
| calls.rb:316:12:316:19 | call to bar= |
| calls.rb:316:22:316:27 | ...[...] |
| calls.rb:317:5:317:10 | ...[...] |
| calls.rb:315:1:315:6 | call to []= |
| calls.rb:318:1:318:10 | call to count= |
| calls.rb:318:1:318:10 | call to count= |
| calls.rb:319:1:319:6 | ...[...] |
| calls.rb:319:1:319:6 | ...[...] |
| calls.rb:320:1:320:32 | ...[...] |
| calls.rb:320:1:320:32 | ...[...] |
| calls.rb:319:1:319:6 | call to []= |
| calls.rb:320:1:320:32 | call to []= |

View File

@@ -2173,14 +2173,14 @@ desugar.rb:
# 10| ...
#-----| -> exit m3 (normal)
# 10| ...[...]
# 10| call to []=
#-----| -> __synth__0
# 10| __synth__0
#-----| -> ...
# 10| ... = ...
#-----| -> ...[...]
#-----| -> call to []=
# 10| __synth__0
#-----| -> 1
@@ -2276,19 +2276,19 @@ desugar.rb:
# 18| ...
#-----| -> exit m5 (normal)
# 18| call to []=
#-----| -> __synth__4
# 18| ... = ...
#-----| -> __synth__1
# 18| ...[...]
#-----| -> __synth__4
# 18| __synth__0
#-----| -> __synth__1
# 18| __synth__0
#-----| -> x
# 18| __synth__0
#-----| -> __synth__1
# 18| ...[...]
# 18| call to []
#-----| -> 1
# 18| __synth__0
@@ -2301,10 +2301,10 @@ desugar.rb:
#-----| -> __synth__2
# 18| __synth__1
#-----| -> 0
#-----| -> __synth__2
# 18| __synth__1
#-----| -> __synth__2
#-----| -> 0
# 18| __synth__1
#-----| -> __synth__2
@@ -2319,10 +2319,10 @@ desugar.rb:
#-----| -> __synth__3
# 18| __synth__2
#-----| -> y
#-----| -> __synth__3
# 18| __synth__2
#-----| -> __synth__3
#-----| -> y
# 18| __synth__2
#-----| -> __synth__3
@@ -2339,14 +2339,14 @@ desugar.rb:
# 18| ... = ...
#-----| -> __synth__4
# 18| __synth__3
#-----| -> x
# 18| __synth__3
#-----| -> __synth__4
# 18| __synth__3
#-----| -> ...[...]
#-----| -> x
# 18| __synth__3
#-----| -> call to []
# 18| 3
#-----| -> ... + ...
@@ -2361,10 +2361,10 @@ desugar.rb:
#-----| -> ... = ...
# 18| __synth__4
#-----| -> __synth__0
#-----| -> call to []=
# 18| __synth__4
#-----| -> ...[...]
#-----| -> __synth__0
# 18| 1
#-----| -> ... + ...