Decodes an RPC payload from a JS string. There is currently no design document that describes the payload, instead you must infer it from reading ServerSerializationStreamWriter. I'll briefly describe the payload here:
The server sends down a string of JavaScript which is eval'ed by the webmode version of ClientSerializationStreamReader into an array. The array contains primitive values, followed by a nested array of strings, followed by a couple of header primitive values. For example,
[ 1, 0, 3, -7, 13, [ "string one", "string two", "string three" ], 7, 0 ]
Long primitives are encoded as strings in the outer array, and strings in the string table are referenced by index values in the outer array.
The payload is almost a JSON literal except for some nuances, like unicode and array concats. We have a specialized devmode version to decode this payload, because the webmode version requires multiple round-trips between devmode and the JSVM for every single element in the payload. This can require several seconds to decode a single RPC payload. The RpcDecoder operates by doing a limited JS parse on the payload within the devmode VM using Rhino, avoiding the cross-process RPCs.