mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Mark deflate's decode_huffman_fast as !? not !??
This commit is contained in:
1 parent
ec0fd9649d
commit
4ff64de78e
4 files changed
+23
-5
No files matched your search
@@ -155,9 +155,21 @@ func (g *gen) writeStatementAssign(b *buffer, n *a.Assign, depth uint32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *gen) writeStatementExpr(b *buffer, n *a.Expr, depth uint32) error {
|
func (g *gen) writeStatementExpr(b *buffer, n *a.Expr, depth uint32) error {
|
||||||
|
// TODO: this same derived code-gen should happen for assignment and var
|
||||||
|
// statements.
|
||||||
|
//
|
||||||
|
// TODO: clean up how this and writeSuspendibles interact.
|
||||||
|
derived := n.Effect().RootCause() && n.Effect().Optional() && !n.Effect().Coroutine()
|
||||||
|
if derived {
|
||||||
|
if err := g.writeSaveExprDerivedVars(b, n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := g.writeSuspendibles(b, n, depth); err != nil {
|
if err := g.writeSuspendibles(b, n, depth); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
checkStatus := false
|
checkStatus := false
|
||||||
if n.Effect().RootCause() {
|
if n.Effect().RootCause() {
|
||||||
if n.Effect().Coroutine() {
|
if n.Effect().Coroutine() {
|
||||||
@@ -171,6 +183,13 @@ func (g *gen) writeStatementExpr(b *buffer, n *a.Expr, depth uint32) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
b.writes(";\n")
|
b.writes(";\n")
|
||||||
|
|
||||||
|
if derived {
|
||||||
|
if err := g.writeLoadExprDerivedVars(b, n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if checkStatus {
|
if checkStatus {
|
||||||
b.writes("if (status) { goto exit; }\n")
|
b.writes("if (status) { goto exit; }\n")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5216,7 +5216,6 @@ wuffs_deflate__decoder__decode_blocks(wuffs_deflate__decoder* self,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
self->private_impl.f_end_of_block = false;
|
self->private_impl.f_end_of_block = false;
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
|
|
||||||
if (a_src.private_impl.buf) {
|
if (a_src.private_impl.buf) {
|
||||||
a_src.private_impl.buf->meta.ri =
|
a_src.private_impl.buf->meta.ri =
|
||||||
iop_a_src - a_src.private_impl.buf->data.ptr;
|
iop_a_src - a_src.private_impl.buf->data.ptr;
|
||||||
@@ -5227,12 +5226,12 @@ wuffs_deflate__decoder__decode_blocks(wuffs_deflate__decoder* self,
|
|||||||
a_src.private_impl.buf->data.ptr + a_src.private_impl.buf->meta.ri;
|
a_src.private_impl.buf->data.ptr + a_src.private_impl.buf->meta.ri;
|
||||||
}
|
}
|
||||||
if (status) {
|
if (status) {
|
||||||
goto suspend;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (self->private_impl.f_end_of_block) {
|
if (self->private_impl.f_end_of_block) {
|
||||||
goto label_0_continue;
|
goto label_0_continue;
|
||||||
}
|
}
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
|
||||||
if (a_src.private_impl.buf) {
|
if (a_src.private_impl.buf) {
|
||||||
a_src.private_impl.buf->meta.ri =
|
a_src.private_impl.buf->meta.ri =
|
||||||
iop_a_src - a_src.private_impl.buf->data.ptr;
|
iop_a_src - a_src.private_impl.buf->data.ptr;
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ pri func decoder.decode_blocks!??(dst base.io_writer, src base.io_reader) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.end_of_block = false
|
this.end_of_block = false
|
||||||
this.decode_huffman_fast!??(dst:args.dst, src:args.src)
|
this.decode_huffman_fast!?(dst:args.dst, src:args.src)
|
||||||
if this.end_of_block {
|
if this.end_of_block {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
// TODO: describe how the xxx_fast version differs from the xxx_slow one, the
|
// TODO: describe how the xxx_fast version differs from the xxx_slow one, the
|
||||||
// assumptions that xxx_fast makes, and how that makes it fast.
|
// assumptions that xxx_fast makes, and how that makes it fast.
|
||||||
pri func decoder.decode_huffman_fast!??(dst base.io_writer, src base.io_reader) {
|
pri func decoder.decode_huffman_fast!?(dst base.io_writer, src base.io_reader) {
|
||||||
// When editing this function, consider making the equivalent change to the
|
// When editing this function, consider making the equivalent change to the
|
||||||
// decode_huffman_slow function. Keep the diff between the two
|
// decode_huffman_slow function. Keep the diff between the two
|
||||||
// decode_huffman_*.wuffs files as small as possible, while retaining both
|
// decode_huffman_*.wuffs files as small as possible, while retaining both
|
||||||
|
|||||||
Reference in new issue
Block a user