Rename io_writer.write_fast_etc

This commit is contained in:
Nigel Tao committed 2020-04-02 12:32:40 +11:00
1 parent 3456f39f9d
commit f515dc0848
5 files changed
+79 -79

No files matched your search

+16 -16
View File
@@ -870,25 +870,25 @@ var peekMethods = [...]struct {
t.IDPeekU64LE - peekMethodsBase: {64, 64, 'l'}, t.IDPeekU64LE - peekMethodsBase: {64, 64, 'l'},
} }
const writeFastMethodsBase = t.IDWriteFastU8 const writeFastMethodsBase = t.IDWriteU8Fast
var writeFastMethods = [...]struct { var writeFastMethods = [...]struct {
n uint8 n uint8
endianness uint8 endianness uint8
}{ }{
t.IDWriteFastU8 - writeFastMethodsBase: {8, 'b'}, t.IDWriteU8Fast - writeFastMethodsBase: {8, 'b'},
t.IDWriteFastU16BE - writeFastMethodsBase: {16, 'b'}, t.IDWriteU16BEFast - writeFastMethodsBase: {16, 'b'},
t.IDWriteFastU16LE - writeFastMethodsBase: {16, 'l'}, t.IDWriteU16LEFast - writeFastMethodsBase: {16, 'l'},
t.IDWriteFastU24BE - writeFastMethodsBase: {24, 'b'}, t.IDWriteU24BEFast - writeFastMethodsBase: {24, 'b'},
t.IDWriteFastU24LE - writeFastMethodsBase: {24, 'l'}, t.IDWriteU24LEFast - writeFastMethodsBase: {24, 'l'},
t.IDWriteFastU32BE - writeFastMethodsBase: {32, 'b'}, t.IDWriteU32BEFast - writeFastMethodsBase: {32, 'b'},
t.IDWriteFastU32LE - writeFastMethodsBase: {32, 'l'}, t.IDWriteU32LEFast - writeFastMethodsBase: {32, 'l'},
t.IDWriteFastU40BE - writeFastMethodsBase: {40, 'b'}, t.IDWriteU40BEFast - writeFastMethodsBase: {40, 'b'},
t.IDWriteFastU40LE - writeFastMethodsBase: {40, 'l'}, t.IDWriteU40LEFast - writeFastMethodsBase: {40, 'l'},
t.IDWriteFastU48BE - writeFastMethodsBase: {48, 'b'}, t.IDWriteU48BEFast - writeFastMethodsBase: {48, 'b'},
t.IDWriteFastU48LE - writeFastMethodsBase: {48, 'l'}, t.IDWriteU48LEFast - writeFastMethodsBase: {48, 'l'},
t.IDWriteFastU56BE - writeFastMethodsBase: {56, 'b'}, t.IDWriteU56BEFast - writeFastMethodsBase: {56, 'b'},
t.IDWriteFastU56LE - writeFastMethodsBase: {56, 'l'}, t.IDWriteU56LEFast - writeFastMethodsBase: {56, 'l'},
t.IDWriteFastU64BE - writeFastMethodsBase: {64, 'b'}, t.IDWriteU64BEFast - writeFastMethodsBase: {64, 'b'},
t.IDWriteFastU64LE - writeFastMethodsBase: {64, 'l'}, t.IDWriteU64LEFast - writeFastMethodsBase: {64, 'l'},
} }
+16 -16
View File
@@ -292,23 +292,23 @@ var Funcs = []string{
// TODO: these should have an explicit pre-condition "available() >= N". // TODO: these should have an explicit pre-condition "available() >= N".
// For now, that's implicitly checked (i.e. hard coded). // For now, that's implicitly checked (i.e. hard coded).
// //
// The io_writer has write_fast_etc methods, not poke_etc and skip_fast, // The io_writer has write_etc_fast methods, not poke_etc and skip_fast,
// because skip_fast could leave uninitialized bytes in the io_buffer. // because skip_fast could leave uninitialized bytes in the io_buffer.
"io_writer.write_fast_u8!(a: u8)", "io_writer.write_u8_fast!(a: u8)",
"io_writer.write_fast_u16be!(a: u16)", "io_writer.write_u16be_fast!(a: u16)",
"io_writer.write_fast_u16le!(a: u16)", "io_writer.write_u16le_fast!(a: u16)",
"io_writer.write_fast_u24be!(a: u32[..= 0xFFFFFF])", "io_writer.write_u24be_fast!(a: u32[..= 0xFFFFFF])",
"io_writer.write_fast_u24le!(a: u32[..= 0xFFFFFF])", "io_writer.write_u24le_fast!(a: u32[..= 0xFFFFFF])",
"io_writer.write_fast_u32be!(a: u32)", "io_writer.write_u32be_fast!(a: u32)",
"io_writer.write_fast_u32le!(a: u32)", "io_writer.write_u32le_fast!(a: u32)",
"io_writer.write_fast_u40be!(a: u64[..= 0xFFFFFFFFFF])", "io_writer.write_u40be_fast!(a: u64[..= 0xFFFFFFFFFF])",
"io_writer.write_fast_u40le!(a: u64[..= 0xFFFFFFFFFF])", "io_writer.write_u40le_fast!(a: u64[..= 0xFFFFFFFFFF])",
"io_writer.write_fast_u48be!(a: u64[..= 0xFFFFFFFFFFFF])", "io_writer.write_u48be_fast!(a: u64[..= 0xFFFFFFFFFFFF])",
"io_writer.write_fast_u48le!(a: u64[..= 0xFFFFFFFFFFFF])", "io_writer.write_u48le_fast!(a: u64[..= 0xFFFFFFFFFFFF])",
"io_writer.write_fast_u56be!(a: u64[..= 0xFFFFFFFFFFFFFF])", "io_writer.write_u56be_fast!(a: u64[..= 0xFFFFFFFFFFFFFF])",
"io_writer.write_fast_u56le!(a: u64[..= 0xFFFFFFFFFFFFFF])", "io_writer.write_u56le_fast!(a: u64[..= 0xFFFFFFFFFFFFFF])",
"io_writer.write_fast_u64be!(a: u64)", "io_writer.write_u64be_fast!(a: u64)",
"io_writer.write_fast_u64le!(a: u64)", "io_writer.write_u64le_fast!(a: u64)",
"io_writer.available() u64", "io_writer.available() u64",
"io_writer.count_since(mark: u64) u64", "io_writer.count_since(mark: u64) u64",
+15 -15
View File
@@ -1263,21 +1263,21 @@ var ioMethodAdvances = [...]struct {
t.IDPeekU64BE - t.IDPeekU8: {eight, false}, t.IDPeekU64BE - t.IDPeekU8: {eight, false},
t.IDPeekU64LE - t.IDPeekU8: {eight, false}, t.IDPeekU64LE - t.IDPeekU8: {eight, false},
t.IDWriteFastU8 - t.IDPeekU8: {one, true}, t.IDWriteU8Fast - t.IDPeekU8: {one, true},
t.IDWriteFastU16BE - t.IDPeekU8: {two, true}, t.IDWriteU16BEFast - t.IDPeekU8: {two, true},
t.IDWriteFastU16LE - t.IDPeekU8: {two, true}, t.IDWriteU16LEFast - t.IDPeekU8: {two, true},
t.IDWriteFastU24BE - t.IDPeekU8: {three, true}, t.IDWriteU24BEFast - t.IDPeekU8: {three, true},
t.IDWriteFastU24LE - t.IDPeekU8: {three, true}, t.IDWriteU24LEFast - t.IDPeekU8: {three, true},
t.IDWriteFastU32BE - t.IDPeekU8: {four, true}, t.IDWriteU32BEFast - t.IDPeekU8: {four, true},
t.IDWriteFastU32LE - t.IDPeekU8: {four, true}, t.IDWriteU32LEFast - t.IDPeekU8: {four, true},
t.IDWriteFastU40BE - t.IDPeekU8: {five, true}, t.IDWriteU40BEFast - t.IDPeekU8: {five, true},
t.IDWriteFastU40LE - t.IDPeekU8: {five, true}, t.IDWriteU40LEFast - t.IDPeekU8: {five, true},
t.IDWriteFastU48BE - t.IDPeekU8: {six, true}, t.IDWriteU48BEFast - t.IDPeekU8: {six, true},
t.IDWriteFastU48LE - t.IDPeekU8: {six, true}, t.IDWriteU48LEFast - t.IDPeekU8: {six, true},
t.IDWriteFastU56BE - t.IDPeekU8: {seven, true}, t.IDWriteU56BEFast - t.IDPeekU8: {seven, true},
t.IDWriteFastU56LE - t.IDPeekU8: {seven, true}, t.IDWriteU56LEFast - t.IDPeekU8: {seven, true},
t.IDWriteFastU64BE - t.IDPeekU8: {eight, true}, t.IDWriteU64BEFast - t.IDPeekU8: {eight, true},
t.IDWriteFastU64LE - t.IDPeekU8: {eight, true}, t.IDWriteU64LEFast - t.IDPeekU8: {eight, true},
t.IDWriteSimpleTokenFast - t.IDPeekU8: {one, true}, t.IDWriteSimpleTokenFast - t.IDPeekU8: {one, true},
} }
+30 -30
View File
@@ -608,21 +608,21 @@ const (
// -------- // --------
IDWriteFastU8 = ID(0x1E1) IDWriteU8Fast = ID(0x1E1)
IDWriteFastU16BE = ID(0x1E2) IDWriteU16BEFast = ID(0x1E2)
IDWriteFastU16LE = ID(0x1E3) IDWriteU16LEFast = ID(0x1E3)
IDWriteFastU24BE = ID(0x1E4) IDWriteU24BEFast = ID(0x1E4)
IDWriteFastU24LE = ID(0x1E5) IDWriteU24LEFast = ID(0x1E5)
IDWriteFastU32BE = ID(0x1E6) IDWriteU32BEFast = ID(0x1E6)
IDWriteFastU32LE = ID(0x1E7) IDWriteU32LEFast = ID(0x1E7)
IDWriteFastU40BE = ID(0x1E8) IDWriteU40BEFast = ID(0x1E8)
IDWriteFastU40LE = ID(0x1E9) IDWriteU40LEFast = ID(0x1E9)
IDWriteFastU48BE = ID(0x1EA) IDWriteU48BEFast = ID(0x1EA)
IDWriteFastU48LE = ID(0x1EB) IDWriteU48LEFast = ID(0x1EB)
IDWriteFastU56BE = ID(0x1EC) IDWriteU56BEFast = ID(0x1EC)
IDWriteFastU56LE = ID(0x1ED) IDWriteU56LEFast = ID(0x1ED)
IDWriteFastU64BE = ID(0x1EE) IDWriteU64BEFast = ID(0x1EE)
IDWriteFastU64LE = ID(0x1EF) IDWriteU64LEFast = ID(0x1EF)
// -------- // --------
@@ -963,21 +963,21 @@ var builtInsByID = [nBuiltInIDs]string{
// -------- // --------
IDWriteFastU8: "write_fast_u8", IDWriteU8Fast: "write_u8_fast",
IDWriteFastU16BE: "write_fast_u16be", IDWriteU16BEFast: "write_u16be_fast",
IDWriteFastU16LE: "write_fast_u16le", IDWriteU16LEFast: "write_u16le_fast",
IDWriteFastU24BE: "write_fast_u24be", IDWriteU24BEFast: "write_u24be_fast",
IDWriteFastU24LE: "write_fast_u24le", IDWriteU24LEFast: "write_u24le_fast",
IDWriteFastU32BE: "write_fast_u32be", IDWriteU32BEFast: "write_u32be_fast",
IDWriteFastU32LE: "write_fast_u32le", IDWriteU32LEFast: "write_u32le_fast",
IDWriteFastU40BE: "write_fast_u40be", IDWriteU40BEFast: "write_u40be_fast",
IDWriteFastU40LE: "write_fast_u40le", IDWriteU40LEFast: "write_u40le_fast",
IDWriteFastU48BE: "write_fast_u48be", IDWriteU48BEFast: "write_u48be_fast",
IDWriteFastU48LE: "write_fast_u48le", IDWriteU48LEFast: "write_u48le_fast",
IDWriteFastU56BE: "write_fast_u56be", IDWriteU56BEFast: "write_u56be_fast",
IDWriteFastU56LE: "write_fast_u56le", IDWriteU56LEFast: "write_u56le_fast",
IDWriteFastU64BE: "write_fast_u64be", IDWriteU64BEFast: "write_u64be_fast",
IDWriteFastU64LE: "write_fast_u64le", IDWriteU64LEFast: "write_u64le_fast",
// -------- // --------
+2 -2
View File
@@ -98,7 +98,7 @@ pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader)
if (table_entry >> 31) <> 0 { if (table_entry >> 31) <> 0 {
// Literal. // Literal.
args.dst.write_fast_u8!(a: ((table_entry >> 8) & 0xFF) as base.u8) args.dst.write_u8_fast!(a: ((table_entry >> 8) & 0xFF) as base.u8)
continue.loop continue.loop
} else if (table_entry >> 30) <> 0 { } else if (table_entry >> 30) <> 0 {
// No-op; code continues past the if-else chain. // No-op; code continues past the if-else chain.
@@ -136,7 +136,7 @@ pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader)
if (table_entry >> 31) <> 0 { if (table_entry >> 31) <> 0 {
// Literal. // Literal.
args.dst.write_fast_u8!(a: ((table_entry >> 8) & 0xFF) as base.u8) args.dst.write_u8_fast!(a: ((table_entry >> 8) & 0xFF) as base.u8)
continue.loop continue.loop
} else if (table_entry >> 30) <> 0 { } else if (table_entry >> 30) <> 0 {
// No-op; code continues past the if-else chain. // No-op; code continues past the if-else chain.