public class Unsoundness
extends java.lang.Object
UnsoundnessOptionValues
, but that is not always the case currently (see TODOs))addMessage(AbstractNode, String)
should be used whenever unsoundness is applied. UnsoundnessOptionValues.showUnsoundnessUsage
can be used to show where unsound transfer functions have been applied.Modifier and Type | Class and Description |
---|---|
static interface |
Unsoundness.MessageCollector |
Constructor and Description |
---|
Unsoundness(UnsoundnessOptionValues options,
Unsoundness.MessageCollector messageCollector)
Constructor with a configuration and a collector for the messages about unsoundness.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(AbstractNode node,
java.lang.String msg)
Records that unsoundness was used.
|
java.util.Optional<java.lang.String> |
evaluate_FunctionToString(AbstractNode node,
ObjectLabel functionLabel)
Maybe produces an unsound value for 'Function.prototype.toString.call(..)'.
|
void |
ignoringException(AbstractNode node,
java.lang.String exceptionKind) |
boolean |
mayAssumeClosedUIntAddition(AbstractNode node)
Decides if the result of 'n + m', where 'n' and 'm' are unsigned integers, is also an unsigned integer.
|
boolean |
mayAssumeFixedLocale(AbstractNode node)
Decides if a call to 'String.prototype.toLocaleString' (and similar methods) can be treated like 'String.prototype.toString'.
|
boolean |
mayAssumeInOperatorReturnsTrueWhenSoundResultIsMaybeTrueAndPropNameIsNumber(AbstractNode node,
Value v,
Value res)
Decides if the 'in' operator should be definitely true, when value to test 'v' is only numeric and 'v' is
maybe in the object.
|
boolean |
mayIgnoreEvalCallAtNonCallNode(AbstractNode node)
Decides if a call to 'eval' at a non-call node (likely spurious) can be treated as a no-op.
|
boolean |
mayIgnoreImpreciseEval(AbstractNode node)
Decides if an imprecise call to 'eval' can be treated as a no-op.
|
boolean |
mayIgnoreImpreciseInnerOuterHTML(AbstractNode node,
java.lang.String propertyName,
Str rhs)
Decides if an imprecise write to outerHTML can be treated as a no-op.
|
boolean |
mayIgnoreUnlikelyUndefinedAsFirstArgumentToAddition(AbstractNode node,
Value v)
Decides if undefined should be ignored as the first argument to addition
|
boolean |
maySimplifyImpreciseFunctionConstructor(CallNode node)
Decides if a an imprecise call to the Function-constructor can be treated as allocating an empty function.
|
boolean |
maySkipDeclaringGlobalVariablesImplicitly(AbstractNode node,
java.lang.String variableName)
Decides if a write to a completely free variable should result in a write on the global object.
|
boolean |
maySkipInternalProtoPropertyWrite(AbstractNode node)
Decides if an property write should update the internal prototype.
|
boolean |
maySkipMissingModelOfNativeFunction(AbstractNode node,
HostObject nativObject)
Decides if at call to a native function without an associated transfer function can be treated as a no-op.
|
boolean |
maySkipPropertyWrite(AbstractNode node,
ObjectProperty property)
Decides if a dynamic property write should consider a particular property name.
|
boolean |
maySkipPrototypesForPropertyRead(AbstractNode node,
Str propertyName,
Value currentPropertyValue)
Decides if a specific property name can be assumed not to be in the prototypes during a property read.
|
boolean |
maySkipSpecificDynamicPropertyRead(AbstractNode node,
PKey concretePropertyName)
Decides if a dynamic property read should consider a particular property name.
|
boolean |
mayUseFixedDateNow(AbstractNode node)
Decides if 'Date.now' produces a fixed value.
|
boolean |
mayUseFixedMathRandom(AbstractNode node)
Decides if 'Math.random' produces a fixed value.
|
boolean |
mayUseSortedObjectKeys(AbstractNode node)
Decides if 'Object.keys' produces a deterministically ordered array.
|
public Unsoundness(UnsoundnessOptionValues options, Unsoundness.MessageCollector messageCollector)
public void addMessage(AbstractNode node, java.lang.String msg)
public java.util.Optional<java.lang.String> evaluate_FunctionToString(AbstractNode node, ObjectLabel functionLabel)
public void ignoringException(AbstractNode node, java.lang.String exceptionKind)
public boolean mayAssumeClosedUIntAddition(AbstractNode node)
public boolean mayAssumeFixedLocale(AbstractNode node)
public boolean mayAssumeInOperatorReturnsTrueWhenSoundResultIsMaybeTrueAndPropNameIsNumber(AbstractNode node, Value v, Value res)
public boolean mayIgnoreEvalCallAtNonCallNode(AbstractNode node)
public boolean mayIgnoreImpreciseEval(AbstractNode node)
public boolean mayIgnoreImpreciseInnerOuterHTML(AbstractNode node, java.lang.String propertyName, Str rhs)
public boolean mayIgnoreUnlikelyUndefinedAsFirstArgumentToAddition(AbstractNode node, Value v)
public boolean maySimplifyImpreciseFunctionConstructor(CallNode node)
public boolean maySkipDeclaringGlobalVariablesImplicitly(AbstractNode node, java.lang.String variableName)
public boolean maySkipInternalProtoPropertyWrite(AbstractNode node)
public boolean maySkipMissingModelOfNativeFunction(AbstractNode node, HostObject nativObject)
public boolean maySkipPropertyWrite(AbstractNode node, ObjectProperty property)
public boolean maySkipPrototypesForPropertyRead(AbstractNode node, Str propertyName, Value currentPropertyValue)
public boolean maySkipSpecificDynamicPropertyRead(AbstractNode node, PKey concretePropertyName)
public boolean mayUseFixedDateNow(AbstractNode node)
public boolean mayUseFixedMathRandom(AbstractNode node)
public boolean mayUseSortedObjectKeys(AbstractNode node)
Copyright © 2009-2019 Aarhus University