scala.tools.nsc.backend

ScalaPrimitives

abstract 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:

Inspired from the scalac compiler.

Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ScalaPrimitives
  2. AnyRef
  3. Any
Implicitly
  1. by StringAdd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScalaPrimitives()

Abstract Value Members

  1. abstract val global: Global

Concrete Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to StringAdd[ScalaPrimitives] performed by method StringAdd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (ScalaPrimitives, B)

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to ArrowAssoc[ScalaPrimitives] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

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

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

  9. final val AND: Int(22)

  10. final val APPLY: Int(71)

  11. final val AS: Int(81)

  12. final val ASR: Int(32)

  13. final val B2B: Int(200)

  14. final val B2C: Int(202)

  15. final val B2D: Int(206)

  16. final val B2F: Int(205)

  17. final val B2I: Int(203)

  18. final val B2L: Int(204)

  19. final val B2S: Int(201)

  20. final val BARRAY_GET: Int(141)

  21. final val BARRAY_LENGTH: Int(132)

  22. final val BARRAY_SET: Int(151)

  23. final val BOX: Int(110)

  24. final val C2B: Int(220)

  25. final val C2C: Int(222)

  26. final val C2D: Int(226)

  27. final val C2F: Int(225)

  28. final val C2I: Int(223)

  29. final val C2L: Int(224)

  30. final val C2S: Int(221)

  31. final val CARRAY_GET: Int(143)

  32. final val CARRAY_LENGTH: Int(134)

  33. final val CARRAY_SET: Int(153)

  34. final val COERCE: Int(101)

  35. final val CONCAT: Int(100)

  36. final val D2B: Int(260)

  37. final val D2C: Int(262)

  38. final val D2D: Int(266)

  39. final val D2F: Int(265)

  40. final val D2I: Int(263)

  41. final val D2L: Int(264)

  42. final val D2S: Int(261)

  43. final val DARRAY_GET: Int(147)

  44. final val DARRAY_LENGTH: Int(138)

  45. final val DARRAY_SET: Int(157)

  46. final val DIV: Int(13)

  47. final val EQ: Int(42)

  48. final val F2B: Int(250)

  49. final val F2C: Int(252)

  50. final val F2D: Int(256)

  51. final val F2F: Int(255)

  52. final val F2I: Int(253)

  53. final val F2L: Int(254)

  54. final val F2S: Int(251)

  55. final val FARRAY_GET: Int(146)

  56. final val FARRAY_LENGTH: Int(137)

  57. final val FARRAY_SET: Int(156)

  58. final val GE: Int(46)

  59. final val GT: Int(47)

  60. final val HASH: Int(87)

  61. final val I2B: Int(230)

  62. final val I2C: Int(232)

  63. final val I2D: Int(236)

  64. final val I2F: Int(235)

  65. final val I2I: Int(233)

  66. final val I2L: Int(234)

  67. final val I2S: Int(231)

  68. final val IARRAY_GET: Int(144)

  69. final val IARRAY_LENGTH: Int(135)

  70. final val IARRAY_SET: Int(154)

  71. final val ID: Int(40)

  72. final val IS: Int(80)

  73. final val L2B: Int(240)

  74. final val L2C: Int(242)

  75. final val L2D: Int(246)

  76. final val L2F: Int(245)

  77. final val L2I: Int(243)

  78. final val L2L: Int(244)

  79. final val L2S: Int(241)

  80. final val LARRAY_GET: Int(145)

  81. final val LARRAY_LENGTH: Int(136)

  82. final val LARRAY_SET: Int(155)

  83. final val LE: Int(45)

  84. final val LENGTH: Int(70)

  85. final val LSL: Int(30)

  86. final val LSR: Int(31)

  87. final val LT: Int(44)

  88. final val MOD: Int(14)

  89. final val MUL: Int(12)

  90. final val NE: Int(43)

  91. final val NEG: Int(2)

  92. final val NEW_BARRAY: Int(113)

  93. final val NEW_CARRAY: Int(115)

  94. final val NEW_DARRAY: Int(119)

  95. final val NEW_FARRAY: Int(118)

  96. final val NEW_IARRAY: Int(116)

  97. final val NEW_LARRAY: Int(117)

  98. final val NEW_OARRAY: Int(120)

  99. final val NEW_SARRAY: Int(114)

  100. final val NEW_ZARRAY: Int(112)

  101. final val NI: Int(41)

  102. final val NOT: Int(3)

  103. final val OARRAY_GET: Int(148)

  104. final val OARRAY_LENGTH: Int(139)

  105. final val OARRAY_SET: Int(158)

  106. final val OR: Int(20)

  107. final val POS: Int(1)

  108. final val S2B: Int(210)

  109. final val S2C: Int(212)

  110. final val S2D: Int(216)

  111. final val S2F: Int(215)

  112. final val S2I: Int(213)

  113. final val S2L: Int(214)

  114. final val S2S: Int(211)

  115. final val SARRAY_GET: Int(142)

  116. final val SARRAY_LENGTH: Int(133)

  117. final val SARRAY_SET: Int(152)

  118. final val SUB: Int(11)

  119. final val SYNCHRONIZED: Int(90)

  120. final val UNBOX: Int(111)

  121. final val UPDATE: Int(72)

  122. final val XOR: Int(21)

  123. final val ZAND: Int(61)

  124. final val ZARRAY_GET: Int(140)

  125. final val ZARRAY_LENGTH: Int(131)

  126. final val ZARRAY_SET: Int(150)

  127. final val ZNOT: Int(50)

  128. final val ZOR: Int(60)

  129. def addPrimitive(s: Global.Symbol, code: Int): Unit

    Add a primitive operation to the map

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

  131. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  132. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  133. def ensuring(cond: (ScalaPrimitives) ⇒ Boolean, msg: ⇒ Any): ScalaPrimitives

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to Ensuring[ScalaPrimitives] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  134. def ensuring(cond: (ScalaPrimitives) ⇒ Boolean): ScalaPrimitives

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to Ensuring[ScalaPrimitives] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  135. def ensuring(cond: Boolean, msg: ⇒ Any): ScalaPrimitives

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to Ensuring[ScalaPrimitives] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  136. def ensuring(cond: Boolean): ScalaPrimitives

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to Ensuring[ScalaPrimitives] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  137. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  140. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to StringFormat[ScalaPrimitives] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  141. def generatedKind(code: Int): Global.icodes.TypeKind

    If code is a coercion primitive, the result type

  142. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  143. def getPrimitive(fun: Global.Symbol, tpe: Global.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

  144. def getPrimitive(sym: Global.Symbol): Int

    Return the code for the given symbol.

  145. def hashCode(): Int

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

    Initialize the primitive map

  147. def isArithmeticOp(code: Int): Boolean

  148. def isArrayGet(code: Int): Boolean

  149. def isArrayLength(code: Int): Boolean

  150. def isArrayNew(code: Int): Boolean

  151. def isArrayOp(code: Int): Boolean

    Check whether the given operation code is an array operation.

  152. def isArraySet(code: Int): Boolean

  153. def isBitwiseOp(code: Int): Boolean

  154. def isCoercion(code: Int): Boolean

  155. def isComparisonOp(code: Int): Boolean

    Check whether the given code is a comparison operator

  156. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  157. def isLogicalOp(code: Int): Boolean

  158. def isPrimitive(sym: Global.Symbol): Boolean

  159. def isReferenceEqualityOp(code: Int): Boolean

  160. def isShiftOp(code: Int): Boolean

  161. def isUniversalEqualityOp(code: Int): Boolean

  162. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  163. final def notify(): Unit

    Definition Classes
    AnyRef
  164. final def notifyAll(): Unit

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

    Definition Classes
    AnyRef
  166. def toString(): String

    Definition Classes
    AnyRef → Any
  167. final val typeOfArrayOp: Map[Int, Global.icodes.TypeKind]

  168. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  171. def [B](y: B): (ScalaPrimitives, B)

    Implicit information
    This member is added by an implicit conversion from ScalaPrimitives to ArrowAssoc[ScalaPrimitives] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion StringAdd from ScalaPrimitives to StringAdd[ScalaPrimitives]

Inherited by implicit conversion StringFormat from ScalaPrimitives to StringFormat[ScalaPrimitives]

Inherited by implicit conversion Ensuring from ScalaPrimitives to Ensuring[ScalaPrimitives]

Inherited by implicit conversion ArrowAssoc from ScalaPrimitives to ArrowAssoc[ScalaPrimitives]

Ungrouped