Commit 42da0c39 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by V8 LUCI CQ

[turbofan] add WasmObject to Turbofan types

Bug: v8:12185
Change-Id: I7d5fbf624fff262b7777e443b12cb7a72d6165e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293404
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78067}
parent 19b9b6eb
......@@ -132,9 +132,10 @@ namespace compiler {
V(SandboxedExternalPointer, uint64_t{1} << 30) \
V(CagedPointer, uint64_t{1} << 31)
// For future use.
// Types defined in the high 32 bit are currently only supported in C++.
#define PROPER_ATOMIC_BITSET_TYPE_HIGH_LIST(V)
// We split the macro list into two parts because the Torque equivalent in
// turbofan-types.tq uses two 32bit bitfield structs.
#define PROPER_ATOMIC_BITSET_TYPE_HIGH_LIST(V) \
V(WasmObject, uint64_t{1} << 32)
#define PROPER_BITSET_TYPE_LIST(V) \
V(None, uint64_t{0}) \
......@@ -199,7 +200,7 @@ namespace compiler {
V(DetectableReceiver, kDetectableObject | kProxy) \
V(DetectableReceiverOrNull, kDetectableReceiver | kNull) \
V(Object, kDetectableObject | kOtherUndetectable) \
V(Receiver, kObject | kProxy) \
V(Receiver, kObject | kProxy | kWasmObject) \
V(ReceiverOrUndefined, kReceiver | kUndefined) \
V(ReceiverOrNullOrUndefined, kReceiver | kNull | kUndefined) \
V(SymbolOrReceiver, kSymbol | kReceiver) \
......
......@@ -48,7 +48,7 @@ bitfield struct TurbofanTypeLowBits extends uint32 {
}
bitfield struct TurbofanTypeHighBits extends uint32 {
_unused_field: bool: 1 bit;
wasm_object: bool: 1 bit;
}
@export
......@@ -85,7 +85,9 @@ macro IsMinusZero(x: float64): bool {
macro TestTurbofanBitsetType(
value: Object, bitsetLow: TurbofanTypeLowBits,
_bitsetHigh: TurbofanTypeHighBits): bool {
bitsetHigh: TurbofanTypeHighBits): bool {
// Silence unused warnings on builds that don't need {bitsetHigh}.
const _unused = bitsetHigh;
typeswitch (value) {
case (value: Number): {
const valueF = Convert<float64>(value);
......@@ -163,6 +165,10 @@ macro TestTurbofanBitsetType(
return bitsetLow.other_object;
}
}
@if(V8_ENABLE_WEBASSEMBLY)
case (WasmObject): {
return bitsetHigh.wasm_object;
}
case (Object): {
return false;
}
......
......@@ -54,6 +54,11 @@ class BuildFlags : public ContextualClass<BuildFlags> {
build_flags_["V8_SCRIPTORMODULE_LEGACY_LIFETIME"] = true;
#else
build_flags_["V8_SCRIPTORMODULE_LEGACY_LIFETIME"] = false;
#endif
#ifdef V8_ENABLE_WEBASSEMBLY
build_flags_["V8_ENABLE_WEBASSEMBLY"] = true;
#else
build_flags_["V8_ENABLE_WEBASSEMBLY"] = false;
#endif
}
static bool GetFlag(const std::string& name, const char* production) {
......
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