Move stack string processing to Java.