Closed Bug 1604118 Opened 1 year ago Closed 1 year ago

Rename isRef() as isTypeIndex()


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




Tracking Status
firefox73 --- fixed


(Reporter: lth, Assigned: lth)



(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

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

Attachment #9116153 - Attachment description: Bug 1604118 - Rename isRef, and tidy up. r?rhunt → Bug 1604118 - Rename isRef, and tidy up. r=rhunt
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.