As an example, GetInt64 used to perform 8 bounds checks, one for each
slice access. By performing a bound check on the highest index, the
number of checks is reduced to one through bounds-check-elimination.
This enables both WriteUint64 and WriteInt64 to both be inlined as
well as implemented with a single assembly instruction. The current Go
compiler refuses to inline functions with for loops. The compiler is
also not smart enough to produce a single assembly instruction for the
for-loop.
Implement code generation and runtime library for Go, derived from the
Java implementation. Additionally, the test suite verifies:
- the exact bytes in the Builder buffer during object construction,
- vtable deduplication, and
- table construction, via a fuzzer derived from the C++ implementation.
Change-Id: Ib95a019c684891def2b50281e570b4843fea7baa