diff options
author | Josh Haberman <jhaberman@gmail.com> | 2014-07-24 09:04:46 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2014-07-24 09:04:46 -0700 |
commit | d493500abc6def6b62d664990ed821e0a836a6cf (patch) | |
tree | 1ceb65e6866ee63612dd73363944a0fc99a65550 /upb/pb/decoder.h | |
parent | 47b5e0968aa0ec47f522ba357c159b2450645806 (diff) |
Sync from Google-internal development.
Diffstat (limited to 'upb/pb/decoder.h')
-rw-r--r-- | upb/pb/decoder.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/upb/pb/decoder.h b/upb/pb/decoder.h index e43ce10..e93f3bd 100644 --- a/upb/pb/decoder.h +++ b/upb/pb/decoder.h @@ -146,19 +146,9 @@ UPB_DEFINE_STRUCT(upb_pbdecodermethod, upb_refcounted, // The destination handlers this method is bound to. We own a ref. const upb_handlers *dest_handlers_; - // The dispatch table layout is: - // [field number] -> [ 48-bit offset ][ 8-bit wt2 ][ 8-bit wt1 ] - // - // If wt1 matches, jump to the 48-bit offset. If wt2 matches, lookup - // (UPB_MAX_FIELDNUMBER + fieldnum) and jump there. - // - // We need two wire types because of packed/non-packed compatibility. A - // primitive repeated field can use either wire type and be valid. While we - // could key the table on fieldnum+wiretype, the table would be 8x sparser. - // - // Storing two wire types in the primary value allows us to quickly rule out - // the second wire type without needing to do a separate lookup (this case is - // less common than an unknown field). + // Dispatch table -- used by both bytecode decoder and JIT when encountering a + // field number that wasn't the one we were expecting to see. See + // decoder.int.h for the layout of this table. upb_inttable dispatch; )); |