Technical debt
How we've solved in past
- Driveby cleanup
- Not as much proactive fixing
- What do we do about places where it won't fit in a driveby?
- Areas that particularly get in the way on an ongoing basis
Existing instances
- Parser nodes as big public unions, unguarded by type-asserting accessors
- Property lookup, getting, setting code (LookupProperty, SetPropertyHelper)
- Error reporting
- The error-number-reporting mechanism is really weird, doesn't actually handle localization
- PropDesc and PropertyDescriptor both
- Lack of split between runtime and GC state
- Single-pass parser (emitting and parsing intertangled)
- Threading and locking messier?
- Switching JSNative to CallArgs
- JSContext removal
- js.cpp is kind of unclean
- Use of js_* naming rather than namespace js/JS
- Splitting overlarge files (particularly in JIT) -- IonBuilder.cpp, MIR.h, CodeGenerator.cpp, macro assembler things
- Splitting up macro assembler, having one header that defines the entire interface
- Integrate the Assembler backend (the one we imported from JSC, js/src/assembler) as part of the JIT, or remove it
- Continued moving of stuff into vm/ and builtin/
- Kill off the remaining js*.* files
- Documentation (particular of larger things that don't get driveby attention)
- Object layout (JSFunction stores extra stuff one way, ArrayBuffers another, maybe Servo stuff using a third, SharedArrayBuffer wanting atomic stuffs for a fourth?)
- Remove all the JSVAL_TO_* and *_TO_JSVAL methods (and having only Value::to* and *Value())
Next steps
Add a js/src/README.txt file, keep it more up-to-date about directory layout
- What do we want to keep fixing as we go?
- Namespace renaming
- Some parts of property lookup cleanup, but not all; making property descriptors less duplicative maybe
- Error reporting stuff, partially -- maybe change JS_ReportError... to JS_ThrowError...?
- Error reporting/throwing tangential to window.onerror-needed improvements
- What should we take the time to fix, independent of other work?
- Getting rid of single-pass parsing, having parsing and name analysis be separate passes, having emitting happen in a full separate pass (rather than at end of a function/script?)
- Parser nodes as public unions
- Removing lookupProperty as a MOP operation
- Removing the reporting/throwing distinction in error paths
- Splitting up big JS files
- Splitting up macro assembler (nbp says he's going to do this)
- What's less important to deal with so soon?
- Mentorable things
- Splitting large files up (sunfish)
- js_*/js::/JS:: naming cleanups
- ...