Skip to content
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

Use BuiltinRootNode.ArgNode to extract argument for a builtin method #12201

Merged
merged 32 commits into from
Feb 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e261e8d
Use BuiltinRootNode.ArgNode to extract argument for a builtin method
JaroslavTulach Jan 30, 2025
5847b0f
Gathering info from all arguments via ArgContext
JaroslavTulach Jan 30, 2025
b646932
Compressing flags into a byte
JaroslavTulach Jan 31, 2025
20fa9c3
Only convert when is(REQUIRES_CAST)
JaroslavTulach Jan 31, 2025
731f3bb
Process warnings in ArgNode
JaroslavTulach Jan 31, 2025
ecb74c5
Generate ArgNode for each positional argument
JaroslavTulach Jan 31, 2025
0925fa2
Cleaning up to address IDE's lints
JaroslavTulach Jan 31, 2025
24fe8da
Allow null return value from processArgument
JaroslavTulach Jan 31, 2025
f60457c
Removing unused variable
JaroslavTulach Jan 31, 2025
feb75d0
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Builti…
JaroslavTulach Feb 3, 2025
8f652cb
Removing commented out code
JaroslavTulach Feb 4, 2025
01be17a
Merge branch 'wip/jtulach/BuiltinArgNode11827' of enso:enso-org/enso …
JaroslavTulach Feb 4, 2025
f0480f7
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Builti…
JaroslavTulach Feb 4, 2025
e2571a1
Insert the node when adding it as a @Child
JaroslavTulach Feb 4, 2025
91d3584
Only process WithWarnings to be compatible with Warnings_Spec
JaroslavTulach Feb 4, 2025
847bd99
Introducing generateArguments again
JaroslavTulach Feb 4, 2025
7be3262
Fixing RuntimeErrorsTest
JaroslavTulach Feb 4, 2025
d6d859a
Avoid cast when type is Object
JaroslavTulach Feb 4, 2025
4ca2226
Throw the sentinal to make RuntimeVisualizationsTest happier
JaroslavTulach Feb 4, 2025
13fc5fe
Only generate ArgNode for positional argument
JaroslavTulach Feb 4, 2025
3579139
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Builti…
JaroslavTulach Feb 4, 2025
934deae
Accept simple benchmark-results.xml name
JaroslavTulach Feb 5, 2025
e3ee0ea
Split the benchmarks to multiple lines
JaroslavTulach Feb 5, 2025
f211c19
Shield against exceptional states
JaroslavTulach Feb 5, 2025
54751cb
Removing superfluous if
JaroslavTulach Feb 5, 2025
68a654b
Removing support for IS_ARRAY
JaroslavTulach Feb 5, 2025
7364a34
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Builti…
JaroslavTulach Feb 6, 2025
0a3ec13
Don't use InteropLibrary for primitive Enso values comparision
JaroslavTulach Feb 7, 2025
21d9bc3
Use EnsoHashMap.generation when concatenating two maps together
JaroslavTulach Feb 7, 2025
e6af654
Let SliceArrayVectorNode handle warnings on its own
JaroslavTulach Feb 7, 2025
560e6b7
Order of some warnings got reversed
JaroslavTulach Feb 7, 2025
5443128
Avoid the need fore corepack when buildEngineDistribution
JaroslavTulach Feb 8, 2025
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
Prev Previous commit
Next Next commit
Compressing flags into a byte
  • Loading branch information
JaroslavTulach committed Jan 31, 2025
commit b64693255ad562059d23ed8cbfb38a5ff017afc6
Original file line number Diff line number Diff line change
@@ -75,32 +75,26 @@ public TruffleObject getReturnValue() {
}

protected abstract static class ArgNode extends Node {
private final boolean isSelf;
private final boolean isArray;
private final boolean requiresCast;
private final boolean checkErrors;
private final boolean checkPanicSentinel;
private final boolean checkWarnings;
private static final byte IS_SELF = 0x01;
private static final byte IS_ARRAY = 0x02;
private static final byte REQUIRES_CAST = 0x04;
private static final byte CHECK_ERRORS = 0x08;
private static final byte CHECK_PANIC_SENTINEL = 0x10;
private static final byte CHECK_WARNINGS = 0x20;
private final byte flags;
@CompilerDirectives.CompilationFinal private Type ensoType;

ArgNode(
boolean isSelf,
boolean isArray,
boolean requiresCast,
boolean checkErrors,
boolean checkPanicSentinel,
boolean checkWarnings) {
this.isSelf = isSelf;
this.isArray = isArray;
this.requiresCast = requiresCast;
this.checkErrors = checkErrors;
this.checkPanicSentinel = checkPanicSentinel;
this.checkWarnings = checkWarnings;
ArgNode(byte flags) {
this.flags = flags;
}

final boolean is(byte what) {
return (flags & what) != 0;
}

@SuppressWarnings("unchecked")
public final <T> T processArgument(Class<T> type, Object value, ArgContext context) {
if (checkErrors && value instanceof DataflowError err) {
if (is(CHECK_ERRORS) && value instanceof DataflowError err) {
context.returnValue = err;
return null;
}
@@ -144,8 +138,26 @@ public static ArgNode create(
boolean checkErrors,
boolean checkPanicSentinel,
boolean checkWarnings) {
return BuiltinRootNodeFactory.ArgNodeGen.create(
isSelf, isArray, requiresCast, checkErrors, checkPanicSentinel, checkWarnings);
byte flags = 0x00;
if (isSelf) {
flags |= IS_SELF;
}
if (isArray) {
flags |= IS_ARRAY;
}
if (requiresCast) {
flags |= REQUIRES_CAST;
}
if (checkErrors) {
flags |= CHECK_ERRORS;
}
if (checkPanicSentinel) {
flags |= CHECK_PANIC_SENTINEL;
}
if (checkWarnings) {
flags |= CHECK_WARNINGS;
}
return BuiltinRootNodeFactory.ArgNodeGen.create(flags);
}

/*