src/vs/workbench/services/extensions/common/rpcProtocol.ts/MessageIO/serializeRequestArguments
class MessageIO:	public static serializeRequestArguments(args: any[], replacer: JSONStringifyReplacer | null): SerializedRequestArguments {
		if (this._useMixedArgSerialization(args)) {
			const massagedArgs: MixedArg[] = [];
			for (let i = 0, len = args.length; i < len; i++) {
				const arg = args[i];
				if (arg instanceof VSBuffer) {
					massagedArgs[i] = { type: ArgType.VSBuffer, value: arg };
				} else if (typeof arg === 'undefined') {
					massagedArgs[i] = { type: ArgType.Undefined };
				} else if (arg instanceof SerializableObjectWithBuffers) {
					const { jsonString, referencedBuffers } = stringifyJsonWithBufferRefs(arg.value, replacer);
					massagedArgs[i] = { type: ArgType.SerializedObjectWithBuffers, value: VSBuffer.fromString(jsonString), buffers: referencedBuffers };
				} else {
					massagedArgs[i] = { type: ArgType.String, value: VSBuffer.fromString(stringify(arg, replacer)) };
				}
			}
			return {
				type: SerializedRequestArgumentType.Mixed,
				args: massagedArgs,
			};
		}
		return {
			type: SerializedRequestArgumentType.Simple,
			args: stringify(args, replacer)
		};
	}