Closed
Bug 1148534
Opened 11 years ago
Closed 11 years ago
Templatize IsMarked and IsAboutToBeFinalized
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla40
| Tracking | Status | |
|---|---|---|
| firefox40 | --- | fixed |
People
(Reporter: terrence, Assigned: terrence)
References
Details
Attachments
(1 file)
|
17.74 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
Nothing too complicated here. Adds a few lines since this needs explicit expansions for jsid that were not present before.
Attachment #8584725 -
Flags: review?(jcoppeard)
Comment 1•11 years ago
|
||
Comment on attachment 8584725 [details] [diff] [review]
4.6.2_templatize_ismarked-v0.diff
Review of attachment 8584725 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good!
::: js/src/gc/Marking.cpp
@@ +840,5 @@
> +IsMarkedInternal<Value>(Value *valuep)
> +{
> + bool rv = true; // Non-markable types are always live.
> + if (valuep->isString()) {
> + JSString *str = (JSString *)valuep->toGCThing();
Let's replace these C-style casts while we're here.
@@ +948,5 @@
> +template <typename T>
> +bool
> +IsMarkedUnbarriered(T *thingp)
> +{
> + auto layout = reinterpret_cast<typename PtrBaseGCType<T>::type *>(thingp);
I think it should be possible to factor out this conversion. Something like:
template <typename T>
PtrBaseGCType<T> *ConvertToBase(T *thing)
{
return reinterpret_cast ... etc
}
Attachment #8584725 -
Flags: review?(jcoppeard) → review+
Comment 2•11 years ago
|
||
(In reply to Jon Coppeard (:jonco) from comment #1)
> @@ +948,5 @@
> > +template <typename T>
> > +bool
> > +IsMarkedUnbarriered(T *thingp)
> > +{
> > + auto layout = reinterpret_cast<typename PtrBaseGCType<T>::type *>(thingp);
>
> I think it should be possible to factor out this conversion. Something like:
>
> template <typename T>
> PtrBaseGCType<T> *ConvertToBase(T *thing)
> {
> return reinterpret_cast ... etc
> }
asBase, maybe? Or asBaseGCType or something.
| Assignee | ||
Comment 3•11 years ago
|
||
| Assignee | ||
Comment 4•11 years ago
|
||
Whoops, checked this in with the wrong bug: bug 1149352.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•