mozilla-spidermonkey / jsparagus

Experimental JS parser-generator project.
Other
448 stars 20 forks source link

Emitter safety improvements #180

Open jorendorff opened 4 years ago

jorendorff commented 4 years ago

jsparagus is all safe code, but that is super misleading because at the end we hand off a bag of bytes to the JS engine, which does no validation at all. If our output is incorrect, SM will crash.

Writing incorrect bytecode is unsafe.

We should build safe abstractions, at least when it is easy.

I have some ideas and a partial patch.

jorendorff commented 4 years ago

Also, the current emitter is a bit messy, and if we don't get organized it is only going to get worse.

jorendorff commented 4 years ago

I split some parts of this out into #230 and #231.

jorendorff commented 4 years ago

In this bug, I'll address the general problem of how to deal with unchecked emitter methods that could produce invalid bytecode.