scala.tools.nsc.backend

ScalaPrimitives

class ScalaPrimitives extends AnyRef

Scala primitive operations are represented as methods in Any and AnyVal subclasses. Here we demultiplex them by providing a mapping from their symbols to integers. Different methods exist for different value types, but with the same meaning (like plus, minus, etc.). They will all be mapped to the same int.

Note: The three equal methods have the following semantics:

- "==" checks for null, and if non-null, calls java.lang.Object.equals
(class: Any; modifier: final). Primitive: EQ

- "eq" usual reference comparison
(class: AnyRef; modifier: final). Primitive: ID

- "equals" user-defined equality (Java semantics)
(class: Object; modifier: none). Primitive: EQUALS

Inspired from the scalac compiler.

Attributes
abstract
Source
ScalaPrimitives.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ScalaPrimitives
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScalaPrimitives ()

Abstract Value Members

  1. val global : Global

    Attributes
    abstract

Concrete Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. val ADD : Int(10)

    Attributes
    final
  7. val AND : Int(22)

    Attributes
    final
  8. val APPLY : Int(71)

    Attributes
    final
  9. val AS : Int(81)

    Attributes
    final
  10. val ASR : Int(32)

    Attributes
    final
  11. val B2B : Int(200)

    Attributes
    final
  12. val B2C : Int(202)

    Attributes
    final
  13. val B2D : Int(206)

    Attributes
    final
  14. val B2F : Int(205)

    Attributes
    final
  15. val B2I : Int(203)

    Attributes
    final
  16. val B2L : Int(204)

    Attributes
    final
  17. val B2S : Int(201)

    Attributes
    final
  18. val BARRAY_GET : Int(141)

    Attributes
    final
  19. val BARRAY_LENGTH : Int(132)

    Attributes
    final
  20. val BARRAY_SET : Int(151)

    Attributes
    final
  21. val BOX : Int(110)

    Attributes
    final
  22. val C2B : Int(220)

    Attributes
    final
  23. val C2C : Int(222)

    Attributes
    final
  24. val C2D : Int(226)

    Attributes
    final
  25. val C2F : Int(225)

    Attributes
    final
  26. val C2I : Int(223)

    Attributes
    final
  27. val C2L : Int(224)

    Attributes
    final
  28. val C2S : Int(221)

    Attributes
    final
  29. val CARRAY_GET : Int(143)

    Attributes
    final
  30. val CARRAY_LENGTH : Int(134)

    Attributes
    final
  31. val CARRAY_SET : Int(153)

    Attributes
    final
  32. val COERCE : Int(101)

    Attributes
    final
  33. val CONCAT : Int(100)

    Attributes
    final
  34. val D2B : Int(260)

    Attributes
    final
  35. val D2C : Int(262)

    Attributes
    final
  36. val D2D : Int(266)

    Attributes
    final
  37. val D2F : Int(265)

    Attributes
    final
  38. val D2I : Int(263)

    Attributes
    final
  39. val D2L : Int(264)

    Attributes
    final
  40. val D2S : Int(261)

    Attributes
    final
  41. val DARRAY_GET : Int(147)

    Attributes
    final
  42. val DARRAY_LENGTH : Int(138)

    Attributes
    final
  43. val DARRAY_SET : Int(157)

    Attributes
    final
  44. val DIV : Int(13)

    Attributes
    final
  45. val EQ : Int(42)

    Attributes
    final
  46. val F2B : Int(250)

    Attributes
    final
  47. val F2C : Int(252)

    Attributes
    final
  48. val F2D : Int(256)

    Attributes
    final
  49. val F2F : Int(255)

    Attributes
    final
  50. val F2I : Int(253)

    Attributes
    final
  51. val F2L : Int(254)

    Attributes
    final
  52. val F2S : Int(251)

    Attributes
    final
  53. val FARRAY_GET : Int(146)

    Attributes
    final
  54. val FARRAY_LENGTH : Int(137)

    Attributes
    final
  55. val FARRAY_SET : Int(156)

    Attributes
    final
  56. val GE : Int(46)

    Attributes
    final
  57. val GT : Int(47)

    Attributes
    final
  58. val HASH : Int(87)

    Attributes
    final
  59. val I2B : Int(230)

    Attributes
    final
  60. val I2C : Int(232)

    Attributes
    final
  61. val I2D : Int(236)

    Attributes
    final
  62. val I2F : Int(235)

    Attributes
    final
  63. val I2I : Int(233)

    Attributes
    final
  64. val I2L : Int(234)

    Attributes
    final
  65. val I2S : Int(231)

    Attributes
    final
  66. val IARRAY_GET : Int(144)

    Attributes
    final
  67. val IARRAY_LENGTH : Int(135)

    Attributes
    final
  68. val IARRAY_SET : Int(154)

    Attributes
    final
  69. val ID : Int(40)

    Attributes
    final
  70. val IS : Int(80)

    Attributes
    final
  71. val L2B : Int(240)

    Attributes
    final
  72. val L2C : Int(242)

    Attributes
    final
  73. val L2D : Int(246)

    Attributes
    final
  74. val L2F : Int(245)

    Attributes
    final
  75. val L2I : Int(243)

    Attributes
    final
  76. val L2L : Int(244)

    Attributes
    final
  77. val L2S : Int(241)

    Attributes
    final
  78. val LARRAY_GET : Int(145)

    Attributes
    final
  79. val LARRAY_LENGTH : Int(136)

    Attributes
    final
  80. val LARRAY_SET : Int(155)

    Attributes
    final
  81. val LE : Int(45)

    Attributes
    final
  82. val LENGTH : Int(70)

    Attributes
    final
  83. val LSL : Int(30)

    Attributes
    final
  84. val LSR : Int(31)

    Attributes
    final
  85. val LT : Int(44)

    Attributes
    final
  86. val MOD : Int(14)

    Attributes
    final
  87. val MUL : Int(12)

    Attributes
    final
  88. val NE : Int(43)

    Attributes
    final
  89. val NEG : Int(2)

    Attributes
    final
  90. val NEW_BARRAY : Int(113)

    Attributes
    final
  91. val NEW_CARRAY : Int(115)

    Attributes
    final
  92. val NEW_DARRAY : Int(119)

    Attributes
    final
  93. val NEW_FARRAY : Int(118)

    Attributes
    final
  94. val NEW_IARRAY : Int(116)

    Attributes
    final
  95. val NEW_LARRAY : Int(117)

    Attributes
    final
  96. val NEW_OARRAY : Int(120)

    Attributes
    final
  97. val NEW_SARRAY : Int(114)

    Attributes
    final
  98. val NEW_ZARRAY : Int(112)

    Attributes
    final
  99. val NI : Int(41)

    Attributes
    final
  100. val NOT : Int(3)

    Attributes
    final
  101. val OARRAY_GET : Int(148)

    Attributes
    final
  102. val OARRAY_LENGTH : Int(139)

    Attributes
    final
  103. val OARRAY_SET : Int(158)

    Attributes
    final
  104. val OR : Int(20)

    Attributes
    final
  105. val POS : Int(1)

    Attributes
    final
  106. val S2B : Int(210)

    Attributes
    final
  107. val S2C : Int(212)

    Attributes
    final
  108. val S2D : Int(216)

    Attributes
    final
  109. val S2F : Int(215)

    Attributes
    final
  110. val S2I : Int(213)

    Attributes
    final
  111. val S2L : Int(214)

    Attributes
    final
  112. val S2S : Int(211)

    Attributes
    final
  113. val SARRAY_GET : Int(142)

    Attributes
    final
  114. val SARRAY_LENGTH : Int(133)

    Attributes
    final
  115. val SARRAY_SET : Int(152)

    Attributes
    final
  116. val SUB : Int(11)

    Attributes
    final
  117. val SYNCHRONIZED : Int(90)

    Attributes
    final
  118. val UNBOX : Int(111)

    Attributes
    final
  119. val UPDATE : Int(72)

    Attributes
    final
  120. val XOR : Int(21)

    Attributes
    final
  121. val ZAND : Int(61)

    Attributes
    final
  122. val ZARRAY_GET : Int(140)

    Attributes
    final
  123. val ZARRAY_LENGTH : Int(131)

    Attributes
    final
  124. val ZARRAY_SET : Int(150)

    Attributes
    final
  125. val ZNOT : Int(50)

    Attributes
    final
  126. val ZOR : Int(60)

    Attributes
    final
  127. def addPrimitive (s: Symbol, code: Int): Unit

    Add a primitive operation to the map

  128. def addPrimitives (cls: Symbol, method: Name, code: Int): Unit

  129. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  130. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  131. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  132. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  134. def generatedKind (code: Int): TypeKind

    If code is a coercion primitive, the result type

  135. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  136. def getPrimitive (fun: Symbol, tpe: Type): Int

    Return the primitive code of the given operation.

    Return the primitive code of the given operation. If the operation is an array get/set, we inspect the type of the receiver to demux the operation.

    fun

    The method symbol

    tpe

    The type of the receiver object. It is used only for array operations

  137. def getPrimitive (sym: Symbol): Int

    Return the code for the given symbol.

  138. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  139. def init (): Unit

    Initialize the primitive map

  140. def isArithmeticOp (code: Int): Boolean

  141. def isArrayGet (code: Int): Boolean

  142. def isArrayLength (code: Int): Boolean

  143. def isArrayNew (code: Int): Boolean

  144. def isArrayOp (code: Int): Boolean

    Check whether the given operation code is an array operation.

  145. def isArraySet (code: Int): Boolean

  146. def isBitwiseOp (code: Int): Boolean

  147. def isCoercion (code: Int): Boolean

  148. def isComparisonOp (code: Int): Boolean

    Check whether the given code is a comparison operator

  149. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  150. def isLogicalOp (code: Int): Boolean

  151. def isPrimitive (sym: Symbol): Boolean

  152. def isReferenceEqualityOp (code: Int): Boolean

  153. def isShiftOp (code: Int): Boolean

  154. def isUniversalEqualityOp (code: Int): Boolean

  155. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  156. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  157. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  158. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  159. def toString (): String

    Definition Classes
    AnyRef → Any
  160. val typeOfArrayOp : Map[Int, TypeKind]

    Attributes
    final
  161. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any