-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run Enso tests with assertions enabled #7882
Changes from all commits
a8d28a4
219ff91
429c9de
dc16932
29d7963
f4e5a82
f23fef3
5bea01a
09fa463
5177e0b
189b335
2302fc8
6ce3a1b
c32d980
9d96365
88d8db2
630bf2d
f5ba767
97f4d76
216fc33
cc8df8b
39d28cd
5b45c58
328ca8d
a9a57d8
30de2ef
b8d53e5
4eff8b4
1876d8b
985ad86
1d4107a
acd896e
f87c1f6
d6c8398
3c2df09
4a46c23
3fa992a
0e0dc6e
0e8dc8e
3f63d9e
ef1c798
8fda9f5
8f08e61
78d603b
faaffc1
b019877
61422e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1178,11 +1178,6 @@ val truffleRunOpts = Seq( | |
"-Dpolyglot.compiler.BackgroundCompilation=false" | ||
) | ||
|
||
val truffleRunOptionsNoAssertSettings = Seq( | ||
fork := true, | ||
javaOptions ++= benchOnlyOptions | ||
) | ||
|
||
val truffleRunOptionsSettings = Seq( | ||
fork := true, | ||
javaOptions ++= "-ea" +: benchOnlyOptions | ||
|
@@ -1375,11 +1370,20 @@ lazy val instrumentationSettings = frgaalJavaCompilerSetting ++ Seq( | |
lazy val `runtime-language-epb` = | ||
(project in file("engine/runtime-language-epb")) | ||
.settings( | ||
frgaalJavaCompilerSetting, | ||
inConfig(Compile)(truffleRunOptionsSettings), | ||
truffleDslSuppressWarnsSetting, | ||
instrumentationSettings | ||
commands += WithDebugCommand.withDebug, | ||
fork := true, | ||
Test / javaOptions ++= Seq(), | ||
instrumentationSettings, | ||
libraryDependencies ++= Seq( | ||
"junit" % "junit" % junitVersion % Test, | ||
"com.github.sbt" % "junit-interface" % junitIfVersion % Test, | ||
"org.graalvm.truffle" % "truffle-api" % graalMavenPackagesVersion % "provided", | ||
"org.graalvm.truffle" % "truffle-dsl-processor" % graalMavenPackagesVersion % "provided" | ||
) | ||
) | ||
.dependsOn(`polyglot-api`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need why |
||
|
||
lazy val runtime = (project in file("engine/runtime")) | ||
.configs(Benchmark) | ||
|
@@ -1727,7 +1731,7 @@ lazy val `runtime-with-polyglot` = | |
.configs(Benchmark) | ||
.settings( | ||
frgaalJavaCompilerSetting, | ||
inConfig(Compile)(truffleRunOptionsNoAssertSettings), | ||
inConfig(Compile)(truffleRunOptionsSettings), | ||
inConfig(Benchmark)(Defaults.testSettings), | ||
commands += WithDebugCommand.withDebug, | ||
Benchmark / javacOptions --= Seq( | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ import org.enso.compiler.pass.analyse.{ | |
} | ||
import org.enso.compiler.pass.lint.UnusedBindings | ||
import org.enso.compiler.pass.optimise.LambdaConsolidate | ||
import org.enso.polyglot.ForeignLanguage | ||
|
||
import scala.annotation.tailrec | ||
|
||
|
@@ -161,7 +160,7 @@ case object GenerateMethodBodies extends IRPass { | |
case lam @ Function.Lambda(_, body, _, _, _, _) | ||
if findForeignDefinition( | ||
body, | ||
lang = Some(ForeignLanguage.JS) | ||
lang = Some("js") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we keep that as a constant somewhere, please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Too much overhead to do so. We would need a new project sharable between all that were using Btw. the real constant is defined in |
||
).isDefined => | ||
val thisArgs = chainedFunctionArgs.collect { | ||
case (arg, idx) if arg.name.name == "this" => | ||
|
@@ -308,7 +307,7 @@ case object GenerateMethodBodies extends IRPass { | |
@tailrec | ||
private def findForeignDefinition( | ||
body: Expression, | ||
lang: Option[ForeignLanguage] | ||
lang: Option[String] | ||
): Option[Foreign.Definition] = { | ||
body match { | ||
case foreignDef: Foreign.Definition => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,41 +3,17 @@ | |
import com.oracle.truffle.api.CallTarget; | ||
import com.oracle.truffle.api.TruffleLanguage; | ||
import java.util.function.Consumer; | ||
import org.enso.interpreter.epb.node.ContextRewrapNode; | ||
import org.enso.interpreter.epb.node.ForeignEvalNode; | ||
import org.enso.polyglot.ForeignLanguage; | ||
|
||
/** | ||
* An internal language that serves as a bridge between Enso and other supported languages. | ||
* | ||
* <p>Truffle places a lot of emphasis on safety guarantees, which also means that single-threaded | ||
* languages cannot easily be called from multiple threads. We circumvent this by using two separate | ||
* {@link com.oracle.truffle.api.TruffleContext}s, one (often referred to as "outer") is allowed to | ||
* run Enso, Host Java, and possibly other thread-ready languages. Languages that cannot safely run | ||
* in a multithreaded environment are relegated to the other context (referred to as "inner"). The | ||
* inner context provides a GIL capability, ensuring that access to the single-threaded languages is | ||
* serialized. | ||
* | ||
* <p>This imposes certain limitations on data interchange between the contexts. In particular, it | ||
* is impossible to execute origin language's code when executing in the other context. Therefore | ||
* outer context values need to be specially wrapped before being passed (e.g. as arguments) to the | ||
* inner context, and inner context values need rewrapping for use in the outer context. See {@link | ||
* org.enso.interpreter.epb.runtime.PolyglotProxy} and {@link ContextRewrapNode} for details of how | ||
* and when this wrapping is done. | ||
* | ||
* <p>With the structure outlined above, EPB is the only language that is initialized in both inner | ||
* and outer contexts and thus it is very minimal. Its only role is to manage both contexts and | ||
* provide context-switching facilities. | ||
*/ | ||
/** An internal language that serves as a bridge between Enso and other supported languages. */ | ||
@TruffleLanguage.Registration( | ||
Comment on lines
-10
to
8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this whole block of documentation removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done by @Akirathan, but I'd say it no longer reflects reality. Times changed and we no longer have to implement this ourselves, but rather rely on Truffle to do it for us. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw. @kustosz asked why do we need this |
||
id = ForeignLanguage.ID, | ||
id = "epb", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
name = "Enso Polyglot Bridge", | ||
characterMimeTypes = {EpbLanguage.MIME}, | ||
internal = true, | ||
defaultMimeType = EpbLanguage.MIME, | ||
contextPolicy = TruffleLanguage.ContextPolicy.SHARED, | ||
services = Consumer.class) | ||
public class EpbLanguage extends TruffleLanguage<EpbContext> { | ||
public final class EpbLanguage extends TruffleLanguage<EpbContext> { | ||
public static final String MIME = "application/epb"; | ||
|
||
@Override | ||
|
@@ -55,9 +31,8 @@ protected void initializeContext(EpbContext context) { | |
|
||
@Override | ||
protected CallTarget parse(ParsingRequest request) { | ||
EpbParser.Result code = EpbParser.parse(request.getSource()); | ||
ForeignEvalNode foreignEvalNode = ForeignEvalNode.build(this, code, request.getArgumentNames()); | ||
return foreignEvalNode.getCallTarget(); | ||
var node = ForeignEvalNode.parse(this, request.getSource(), request.getArgumentNames()); | ||
return node.getCallTarget(); | ||
} | ||
|
||
@Override | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as we always run with
-ea
.