From bada1e94f472e7507a97e7565369841b3d25c9b0 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 28 May 2013 13:44:50 -0700 Subject: Merge from Google-internal development. - Better error reporting for upb::Def setters. - error reporting for upb::Handlers setters. - made the start/endmsg handlers a little less special-cased. --- upb/pb/decoder_x64.dasc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'upb/pb/decoder_x64.dasc') diff --git a/upb/pb/decoder_x64.dasc b/upb/pb/decoder_x64.dasc index 154fee3..dee063a 100644 --- a/upb/pb/decoder_x64.dasc +++ b/upb/pb/decoder_x64.dasc @@ -192,9 +192,9 @@ static void upb_assert_notnull(void *addr) { assert(addr != NULL); (void)addr; } || } |.endmacro | -|.macro load_handler_data, h, f, type +|.macro loadarg2, val ||{ -|| uintptr_t data = (uintptr_t)gethandlerdata(h, f, type); +|| uintptr_t data = (uintptr_t)val; || if (data > 0xffffffff) { | mov64 ARG2_64, data || } else if (data) { @@ -205,6 +205,10 @@ static void upb_assert_notnull(void *addr) { assert(addr != NULL); (void)addr; } || } |.endmacro | +|.macro load_handler_data, h, f, type +| loadarg2 gethandlerdata(h, f, type) +|.endmacro +| |// Checkpoints our progress by writing PTR to DECODER, and |// checks for end-of-buffer. |.macro checkpoint, h @@ -768,10 +772,11 @@ static void upb_decoderplan_jit_msg(decoderplan *plan, | mov rbp, rsp // Call startmsg handler (if any): - upb_startmsg_handler *startmsg = upb_handlers_getstartmsg(h); + upb_func *startmsg = upb_handlers_gethandler(h, UPB_STARTMSG_SELECTOR); if (startmsg) { - // upb_flow_t startmsg(void *closure); + // upb_flow_t startmsg(void *closure, const void *hd); | mov ARG1_64, CLOSURE + | loadarg2 upb_handlers_gethandlerdata(h, UPB_STARTMSG_SELECTOR) | callp startmsg | check_bool_ret } @@ -821,13 +826,14 @@ static void upb_decoderplan_jit_msg(decoderplan *plan, |=>upb_getpclabel(plan, h, ENDOFMSG): // We are at end-of-submsg: call endmsg handler (if any): - upb_endmsg_handler *endmsg = upb_handlers_getendmsg(h); + upb_func *endmsg = upb_handlers_gethandler(h, UPB_ENDMSG_SELECTOR); if (endmsg) { - // void endmsg(void *closure, upb_status *status) { + // void endmsg(void *closure, const void *hd, upb_status *status) { | mov ARG1_64, CLOSURE - | mov ARG2_64, DECODER->sink - | mov ARG2_64, SINK:ARG2_64->pipeline_ - | add ARG2_64, offsetof(upb_pipeline, status_) + | loadarg2 upb_handlers_gethandlerdata(h, UPB_ENDMSG_SELECTOR) + | mov ARG3_64, DECODER->sink + | mov ARG3_64, SINK:ARG3_64->pipeline_ + | add ARG3_64, offsetof(upb_pipeline, status_) | callp endmsg } -- cgit v1.2.3