diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-01-15 04:21:56 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-01-15 04:21:56 -0800 |
commit | 1508648f30cbaf5a3590572b2313fb5b595a7946 (patch) | |
tree | c153db730ec3571981c7b1630ac724a5fef59b70 /upb/pb/compile_decoder_x64.dasc | |
parent | 754b9f1cfdf59104fa62cfaf99f21e5a817d281b (diff) |
Build & fix the JIT.
Diffstat (limited to 'upb/pb/compile_decoder_x64.dasc')
-rw-r--r-- | upb/pb/compile_decoder_x64.dasc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/upb/pb/compile_decoder_x64.dasc b/upb/pb/compile_decoder_x64.dasc index 7fcd006..7dc1987 100644 --- a/upb/pb/compile_decoder_x64.dasc +++ b/upb/pb/compile_decoder_x64.dasc @@ -92,7 +92,7 @@ |.endmacro | |.macro load_handler_data, h, arg -| ld64 upb_handlers_gethandlerdata(h, arg) +| ld64 gethandlerdata(h, arg) |.endmacro | |.macro chkeob, bytes, target @@ -140,7 +140,7 @@ #define DECODE_EOF -3 static upb_func *gethandler(const upb_handlers *h, upb_selector_t sel) { - return h ? upb_handlers_gethandler(h, sel) : NULL; + return h ? upb_handlers_gethandler(h, sel, NULL) : NULL; } /* Defines an "assembly label" for the current code generation offset. @@ -179,14 +179,19 @@ static void asmlabel(jitcompiler *jc, const char *fmt, ...) { /* Should only be called when the associated handler is known to exist. */ static bool alwaysok(const upb_handlers *h, upb_selector_t sel) { - upb_handlerattr attr = UPB_HANDLERATTR_INITIALIZER; + upb_handlerattr attr = UPB_HANDLERATTR_INIT; bool ok = upb_handlers_getattr(h, sel, &attr); - bool ret; UPB_ASSERT(ok); - ret = upb_handlerattr_alwaysok(&attr); - upb_handlerattr_uninit(&attr); - return ret; + return attr.alwaysok; +} + +static const void *gethandlerdata(const upb_handlers *h, upb_selector_t sel) { + upb_handlerattr attr = UPB_HANDLERATTR_INIT; + bool ok = upb_handlers_getattr(h, sel, &attr); + + UPB_ASSERT(ok); + return attr.handler_data; } /* Emit static assembly routines; code that does not vary based on the message |