Commit e0c1ca5a authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque] fix formatting of union types

The Torque formatter script did a hack to put spaces arount the | of
union types. This was broken when the inserted comment ended up on the
end of a line. For this reason, and since it doesn't make sense to
fight the Google-wide TypeScript style for union types, this CL reverts
to not putting spaces around union types.

Bug: v8:7793
Change-Id: Ic0acf9e1da82540432a8e21b58497a6a7d523b9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1871604
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarJoshua Litt <joshualitt@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64536}
parent 38da4d19
...@@ -67,7 +67,7 @@ namespace array { ...@@ -67,7 +67,7 @@ namespace array {
transitioning builtin ArrayReduceRightLoopContinuation(implicit context: transitioning builtin ArrayReduceRightLoopContinuation(implicit context:
Context)( Context)(
_receiver: JSReceiver, callbackfn: Callable, _receiver: JSReceiver, callbackfn: Callable,
initialAccumulator: JSAny | TheHole, o: JSReceiver, initialK: Number, initialAccumulator: JSAny|TheHole, o: JSReceiver, initialK: Number,
_length: Number): JSAny { _length: Number): JSAny {
let accumulator = initialAccumulator; let accumulator = initialAccumulator;
...@@ -118,8 +118,8 @@ namespace array { ...@@ -118,8 +118,8 @@ namespace array {
transitioning macro FastArrayReduceRight(implicit context: Context)( transitioning macro FastArrayReduceRight(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, o: JSReceiver, len: Number, callbackfn: Callable,
initialAccumulator: JSAny | TheHole): JSAny initialAccumulator: JSAny|TheHole): JSAny
labels Bailout(Number, JSAny | TheHole) { labels Bailout(Number, JSAny|TheHole) {
let accumulator = initialAccumulator; let accumulator = initialAccumulator;
const smiLen = Cast<Smi>(len) otherwise goto Bailout(len - 1, accumulator); const smiLen = Cast<Smi>(len) otherwise goto Bailout(len - 1, accumulator);
const fastO = Cast<FastJSArrayForRead>(o) const fastO = Cast<FastJSArrayForRead>(o)
...@@ -178,14 +178,14 @@ namespace array { ...@@ -178,14 +178,14 @@ namespace array {
// exception. (This case is handled at the end of // exception. (This case is handled at the end of
// ArrayReduceRightLoopContinuation). // ArrayReduceRightLoopContinuation).
const initialValue: JSAny | TheHole = const initialValue: JSAny|TheHole =
arguments.length > 1 ? arguments[1] : TheHole; arguments.length > 1 ? arguments[1] : TheHole;
try { try {
return FastArrayReduceRight(o, len, callbackfn, initialValue) return FastArrayReduceRight(o, len, callbackfn, initialValue)
otherwise Bailout; otherwise Bailout;
} }
label Bailout(value: Number, accumulator: JSAny | TheHole) { label Bailout(value: Number, accumulator: JSAny|TheHole) {
return ArrayReduceRightLoopContinuation( return ArrayReduceRightLoopContinuation(
o, callbackfn, accumulator, o, value, len); o, callbackfn, accumulator, o, value, len);
} }
......
...@@ -66,7 +66,7 @@ namespace array { ...@@ -66,7 +66,7 @@ namespace array {
transitioning builtin ArrayReduceLoopContinuation(implicit context: Context)( transitioning builtin ArrayReduceLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, _receiver: JSReceiver, callbackfn: Callable,
initialAccumulator: JSAny | TheHole, o: JSReceiver, initialK: Number, initialAccumulator: JSAny|TheHole, o: JSReceiver, initialK: Number,
length: Number): JSAny { length: Number): JSAny {
let accumulator = initialAccumulator; let accumulator = initialAccumulator;
...@@ -117,8 +117,8 @@ namespace array { ...@@ -117,8 +117,8 @@ namespace array {
transitioning macro FastArrayReduce(implicit context: Context)( transitioning macro FastArrayReduce(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, o: JSReceiver, len: Number, callbackfn: Callable,
initialAccumulator: JSAny | TheHole): JSAny initialAccumulator: JSAny|TheHole): JSAny
labels Bailout(Number, JSAny | TheHole) { labels Bailout(Number, JSAny|TheHole) {
const k = 0; const k = 0;
let accumulator = initialAccumulator; let accumulator = initialAccumulator;
Cast<Smi>(len) otherwise goto Bailout(k, accumulator); Cast<Smi>(len) otherwise goto Bailout(k, accumulator);
...@@ -178,14 +178,14 @@ namespace array { ...@@ -178,14 +178,14 @@ namespace array {
// exception. (This case is handled at the end of // exception. (This case is handled at the end of
// ArrayReduceLoopContinuation). // ArrayReduceLoopContinuation).
const initialValue: JSAny | TheHole = const initialValue: JSAny|TheHole =
arguments.length > 1 ? arguments[1] : TheHole; arguments.length > 1 ? arguments[1] : TheHole;
try { try {
return FastArrayReduce(o, len, callbackfn, initialValue) return FastArrayReduce(o, len, callbackfn, initialValue)
otherwise Bailout; otherwise Bailout;
} }
label Bailout(value: Number, accumulator: JSAny | TheHole) { label Bailout(value: Number, accumulator: JSAny|TheHole) {
return ArrayReduceLoopContinuation( return ArrayReduceLoopContinuation(
o, callbackfn, accumulator, o, value, len); o, callbackfn, accumulator, o, value, len);
} }
......
...@@ -41,11 +41,11 @@ extern class HeapObject extends Tagged { ...@@ -41,11 +41,11 @@ extern class HeapObject extends Tagged {
map: Map; map: Map;
} }
type Object = Smi | HeapObject; type Object = Smi|HeapObject;
// Defined to coincide with https://tc39.es/ecma262/#sec-ispropertykey // Defined to coincide with https://tc39.es/ecma262/#sec-ispropertykey
// Doesn't include PrivateSymbol. // Doesn't include PrivateSymbol.
type PropertyKey = String | PublicSymbol; type PropertyKey = String|PublicSymbol;
// TODO(tebbi): PrivateSymbol is only exposed to JavaScript through the debugger // TODO(tebbi): PrivateSymbol is only exposed to JavaScript through the debugger
// API. We should reconsider this and try not to expose it at all. Then JSAny // API. We should reconsider this and try not to expose it at all. Then JSAny
...@@ -53,18 +53,16 @@ type PropertyKey = String | PublicSymbol; ...@@ -53,18 +53,16 @@ type PropertyKey = String | PublicSymbol;
// A JavaScript primitive value as defined in // A JavaScript primitive value as defined in
// https://tc39.es/ecma262/#sec-primitive-value. // https://tc39.es/ecma262/#sec-primitive-value.
type JSPrimitive = Numeric | String | Symbol | Boolean | type JSPrimitive = Numeric|String|Symbol|Boolean|Null|Undefined;
Null | Undefined;
// A user-exposed JavaScript value, as opposed to V8-internal values like // A user-exposed JavaScript value, as opposed to V8-internal values like
// TheHole or FixedArray. // TheHole or FixedArray.
type JSAny = JSReceiver | JSPrimitive; type JSAny = JSReceiver|JSPrimitive;
type JSAnyNotNumber = BigInt | String | Symbol | Boolean | type JSAnyNotNumber = BigInt|String|Symbol|Boolean|Null|Undefined|JSReceiver;
Null | Undefined | JSReceiver;
// This is the intersection of JSAny and HeapObject. // This is the intersection of JSAny and HeapObject.
type JSAnyNotSmi = JSAnyNotNumber | HeapNumber; type JSAnyNotSmi = JSAnyNotNumber|HeapNumber;
type int32 generates 'TNode<Int32T>' constexpr 'int32_t'; type int32 generates 'TNode<Int32T>' constexpr 'int32_t';
type uint32 generates 'TNode<Uint32T>' constexpr 'uint32_t'; type uint32 generates 'TNode<Uint32T>' constexpr 'uint32_t';
...@@ -145,8 +143,8 @@ extern class Oddball extends PrimitiveHeapObject { ...@@ -145,8 +143,8 @@ extern class Oddball extends PrimitiveHeapObject {
} }
extern class HeapNumber extends PrimitiveHeapObject { value: float64; } extern class HeapNumber extends PrimitiveHeapObject { value: float64; }
type Number = Smi | HeapNumber; type Number = Smi|HeapNumber;
type Numeric = Number | BigInt; type Numeric = Number|BigInt;
@abstract @abstract
@generateCppClass @generateCppClass
...@@ -155,7 +153,7 @@ extern class Name extends PrimitiveHeapObject { ...@@ -155,7 +153,7 @@ extern class Name extends PrimitiveHeapObject {
} }
// This is the same as Name, but with the information that there are no other // This is the same as Name, but with the information that there are no other
// kinds of names. // kinds of names.
type AnyName = PrivateSymbol | PublicSymbol | String; type AnyName = PrivateSymbol|PublicSymbol|String;
@generateCppClass @generateCppClass
extern class Symbol extends Name { extern class Symbol extends Name {
...@@ -305,11 +303,10 @@ extern class Map extends HeapObject { ...@@ -305,11 +303,10 @@ extern class Map extends HeapObject {
@if(V8_DOUBLE_FIELDS_UNBOXING) layout_descriptor: LayoutDescriptor; @if(V8_DOUBLE_FIELDS_UNBOXING) layout_descriptor: LayoutDescriptor;
@ifnot(V8_DOUBLE_FIELDS_UNBOXING) layout_descriptor: void; @ifnot(V8_DOUBLE_FIELDS_UNBOXING) layout_descriptor: void;
dependent_code: DependentCode; dependent_code: DependentCode;
prototype_validity_cell: Smi | Cell; prototype_validity_cell: Smi|Cell;
// TODO(v8:9108): Misusing "weak" keyword; type should be // TODO(v8:9108): Misusing "weak" keyword; type should be
// Map | Weak<Map> | TransitionArray | PrototypeInfo | Smi. // Map | Weak<Map> | TransitionArray | PrototypeInfo | Smi.
weak transitions_or_prototype_info: Map | TransitionArray | weak transitions_or_prototype_info: Map|TransitionArray|PrototypeInfo|Smi;
PrototypeInfo | Smi;
} }
@generatePrint @generatePrint
...@@ -379,7 +376,7 @@ intrinsic ...@@ -379,7 +376,7 @@ intrinsic
@abstract @abstract
@highestInstanceTypeWithinParentClassRange @highestInstanceTypeWithinParentClassRange
extern class JSReceiver extends HeapObject { extern class JSReceiver extends HeapObject {
properties_or_hash: FixedArrayBase | PropertyArray | Smi; properties_or_hash: FixedArrayBase|PropertyArray|Smi;
} }
type Constructor extends JSReceiver; type Constructor extends JSReceiver;
...@@ -473,13 +470,13 @@ extern class JSFunction extends JSFunctionOrBoundFunction { ...@@ -473,13 +470,13 @@ extern class JSFunction extends JSFunctionOrBoundFunction {
weak code: Code; weak code: Code;
// Space for the following field may or may not be allocated. // Space for the following field may or may not be allocated.
@noVerifier weak prototype_or_initial_map: JSReceiver | Map; @noVerifier weak prototype_or_initial_map: JSReceiver|Map;
} }
@generateCppClass @generateCppClass
extern class JSProxy extends JSReceiver { extern class JSProxy extends JSReceiver {
target: JSReceiver | Null; target: JSReceiver|Null;
handler: JSReceiver | Null; handler: JSReceiver|Null;
} }
// Just a starting shape for JSObject; properties can move after initialization. // Just a starting shape for JSObject; properties can move after initialization.
...@@ -592,8 +589,8 @@ type NoSharedNameSentinel extends Smi; ...@@ -592,8 +589,8 @@ type NoSharedNameSentinel extends Smi;
@generateCppClass @generateCppClass
extern class CallHandlerInfo extends Struct { extern class CallHandlerInfo extends Struct {
callback: NonNullForeign | Undefined | Zero; callback: NonNullForeign|Undefined|Zero;
js_callback: NonNullForeign | Undefined | Zero; js_callback: NonNullForeign|Undefined|Zero;
data: Object; data: Object;
} }
...@@ -602,7 +599,7 @@ extern class Module extends HeapObject { ...@@ -602,7 +599,7 @@ extern class Module extends HeapObject {
exports: ObjectHashTable; exports: ObjectHashTable;
hash: Smi; hash: Smi;
status: Smi; status: Smi;
module_namespace: JSModuleNamespace | Undefined; module_namespace: JSModuleNamespace|Undefined;
exception: Object; exception: Object;
} }
...@@ -611,8 +608,7 @@ type SourceTextModuleInfo extends FixedArray; ...@@ -611,8 +608,7 @@ type SourceTextModuleInfo extends FixedArray;
@generateCppClass @generateCppClass
extern class SourceTextModule extends Module { extern class SourceTextModule extends Module {
// The code representing this module, or an abstraction thereof. // The code representing this module, or an abstraction thereof.
code: SharedFunctionInfo | JSFunction | code: SharedFunctionInfo|JSFunction|JSGeneratorObject|SourceTextModuleInfo;
JSGeneratorObject | SourceTextModuleInfo;
// Arrays of cells corresponding to regular exports and regular imports. // Arrays of cells corresponding to regular exports and regular imports.
// A cell's position in the array is determined by the cell index of the // A cell's position in the array is determined by the cell index of the
...@@ -632,9 +628,9 @@ extern class SourceTextModule extends Module { ...@@ -632,9 +628,9 @@ extern class SourceTextModule extends Module {
// The value of import.meta inside of this module. // The value of import.meta inside of this module.
// Lazily initialized on first access. It's the hole before first access and // Lazily initialized on first access. It's the hole before first access and
// a JSObject afterwards. // a JSObject afterwards.
import_meta: TheHole | JSObject; import_meta: TheHole|JSObject;
async_parent_modules: ArrayList; async_parent_modules: ArrayList;
top_level_capability: JSPromise | Undefined; top_level_capability: JSPromise|Undefined;
dfs_index: Smi; dfs_index: Smi;
dfs_ancestor_index: Smi; dfs_ancestor_index: Smi;
pending_async_dependencies: Smi; pending_async_dependencies: Smi;
...@@ -702,7 +698,7 @@ extern class JSMessageObject extends JSObject { ...@@ -702,7 +698,7 @@ extern class JSMessageObject extends JSObject {
arguments: Object; arguments: Object;
script: Script; script: Script;
stack_frames: Object; stack_frames: Object;
shared_info: SharedFunctionInfo | Undefined; shared_info: SharedFunctionInfo|Undefined;
// Raw data fields. // Raw data fields.
// TODO(ishell): store as int32 instead of Smi. // TODO(ishell): store as int32 instead of Smi.
...@@ -720,12 +716,12 @@ extern class WeakArrayList extends HeapObject { ...@@ -720,12 +716,12 @@ extern class WeakArrayList extends HeapObject {
} }
extern class PrototypeInfo extends Struct { extern class PrototypeInfo extends Struct {
js_module_namespace: JSModuleNamespace | Undefined; js_module_namespace: JSModuleNamespace|Undefined;
prototype_users: WeakArrayList | Zero; prototype_users: WeakArrayList|Zero;
registry_slot: Smi; registry_slot: Smi;
validity_cell: Object; validity_cell: Object;
// TODO(v8:9108): Should be Weak<Map> | Undefined. // TODO(v8:9108): Should be Weak<Map> | Undefined.
@noVerifier object_create_map: Map | Undefined; @noVerifier object_create_map: Map|Undefined;
bit_field: Smi; bit_field: Smi;
} }
...@@ -739,7 +735,7 @@ extern class Script extends Struct { ...@@ -739,7 +735,7 @@ extern class Script extends Struct {
line_ends: Object; line_ends: Object;
id: Smi; id: Smi;
eval_from_shared_or_wrapped_arguments: Object; eval_from_shared_or_wrapped_arguments: Object;
eval_from_position: Smi | Foreign; // Smi or Managed<wasm::NativeModule> eval_from_position: Smi|Foreign; // Smi or Managed<wasm::NativeModule>
shared_function_infos: Object; shared_function_infos: Object;
flags: Smi; flags: Smi;
source_url: Object; source_url: Object;
...@@ -768,9 +764,9 @@ extern class InterpreterData extends Struct { ...@@ -768,9 +764,9 @@ extern class InterpreterData extends Struct {
extern class SharedFunctionInfo extends HeapObject { extern class SharedFunctionInfo extends HeapObject {
weak function_data: Object; weak function_data: Object;
name_or_scope_info: String | NoSharedNameSentinel | ScopeInfo; name_or_scope_info: String|NoSharedNameSentinel|ScopeInfo;
outer_scope_info_or_feedback_metadata: HeapObject; outer_scope_info_or_feedback_metadata: HeapObject;
script_or_debug_info: Script | DebugInfo | Undefined; script_or_debug_info: Script|DebugInfo|Undefined;
length: int16; length: int16;
formal_parameter_count: uint16; formal_parameter_count: uint16;
// Currently set to uint16, can be set to uint8 to save space. // Currently set to uint16, can be set to uint8 to save space.
...@@ -810,7 +806,7 @@ extern class JSBoundFunction extends JSFunctionOrBoundFunction { ...@@ -810,7 +806,7 @@ extern class JSBoundFunction extends JSFunctionOrBoundFunction {
bound_target_function: Callable; bound_target_function: Callable;
// The value that is always passed as the this value when calling the wrapped // The value that is always passed as the this value when calling the wrapped
// function. // function.
bound_this: JSAny | SourceTextModule; bound_this: JSAny|SourceTextModule;
// A list of values whose elements are used as the first arguments to any call // A list of values whose elements are used as the first arguments to any call
// to the wrapped function. // to the wrapped function.
bound_arguments: FixedArray; bound_arguments: FixedArray;
...@@ -828,8 +824,7 @@ type CallableApiObject extends JSObject; ...@@ -828,8 +824,7 @@ type CallableApiObject extends JSObject;
// A JSProxy with the callable bit set. // A JSProxy with the callable bit set.
type CallableJSProxy extends JSProxy; type CallableJSProxy extends JSProxy;
type Callable = type Callable = JSFunction|JSBoundFunction|CallableJSProxy|CallableApiObject;
JSFunction | JSBoundFunction | CallableJSProxy | CallableApiObject;
extern operator '.length_intptr' macro LoadAndUntagFixedArrayBaseLength( extern operator '.length_intptr' macro LoadAndUntagFixedArrayBaseLength(
FixedArrayBase): intptr; FixedArrayBase): intptr;
...@@ -838,7 +833,7 @@ type SloppyArgumentsElements extends FixedArray; ...@@ -838,7 +833,7 @@ type SloppyArgumentsElements extends FixedArray;
extern class FreeSpace extends HeapObject { extern class FreeSpace extends HeapObject {
size: Smi; size: Smi;
next: FreeSpace | Uninitialized; next: FreeSpace|Uninitialized;
} }
// %RawDownCast should *never* be used anywhere in Torque code except for // %RawDownCast should *never* be used anywhere in Torque code except for
...@@ -904,7 +899,7 @@ extern class JSArrayBufferView extends JSObject { ...@@ -904,7 +899,7 @@ extern class JSArrayBufferView extends JSObject {
extern class JSTypedArray extends JSArrayBufferView { extern class JSTypedArray extends JSArrayBufferView {
length: uintptr; length: uintptr;
external_pointer: RawPtr; external_pointer: RawPtr;
base_pointer: ByteArray | Smi; base_pointer: ByteArray|Smi;
} }
@abstract @abstract
...@@ -928,17 +923,17 @@ extern class JSDate extends JSObject { ...@@ -928,17 +923,17 @@ extern class JSDate extends JSObject {
value: NumberOrUndefined; value: NumberOrUndefined;
// Cached values: // Cached values:
year: Undefined | Smi | NaN; year: Undefined|Smi|NaN;
month: Undefined | Smi | NaN; month: Undefined|Smi|NaN;
day: Undefined | Smi | NaN; day: Undefined|Smi|NaN;
weekday: Undefined | Smi | NaN; weekday: Undefined|Smi|NaN;
hour: Undefined | Smi | NaN; hour: Undefined|Smi|NaN;
min: Undefined | Smi | NaN; min: Undefined|Smi|NaN;
sec: Undefined | Smi | NaN; sec: Undefined|Smi|NaN;
// Sample of the date cache stamp at the moment when chached fields were // Sample of the date cache stamp at the moment when chached fields were
// cached. // cached.
cache_stamp: Undefined | Smi | NaN; cache_stamp: Undefined|Smi|NaN;
} }
extern class JSGlobalObject extends JSSpecialObject { extern class JSGlobalObject extends JSSpecialObject {
...@@ -1063,22 +1058,22 @@ extern class Foreign extends HeapObject { ...@@ -1063,22 +1058,22 @@ extern class Foreign extends HeapObject {
@generateCppClass @generateCppClass
extern class InterceptorInfo extends Struct { extern class InterceptorInfo extends Struct {
getter: NonNullForeign | Zero | Undefined; getter: NonNullForeign|Zero|Undefined;
setter: NonNullForeign | Zero | Undefined; setter: NonNullForeign|Zero|Undefined;
query: NonNullForeign | Zero | Undefined; query: NonNullForeign|Zero|Undefined;
descriptor: NonNullForeign | Zero | Undefined; descriptor: NonNullForeign|Zero|Undefined;
deleter: NonNullForeign | Zero | Undefined; deleter: NonNullForeign|Zero|Undefined;
enumerator: NonNullForeign | Zero | Undefined; enumerator: NonNullForeign|Zero|Undefined;
definer: NonNullForeign | Zero | Undefined; definer: NonNullForeign|Zero|Undefined;
data: Object; data: Object;
flags: Smi; flags: Smi;
} }
@generateCppClass @generateCppClass
extern class AccessCheckInfo extends Struct { extern class AccessCheckInfo extends Struct {
callback: Foreign | Zero | Undefined; callback: Foreign|Zero|Undefined;
named_interceptor: InterceptorInfo | Zero | Undefined; named_interceptor: InterceptorInfo|Zero|Undefined;
indexed_interceptor: InterceptorInfo | Zero | Undefined; indexed_interceptor: InterceptorInfo|Zero|Undefined;
data: Object; data: Object;
} }
...@@ -1100,8 +1095,8 @@ extern class Cell extends HeapObject { ...@@ -1100,8 +1095,8 @@ extern class Cell extends HeapObject {
@abstract @abstract
extern class DataHandler extends Struct { extern class DataHandler extends Struct {
smi_handler: Smi | Code; smi_handler: Smi|Code;
validity_cell: Smi | Cell; validity_cell: Smi|Cell;
// Space for the following fields may or may not be allocated. // Space for the following fields may or may not be allocated.
// TODO(v8:9108): Misusing "weak" keyword; should be MaybeObject. // TODO(v8:9108): Misusing "weak" keyword; should be MaybeObject.
...@@ -1178,7 +1173,7 @@ extern class JSPromise extends JSObject { ...@@ -1178,7 +1173,7 @@ extern class JSPromise extends JSObject {
// Smi 0 terminated list of PromiseReaction objects in case the JSPromise was // Smi 0 terminated list of PromiseReaction objects in case the JSPromise was
// not settled yet, otherwise the result. // not settled yet, otherwise the result.
reactions_or_result: Smi | PromiseReaction | JSAny; reactions_or_result: Smi|PromiseReaction|JSAny;
flags: Smi; flags: Smi;
} }
...@@ -1204,14 +1199,14 @@ extern class StackFrameInfo extends Struct { ...@@ -1204,14 +1199,14 @@ extern class StackFrameInfo extends Struct {
column_number: Smi; column_number: Smi;
promise_all_index: Smi; promise_all_index: Smi;
script_id: Smi; script_id: Smi;
script_name: String | Null | Undefined; script_name: String|Null|Undefined;
script_name_or_source_url: String | Null | Undefined; script_name_or_source_url: String|Null|Undefined;
function_name: String | Null | Undefined; function_name: String|Null|Undefined;
method_name: String | Null | Undefined; method_name: String|Null|Undefined;
type_name: String | Null | Undefined; type_name: String|Null|Undefined;
eval_origin: String | Null | Undefined; eval_origin: String|Null|Undefined;
wasm_module_name: String | Null | Undefined; wasm_module_name: String|Null|Undefined;
wasm_instance: WasmInstanceObject | Null | Undefined; wasm_instance: WasmInstanceObject|Null|Undefined;
flag: Smi; flag: Smi;
} }
...@@ -1219,9 +1214,9 @@ type FrameArray extends FixedArray; ...@@ -1219,9 +1214,9 @@ type FrameArray extends FixedArray;
@generateCppClass @generateCppClass
extern class StackTraceFrame extends Struct { extern class StackTraceFrame extends Struct {
frame_array: FrameArray | Undefined; frame_array: FrameArray|Undefined;
frame_index: Smi; frame_index: Smi;
frame_info: StackFrameInfo | Undefined; frame_info: StackFrameInfo|Undefined;
id: Smi; id: Smi;
} }
...@@ -1241,7 +1236,7 @@ extern class WasmExportedFunctionData extends Struct { ...@@ -1241,7 +1236,7 @@ extern class WasmExportedFunctionData extends Struct {
// The remaining fields are for fast calling from C++. The contract is // The remaining fields are for fast calling from C++. The contract is
// that they are lazily populated, and either all will be present or none. // that they are lazily populated, and either all will be present or none.
c_wrapper_code: Object; c_wrapper_code: Object;
wasm_call_target: Smi | Foreign; wasm_call_target: Smi|Foreign;
packed_args_size: Smi; packed_args_size: Smi;
} }
...@@ -1266,17 +1261,17 @@ extern class WasmIndirectFunctionTable extends Struct { ...@@ -1266,17 +1261,17 @@ extern class WasmIndirectFunctionTable extends Struct {
@ifnot(TAGGED_SIZE_8_BYTES) optional_padding: void; @ifnot(TAGGED_SIZE_8_BYTES) optional_padding: void;
sig_ids: RawPtr; sig_ids: RawPtr;
targets: RawPtr; targets: RawPtr;
managed_native_allocations: Foreign | Undefined; managed_native_allocations: Foreign|Undefined;
refs: FixedArray; refs: FixedArray;
} }
extern class WasmDebugInfo extends Struct { extern class WasmDebugInfo extends Struct {
instance: WasmInstanceObject; instance: WasmInstanceObject;
interpreter_handle: Foreign | Undefined; interpreter_handle: Foreign|Undefined;
interpreter_reference_stack: Cell; interpreter_reference_stack: Cell;
locals_names: FixedArray | Undefined; locals_names: FixedArray|Undefined;
c_wasm_entries: FixedArray | Undefined; c_wasm_entries: FixedArray|Undefined;
c_wasm_entry_map: Foreign | Undefined; // Managed<wasm::SignatureMap> c_wasm_entry_map: Foreign|Undefined; // Managed<wasm::SignatureMap>
} }
@generateCppClass @generateCppClass
...@@ -1467,9 +1462,9 @@ type Undefined extends Oddball; ...@@ -1467,9 +1462,9 @@ type Undefined extends Oddball;
type True extends Oddball; type True extends Oddball;
type False extends Oddball; type False extends Oddball;
type EmptyString extends String; type EmptyString extends String;
type Boolean = True | False; type Boolean = True|False;
type NumberOrUndefined = Number | Undefined; type NumberOrUndefined = Number|Undefined;
extern macro TheHoleConstant(): TheHole; extern macro TheHoleConstant(): TheHole;
extern macro NullConstant(): Null; extern macro NullConstant(): Null;
...@@ -1506,7 +1501,7 @@ const UNSAFE_SKIP_WRITE_BARRIER: ...@@ -1506,7 +1501,7 @@ const UNSAFE_SKIP_WRITE_BARRIER:
@generateCppClass @generateCppClass
extern class AsyncGeneratorRequest extends Struct { extern class AsyncGeneratorRequest extends Struct {
next: AsyncGeneratorRequest | Undefined; next: AsyncGeneratorRequest|Undefined;
resume_mode: Smi; resume_mode: Smi;
value: Object; value: Object;
promise: JSPromise; promise: JSPromise;
...@@ -1514,9 +1509,9 @@ extern class AsyncGeneratorRequest extends Struct { ...@@ -1514,9 +1509,9 @@ extern class AsyncGeneratorRequest extends Struct {
@generateCppClass @generateCppClass
extern class SourceTextModuleInfoEntry extends Struct { extern class SourceTextModuleInfoEntry extends Struct {
export_name: String | Undefined; export_name: String|Undefined;
local_name: String | Undefined; local_name: String|Undefined;
import_name: String | Undefined; import_name: String|Undefined;
module_request: Smi; module_request: Smi;
cell_index: Smi; cell_index: Smi;
beg_pos: Smi; beg_pos: Smi;
...@@ -1525,7 +1520,7 @@ extern class SourceTextModuleInfoEntry extends Struct { ...@@ -1525,7 +1520,7 @@ extern class SourceTextModuleInfoEntry extends Struct {
@generateCppClass @generateCppClass
extern class PromiseCapability extends Struct { extern class PromiseCapability extends Struct {
promise: JSReceiver | Undefined; promise: JSReceiver|Undefined;
resolve: Object; resolve: Object;
reject: Object; reject: Object;
} }
...@@ -1537,12 +1532,12 @@ const kPromiseReactionFulfill: constexpr PromiseReactionType ...@@ -1537,12 +1532,12 @@ const kPromiseReactionFulfill: constexpr PromiseReactionType
@generateCppClass @generateCppClass
extern class PromiseReaction extends Struct { extern class PromiseReaction extends Struct {
next: PromiseReaction | Zero; next: PromiseReaction|Zero;
reject_handler: Callable | Undefined; reject_handler: Callable|Undefined;
fulfill_handler: Callable | Undefined; fulfill_handler: Callable|Undefined;
// Either a JSPromise (in case of native promises), a PromiseCapability // Either a JSPromise (in case of native promises), a PromiseCapability
// (general case), or undefined (in case of await). // (general case), or undefined (in case of await).
promise_or_capability: JSPromise | PromiseCapability | Undefined; promise_or_capability: JSPromise|PromiseCapability|Undefined;
} }
@abstract @abstract
...@@ -1550,10 +1545,10 @@ extern class PromiseReaction extends Struct { ...@@ -1550,10 +1545,10 @@ extern class PromiseReaction extends Struct {
extern class PromiseReactionJobTask extends Microtask { extern class PromiseReactionJobTask extends Microtask {
argument: Object; argument: Object;
context: Context; context: Context;
handler: Callable | Undefined; handler: Callable|Undefined;
// Either a JSPromise (in case of native promises), a PromiseCapability // Either a JSPromise (in case of native promises), a PromiseCapability
// (general case), or undefined (in case of await). // (general case), or undefined (in case of await).
promise_or_capability: JSPromise | PromiseCapability | Undefined; promise_or_capability: JSPromise|PromiseCapability|Undefined;
} }
@generateCppClass @generateCppClass
...@@ -1574,9 +1569,9 @@ extern class PromiseResolveThenableJobTask extends Microtask { ...@@ -1574,9 +1569,9 @@ extern class PromiseResolveThenableJobTask extends Microtask {
@generateCppClass @generateCppClass
extern class JSRegExp extends JSObject { extern class JSRegExp extends JSObject {
data: FixedArray | Undefined; data: FixedArray|Undefined;
source: String | Undefined; source: String|Undefined;
flags: Smi | Undefined; flags: Smi|Undefined;
} }
extern transitioning macro AllocateJSIteratorResult(implicit context: Context)( extern transitioning macro AllocateJSIteratorResult(implicit context: Context)(
...@@ -1606,8 +1601,8 @@ extern class JSRegExpResult extends JSArray { ...@@ -1606,8 +1601,8 @@ extern class JSRegExpResult extends JSArray {
groups: JSAny; groups: JSAny;
// The below fields are for internal use only. // The below fields are for internal use only.
cached_indices_or_match_info: JSRegExpResultIndices | RegExpMatchInfo; cached_indices_or_match_info: JSRegExpResultIndices|RegExpMatchInfo;
names: FixedArray | Undefined; names: FixedArray|Undefined;
} }
@hasSameInstanceTypeAsParent @hasSameInstanceTypeAsParent
...@@ -1658,9 +1653,9 @@ extern class AccessorInfo extends Struct { ...@@ -1658,9 +1653,9 @@ extern class AccessorInfo extends Struct {
name: Object; name: Object;
flags: Smi; flags: Smi;
expected_receiver_type: Object; expected_receiver_type: Object;
setter: NonNullForeign | Zero; setter: NonNullForeign|Zero;
getter: NonNullForeign | Zero; getter: NonNullForeign|Zero;
js_getter: NonNullForeign | Zero; js_getter: NonNullForeign|Zero;
data: Object; data: Object;
} }
...@@ -1683,17 +1678,17 @@ extern class DebugInfo extends Struct { ...@@ -1683,17 +1678,17 @@ extern class DebugInfo extends Struct {
shared: SharedFunctionInfo; shared: SharedFunctionInfo;
debugger_hints: Smi; debugger_hints: Smi;
// Script field from shared function info. // Script field from shared function info.
script: Undefined | Script; script: Undefined|Script;
// The original uninstrumented bytecode array for functions with break // The original uninstrumented bytecode array for functions with break
// points - the instrumented bytecode is held in the shared function info. // points - the instrumented bytecode is held in the shared function info.
original_bytecode_array: Undefined | BytecodeArray; original_bytecode_array: Undefined|BytecodeArray;
// The debug instrumented bytecode array for functions with break points // The debug instrumented bytecode array for functions with break points
// - also pointed to by the shared function info. // - also pointed to by the shared function info.
debug_bytecode_array: Undefined | BytecodeArray; debug_bytecode_array: Undefined|BytecodeArray;
// Fixed array holding status information for each active break point. // Fixed array holding status information for each active break point.
break_points: FixedArray; break_points: FixedArray;
flags: Smi; flags: Smi;
coverage_info: CoverageInfo | Undefined; coverage_info: CoverageInfo|Undefined;
} }
extern class FeedbackVector extends HeapObject { extern class FeedbackVector extends HeapObject {
...@@ -1712,7 +1707,7 @@ extern class FeedbackVector extends HeapObject { ...@@ -1712,7 +1707,7 @@ extern class FeedbackVector extends HeapObject {
@generateCppClass @generateCppClass
extern class FeedbackCell extends Struct { extern class FeedbackCell extends Struct {
value: Undefined | FeedbackVector | FixedArray; value: Undefined|FeedbackVector|FixedArray;
interrupt_budget: int32; interrupt_budget: int32;
} }
...@@ -1727,12 +1722,12 @@ extern class WasmModuleObject extends JSObject { ...@@ -1727,12 +1722,12 @@ extern class WasmModuleObject extends JSObject {
native_module: Foreign; native_module: Foreign;
export_wrappers: FixedArray; export_wrappers: FixedArray;
script: Script; script: Script;
asm_js_offset_table: ByteArray | Undefined; asm_js_offset_table: ByteArray|Undefined;
} }
extern class WasmTableObject extends JSObject { extern class WasmTableObject extends JSObject {
entries: FixedArray; entries: FixedArray;
maximum_length: Smi | HeapNumber | Undefined; maximum_length: Smi|HeapNumber|Undefined;
dispatch_tables: FixedArray; dispatch_tables: FixedArray;
raw_type: Smi; raw_type: Smi;
} }
...@@ -1740,12 +1735,12 @@ extern class WasmTableObject extends JSObject { ...@@ -1740,12 +1735,12 @@ extern class WasmTableObject extends JSObject {
extern class WasmMemoryObject extends JSObject { extern class WasmMemoryObject extends JSObject {
array_buffer: JSArrayBuffer; array_buffer: JSArrayBuffer;
maximum_pages: Smi; maximum_pages: Smi;
instances: WeakArrayList | Undefined; instances: WeakArrayList|Undefined;
} }
extern class WasmGlobalObject extends JSObject { extern class WasmGlobalObject extends JSObject {
untagged_buffer: JSArrayBuffer | Undefined; untagged_buffer: JSArrayBuffer|Undefined;
tagged_buffer: FixedArray | Undefined; tagged_buffer: FixedArray|Undefined;
offset: Smi; offset: Smi;
flags: Smi; flags: Smi;
} }
...@@ -1767,10 +1762,10 @@ extern class AsmWasmData extends Struct { ...@@ -1767,10 +1762,10 @@ extern class AsmWasmData extends Struct {
extern class JSFinalizationGroup extends JSObject { extern class JSFinalizationGroup extends JSObject {
native_context: NativeContext; native_context: NativeContext;
cleanup: Object; cleanup: Object;
active_cells: Undefined | WeakCell; active_cells: Undefined|WeakCell;
cleared_cells: Undefined | WeakCell; cleared_cells: Undefined|WeakCell;
key_map: Object; key_map: Object;
next: Undefined | JSFinalizationGroup; next: Undefined|JSFinalizationGroup;
flags: Smi; flags: Smi;
} }
...@@ -1781,35 +1776,34 @@ extern class JSFinalizationGroupCleanupIterator extends JSObject { ...@@ -1781,35 +1776,34 @@ extern class JSFinalizationGroupCleanupIterator extends JSObject {
@generateCppClass @generateCppClass
extern class WeakCell extends HeapObject { extern class WeakCell extends HeapObject {
finalization_group: Undefined | JSFinalizationGroup; finalization_group: Undefined|JSFinalizationGroup;
target: Undefined | JSReceiver; target: Undefined|JSReceiver;
holdings: Object; holdings: Object;
// For storing doubly linked lists of WeakCells in JSFinalizationGroup's // For storing doubly linked lists of WeakCells in JSFinalizationGroup's
// "active_cells" and "cleared_cells" lists. // "active_cells" and "cleared_cells" lists.
prev: Undefined | WeakCell; prev: Undefined|WeakCell;
next: Undefined | WeakCell; next: Undefined|WeakCell;
// For storing doubly linked lists of WeakCells per key in // For storing doubly linked lists of WeakCells per key in
// JSFinalizationGroup's key-based hashmap. WeakCell also needs to know its // JSFinalizationGroup's key-based hashmap. WeakCell also needs to know its
// key, so that we can remove the key from the key_map when we remove the last // key, so that we can remove the key from the key_map when we remove the last
// WeakCell associated with it. // WeakCell associated with it.
key: Object; key: Object;
key_list_prev: Undefined | WeakCell; key_list_prev: Undefined|WeakCell;
key_list_next: Undefined | WeakCell; key_list_next: Undefined|WeakCell;
} }
@generateCppClass @generateCppClass
extern class JSWeakRef extends JSObject { extern class JSWeakRef extends JSObject {
target: Undefined | JSReceiver; target: Undefined|JSReceiver;
} }
extern class BytecodeArray extends FixedArrayBase { extern class BytecodeArray extends FixedArrayBase {
// TODO(v8:8983): bytecode array object sizes vary based on their contents. // TODO(v8:8983): bytecode array object sizes vary based on their contents.
constant_pool: FixedArray; constant_pool: FixedArray;
handler_table: ByteArray; handler_table: ByteArray;
source_position_table: Undefined | ByteArray | source_position_table: Undefined|ByteArray|SourcePositionTableWithFrameCache;
SourcePositionTableWithFrameCache;
frame_size: int32; frame_size: int32;
parameter_size: int32; parameter_size: int32;
incoming_new_target_or_generator_register: int32; incoming_new_target_or_generator_register: int32;
...@@ -2073,8 +2067,7 @@ macro Float64IsNaN(n: float64): bool { ...@@ -2073,8 +2067,7 @@ macro Float64IsNaN(n: float64): bool {
} }
// The type of all tagged values that can safely be compared with TaggedEqual. // The type of all tagged values that can safely be compared with TaggedEqual.
type TaggedWithIdentity = type TaggedWithIdentity = JSReceiver|FixedArrayBase|Oddball|Map|EmptyString;
JSReceiver | FixedArrayBase | Oddball | Map | EmptyString;
extern operator '==' macro TaggedEqual(TaggedWithIdentity, Object): bool; extern operator '==' macro TaggedEqual(TaggedWithIdentity, Object): bool;
extern operator '==' macro TaggedEqual(Object, TaggedWithIdentity): bool; extern operator '==' macro TaggedEqual(Object, TaggedWithIdentity): bool;
...@@ -2391,7 +2384,7 @@ Cast<JSAny>(o: Object): JSAny labels CastError { ...@@ -2391,7 +2384,7 @@ Cast<JSAny>(o: Object): JSAny labels CastError {
} }
} }
Cast<JSAny | TheHole>(o: Object): JSAny | TheHole labels CastError { Cast<JSAny|TheHole>(o: Object): JSAny|TheHole labels CastError {
typeswitch (o) { typeswitch (o) {
case (o: JSAny): { case (o: JSAny): {
return o; return o;
...@@ -2405,7 +2398,7 @@ Cast<JSAny | TheHole>(o: Object): JSAny | TheHole labels CastError { ...@@ -2405,7 +2398,7 @@ Cast<JSAny | TheHole>(o: Object): JSAny | TheHole labels CastError {
} }
} }
Cast<Number | TheHole>(o: Object): Number | TheHole labels CastError { Cast<Number|TheHole>(o: Object): Number|TheHole labels CastError {
typeswitch (o) { typeswitch (o) {
case (o: Number): { case (o: Number): {
return o; return o;
...@@ -2494,7 +2487,7 @@ Cast<Callable>(o: HeapObject): Callable ...@@ -2494,7 +2487,7 @@ Cast<Callable>(o: HeapObject): Callable
return HeapObjectToCallable(o) otherwise CastError; return HeapObjectToCallable(o) otherwise CastError;
} }
Cast<Undefined | Callable>(o: HeapObject): Undefined | Callable Cast<Undefined|Callable>(o: HeapObject): Undefined|Callable
labels CastError { labels CastError {
if (o == Undefined) return Undefined; if (o == Undefined) return Undefined;
return HeapObjectToCallable(o) otherwise CastError; return HeapObjectToCallable(o) otherwise CastError;
...@@ -2738,7 +2731,7 @@ Cast<CoverageInfo>(implicit context: Context)(o: HeapObject): CoverageInfo ...@@ -2738,7 +2731,7 @@ Cast<CoverageInfo>(implicit context: Context)(o: HeapObject): CoverageInfo
goto CastError; goto CastError;
} }
Cast<JSReceiver | Null>(o: HeapObject): JSReceiver | Null Cast<JSReceiver|Null>(o: HeapObject): JSReceiver|Null
labels CastError { labels CastError {
typeswitch (o) { typeswitch (o) {
case (o: Null): { case (o: Null): {
...@@ -2758,8 +2751,7 @@ Cast<PromiseReaction>(o: HeapObject): PromiseReaction labels CastError { ...@@ -2758,8 +2751,7 @@ Cast<PromiseReaction>(o: HeapObject): PromiseReaction labels CastError {
goto CastError; goto CastError;
} }
Cast<Smi | PromiseReaction>(o: Object): Smi | Cast<Smi|PromiseReaction>(o: Object): Smi|PromiseReaction labels CastError {
PromiseReaction labels CastError {
typeswitch (o) { typeswitch (o) {
case (o: Smi): { case (o: Smi): {
return o; return o;
...@@ -3953,7 +3945,7 @@ builtin CheckNumberInRange(implicit context: Context)( ...@@ -3953,7 +3945,7 @@ builtin CheckNumberInRange(implicit context: Context)(
} }
} }
macro ReplaceTheHoleWithUndefined(o: JSAny | TheHole): JSAny { macro ReplaceTheHoleWithUndefined(o: JSAny|TheHole): JSAny {
typeswitch (o) { typeswitch (o) {
case (TheHole): { case (TheHole): {
return Undefined; return Undefined;
......
...@@ -33,8 +33,8 @@ type FrameBase extends RawPtr constexpr 'void*'; ...@@ -33,8 +33,8 @@ type FrameBase extends RawPtr constexpr 'void*';
type StandardFrame extends FrameBase constexpr 'void*'; type StandardFrame extends FrameBase constexpr 'void*';
type ArgumentsAdaptorFrame extends FrameBase constexpr 'void*'; type ArgumentsAdaptorFrame extends FrameBase constexpr 'void*';
type StubFrame extends FrameBase constexpr 'void*'; type StubFrame extends FrameBase constexpr 'void*';
type FrameWithArguments = StandardFrame | ArgumentsAdaptorFrame; type FrameWithArguments = StandardFrame|ArgumentsAdaptorFrame;
type Frame = FrameWithArguments | StubFrame; type Frame = FrameWithArguments|StubFrame;
extern macro LoadFramePointer(): Frame; extern macro LoadFramePointer(): Frame;
extern macro LoadParentFramePointer(): Frame; extern macro LoadParentFramePointer(): Frame;
...@@ -67,7 +67,7 @@ operator '.caller' macro LoadCallerFromFrame(f: Frame): Frame { ...@@ -67,7 +67,7 @@ operator '.caller' macro LoadCallerFromFrame(f: Frame): Frame {
return %RawDownCast<Frame>(result); return %RawDownCast<Frame>(result);
} }
type ContextOrFrameType = Context | FrameType; type ContextOrFrameType = Context|FrameType;
Cast<ContextOrFrameType>(implicit context: Context)(o: Object): Cast<ContextOrFrameType>(implicit context: Context)(o: Object):
ContextOrFrameType ContextOrFrameType
labels CastError { labels CastError {
......
...@@ -48,7 +48,7 @@ namespace iterator { ...@@ -48,7 +48,7 @@ namespace iterator {
transitioning builtin GetIteratorWithFeedback( transitioning builtin GetIteratorWithFeedback(
context: Context, receiver: JSAny, loadSlot: Smi, callSlot: Smi, context: Context, receiver: JSAny, loadSlot: Smi, callSlot: Smi,
feedback: Undefined | FeedbackVector): JSAny { feedback: Undefined|FeedbackVector): JSAny {
let iteratorMethod: JSAny; let iteratorMethod: JSAny;
typeswitch (feedback) { typeswitch (feedback) {
case (Undefined): { case (Undefined): {
...@@ -65,7 +65,7 @@ namespace iterator { ...@@ -65,7 +65,7 @@ namespace iterator {
transitioning builtin CallIteratorWithFeedback( transitioning builtin CallIteratorWithFeedback(
context: Context, receiver: JSAny, iteratorMethod: JSAny, callSlot: Smi, context: Context, receiver: JSAny, iteratorMethod: JSAny, callSlot: Smi,
feedback: Undefined | FeedbackVector): JSAny { feedback: Undefined|FeedbackVector): JSAny {
const callSlotUnTagged: uintptr = Unsigned(SmiUntag(callSlot)); const callSlotUnTagged: uintptr = Unsigned(SmiUntag(callSlot));
CollectCallFeedback(iteratorMethod, context, feedback, callSlotUnTagged); CollectCallFeedback(iteratorMethod, context, feedback, callSlotUnTagged);
const iteratorCallable: Callable = Cast<Callable>(iteratorMethod) const iteratorCallable: Callable = Cast<Callable>(iteratorMethod)
......
...@@ -72,7 +72,7 @@ namespace object { ...@@ -72,7 +72,7 @@ namespace object {
transitioning macro transitioning macro
ObjectSetPrototypeOfThrow(implicit context: Context)( ObjectSetPrototypeOfThrow(implicit context: Context)(
object: JSAny, proto: JSReceiver | Null): JSAny { object: JSAny, proto: JSReceiver|Null): JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return object; const objectJSReceiver = Cast<JSReceiver>(object) otherwise return object;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver) const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
otherwise return runtime::JSReceiverSetPrototypeOfThrow( otherwise return runtime::JSReceiverSetPrototypeOfThrow(
...@@ -83,7 +83,7 @@ namespace object { ...@@ -83,7 +83,7 @@ namespace object {
transitioning macro transitioning macro
ObjectSetPrototypeOfDontThrow(implicit context: Context)( ObjectSetPrototypeOfDontThrow(implicit context: Context)(
object: JSAny, proto: JSReceiver | Null): JSAny { object: JSAny, proto: JSReceiver|Null): JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return False; const objectJSReceiver = Cast<JSReceiver>(object) otherwise return False;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver) const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
otherwise return runtime::JSReceiverSetPrototypeOfDontThrow( otherwise return runtime::JSReceiverSetPrototypeOfDontThrow(
...@@ -122,7 +122,7 @@ namespace object { ...@@ -122,7 +122,7 @@ namespace object {
// 5. If status is false, throw a TypeError exception. // 5. If status is false, throw a TypeError exception.
// 6. Return O. // 6. Return O.
typeswitch (proto) { typeswitch (proto) {
case (proto: JSReceiver | Null): { case (proto: JSReceiver|Null): {
return object::ObjectSetPrototypeOfThrow(object, proto); return object::ObjectSetPrototypeOfThrow(object, proto);
} }
case (JSAny): { case (JSAny): {
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
// https://tc39.es/ecma262/#sec-promise-abstract-operations // https://tc39.es/ecma262/#sec-promise-abstract-operations
namespace promise { namespace promise {
extern macro PromiseBuiltinsAssembler::TriggerPromiseReactions( extern macro PromiseBuiltinsAssembler::TriggerPromiseReactions(
implicit context: Context)( implicit context:
Smi | PromiseReaction, JSAny, constexpr PromiseReactionType): void; Context)(Smi|PromiseReaction, JSAny, constexpr PromiseReactionType):
void;
// https://tc39.es/ecma262/#sec-fulfillpromise // https://tc39.es/ecma262/#sec-fulfillpromise
transitioning builtin transitioning builtin
......
...@@ -19,7 +19,7 @@ namespace proxy { ...@@ -19,7 +19,7 @@ namespace proxy {
// https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver // https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
transitioning builtin transitioning builtin
ProxySetProperty(implicit context: Context)( ProxySetProperty(implicit context: Context)(
proxy: JSProxy, name: PropertyKey | PrivateSymbol, value: JSAny, proxy: JSProxy, name: PropertyKey|PrivateSymbol, value: JSAny,
receiverValue: JSAny): JSAny { receiverValue: JSAny): JSAny {
// 1. Assert: IsPropertyKey(P) is true. // 1. Assert: IsPropertyKey(P) is true.
assert(TaggedIsNotSmi(name)); assert(TaggedIsNotSmi(name));
......
...@@ -10,7 +10,7 @@ namespace proxy { ...@@ -10,7 +10,7 @@ namespace proxy {
// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v // https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v
transitioning builtin transitioning builtin
ProxySetPrototypeOf(implicit context: Context)( ProxySetPrototypeOf(implicit context: Context)(
proxy: JSProxy, proto: Null | JSReceiver, doThrow: Boolean): JSAny { proxy: JSProxy, proto: Null|JSReceiver, doThrow: Boolean): JSAny {
PerformStackCheck(); PerformStackCheck();
const kTrapName: constexpr string = 'setPrototypeOf'; const kTrapName: constexpr string = 'setPrototypeOf';
try { try {
...@@ -63,7 +63,7 @@ namespace proxy { ...@@ -63,7 +63,7 @@ namespace proxy {
} }
ThrowTypeError(kProxySetPrototypeOfNonExtensible); ThrowTypeError(kProxySetPrototypeOfNonExtensible);
} }
label TrapUndefined(target: JSAny, proto: JSReceiver | Null) { label TrapUndefined(target: JSAny, proto: JSReceiver|Null) {
// 7.a. Return ? target.[[SetPrototypeOf]](). // 7.a. Return ? target.[[SetPrototypeOf]]().
if (doThrow == True) { if (doThrow == True) {
return object::ObjectSetPrototypeOfThrow(target, proto); return object::ObjectSetPrototypeOfThrow(target, proto);
......
...@@ -37,7 +37,7 @@ namespace reflect { ...@@ -37,7 +37,7 @@ namespace reflect {
const objectJSReceiver = Cast<JSReceiver>(object) const objectJSReceiver = Cast<JSReceiver>(object)
otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.setPrototypeOf'); otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.setPrototypeOf');
typeswitch (proto) { typeswitch (proto) {
case (proto: JSReceiver | Null): { case (proto: JSReceiver|Null): {
return object::ObjectSetPrototypeOfDontThrow(objectJSReceiver, proto); return object::ObjectSetPrototypeOfDontThrow(objectJSReceiver, proto);
} }
case (JSAny): { case (JSAny): {
......
...@@ -10,7 +10,7 @@ namespace regexp { ...@@ -10,7 +10,7 @@ namespace regexp {
SubString(implicit context: Context)(String, Smi, Smi): String; SubString(implicit context: Context)(String, Smi, Smi): String;
extern runtime RegExpExecMultiple(implicit context: Context)( extern runtime RegExpExecMultiple(implicit context: Context)(
JSRegExp, String, RegExpMatchInfo, JSArray): Null | JSArray; JSRegExp, String, RegExpMatchInfo, JSArray): Null|JSArray;
extern transitioning runtime extern transitioning runtime
RegExpReplaceRT(Context, JSReceiver, String, Object): String; RegExpReplaceRT(Context, JSReceiver, String, Object): String;
extern transitioning runtime extern transitioning runtime
...@@ -86,7 +86,7 @@ namespace regexp { ...@@ -86,7 +86,7 @@ namespace regexp {
const kInitialCapacity: Smi = 16; const kInitialCapacity: Smi = 16;
const kInitialLength: Smi = 0; const kInitialLength: Smi = 0;
const result: Null | JSArray = RegExpExecMultiple( const result: Null|JSArray = RegExpExecMultiple(
regexp, string, GetRegExpLastMatchInfo(), regexp, string, GetRegExpLastMatchInfo(),
AllocateJSArray( AllocateJSArray(
PACKED_ELEMENTS, GetFastPackedElementsJSArrayMap(), PACKED_ELEMENTS, GetFastPackedElementsJSArrayMap(),
......
...@@ -9,7 +9,7 @@ namespace typed_array { ...@@ -9,7 +9,7 @@ namespace typed_array {
transitioning macro ReduceAllElements(implicit context: Context)( transitioning macro ReduceAllElements(implicit context: Context)(
array: typed_array::AttachedJSTypedArray, callbackfn: Callable, array: typed_array::AttachedJSTypedArray, callbackfn: Callable,
initialValue: JSAny | TheHole): JSAny { initialValue: JSAny|TheHole): JSAny {
let witness = typed_array::NewAttachedJSTypedArrayWitness(array); let witness = typed_array::NewAttachedJSTypedArrayWitness(array);
const length: uintptr = witness.Get().length; const length: uintptr = witness.Get().length;
let accumulator = initialValue; let accumulator = initialValue;
......
...@@ -10,7 +10,7 @@ namespace typed_array { ...@@ -10,7 +10,7 @@ namespace typed_array {
transitioning macro ReduceRightAllElements(implicit context: Context)( transitioning macro ReduceRightAllElements(implicit context: Context)(
array: typed_array::AttachedJSTypedArray, callbackfn: Callable, array: typed_array::AttachedJSTypedArray, callbackfn: Callable,
initialValue: JSAny | TheHole): JSAny { initialValue: JSAny|TheHole): JSAny {
let witness = typed_array::NewAttachedJSTypedArrayWitness(array); let witness = typed_array::NewAttachedJSTypedArrayWitness(array);
const length: uintptr = witness.Get().length; const length: uintptr = witness.Get().length;
let accumulator = initialValue; let accumulator = initialValue;
......
...@@ -18,7 +18,7 @@ extern class JSDateTimeFormat extends JSObject { ...@@ -18,7 +18,7 @@ extern class JSDateTimeFormat extends JSObject {
icu_locale: Foreign; // Managed<icu::Locale> icu_locale: Foreign; // Managed<icu::Locale>
icu_simple_date_format: Foreign; // Managed<icu::SimpleDateFormat> icu_simple_date_format: Foreign; // Managed<icu::SimpleDateFormat>
icu_date_interval_format: Foreign; // Managed<icu::DateIntervalFormat> icu_date_interval_format: Foreign; // Managed<icu::DateIntervalFormat>
bound_format: JSFunction | Undefined; bound_format: JSFunction|Undefined;
flags: Smi; flags: Smi;
} }
...@@ -32,7 +32,7 @@ extern class JSNumberFormat extends JSObject { ...@@ -32,7 +32,7 @@ extern class JSNumberFormat extends JSObject {
locale: String; locale: String;
icu_number_formatter: icu_number_formatter:
Foreign; // Managed<icu::number::LocalizedNumberFormatter> Foreign; // Managed<icu::number::LocalizedNumberFormatter>
bound_format: JSFunction | Undefined; bound_format: JSFunction|Undefined;
flags: Smi; flags: Smi;
} }
...@@ -70,15 +70,15 @@ extern class JSV8BreakIterator extends JSObject { ...@@ -70,15 +70,15 @@ extern class JSV8BreakIterator extends JSObject {
locale: String; locale: String;
break_iterator: Foreign; // Managed<icu::BreakIterator>; break_iterator: Foreign; // Managed<icu::BreakIterator>;
unicode_string: Foreign; // Managed<icu::UnicodeString>; unicode_string: Foreign; // Managed<icu::UnicodeString>;
bound_adopt_text: Undefined | JSFunction; bound_adopt_text: Undefined|JSFunction;
bound_first: Undefined | JSFunction; bound_first: Undefined|JSFunction;
bound_next: Undefined | JSFunction; bound_next: Undefined|JSFunction;
bound_current: Undefined | JSFunction; bound_current: Undefined|JSFunction;
bound_break_type: Undefined | JSFunction; bound_break_type: Undefined|JSFunction;
break_iterator_type: Smi; break_iterator_type: Smi;
} }
extern class JSCollator extends JSObject { extern class JSCollator extends JSObject {
icu_collator: Foreign; // Managed<icu::Collator> icu_collator: Foreign; // Managed<icu::Collator>
bound_compare: Undefined | JSFunction; bound_compare: Undefined|JSFunction;
} }
...@@ -465,7 +465,7 @@ namespace test { ...@@ -465,7 +465,7 @@ namespace test {
} }
} }
type NumberOrFixedArray = Number | FixedArray; type NumberOrFixedArray = Number|FixedArray;
macro TypeswitchExample(implicit context: Context)(x: NumberOrFixedArray): macro TypeswitchExample(implicit context: Context)(x: NumberOrFixedArray):
int32 { int32 {
let result: int32 = 0; let result: int32 = 0;
......
...@@ -47,7 +47,7 @@ namespace array { ...@@ -47,7 +47,7 @@ namespace array {
initialReceiverLength: Number; initialReceiverLength: Number;
// If the user provided a comparison function, it is stored here. // If the user provided a comparison function, it is stored here.
userCmpFn: Undefined | Callable; userCmpFn: Undefined|Callable;
// Function pointer to the comparison function. This can either be a builtin // Function pointer to the comparison function. This can either be a builtin
// that calls the user-provided comparison function or "SortDefault", which // that calls the user-provided comparison function or "SortDefault", which
...@@ -132,7 +132,7 @@ namespace array { ...@@ -132,7 +132,7 @@ namespace array {
} }
transitioning macro NewSortState(implicit context: Context)( transitioning macro NewSortState(implicit context: Context)(
receiver: JSReceiver, comparefn: Undefined | Callable, receiver: JSReceiver, comparefn: Undefined|Callable,
initialReceiverLength: Number): SortState { initialReceiverLength: Number): SortState {
const sortComparePtr = const sortComparePtr =
comparefn != Undefined ? SortCompareUserFn : SortCompareDefault; comparefn != Undefined ? SortCompareUserFn : SortCompareDefault;
...@@ -214,7 +214,7 @@ namespace array { ...@@ -214,7 +214,7 @@ namespace array {
// it is first requested, but it has always at least this size. // it is first requested, but it has always at least this size.
const kSortStateTempSize: Smi = 32; const kSortStateTempSize: Smi = 32;
type LoadFn = builtin(Context, SortState, Smi) => (JSAny | TheHole); type LoadFn = builtin(Context, SortState, Smi) => (JSAny|TheHole);
type StoreFn = builtin(Context, SortState, Smi, JSAny) => Smi; type StoreFn = builtin(Context, SortState, Smi, JSAny) => Smi;
type DeleteFn = builtin(Context, SortState, Smi) => Smi; type DeleteFn = builtin(Context, SortState, Smi) => Smi;
type CanUseSameAccessorFn = builtin(Context, JSReceiver, Map, Number) => type CanUseSameAccessorFn = builtin(Context, JSReceiver, Map, Number) =>
...@@ -228,28 +228,28 @@ namespace array { ...@@ -228,28 +228,28 @@ namespace array {
// through a hole. // through a hole.
transitioning builtin Load<ElementsAccessor: type>( transitioning builtin Load<ElementsAccessor: type>(
context: Context, sortState: SortState, index: Smi): JSAny | TheHole { context: Context, sortState: SortState, index: Smi): JSAny|TheHole {
const receiver = sortState.receiver; const receiver = sortState.receiver;
if (!HasProperty_Inline(receiver, index)) return TheHole; if (!HasProperty_Inline(receiver, index)) return TheHole;
return GetProperty(receiver, index); return GetProperty(receiver, index);
} }
Load<FastSmiElements>(context: Context, sortState: SortState, index: Smi): Load<FastSmiElements>(context: Context, sortState: SortState, index: Smi):
JSAny | TheHole { JSAny|TheHole {
const object = UnsafeCast<JSObject>(sortState.receiver); const object = UnsafeCast<JSObject>(sortState.receiver);
const elements = UnsafeCast<FixedArray>(object.elements); const elements = UnsafeCast<FixedArray>(object.elements);
return UnsafeCast<(JSAny | TheHole)>(elements.objects[index]); return UnsafeCast<(JSAny | TheHole)>(elements.objects[index]);
} }
Load<FastObjectElements>(context: Context, sortState: SortState, index: Smi): Load<FastObjectElements>(context: Context, sortState: SortState, index: Smi):
JSAny | TheHole { JSAny|TheHole {
const object = UnsafeCast<JSObject>(sortState.receiver); const object = UnsafeCast<JSObject>(sortState.receiver);
const elements = UnsafeCast<FixedArray>(object.elements); const elements = UnsafeCast<FixedArray>(object.elements);
return UnsafeCast<(JSAny | TheHole)>(elements.objects[index]); return UnsafeCast<(JSAny | TheHole)>(elements.objects[index]);
} }
Load<FastDoubleElements>(context: Context, sortState: SortState, index: Smi): Load<FastDoubleElements>(context: Context, sortState: SortState, index: Smi):
JSAny | TheHole { JSAny|TheHole {
try { try {
const object = UnsafeCast<JSObject>(sortState.receiver); const object = UnsafeCast<JSObject>(sortState.receiver);
const elements = UnsafeCast<FixedDoubleArray>(object.elements); const elements = UnsafeCast<FixedDoubleArray>(object.elements);
...@@ -1306,7 +1306,7 @@ namespace array { ...@@ -1306,7 +1306,7 @@ namespace array {
// are ignored. // are ignored.
let numberOfUndefined: Smi = 0; let numberOfUndefined: Smi = 0;
for (let i: Smi = 0; i < receiverLength; ++i) { for (let i: Smi = 0; i < receiverLength; ++i) {
const element: JSAny | TheHole = loadFn(context, sortState, i); const element: JSAny|TheHole = loadFn(context, sortState, i);
if (element == TheHole) { if (element == TheHole) {
// Do nothing for holes. The result is that elements are // Do nothing for holes. The result is that elements are
......
...@@ -24,14 +24,6 @@ def preprocess(input): ...@@ -24,14 +24,6 @@ def preprocess(input):
input = re.sub(r'\bcase\s*(\([^{]*\))\s*:\s*deferred\s*{', r' if /*cAsEdEfF*/ \1 {', input) input = re.sub(r'\bcase\s*(\([^{]*\))\s*:\s*deferred\s*{', r' if /*cAsEdEfF*/ \1 {', input)
input = re.sub(r'\bcase\s*(\([^{]*\))\s*:\s*{', r' if /*cA*/ \1 {', input) input = re.sub(r'\bcase\s*(\([^{]*\))\s*:\s*{', r' if /*cA*/ \1 {', input)
# Add extra space around | operators to fix union types later.
while True:
old = input
input = re.sub(r'(\w+\s*)\|(\s*\w+)',
r'\1|/**/\2', input)
if old == input:
break;
input = re.sub(r'\bgenerates\s+\'([^\']+)\'\s*', input = re.sub(r'\bgenerates\s+\'([^\']+)\'\s*',
r'_GeNeRaTeS00_/*\1@*/', input) r'_GeNeRaTeS00_/*\1@*/', input)
input = re.sub(r'\bconstexpr\s+\'([^\']+)\'\s*', input = re.sub(r'\bconstexpr\s+\'([^\']+)\'\s*',
...@@ -77,13 +69,6 @@ def postprocess(output): ...@@ -77,13 +69,6 @@ def postprocess(output):
output = re.sub(r'jS_iMpLiCiT_', output = re.sub(r'jS_iMpLiCiT_',
r"js-implicit ", output) r"js-implicit ", output)
while True:
old = output
output = re.sub(r'(\w+)\s{0,1}\|\s{0,1}/\*\*/(\s*\w+)',
r'\1 |\2', output)
if old == output:
break;
output = re.sub(kPercentEscape, r'%', output) output = re.sub(kPercentEscape, r'%', output)
return output return output
......
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