Backport Fix #1072: Bump sbt version to 0.13.5

Also see #1008, #1038.

This re-does eede37cc4fb87db96eae28a9a536c507233f1dd1 and
8f2169a37e77bca4cee8300c638e15d9eca138aa which were
reverted in 353e9635a2276e48b6ea6541e49f6c7ab8763b71.

Backport: This fixes #1140 which was caused by the old sbt.

(cherry picked from commit 42531f6f262df1b4549fd4acfbb75504c3a3f973)
Backport Consider more trees as trivial for inlining.

(cherry picked from commit d1adb57d85f3f0f81ae6d69fb252cd1f43803954)
Backport Improve optimization of IsInstanceOf.

(cherry picked from commit f514be61685ff5c23f1d27a0f0aae0308605ae4c)
Backport Update checksizes.sh for the two previous commits.

(cherry picked from commit 20511d2a94c61265c926b51bb3e5ac8cfd5fef9f)
Backport Fix #1091: Improve genPrimitiveJSRepeatedParam for arrays of primitive types.

(cherry picked from commit 5c795071cd444422265481ac652507b38e7a0ccd)
Backport Fix #1097: Emit 'new js.Array' as '[]'.

(cherry picked from commit 0a52e5b7715714e2da22edec8e7e1112ca7c20a9)
Backport Separate the knowledge query getMethodBody() from resolve calls.

The three existing knowledge queries staticCall, dynamicCall and
traitImplCall are not invalidated anymore if the *body* (the
`originalDef`) of a MethodImpl changes. They are invalidated only
for added methods, removed methods, and when a public "attribute"
of a method changes.

Attributes are the `inlineable` and `isTraitImplForwarder` flags.
They are exposed clearly in the MethodID interface, which is what
is returned from the three queries above.

A MethodID does not give access to its body. To do that, another,
separate knowledge query getMethodBody() is provided.

This separation follows what we described in the paper. It makes
sure we do not break our own assumptions by encoding in the type
system that MethodID only gives access to the flags that are
examined for the three xxCalls queries; and not to the body
itself.

It has at least one direct advantage in terms of accuracy of
detecting what to reoptimize: if only the body of an inlineable
method changes (but it remains inlineable and keeps the value of
its isTraitImplForwarder flag), then call sites that could call
that method with a dynamicCall, but cannot actually inline it
because there are multiple targets, need not be reoptimized.
This is especially important for the FunctionN.apply() case,
because all anonymous functions that are compiled as classes have
their apply method marked with @inline.

There is another potential advantage for the future: it makes it
possible, and sound, to decide to inline a method even if it does
not have the inlineable flag on.

(cherry picked from commit 97a7ae5d1e4affd38c166027993c36676b565dc2)
Backport Fix #1101: Do not unbox results of raw JS calls in statement position.

This aligns with the semantics of generics.

(cherry picked from commit 73c4a51c8f1d15f1e6227ba03d544176abf1cd06)
Backport Aggressively inline methods when arguments are "likely" optimizable.

If at least one of the receiver and arguments to a method call
is "likely optimizable", then we force inlining of the method,
even if it is not inlineable.

An argument is likely optimizable if it is a LocalDef for a
tentative anon fun replacement, or for an inlined class instance
(i.e., a record var ref).

At the same time, we removed ad-hoc @inline's on methods, because
they were targeted at the use case now better covered by this
improvement.

Together, these changes perform less inlinings that serve no
purpose, and more inlinings that do bring improvements.

(cherry picked from commit 490cc0bbe5ac8cbddfeb3bb0c9f798ed63d9b437)
Backport Add insert methods to java.lang StringBuilder and StringBuffer

(cherry picked from commit 28fc5cf03d1309a9e616bf81f68e2f2e2ff374b6)
Backport Add Cast() case in OptimizerCore.pretransformExpr().

This is necessary for a Cast(expr) not to force expr if the
result of the Cast is not used.

(cherry picked from commit 12a2509a67485d4db9c9db1c027ca268e43bfd1d)
Backport Fix js.ArrayOps.repr.

Its default implementation is to return
  this.asInstanceOf[Repr]
but we have to override it to return `array`.

(cherry picked from commit 5d17c1bfe9bc5bde855804f747eee9dfc4c5a869)
Backport Fix #1110: Correct toMatch(re: RegExp) in Jasmine typing

(cherry picked from commit 5cef5ee4a2d53df516b2386e5c719989db81ec0a)

Conflicts:

	jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala
Backport Fix #1114: Verify contents of interop annotations

Backport: Only verifies @JSExport annotations unlike original commit,
since the PrepJSInterop phase does not have the facilities to easily
add the check for @JSName in 0.5.x.

(cherry picked from commit 842b0d39c416f1a074eae004717ae00870eaca2d)

Conflicts:

	compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala
	compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala
	compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala
Backport Add a setter for js.Array.length.

Backport: Changed body of method from `native` to `???`
w.r.t. original commit.

(cherry picked from commit 2d4058a14ce01a74fde6dd4f5fcf4ee18e3310ab)
Backport Fix #1121: Desugar of a Match does not transformExpr its selector.

(cherry picked from commit 3494b99aae983fc7f2214775e1d22ea7474c35a9)
Backport Fix #1123: IR checker should allow Apply/Select on {Null,Nothing}Type.

(cherry picked from commit 4cf00838432942fa4e4f65138c9b1cbe00e88985)
Backport Add case IsInstanceOf(inner, _) in inlineable methods.

This mostly gets rid of the canEqual() methods that are part of
the equals() methods generated for case classes.

(cherry picked from commit 8c77c36d76e65137114f57eece9fd565ca2e4724)
Backport Fix #1132: RuntimeLong.intValue() not preserved by numberIntValue(x: jl.Long).

(cherry picked from commit a0e52d6a9da955846a73fc5357e970e300036fa0)
Backport Optimize BoxesRunTime with the numeric semantics in mind.

(cherry picked from commit db49957d496e40ac2cdf0bfa168a21bf0fbcd9d1)

Conflicts:

	ci/checksizes.sh