Closed Bug 838361 Opened 10 years ago Closed 10 years ago

BaselineCompiler: Use identity comparison on type tests for singleton objects

Categories

(Core :: JavaScript Engine, defect)

Other Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bhackett1024, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
When generating IC stubs to test whether objects have a type that has seen before, the type of singleton objects is explicitly instantiated with a getType(cx) call.  Instead, an identity comparison on the input object can be used.

Doing the identity comparison is preferable because (a) it requires one less load, and more importantly (b) instantiating singleton types can bloat memory usage unnecessarily.  Many objects with lazy singleton types will flow around the program without any need to ever instantiate the type.
Attachment #710418 - Flags: review?(kvijayan)
Comment on attachment 710418 [details] [diff] [review]
patch

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

Good find.
Attachment #710418 - Flags: review?(kvijayan) → review+
https://hg.mozilla.org/projects/ionmonkey/rev/2ede3f54f81b
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.