Closed
Bug 909989
Opened 11 years ago
Closed 11 years ago
Implement CodeGenerator::DataPtr
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: efaust, Assigned: efaust)
Details
Attachments
(3 files, 1 obsolete file)
6.38 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
11.46 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
2.95 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
Currently, putting things in CodeGenerator::runtimeData_ is a huge footgun. Every time you append to the vector, it might realloc, causing any pointer to an object stored in the same vector to immediately become stale. I propose a templated wrapper, DataPtr, which wraps the offset into the vector, and actively does the vector calculations at every access. Attached in a first draft, previously reviewed.
Attachment #796322 -
Flags: review+
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: general → efaustbmo
Status: NEW → ASSIGNED
Attachment #796419 -
Flags: review?(nicolas.b.pierron)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #796420 -
Flags: review?(nicolas.b.pierron)
Comment 3•11 years ago
|
||
Comment on attachment 796419 [details] [diff] [review] Part 0: Use runtimeData_ offsets instead of cacheList_ offsets to refer to caches other than during GC Review of attachment 796419 [details] [diff] [review]: ----------------------------------------------------------------- I am not sure to understand where this patch should be applied, update the patches which are attached to this bug, either this one, or the one which carry the r+.
Attachment #796419 -
Flags: review?(nicolas.b.pierron)
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #796322 -
Attachment is obsolete: true
Attachment #796823 -
Flags: review+
Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 796419 [details] [diff] [review] Part 0: Use runtimeData_ offsets instead of cacheList_ offsets to refer to caches other than during GC This should apply to tip. It has no other dependencies.
Attachment #796419 -
Flags: review?(nicolas.b.pierron)
Comment 6•11 years ago
|
||
Comment on attachment 796823 [details] [diff] [review] Part 1: Implement DataPtr, and use it in addCache() Review of attachment 796823 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jit/CodeGenerator.cpp @@ +118,5 @@ > > bool > CodeGenerator::visitOutOfLineCache(OutOfLineUpdateCache *ool) > { > + DataPtr<IonCache> cache(this, ool->getCacheIndex()); Ok, now that I have seen this change, I can accept the part 0.
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #6) > Comment on attachment 796823 [details] [diff] [review] > Part 1: Implement DataPtr, and use it in addCache() > > Review of attachment 796823 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: js/src/jit/CodeGenerator.cpp > @@ +118,5 @@ > > > > bool > > CodeGenerator::visitOutOfLineCache(OutOfLineUpdateCache *ool) > > { > > + DataPtr<IonCache> cache(this, ool->getCacheIndex()); > > Ok, now that I have seen this change, I can accept the part 0. Yeah, sorry. This was not generally well done on my part. I had this mental model of "oh, yeah, and then I'll do the trivial rebase, and it'll be fine. He'll 'just know'", and of course that makes no sense.
Updated•11 years ago
|
Attachment #796419 -
Flags: review?(nicolas.b.pierron) → review+
Updated•11 years ago
|
Attachment #796420 -
Flags: review?(nicolas.b.pierron) → review+
Assignee | ||
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ccc30b7c2277 https://hg.mozilla.org/integration/mozilla-inbound/rev/f1842e91034d https://hg.mozilla.org/integration/mozilla-inbound/rev/91b14e27101a
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8328d4b74a2e https://hg.mozilla.org/mozilla-central/rev/674a3e4f0959 https://hg.mozilla.org/mozilla-central/rev/125ce2b2c1a8
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•