Closed Bug 1604118 Opened 7 months ago Closed 7 months ago

Rename isRef() as isTypeIndex()

Categories

(Core :: Javascript: WebAssembly, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: lth, Assigned: lth)

Details

Attachments

(1 file)

One of the fallouts from the RefType work was that we got RefType::TypeIndex to be the name of (ref T) types. It was always confusing to have both ValType::isReference() and ValType::isRef(), so we should rename the latter as ValType::isTypeIndex() to fit the improved naming scheme.

We should probably also introduce other predicates, isNull, isAny, etc.

Right now, TypeIndex only describes (ref T) where T is a struct type, but this will change with typed function references at least, and possibly with events and other things that reference function types in the type table. So when we change from isRef() to isTypeIndex() we should consider adding predicates or assertions at the locations of isRef() to test for struct-type, since that is usually what is expected. We don't want surprises later.

Renames isRef() as isTypeIndex90 and slightly change some error
messages to distinguish indexed reference types from the more generic
ones.

Adds predicates on ValType to test various reference type subtypes,
this reduces clutter.

Slightly changes the code around existing uses of isRef to improve
error checking and provide resilience as we go forward toward other
reference types, by calling out struct types specifically when they
are the types we care about, and in one case changing from isRef() to
!isAnyRef(), since that was the intent when we only had those two
cases.

Attachment #9116153 - Attachment description: Bug 1604118 - Rename isRef, and tidy up. r?rhunt → Bug 1604118 - Rename isRef, and tidy up. r=rhunt
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e7dd9fe1cde
Rename isRef, and tidy up.  r=rhunt
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.