From d493500abc6def6b62d664990ed821e0a836a6cf Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Thu, 24 Jul 2014 09:04:46 -0700 Subject: Sync from Google-internal development. --- upb/pb/decoder.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'upb/pb/decoder.h') 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; )); -- cgit v1.2.3