Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Jun 24, 2019

  • move implementation of splatnew into lowering instead of dispatch (given the current definition of splatnew)
  • use field indexes with fieldtype instead of names
  • use fieldtype in most cases, instead of copying expression tree
  • explicit syntax error for too many type parameters on new (instead of deferring to the runtime apply_type error)

- move implementation of splatnew into lowering instead of dispatch (given the current definition of splatnew)
- use field indexes with fieldtype instead of names
- use fieldtype in most cases, instead of copying expression tree
- explicit syntax error for too many type parameters on new (instead of deferring to the runtime apply_type error)
@vtjnash vtjnash force-pushed the jn/new-lowering-simplify branch from b7ddd6b to c054ff5 Compare June 24, 2019 21:27
@vtjnash vtjnash requested a review from JeffBezanson June 25, 2019 22:00
@JeffBezanson
Copy link
Member

use field indexes with fieldtype instead of names

That's fine, but I'm curious what the motivation for it is?

@vtjnash
Copy link
Member Author

vtjnash commented Jun 25, 2019

Just simpler. In the backend, we’ll try to optimize to an integer—so seemed like we might as well start there.

(if (equal? fty '(core Any))
val
`(call (top convert)
,(if (and (equal? type-params params) (memq fty params) (memq fty sparams))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the (memq fty sparams) check is necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually added a test for that. This is stricter than necessary (we only really need to show that duplicating fty won't have side-effects here—or we needed to introduce an ssavalue), but it seems like not a very common case anyways.

@vtjnash vtjnash merged commit 7bd700f into master Jun 26, 2019
@vtjnash vtjnash deleted the jn/new-lowering-simplify branch June 26, 2019 18:44
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

Successfully merging this pull request may close these issues.

3 participants