-
Notifications
You must be signed in to change notification settings - Fork 120
Gabor/typtbl #5642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Gabor/typtbl #5642
Conversation
| let compile_add_const = compile_op_const I32Op.Add | ||
| let compile_sub_const = compile_op_const I32Op.Sub | ||
| let compile_mul_const = compile_op_const I32Op.Mul | ||
| let compile_mul_const = compile_op_const I32Op.Mul (* TODO: use shift: compile_mul_const 2l *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #5651.
src/codegen/compile_enhanced.ml
Outdated
| (* Go! *) | ||
| Bool.lit extended ^^ Bool.to_rts_int32 ^^ get_data_buf ^^ get_typtbl_ptr ^^ get_typtbl_size_ptr ^^ get_maintyps_ptr ^^ | ||
| let tydesc, _, _ = type_desc env Candid ts in | ||
| let tydesc_len = Int64.of_int (String.length tydesc * 2 + 300) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't limit when extended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May do it in the RTS, but we have to be careful to not reuse functions across this flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it, we could leave the rule in, as the type table is not expected to shrink considerably for orthogonal persistence between upgrades. Needs more thinking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaah ok, they are separated already: @deserialize_extended and @deserialize.
test/bench/ok/bignum.drun-run.ok
Outdated
| debug.print: {cycles = 2_509_532; size = +25_528} | ||
| ingress Completed: Reply: 0x4449444c0000 | ||
| debug.print: {cycles = 54_921_553; size = +830_464} | ||
| debug.print: {cycles = 54_921_579; size = +830_464} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minimal penalty.
rts/motoko-rts/src/buf.rs
Outdated
| const WORD_SIZE: usize = core::mem::size_of::<u32>(); | ||
|
|
||
| if (*buf).ptr.add(WORD_SIZE - 1) >= (*buf).end { | ||
| // TODO: use add(WORD_SIZE) and > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would aid CSE.
| const WORD_SIZE: usize = core::mem::size_of::<u32>(); | ||
|
|
||
| if (*buf).ptr.add(WORD_SIZE - 1) >= (*buf).end { | ||
| if (*buf).ptr.add(WORD_SIZE) > (*buf).end { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows CSE with line 58. Justified, because buf.ptr is a *mut u8.
src/codegen/compile_classical.ml
Outdated
| (* Go! *) | ||
| Bool.lit extended ^^ get_data_buf ^^ get_typtbl_ptr ^^ get_typtbl_size_ptr ^^ get_maintyps_ptr ^^ | ||
| let tydesc, _, _ = type_desc env ts in | ||
| let tydesc_len = Int32.of_int (String.length tydesc * 2 + 300) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a configurable affine function. See get/setCandidLimits primitives for an example.
This PR TBW