-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JVM] Deserialize native arrays as such
There is a long standing issue with Rakudo on the JVM backend: If one declares a native array (like 'my int @arr;') this comes out as a non-native array after precompilation. (Compare rakudo/rakudo#1666.) I think I figured out what happened: Both, native and non-native arrays have the REPR 'VMArray'. They differ in native arrays having a non-null REPRData in their STable. When an array is serialized, a string representing the REPR is put into the string heap. During the first pass of deserialization, this string is used to create a stub object (of the given REPR). At this moment the REPRData is not yet known -- so a plain (non-native) VMArray is created. Only during the second pass of deserialization, the REPRData is added to the STable (in deserialize_repr_data). But that's too late to change the object. My patch tweaks the string that is put into the string heap, so that the correct stub object can be created. If I'm not mistaken, this fake REPR name isn't used in another place and it is corrected during the first pass of deserialization. This doesn't feel clean, but it seems to work.
- Loading branch information
Showing
3 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters