Useful type tags for js::Value to allow easier type checking and so forth

NEW
Unassigned

Status

()

Core
JavaScript Engine
6 years ago
3 years ago

People

(Reporter: evilpie, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
We should assign type tags in a way, in which we can use a bitmask/and to reuse the same code for different stuff. 
For example, for ToInt32, it would be useful if we could detected int/boolean/undefined/null, which just require use to use the payload.

I am sure there are some other cases, too. It would be good if we could find out these beforehand.

Comment 1

6 years ago
Originally type tags were just a bitmask.  Punboxing forced a dense index since there were only 3 bits and I just made nunboxing do the same for simplicity in a few cases and to optimize a few conversions in the tracer (hah!).  With nunbox64, the type bitmask could help both 32/64-bit, so I'm excited to see what speedups you find.

One reason why there may not be a massive speedup awaiting is that js::Value usage in the VM is increasingly not hot and the hot paths often involve single-type queries, isObjectOrNull or isNumber and the latter two are, by design, already single operations.
(Reporter)

Updated

6 years ago
Assignee: general → evilpies
(Reporter)

Comment 2

5 years ago
I am not working on this.
Assignee: evilpies → general
(Assignee)

Updated

3 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.