Class IsPristineObjectNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.builtins.helper.IsPristineObjectNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
Helper node for optimization of built-in functions. Some built-in functions, like
RegExp.prototype.[@@replace], are suboptimal when implemented in full conformance to the
ECMAScript spec. We want to replace those functions with faster, non-spec-conforming variants
whenever possible. One of the prerequisites for doing so is that running the spec-conforming
variant must be side-effect-free, which can only be guaranteed when all properties and functions
used by the built-in function are known/built-in as well. Therefore, we define a "pristine"
property for built-in objects:
An object is considered "pristine" in respect to a given class and list of properties if and only if:
An object is considered "pristine" in respect to a given class and list of properties if and only if:
- The object is an instance of the given class
- The object's prototype's shape has never been changed
- None of the given properties have been overwritten in the prototype or the object
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Method Summary
Modifier and TypeMethodDescriptionstatic IsPristineObjectNodecreate(JSClass jsClass, com.oracle.truffle.api.object.Shape initialPrototypeShape, Object... propertyKeys) static IsPristineObjectNodecreateRegExpExecAndMatch(JSContext context) abstract booleanexecute(JSDynamicObject object) Methods inherited from class com.oracle.truffle.js.nodes.JavaScriptBaseNode
copy, getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, onReplaceMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecialize, toString
-
Method Details
-
create
public static IsPristineObjectNode create(JSClass jsClass, com.oracle.truffle.api.object.Shape initialPrototypeShape, Object... propertyKeys) -
createRegExpExecAndMatch
-
execute
-