Use BytecodeLocation and BytecodeIterator in JitScript::initICEntriesAndBytecodeTypeMap
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: mgaudet, Assigned: asorholm, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++])
Attachments
(1 file)
Background
Historically access to bytecode in SpiderMonkey has been fairly freeform and common. This means that common idioms are repeated without encapsulation, and it's difficult to audit the codebase for patterns which makes changes around bytecode much more fragile than we'd like.
We'd like to encapsulate manipulation of bytecode within the engine to a set of accessor classes where possible.
This Bug
By using the BytecodeLocation
and BytecodeIterator
, we'd like to replace uses of jsbytecode*
and pcOffset
inside ICScript::create
.
This bug is only for changing the implementation of this function: It's OK that when values escape this function the return to jsbytecode*
and pcOffset
s. We can't change everything at once!
Note: It is expected that you may have to expand the interface of BytecodeLocation or BytecodeIterator. The interfaces as they exist now are driven by clients, and are comparatively thin.
Prior Art
- In Bug 1499544, Part 2 used these interfaces to modify
JSScript::assertValidJumpTargets
. You can use that patch as inspiration for what we're looking for.
Prerequisites
Before getting started, you'll want to
- You Have a checkout of the Firefox source code
- Make sure you can build SpiderMonkey
- Read this walkthrough about how development works in Firefox
Getting Help
Feel free to leave comments on this bug for questions, or, if you have more synchronous questions about this bug, feel free to drop into #jsapi on irc.mozilla.org.
Tips:
- Not sure if the code you've been editing is getting run? Insert a call to
MOZ_CRASH
, a macro which will crash when executed, and run the entire test suite with an optimized build (for speed). If you see crashes, you can then use a debug build to make sure it's crashing in your code!
Comment 1•6 years ago
|
||
Please hold off on this for a bit, I'm making some changes to this code and it would be good to avoid merge conflicts :)
Comment 2•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #1)
Please hold off on this for a bit, I'm making some changes to this code and it would be good to avoid merge conflicts :)
We could do this after bug 1551796 lands...
Hey I would like to contribute and volunteer to fix this bug. I am just a beginner and starting off my open source journey so please help me.
I had just started working on this, but let's see what @Matt thinks.
Reporter | ||
Comment 5•6 years ago
|
||
Hey Chirag, I've opened Bug 1566057 and CC'd you on it. It's very similar to this one, but at a different location so we don't overlap your work and Adam's work, who has already started looking at this one.
(In reply to Adam Holm from comment #7)
Try build: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3bda190eeb8391331675895fd974b295cfa5e6fe
Try build with the error behind the failures in this build (hopefully) fixed: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d1aec7933967e6a7ac07b7e62662fc0141c9b648
Updated•6 years ago
|
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce02f51dbf78
Use BytecodeLocation and BytecodeIterator in JitScript::initICEntriesAndBytecodeTypeMap to replace uses of jsbytecode* and pcToOffset. r=jandem,tcampbell
Comment 10•6 years ago
|
||
bugherder |
Description
•