constructor(tree, BOM) {
        this._pieces = [];
        this._tree = tree;
        this._BOM = BOM;
        this._index = 0;
        if (tree.root !== SENTINEL) {
            tree.iterate(tree.root, node => {
                if (node !== SENTINEL) {
                    this._pieces.push(node.piece);
                }
                return true;
            });
        }
    }
Readonly snapshot for piece tree.
In a real multiple thread environment, to make snapshot reading always work correctly, we need to
1. Make TreeNode.piece immutable, then reading and writing can run in parallel.
2. TreeNode/Buffers normalization should not happen during snapshot reading.