aboutsummaryrefslogtreecommitdiff
path: root/lux-lua/source
diff options
context:
space:
mode:
authorEduardo Julian2022-04-06 21:52:30 -0400
committerEduardo Julian2022-04-06 21:52:30 -0400
commitb0d725f24335e82eefc77175efc0a5282951316e (patch)
tree18a5cc4b318776250442311636a415a5cc2c1f20 /lux-lua/source
parenta0ed5fd377daf5754697636504de8e180abf9ec0 (diff)
More efficient binary formatting.
Diffstat (limited to '')
-rw-r--r--lux-lua/source/program.lux40
1 files changed, 20 insertions, 20 deletions
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index fbe24bba8..1d4a2518b 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -218,7 +218,7 @@
{.#Some member}
(case (read member)
{try.#Success parsed_member}
- (again num_keys (++ idx) (array.write! idx (as java/lang/Object parsed_member) output))
+ (again num_keys (++ idx) (array.has! idx (as java/lang/Object parsed_member) output))
{try.#Failure error}
{try.#Failure error}))
@@ -387,7 +387,7 @@
(net/sandius/rembulan/impl/DefaultTable
[] (rawget self [idx long]) java/lang/Object
(|> value
- (array.read! (|> idx ffi.of_long .nat --))
+ (array.item (|> idx ffi.of_long .nat --))
maybe.trusted
to_host))
@@ -398,7 +398,7 @@
{.#Some field}
(case (ffi.of_string (net/sandius/rembulan/ByteString::decode field))
(pattern (static runtime.variant_tag_field))
- (case (array.read! 0 value)
+ (case (array.item 0 value)
{.#Some it}
(|> it
(as java/lang/Integer)
@@ -408,7 +408,7 @@
(undefined))
(pattern (static runtime.variant_flag_field))
- (case (array.read! 1 value)
+ (case (array.item 1 value)
{.#Some _}
(as java/lang/Object "")
@@ -417,7 +417,7 @@
(pattern (static runtime.variant_value_field))
(|> value
- (array.read! 2)
+ (array.item 2)
maybe.trusted
to_host)
@@ -434,7 +434,7 @@
{.#None}
(case (ffi.as java/lang/Long field)
{.#Some idx}
- (case (array.read! (|> idx ffi.of_long .nat --) value)
+ (case (array.item (|> idx ffi.of_long .nat --) value)
{.#Some it}
(to_host it)
@@ -463,15 +463,15 @@
(do try.monad
[.let [inputs (is (ffi.type [java/lang/Object])
(|> (array.empty 2)
- (array.write! 0 ... (as java/lang/Object inputs)
- ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
- (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) inputs))))
- (array.write! 1 ... (as java/lang/Object lux)
- ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
- (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) lux))))))]
+ (array.has! 0 ... (as java/lang/Object inputs)
+ ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
+ (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) inputs))))
+ (array.has! 1 ... (as java/lang/Object lux)
+ ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
+ (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) lux))))))]
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context (as java/lang/Object macro) inputs executor)]
(|> output
- (array.read! 0)
+ (array.item 0)
maybe.trusted
(as java/lang/Object)
..read)))
@@ -703,7 +703,7 @@
[lua_function (net/sandius/rembulan/load/ChunkLoader::loadTextChunk variable (ffi.as_string "lux compilation") (ffi.as_string (_.code code)) loader)
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context (as java/lang/Object lua_function) (array.empty 0)
executor)]
- (case (array.read! 0 output)
+ (case (array.item 0 output)
{.#None}
(in [])
@@ -816,14 +816,14 @@
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context
(as java/lang/Object handler)
(|> (array.empty 5)
- (array.write! 0 name)
- (array.write! 1 (as java/lang/Object (phase_wrapper phase)))
- (array.write! 2 (..to_host archive))
- (array.write! 3 (..to_host parameters))
- (array.write! 4 (..to_host state)))
+ (array.has! 0 name)
+ (array.has! 1 (as java/lang/Object (phase_wrapper phase)))
+ (array.has! 2 (..to_host archive))
+ (array.has! 3 (..to_host parameters))
+ (array.has! 4 (..to_host state)))
executor)]
(|> output
- (array.read! 0)
+ (array.item 0)
maybe.trusted
(as java/lang/Object)
..read)))))]