Object

org.scalajs.core.ir

Trees

Related Doc: package ir

Permalink

object Trees

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Trees
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Apply(receiver: Tree, method: Ident, args: List[Tree])(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Apply an instance method with dynamic dispatch (the default).

  2. case class ApplyStatic(cls: ClassType, method: Ident, args: List[Tree])(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Apply a static method.

  3. case class ApplyStatically(receiver: Tree, cls: ClassType, method: Ident, args: List[Tree])(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Apply an instance method with static dispatch (e.g., super calls).

  4. case class ArrayLength(array: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  5. case class ArraySelect(array: Tree, index: Tree)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  6. case class ArrayValue(tpe: ArrayType, elems: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  7. case class AsInstanceOf(expr: Tree, cls: ReferenceType)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  8. case class Assign(lhs: Tree, rhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  9. case class BinaryOp(op: Code, lhs: Tree, rhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Binary operation (always preserves pureness).

  10. class Block extends Tree

    Permalink
  11. case class BooleanLiteral(value: Boolean)(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  12. case class CallHelper(helper: String, args: List[Tree])(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  13. case class ClassDef(name: Ident, kind: ClassKind, superClass: Option[Ident], interfaces: List[Ident], jsName: Option[String], defs: List[Tree])(optimizerHints: OptimizerHints)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  14. case class ClassOf(cls: ReferenceType)(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  15. case class Closure(captureParams: List[ParamDef], params: List[ParamDef], body: Tree, captureValues: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Closure with explicit captures.

    Closure with explicit captures. The n captures map to the n first formal arguments.

  16. case class ConstructorExportDef(name: String, args: List[ParamDef], body: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  17. case class Continue(label: Option[Ident] = None)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  18. case class Debugger()(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  19. case class DoWhile(body: Tree, cond: Tree, label: Option[Ident] = None)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  20. case class DoubleLiteral(value: Double)(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  21. case class FieldDef(name: PropertyName, ftpe: Type, mutable: Boolean)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  22. case class FloatLiteral(value: Float)(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  23. case class GetClass(expr: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  24. case class Ident(name: String, originalName: Option[String])(implicit pos: Position) extends PropertyName with Product with Serializable

    Permalink
  25. case class If(cond: Tree, thenp: Tree, elsep: Tree)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  26. case class IntLiteral(value: Int)(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  27. case class IsInstanceOf(expr: Tree, cls: ReferenceType)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  28. case class JSArrayConstr(items: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  29. case class JSBinaryOp(op: Code, lhs: Tree, rhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Binary operation (always preserves pureness).

    Binary operation (always preserves pureness).

    Operations which do not preserve pureness are not allowed in this tree. These are notably +=, -=, *=, /= and %=

  30. case class JSBracketMethodApply(receiver: Tree, method: Tree, args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  31. case class JSBracketSelect(qualifier: Tree, item: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  32. case class JSClassExportDef(fullName: String)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  33. case class JSDelete(prop: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  34. case class JSDotMethodApply(receiver: Tree, method: Ident, args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  35. case class JSDotSelect(qualifier: Tree, item: Ident)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  36. case class JSFunctionApply(fun: Tree, args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  37. case class JSLinkingInfo()(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  38. case class JSNew(ctor: Tree, args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  39. case class JSObjectConstr(fields: List[(PropertyName, Tree)])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  40. case class JSSpread(items: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    ...items, the "spread" operator of ECMAScript 6.

    ...items, the "spread" operator of ECMAScript 6.

    It is only valid in the args/items of a JSNew, JSFunctionApply, JSDotMethodApply, JSBracketMethodApply, or JSArrayConstr.

    items

    An Array whose items will be spread (not an arbitrary iterable)

  41. case class JSSuperBracketCall(cls: ClassType, receiver: Tree, method: Tree, args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Calls a method inherited from the parent class of cls on receiver.

    Calls a method inherited from the parent class of cls on receiver.

    cls must be a Scala.js-defined JS class.

    Given the Scala.js-defined JS class

    @ScalaJSDefined
    class Foo extends Bar

    The node

    JSSuperBrackerCall(ClassType(Foo), receiver, method, args)

    which is printed as

    receiver.Foo::super[method](...args)

    has the following semantics:

    Bar.prototype[method].call(receiver, ...args)

    If this happens to be located in an instance method of Foo, *and* receiver happens to be This(), this is equivalent to the ES6 statement

    super[method](...args)
  42. case class JSSuperBracketSelect(cls: ClassType, receiver: Tree, item: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Selects a property inherited from the parent class of cls on receiver.

    Selects a property inherited from the parent class of cls on receiver.

    cls must be a Scala.js-defined JS class.

    Given the Scala.js-defined JS class

    @ScalaJSDefined
    class Foo extends Bar

    The node

    JSSuperBrackerSelect(ClassType(Foo), qualifier, item)

    which is printed as

    qualifier.Foo::super[item]

    has the semantics of an ES6 super reference

    super[item]

    as if it were in an instance method of Foo with qualifier as the this value.

  43. case class JSSuperConstructorCall(args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Super constructor call in the constructor of a Scala.js-defined JS class.

    Super constructor call in the constructor of a Scala.js-defined JS class.

    Exactly one such node must appear in the constructor of a Scala.js-defined JS class, at the top-level (possibly as a direct child of a top-level Block). Any other use of this node is invalid.

    Statements before this node, as well as the args, cannot contain any This() node. Statements after this node can use This().

    After the execution of this node, it is guaranteed that all fields declared in the current class have been created and initialized. Up to that point, accessing any field declared in this class (e.g., through an overridden method called from the super constructor) is undefined behavior.

    All in all, the shape of a constructor is therefore:

    {
      statementsNotUsingThis();
      JSSuperConstructorCall(...argsNotUsingThis);
      statementsThatMayUseThis()
    }

    which currently translates to something of the following shape:

    {
      statementsNotUsingThis();
      super(...argsNotUsingThis);
      this.privateField1 = 0;
      this["publicField2"] = false;
      statementsThatMayUseThis()
    }
  44. case class JSUnaryOp(op: Code, lhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Unary operation (always preserves pureness).

    Unary operation (always preserves pureness).

    Operations which do not preserve pureness are not allowed in this tree. These are notably ++ and --

  45. case class Labeled(label: Ident, tpe: Type, body: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  46. sealed trait Literal extends Tree

    Permalink

    Marker for literals.

    Marker for literals. Literals are always pure.

  47. case class LoadJSConstructor(cls: ClassType)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Loads the constructor of a JS class (native or not).

    Loads the constructor of a JS class (native or not).

    cls must represent a non-trait JS class (native or not).

    This is used typically to instantiate a JS class, and most importantly if it is a Scala.js-defined JS class. Given the class

    @ScalaJSDefined
    class Foo(x: Int) extends js.Object

    The instantiation new Foo(1) would be represented as

    JSNew(LoadJSConstructor(ClassType("Foo")), List(IntLiteral(1)))

    This node is also useful to encode o.isInstanceOf[Foo]:

    JSBinaryOp(instanceof, o, LoadJSConstructor(ClassType("Foo")))

    If Foo is Scala.js-defined, the presence of this node makes it instantiable, and therefore reachable.

  48. case class LoadJSModule(cls: ClassType)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Like LoadModule but for a JS module class.

  49. case class LoadModule(cls: ClassType)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  50. case class LongLiteral(value: Long)(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  51. case class Match(selector: Tree, cases: List[(List[Literal], Tree)], default: Tree)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    A break-free switch (without fallthrough behavior).

    A break-free switch (without fallthrough behavior). Unlike a JavaScript switch, it can be used in expression position. It supports alternatives explicitly (hence the List[Tree] in cases), whereas in a switch one would use the fallthrough behavior to implement alternatives. (This is not a pattern matching construct like in Scala.)

  52. case class MethodDef(static: Boolean, name: PropertyName, args: List[ParamDef], resultType: Type, body: Tree)(optimizerHints: OptimizerHints, hash: Option[TreeHash])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  53. case class ModuleExportDef(fullName: String)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  54. case class New(cls: ClassType, ctor: Ident, args: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  55. case class NewArray(tpe: ArrayType, lengths: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  56. case class Null()(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  57. final class OptimizerHints extends AnyVal

    Permalink
  58. case class ParamDef(name: Ident, ptpe: Type, mutable: Boolean, rest: Boolean)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  59. case class PropertyDef(name: PropertyName, getterBody: Tree, setterArg: ParamDef, setterBody: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  60. sealed trait PropertyName extends AnyRef

    Permalink
  61. case class RecordValue(tpe: RecordType, elems: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  62. case class Return(expr: Tree, label: Option[Ident] = None)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  63. case class Select(qualifier: Tree, item: Ident)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  64. case class Skip()(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  65. case class StoreModule(cls: ClassType, value: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  66. case class StringLiteral(value: String)(implicit pos: Position) extends Tree with Literal with PropertyName with Product with Serializable

    Permalink
  67. case class This()(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  68. case class Throw(expr: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  69. sealed abstract class Tree extends AnyRef

    Permalink

    AST node of the IR.

  70. final class TreeHash extends AnyRef

    Permalink

    A hash of a tree (usually a MethodDef).

    A hash of a tree (usually a MethodDef). Contains two SHA-1 hashes

  71. case class Try(block: Tree, errVar: Ident, handler: Tree, finalizer: Tree)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  72. case class UnaryOp(op: Code, lhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

    Unary operation (always preserves pureness).

  73. case class Unbox(expr: Tree, charCode: Char)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  74. case class Undefined()(implicit pos: Position) extends Tree with Literal with Product with Serializable

    Permalink
  75. case class UndefinedParam()(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  76. case class VarDef(name: Ident, vtpe: Type, mutable: Boolean, rhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  77. case class VarRef(ident: Ident)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink
  78. case class While(cond: Tree, body: Tree, label: Option[Ident] = None)(implicit pos: Position) extends Tree with Product with Serializable

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object BinaryOp extends Serializable

    Permalink
  5. object Block

    Permalink
  6. object CallHelper extends Serializable

    Permalink
  7. object EmptyTree extends Tree with Product with Serializable

    Permalink
  8. object Ident extends Serializable

    Permalink
  9. object JSBinaryOp extends Serializable

    Permalink
  10. object JSUnaryOp extends Serializable

    Permalink
  11. object OptimizerHints

    Permalink
  12. object UnaryOp extends Serializable

    Permalink
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. final val isKeyword: Set[String]

    Permalink
  22. final def isValidIdentifier(name: String): Boolean

    Permalink
  23. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def requireValidIdent(name: String): Unit

    Permalink
    Annotations
    @inline()
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped