Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4244 closed enhancement (fixed)

[PATCH] Remove unneeded ReserveScriptBackref from the StdDeserializer

Reported by: Itms Owned by: Itms
Priority: Nice to Have Milestone: Alpha 22
Component: Core engine Keywords: patch
Cc: leper Patch:

Description

If I'm not mistaken, the ReserveScriptBackref system in the deserializer is useless. One must pay attention to creating the backref at the right moment (see r16959) but it's not needed to actually assign the backref after the object is populated.

I think this system was actually useful before we had exact stack rooting.

This patch also contains whitespace fixes, and it makes one of the tests more logical.

Attachments (1)

deserializer-cleanup.patch (7.8 KB ) - added by Itms 8 years ago.

Download all attachments as: .zip

Change History (8)

by Itms, 8 years ago

Attachment: deserializer-cleanup.patch added

comment:1 by elexis, 7 years ago

Summary: [PATCH] Small cleanup of the deserializer[PATCH] Remove unneeded ReserveScriptBackref from the StdDeserializer

comment:2 by wraitii, 7 years ago

Seems to work fine, can be committed imo.

comment:3 by Itms, 7 years ago

Cc: leper added

I'll take care of committing after taking one more look - also I thought I had put leper in CC (since we worked together on fixing bugs here), I'm doing it now.

comment:4 by leper, 7 years ago

It might have been useful back when it was introcuded (r13429), but the SpiderMonkey API changed since then, and it doesn't seem useful any more. We might create backrefs to something and then fail to actually construct the object, but in those cases we already throw (and we never attempt to recover from that so no real issue there).

You should also nuke FreeScriptBackrefs which is useless since r16214.

Didn't test it though.

comment:5 by elexis, 7 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:6 by Itms, 7 years ago

Resolution: fixed
Status: newclosed

In 18993:

Remove some obsolete backref logic from the deserializer. It was introduced in earlier versions of the SpiderMonkey API.
Name some variables more logically in one test.

Fixes #4244

comment:7 by Itms, 7 years ago

Keywords: review removed
Milestone: Work In ProgressAlpha 22

Thanks for noticing the FreeScriptBackrefs function.

Note: See TracTickets for help on using tickets.