Commit 120441ca authored by Matthias Liedtke's avatar Matthias Liedtke Committed by V8 LUCI CQ

[wasm-gc][Subtyping] Update comment about heap type hierarchies

Bug: v8:7748
Change-Id: I678d890cf5a6a606790d782eb4cbc8b574faf4d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913399
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83400}
parent 6ae82935
...@@ -47,19 +47,26 @@ V8_NOINLINE V8_EXPORT_PRIVATE bool EquivalentTypes(ValueType type1, ...@@ -47,19 +47,26 @@ V8_NOINLINE V8_EXPORT_PRIVATE bool EquivalentTypes(ValueType type1,
// - (ref ht1) <: (ref null? ht2) iff ht1 <: ht2. // - (ref ht1) <: (ref null? ht2) iff ht1 <: ht2.
// - rtt1 <: rtt2 iff rtt1 ~ rtt2. // - rtt1 <: rtt2 iff rtt1 ~ rtt2.
// For heap types, the following subtyping rules hold: // For heap types, the following subtyping rules hold:
// - The abstract heap types form the following type hierarchy: // - The abstract heap types form the following type hierarchies:
// any (a.k.a. extern) // TODO(7748): abstract ref.data should become ref.struct.
// / \ //
// eq func // any func extern
// | | |
// eq nofunc noextern
// / \ // / \
// i31 data // i31 data
// | // | |
// array // | array
// \ /
// none
//
// - All functions are subtypes of func. // - All functions are subtypes of func.
// - All structs are subtypes of data. // - All structs are subtypes of data.
// - All arrays are subtypes of array. // - All arrays are subtypes of array.
// - An indexed heap type h1 is a subtype of indexed heap type h2 if h2 is // - An indexed heap type h1 is a subtype of indexed heap type h2 if h2 is
// transitively an explicit canonical supertype of h1. // transitively an explicit canonical supertype of h1.
// Note that {any} includes references introduced by the host which belong to
// none of any's subtypes (e.g. JS objects).
V8_INLINE bool IsSubtypeOf(ValueType subtype, ValueType supertype, V8_INLINE bool IsSubtypeOf(ValueType subtype, ValueType supertype,
const WasmModule* sub_module, const WasmModule* sub_module,
const WasmModule* super_module) { const WasmModule* super_module) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment