From 3fca43e4ed20ac634b34b8a18e4a6cdeea991bf1 Mon Sep 17 00:00:00 2001 From: volodya-lombrozo Date: Wed, 9 Oct 2024 17:46:17 +0300 Subject: [PATCH] feat(#540): disable parallelism temporarily --- src/main/java/org/eolang/jeo/BachedTranslator.java | 4 +++- .../jeo/representation/bytecode/BytecodeMethod.java | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/eolang/jeo/BachedTranslator.java b/src/main/java/org/eolang/jeo/BachedTranslator.java index 5c1d2882b..a5c0618b0 100644 --- a/src/main/java/org/eolang/jeo/BachedTranslator.java +++ b/src/main/java/org/eolang/jeo/BachedTranslator.java @@ -53,7 +53,9 @@ public final class BachedTranslator implements Translator { @Override public Stream apply(final Stream representations) { - return representations.parallel().map(this::translate); + return representations +// .parallel() + .map(this::translate); } /** diff --git a/src/main/java/org/eolang/jeo/representation/bytecode/BytecodeMethod.java b/src/main/java/org/eolang/jeo/representation/bytecode/BytecodeMethod.java index 31f5b8f41..1b656421c 100644 --- a/src/main/java/org/eolang/jeo/representation/bytecode/BytecodeMethod.java +++ b/src/main/java/org/eolang/jeo/representation/bytecode/BytecodeMethod.java @@ -568,6 +568,7 @@ private int computeLocals() { private int computeLocalsWithCFG() { + Logger.info(this, "Computing locals for %s", this.properties); Map variables = new HashMap<>(0); int first = 0; if (!this.properties.isStatic()) { @@ -633,7 +634,10 @@ private int computeLocalsWithCFG( max = Math.max( max, this.computeLocalsWithCFG( - new HashMap<>(variables), index1, new HashSet<>(visited)) + new HashMap<>(variables), + index1, + new HashSet<>(visited) + ) ); } } @@ -644,7 +648,8 @@ private int computeLocalsWithCFG( return variables.values().stream().mapToInt(Integer::intValue).sum(); } else { visited.add(jump); - return this.computeLocalsWithCFG(new HashMap<>(variables), jump, visited); + return this.computeLocalsWithCFG( + new HashMap<>(variables), jump, new HashSet<>(visited)); } } if (var.isVarInstruction()) {