-
Notifications
You must be signed in to change notification settings - Fork 326
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
Unify & speed access to array-like objects behind ArrayXyzNode
#6299
Comments
While investigating #7420 it turned out that eliminating need for diff --git engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Vector.java engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Vector.java
index a966d47a5d..e9e283deaa 100644
--- engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Vector.java
+++ engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Vector.java
@@ -119,7 +119,7 @@ public final class Vector implements TruffleObject {
}
return WithWarnings.wrap(EnsoContext.get(interop), toEnso.execute(v), extracted);
}
- return toEnso.execute(v);
+ return v;
}
public static Vector fromArray(Object arr) { the |
ArrayXyzNode
ArrayXyzNode
The handling of warnings is also something that would better be unified as demonstrates. |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-10): Progress: - cleanup array-like classes: #7544
Next Day: Array access unification |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-11): Progress: - Array access unification - #7544
Next Day: Finish array access unification |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-13): Progress: - Next Day: Finish array access unification |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-14): Progress: -
Next Day: Finish array access unification |
Currently the Enso engine is using
InteropLibrary
to read elements from array-like objects. However that's not enough - we have to guarantee that such elements are converted to Enso supported objects usingHostValueToEnsoNode
. As various incidents indicate:we often forget to do such conversion.
The standard Truffle way of avoiding such problem and also making the array-like object access fast is to define nodes that specialize according to the data (
Vector
,Array
, foreign object). Let's define:ArrayLengthNode
ArrayAtNode
and replace all array-like access with these nodes rather than using
InteropLibrary
directly.The text was updated successfully, but these errors were encountered: