This repository was archived by the owner on Jul 12, 2024. It is now read-only.
File tree 1 file changed +5
-14
lines changed
wasm/src/main/scala/ir2wasm
1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -17,31 +17,22 @@ import wasm.utils.MemClassDefIRFile
17
17
/** Patches that we apply to the standard library classes to make them wasm-friendly. */
18
18
object LibraryPatches {
19
19
def patchIRFiles (irFiles : Seq [IRFile ])(implicit ec : ExecutionContext ): Future [Seq [IRFile ]] = {
20
- val derivedCharBox = new java.util.concurrent.atomic.AtomicReference [IRFile ](null )
21
- val derivedLongBox = new java.util.concurrent.atomic.AtomicReference [IRFile ](null )
22
-
23
- val patched1 : Future [Seq [IRFile ]] = Future .traverse(irFiles) { irFile =>
20
+ val derivedIRFiles : Future [Seq [Option [IRFile ]]] = Future .traverse(irFiles) { irFile =>
24
21
val irFileImpl = IRFileImpl .fromIRFile(irFile)
25
22
irFileImpl.entryPointsInfo.flatMap { entryPointsInfo =>
26
23
entryPointsInfo.className match {
27
24
case BoxedCharacterClass | BoxedLongClass =>
28
25
irFileImpl.tree.map { classDef =>
29
- val derivedBox = MemClassDefIRFile (deriveBoxClass(classDef))
30
- if (classDef.className == BoxedCharacterClass )
31
- derivedCharBox.set(derivedBox)
32
- else
33
- derivedLongBox.set(derivedBox)
34
- irFile
26
+ Some (MemClassDefIRFile (deriveBoxClass(classDef)))
35
27
}
36
28
case _ =>
37
- Future .successful(irFile )
29
+ Future .successful(None )
38
30
}
39
31
}
40
32
}
41
33
42
- patched1.map { irFiles1 =>
43
- val extra = List (derivedCharBox.get(), derivedLongBox.get())
44
- extra ++ irFiles1
34
+ derivedIRFiles.map { derived =>
35
+ derived.flatten ++ irFiles
45
36
}
46
37
}
47
38
You can’t perform that action at this time.
0 commit comments