Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .idea/icon.png
Binary file not shown.
12 changes: 5 additions & 7 deletions compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package dotty.tools.backend.jvm
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: the icon.png deletion above, every time I open the project IntelliJ wants to do this, so...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hamzaremmal I don't really get why it was added in the first place in #21188 it's just for local users to make distinguishment of this repo easier, right ?

If the intelij suggests deletion then maybe we should check if that method is outdated or just add it to .gitignore (it's already commited so it's fine)


import scala.language.unsafeNulls

import org.junit.Assert._
import org.junit.Assert.*
import org.junit.Test

import scala.tools.asm
import asm._
import asm.tree._

import asm.*
import asm.tree.*
import scala.tools.asm.Opcodes
import scala.jdk.CollectionConverters._
import Opcodes._
import scala.jdk.CollectionConverters.*
import Opcodes.*

class DottyBytecodeTests extends DottyBytecodeTest {
import ASMConverters._
Expand Down
48 changes: 6 additions & 42 deletions compiler/test/dotty/tools/backend/jvm/InlineBytecodeTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package dotty.tools.backend.jvm

import scala.language.unsafeNulls

import org.junit.Assert._
import org.junit.Test
import org.junit.{Test, Ignore}

import scala.tools.asm.Opcodes._

Expand Down Expand Up @@ -75,46 +74,13 @@ class InlineBytecodeTests extends DottyBytecodeTest {
}
}

/** Disabled since locally comes from Predef now
@Test
def inlineLocally = {
val source =
"""
|class Foo {
| def meth1: Unit = locally {
| val a = 5
| a
| }
|
| def meth2: Unit = {
| val a = 5
| a
| }
|}
""".stripMargin

checkBCode(source) { dir =>
val clsIn = dir.lookupName("Foo.class", directory = false).input
val clsNode = loadClassNode(clsIn)
val meth1 = getMethod(clsNode, "meth1")
val meth2 = getMethod(clsNode, "meth2")

val instructions1 = instructionsFromMethod(meth1)
val instructions2 = instructionsFromMethod(meth2)

assert(instructions1 == instructions2,
"`locally` was not properly inlined in `meth1`\n" +
diffInstructions(instructions1, instructions2))
}
}
*/
/*
@Ignore("Intended to document how `.nn` is compiled, but out of date, and not useful until we have an optimizer that can eliminate dead code")
@Test def inlineNn = {
val source =
s"""
|class Foo {
| def meth1(x: Int | Null): Int = x.nn
| def meth2(x: Int | Null): Int = x.getClass; x
| def meth2(x: Int | Null): Int = { x.getClass; x.asInstanceOf[Int] }
|}
""".stripMargin

Expand All @@ -132,7 +98,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
diffInstructions(instructions1, instructions2))
}
}
*/

@Test def i4947 = {
val source = """class Foo {
| transparent inline def track[T](inline f: T): T = {
Expand Down Expand Up @@ -369,7 +335,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
}
}

// Testing that a is not boxed
// Testing that a is not boxed
@Test def i4522 = {
val source = """class Foo {
| def test: Int = {
Expand Down Expand Up @@ -478,7 +444,6 @@ class InlineBytecodeTests extends DottyBytecodeTest {
}
}


@Test def i9246 = {
val source = """class Foo:
| inline def check(v:Double): Unit = if(v==0) throw new Exception()
Expand Down Expand Up @@ -520,7 +485,6 @@ class InlineBytecodeTests extends DottyBytecodeTest {
}
}


@Test def i9466 = {
val source = """class Test:
| inline def i(inline f: Int => Boolean): String =
Expand Down Expand Up @@ -651,7 +615,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {

val fun = getMethod(clsNode, "test")
val instructions = instructionsFromMethod(fun)
val expected = // TODO room for constant folding
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked, this TODO was done (the code below was modified but this todo was kept)

val expected =
List(
IntOp(BIPUSH, 6),
Op(IRETURN),
Expand Down
Loading
Loading