ratel-rust / ratel-core

High performance JavaScript to JavaScript compiler with a Rust core
Apache License 2.0
432 stars 17 forks source link

Consider reorganizing things related to arena #119

Open ishitatsuyuki opened 5 years ago

ishitatsuyuki commented 5 years ago

The current AST types uses CopyCell from toolshed, which is not really sound. Adding to that, interior mutability is inherently confusing.

I propose that we move back to normal heap allocated objects if the performance difference is small; otherwise, we should consider saving &mut in types.

Also, while toolshed requires Copy bound, it's not always necessary as rustc's DroplessArena shows. We could either use a reimplementation of that or simply typed-arena.

ishitatsuyuki commented 5 years ago

I discussed with @maciejhirsz and agreed on moving back to normal heap allocated objects for the meanwhile.

As the replacement for CopyCell, my plan is to implement MutVisitor like the one in rustc.