Closed Bug 933760 Opened 11 years ago Closed 11 years ago

Have TI track a TypeRepresentation for each type descriptor

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: nmatsakis, Assigned: nmatsakis)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

As of bug 898347, we associate a TypeRepresentation with typed object instances, but there is nothing in particular associated with *type descriptors*. Particularly when optimizing new object construction (bug 933277) we need the ability to figure out what type a type descriptor represents.

There are two options:

1. Give each type descriptor a singleton type.

2. Associate a type object with each type representation (canonical form of a type descriptor) and then use that type object for the type descriptor.

The latter seems more efficient (fewer type objects overall) so that's the path I've taken thus far.
Depends on: 898347
Attached patch Bug933760.diff (obsolete) — Splinter Review
Attachment #825987 - Flags: review?(bhackett1024)
Comment on attachment 825987 [details] [diff] [review]
Bug933760.diff

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

Sorry for the delay.

::: js/src/builtin/TypeRepresentation.h
@@ +22,5 @@
> +  this object is never exposed to user code (it is used by self-hosted
> +  code). Type representations are interned into a hashset in the
> +  compartment (typeReprs), meaning that you can compare two type
> +  representations for equality just using `==`. If they are equal,
> +  it means that they represent the same binary layout.

Preexisting, but can you change the format of this comment to match other block comments in js?
Attachment #825987 - Flags: review?(bhackett1024) → review+
Attached patch Bug933760.diffSplinter Review
Carrying over r+ from bhackett
Attachment #825987 - Attachment is obsolete: true
Attachment #8341820 - Flags: review+
Assignee: nobody → nmatsakis
https://hg.mozilla.org/mozilla-central/rev/c996211971a8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: