Open Bug 1251528 Opened 8 years ago Updated 2 years ago

Rename js::ObjectWeakMap js::ObjectMetadataMap

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

ASSIGNED

People

(Reporter: jimb, Assigned: jimb)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The js::ObjectWeakMap type is generally used to store metadata about objects, and the present name is easily confused with js::WeakMapObject, which is something entirely different. The name js::ObjectMetadataMap will also fit nicely with the upcoming js::StringMetadataMap type.
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Attachment #8723946 - Flags: review?(terrence)
Blocks: 1178505
This patch should have no visible effect on behavior, and doesn't significantly change the logic, so it has no tests.
Flags: in-testsuite-
Comment on attachment 8723946 [details] [diff] [review]
Rename ObjectWeakMap to ObjectMetadataMap.

Review of attachment 8723946 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsweakmap.h
@@ +387,5 @@
>  
> +// A simple map for storing metadata about JSObjects, where the metadata itself
> +// is a JSObject. This is appropriate for metadata that is usually absent. This
> +// is just a thin wrapper around ObjectValueMap, with a more focused interface.
> +class ObjectMetadataMap

This is orthogonal to WeakMap and is only concerned with our metadata implementation; I think it should move to jscompartment.{cpp,h} with the usages.
Attachment #8723946 - Flags: review?(terrence) → review+
(In reply to Terrence Cole [:terrence] from comment #3)
> This is orthogonal to WeakMap and is only concerned with our metadata
> implementation; I think it should move to jscompartment.{cpp,h} with the
> usages.

Did you know that ObjectWeapMap is also used in vm/ScopeObject.h and builtin/TypedObject.cpp? In that light,
1) Do you still approve of renaming it ObjectMetadataMap?
2) Do you still think it should be moved to jscompartment.cpp?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: