Skip to content
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

missed numeric optimizations with type-check #23

Open
tromey opened this issue Sep 16, 2017 · 1 comment
Open

missed numeric optimizations with type-check #23

tromey opened this issue Sep 16, 2017 · 1 comment

Comments

@tromey
Copy link
Owner

tromey commented Sep 16, 2017

Consider if json--decode-utf16-surrogates checked the input types:

(defun json--decode-utf-16-surrogates (high low)
  "Return the code point represented by the UTF-16 surrogates HIGH and LOW."
  (cl-check-type high integer)
  (cl-check-type low integer)
  (+ (lsh (- high #xD800) 10) (- low #xDC00) #x10000))

This should compile to some ordinary arithmetic. Instead the compiler emits calls to Fminus, Qlsh, etc.

@tromey
Copy link
Owner Author

tromey commented Sep 16, 2017

The issue is there's no lower-level IR which can represent unboxed values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant