public class WritePropertyNode extends Node
vbase[vproperty] = v
or
vbase.property = v
Also used for defining object literal properties and ES5 getters and setters.
Note that reading a property may overwrite the base register due to ToObject coercion.
| Modifier and Type | Class and Description |
|---|---|
static class |
WritePropertyNode.Kind |
EXCEPTION_REG, FIRST_ORDINARY_REG, NO_VALUE, RETURN_REG| Constructor and Description |
|---|
WritePropertyNode(int base_reg,
int property_reg,
int value_reg,
boolean decl,
SourceLocation location)
Constructs a new write property node with variable property name.
|
WritePropertyNode(int base_reg,
java.lang.String property_str,
int value_reg,
WritePropertyNode.Kind kind,
boolean decl,
SourceLocation location)
Constructs a new write property node with fixed property name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canThrowExceptions()
Returns true if this node may throw exceptions.
|
void |
check(BasicBlock b)
Perform a consistency check of this node.
|
int |
getBaseRegister()
Returns the base register.
|
WritePropertyNode.Kind |
getKind()
Returns the kind.
|
int |
getPropertyRegister()
Returns the property register, or
AbstractNode.NO_VALUE if not applicable. |
java.lang.String |
getPropertyString()
Returns the property string, or null if not fixed.
|
int |
getValueRegister()
Returns the value register.
|
boolean |
isDecl()
Returns true if this node comes from a property declaration in an object literal.
|
boolean |
isPropertyFixed()
Returns true if the property is a fixed string.
|
void |
setBaseRegister(int base_reg)
Sets the base register.
|
void |
setPropertyRegister(int property_reg)
Set the property register.
|
void |
setValueRegister(int value_reg)
Sets the value register.
|
java.lang.String |
toString()
Returns a string description of this node.
|
void |
visitBy(NodeVisitor v)
Visits this node with the given visitor.
|
clone, getBlock, getDuplicateOf, getImplicitAfterCall, getIndex, getSourceLocation, getThisOrDuplicateOf, isArtificial, isRegistersDone, setArtificial, setBlock, setDuplicateOf, setImplicitAfterCall, setIndex, setRegistersDone, setSourceLocationpublic WritePropertyNode(int base_reg,
int property_reg,
int value_reg,
boolean decl,
SourceLocation location)
base_reg - The register for the base value.property_reg - The register for the property value.value_reg - The register for the value to write.decl - If set, this operation comes from an object literal property declaration.location - The source location.public WritePropertyNode(int base_reg,
java.lang.String property_str,
int value_reg,
WritePropertyNode.Kind kind,
boolean decl,
SourceLocation location)
base_reg - The register for the base value.property_str - The property string.value_reg - The register holding the value to write.kind - The kind of property being written.decl - If set, this operation comes from an object literal property declaration.location - The source location.public boolean canThrowExceptions()
AbstractNodecanThrowExceptions in class AbstractNodepublic void check(BasicBlock b)
AbstractNodecheck in class AbstractNodeb - basic block containing this nodepublic int getBaseRegister()
public WritePropertyNode.Kind getKind()
public int getPropertyRegister()
AbstractNode.NO_VALUE if not applicable.public java.lang.String getPropertyString()
public int getValueRegister()
public boolean isDecl()
public boolean isPropertyFixed()
public void setBaseRegister(int base_reg)
public void setPropertyRegister(int property_reg)
public void setValueRegister(int value_reg)
public java.lang.String toString()
AbstractNodetoString in class AbstractNodepublic void visitBy(NodeVisitor v)
NodeCopyright © 2009-2019 Aarhus University