2018-04-16 09:24:22 +00:00
|
|
|
// Copyright 2018 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
type Arguments constexpr 'CodeStubArguments*';
|
2018-04-16 09:24:22 +00:00
|
|
|
type void generates 'void';
|
|
|
|
type never generates 'void';
|
|
|
|
|
2018-05-29 13:31:56 +00:00
|
|
|
type Tagged generates 'TNode<Object>';
|
|
|
|
type Smi extends Tagged generates 'TNode<Smi>';
|
|
|
|
type HeapObject extends Tagged generates 'TNode<HeapObject>';
|
2018-06-07 11:48:26 +00:00
|
|
|
type Object = Smi|HeapObject;
|
2018-05-04 15:04:42 +00:00
|
|
|
type int32 generates 'TNode<Int32T>' constexpr 'int32_t';
|
2018-06-06 12:30:08 +00:00
|
|
|
type uint32 generates 'TNode<Uint32T>' constexpr 'uint32_t';
|
2018-05-04 15:04:42 +00:00
|
|
|
type intptr generates 'TNode<IntPtrT>' constexpr 'intptr_t';
|
|
|
|
type float64 generates 'TNode<Float64T>' constexpr 'double';
|
|
|
|
type bool generates 'TNode<BoolT>' constexpr 'bool';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
type int31 extends int32 generates 'TNode<Int32T>' constexpr 'int32_t';
|
|
|
|
type RawPtr generates 'TNode<RawPtrT>' constexpr 'void*';
|
2018-05-16 14:00:35 +00:00
|
|
|
type AbstractCode extends HeapObject generates 'TNode<AbstractCode>';
|
|
|
|
type Code extends AbstractCode generates 'TNode<Code>';
|
2018-05-09 08:16:07 +00:00
|
|
|
type JSReceiver extends HeapObject generates 'TNode<JSReceiver>';
|
2018-04-16 09:24:22 +00:00
|
|
|
type Context extends HeapObject generates 'TNode<Context>';
|
|
|
|
type String extends HeapObject generates 'TNode<String>';
|
|
|
|
type Oddball extends HeapObject generates 'TNode<Oddball>';
|
2018-05-09 08:16:07 +00:00
|
|
|
type HeapNumber extends HeapObject generates 'TNode<HeapNumber>';
|
2018-06-07 11:48:26 +00:00
|
|
|
type Number = Smi|HeapNumber;
|
2018-04-16 09:24:22 +00:00
|
|
|
type Boolean extends Oddball generates 'TNode<Oddball>';
|
2018-05-29 13:31:56 +00:00
|
|
|
type JSProxy extends JSReceiver generates 'TNode<JSProxy>';
|
2018-05-29 08:34:01 +00:00
|
|
|
type JSObject extends JSReceiver generates 'TNode<JSObject>';
|
|
|
|
type JSArray extends JSObject generates 'TNode<JSArray>';
|
2018-05-29 13:31:56 +00:00
|
|
|
type JSFunction extends JSObject generates 'TNode<JSFunction>';
|
|
|
|
type JSBoundFunction extends JSObject generates 'TNode<JSBoundFunction>';
|
2018-06-07 11:48:26 +00:00
|
|
|
type Callable = JSFunction|JSBoundFunction|JSProxy;
|
2018-05-09 08:16:07 +00:00
|
|
|
type Map extends HeapObject generates 'TNode<Map>';
|
|
|
|
type FixedArrayBase extends HeapObject generates 'TNode<FixedArrayBase>';
|
2018-04-16 09:24:22 +00:00
|
|
|
type FixedArray extends FixedArrayBase generates 'TNode<FixedArray>';
|
|
|
|
type FixedDoubleArray extends FixedArrayBase generates
|
|
|
|
'TNode<FixedDoubleArray>';
|
2018-05-24 09:25:58 +00:00
|
|
|
type FixedTypedArrayBase extends FixedArrayBase generates
|
|
|
|
'TNode<FixedTypedArrayBase>';
|
|
|
|
type FixedTypedArray extends FixedTypedArrayBase generates
|
|
|
|
'TNode<FixedTypedArray>';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
type JSArrayBuffer extends JSObject generates 'TNode<JSArrayBuffer>';
|
|
|
|
type JSArrayBufferView extends JSObject generates 'TNode<JSArrayBufferView>';
|
2018-04-25 08:14:09 +00:00
|
|
|
type JSTypedArray extends JSArrayBufferView generates 'TNode<JSTypedArray>';
|
2018-05-24 13:43:57 +00:00
|
|
|
type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>';
|
2018-04-25 08:14:09 +00:00
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType';
|
2018-05-04 15:04:42 +00:00
|
|
|
type ElementsKind generates 'TNode<Int32T>' constexpr 'ElementsKind';
|
|
|
|
type LanguageMode generates 'TNode<Smi>' constexpr 'LanguageMode';
|
|
|
|
type ExtractFixedArrayFlags generates
|
2018-05-04 15:55:55 +00:00
|
|
|
'TNode<Smi>' constexpr 'ExtractFixedArrayFlags';
|
2018-06-05 07:54:49 +00:00
|
|
|
type ParameterMode generates 'TNode<Int32T>' constexpr 'ParameterMode';
|
2018-06-07 11:48:26 +00:00
|
|
|
type RootListIndex generates 'TNode<Int32T>' constexpr 'Heap::RootListIndex';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
type MessageTemplate constexpr 'MessageTemplate';
|
|
|
|
type HasPropertyLookupMode constexpr 'HasPropertyLookupMode';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-24 09:25:58 +00:00
|
|
|
const NO_ELEMENTS: constexpr ElementsKind = 'NO_ELEMENTS';
|
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
const PACKED_SMI_ELEMENTS: constexpr ElementsKind = 'PACKED_SMI_ELEMENTS';
|
|
|
|
const HOLEY_SMI_ELEMENTS: constexpr ElementsKind = 'HOLEY_SMI_ELEMENTS';
|
|
|
|
const PACKED_ELEMENTS: constexpr ElementsKind = 'PACKED_ELEMENTS';
|
|
|
|
const HOLEY_ELEMENTS: constexpr ElementsKind = 'HOLEY_ELEMENTS';
|
|
|
|
const PACKED_DOUBLE_ELEMENTS: constexpr ElementsKind = 'PACKED_DOUBLE_ELEMENTS';
|
|
|
|
const HOLEY_DOUBLE_ELEMENTS: constexpr ElementsKind = 'HOLEY_DOUBLE_ELEMENTS';
|
|
|
|
|
|
|
|
const UINT8_ELEMENTS: constexpr ElementsKind = 'UINT8_ELEMENTS';
|
|
|
|
const INT8_ELEMENTS: constexpr ElementsKind = 'INT8_ELEMENTS';
|
|
|
|
const UINT16_ELEMENTS: constexpr ElementsKind = 'UINT16_ELEMENTS';
|
|
|
|
const INT16_ELEMENTS: constexpr ElementsKind = 'INT16_ELEMENTS';
|
|
|
|
const UINT32_ELEMENTS: constexpr ElementsKind = 'UINT32_ELEMENTS';
|
|
|
|
const INT32_ELEMENTS: constexpr ElementsKind = 'INT32_ELEMENTS';
|
|
|
|
const FLOAT32_ELEMENTS: constexpr ElementsKind = 'FLOAT32_ELEMENTS';
|
|
|
|
const FLOAT64_ELEMENTS: constexpr ElementsKind = 'FLOAT64_ELEMENTS';
|
|
|
|
const UINT8_CLAMPED_ELEMENTS: constexpr ElementsKind = 'UINT8_CLAMPED_ELEMENTS';
|
|
|
|
const BIGUINT64_ELEMENTS: constexpr ElementsKind = 'BIGUINT64_ELEMENTS';
|
|
|
|
const BIGINT64_ELEMENTS: constexpr ElementsKind = 'BIGINT64_ELEMENTS';
|
|
|
|
|
2018-05-24 09:25:58 +00:00
|
|
|
type FixedUint8Array extends FixedTypedArray;
|
|
|
|
type FixedInt8Array extends FixedTypedArray;
|
|
|
|
type FixedUint16Array extends FixedTypedArray;
|
|
|
|
type FixedInt16Array extends FixedTypedArray;
|
|
|
|
type FixedUint32Array extends FixedTypedArray;
|
|
|
|
type FixedInt32Array extends FixedTypedArray;
|
|
|
|
type FixedFloat32Array extends FixedTypedArray;
|
|
|
|
type FixedFloat64Array extends FixedTypedArray;
|
|
|
|
type FixedUint8ClampedArray extends FixedTypedArray;
|
|
|
|
type FixedBigUint64Array extends FixedTypedArray;
|
|
|
|
type FixedBigInt64Array extends FixedTypedArray;
|
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
const kAllFixedArrays: constexpr ExtractFixedArrayFlags =
|
2018-04-16 09:24:22 +00:00
|
|
|
'ExtractFixedArrayFlag::kAllFixedArrays';
|
|
|
|
|
|
|
|
const kCOWMap: Map = 'LoadRoot(Heap::kFixedCOWArrayMapRootIndex)';
|
|
|
|
const kEmptyFixedArray: FixedArrayBase =
|
|
|
|
'UncheckedCast<FixedArrayBase>(LoadRoot(Heap::kEmptyFixedArrayRootIndex))';
|
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
const kInvalidArrayLength: constexpr MessageTemplate =
|
2018-04-16 09:24:22 +00:00
|
|
|
'MessageTemplate::kInvalidArrayLength';
|
2018-05-29 08:34:01 +00:00
|
|
|
const kCalledNonCallable: constexpr MessageTemplate =
|
2018-05-09 08:16:07 +00:00
|
|
|
'MessageTemplate::kCalledNonCallable';
|
2018-05-29 08:34:01 +00:00
|
|
|
const kCalledOnNullOrUndefined: constexpr MessageTemplate =
|
2018-05-09 08:16:07 +00:00
|
|
|
'MessageTemplate::kCalledOnNullOrUndefined';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
const kHasProperty: constexpr HasPropertyLookupMode = 'kHasProperty';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
const kMaxSafeInteger: constexpr float64 = 'kMaxSafeInteger';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
const kNotTypedArray: constexpr MessageTemplate =
|
|
|
|
'MessageTemplate::kNotTypedArray';
|
|
|
|
const kDetachedOperation: constexpr MessageTemplate =
|
2018-04-25 08:14:09 +00:00
|
|
|
'MessageTemplate::kDetachedOperation';
|
2018-05-29 08:34:01 +00:00
|
|
|
const kBadSortComparisonFunction: constexpr MessageTemplate =
|
2018-04-25 08:14:09 +00:00
|
|
|
'MessageTemplate::kBadSortComparisonFunction';
|
2018-05-29 08:34:01 +00:00
|
|
|
const kIncompatibleMethodReceiver: constexpr MessageTemplate =
|
2018-05-24 13:43:57 +00:00
|
|
|
'MessageTemplate::kIncompatibleMethodReceiver';
|
2018-06-06 12:30:08 +00:00
|
|
|
const kInvalidDataViewAccessorOffset: constexpr MessageTemplate =
|
|
|
|
'MessageTemplate::kInvalidDataViewAccessorOffset';
|
2018-04-25 08:14:09 +00:00
|
|
|
|
2018-05-04 15:55:55 +00:00
|
|
|
const Hole: Oddball = 'TheHoleConstant()';
|
|
|
|
const Null: Oddball = 'NullConstant()';
|
|
|
|
const Undefined: Oddball = 'UndefinedConstant()';
|
|
|
|
const True: Boolean = 'TrueConstant()';
|
|
|
|
const False: Boolean = 'FalseConstant()';
|
|
|
|
const true: constexpr bool = 'true';
|
|
|
|
const false: constexpr bool = 'false';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-24 11:19:32 +00:00
|
|
|
const kStrict: constexpr LanguageMode = 'LanguageMode::kStrict';
|
|
|
|
const kSloppy: constexpr LanguageMode = 'LanguageMode::kSloppy';
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-06-05 07:54:49 +00:00
|
|
|
const SMI_PARAMETERS: constexpr ParameterMode = 'SMI_PARAMETERS';
|
|
|
|
const INTPTR_PARAMETERS: constexpr ParameterMode = 'INTPTR_PARAMETERS';
|
|
|
|
|
2018-04-16 09:24:22 +00:00
|
|
|
extern macro Print(Object);
|
|
|
|
extern macro DebugBreak();
|
|
|
|
extern macro ToInteger_Inline(Context, Object): Number;
|
|
|
|
extern macro ToLength_Inline(Context, Object): Number;
|
2018-04-25 08:14:09 +00:00
|
|
|
extern macro ToNumber_Inline(Context, Object): Number;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern macro ToString_Inline(Context, Object): String;
|
|
|
|
extern macro GetProperty(Context, Object, Object): Object;
|
2018-05-29 08:34:01 +00:00
|
|
|
extern macro HasProperty(
|
|
|
|
HeapObject, Object, Context, constexpr HasPropertyLookupMode): Oddball;
|
|
|
|
extern macro ThrowRangeError(Context, constexpr MessageTemplate): never;
|
|
|
|
extern macro ThrowTypeError(Context, constexpr MessageTemplate): never;
|
|
|
|
extern macro ThrowTypeError(Context, constexpr MessageTemplate, Object): never;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern macro ArraySpeciesCreate(Context, Object, Number): Object;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro EnsureArrayPushable(Map): ElementsKind labels Bailout;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-06-07 11:48:26 +00:00
|
|
|
extern builtin ToObject(Context, Object): JSReceiver;
|
2018-05-09 08:16:07 +00:00
|
|
|
extern macro IsNullOrUndefined(Object): bool;
|
2018-06-05 07:54:49 +00:00
|
|
|
extern macro IsTheHole(Object): bool;
|
|
|
|
extern macro IsString(HeapObject): bool;
|
|
|
|
extern builtin ToString(Context, Object): String;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern runtime CreateDataProperty(Context, Object, Object, Object);
|
|
|
|
extern runtime SetProperty(Context, Object, Object, Object, LanguageMode);
|
|
|
|
extern runtime DeleteProperty(Context, Object, Object, LanguageMode);
|
|
|
|
|
2018-06-07 11:48:26 +00:00
|
|
|
extern macro LoadRoot(constexpr RootListIndex): Object;
|
|
|
|
extern macro StoreRoot(constexpr RootListIndex, Object): Object;
|
|
|
|
extern macro LoadAndUntagToWord32Root(constexpr RootListIndex): int32;
|
|
|
|
|
2018-04-16 09:24:22 +00:00
|
|
|
extern runtime StringEqual(Context, String, String): Oddball;
|
2018-06-05 07:54:49 +00:00
|
|
|
extern builtin StringLessThan(Context, String, String): Boolean;
|
|
|
|
|
|
|
|
extern macro StrictEqual(Object, Object): Boolean;
|
|
|
|
extern runtime SmiLexicographicCompare(Context, Object, Object): Number;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '==' macro Word32Equal(int32, int32): bool;
|
|
|
|
extern operator '!=' macro Word32NotEqual(int32, int32): bool;
|
|
|
|
extern operator '<' macro Int32LessThan(int32, int32): bool;
|
|
|
|
extern operator '>' macro Int32GreaterThan(int32, int32): bool;
|
|
|
|
extern operator '<=' macro Int32LessThanOrEqual(int32, int32): bool;
|
|
|
|
extern operator '>=' macro Int32GreaterThanOrEqual(int32, int32): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '==' macro SmiEqual(Smi, Smi): bool;
|
|
|
|
extern operator '!=' macro SmiNotEqual(Smi, Smi): bool;
|
|
|
|
extern operator '<' macro SmiLessThan(Smi, Smi): bool;
|
|
|
|
extern operator '<=' macro SmiLessThanOrEqual(Smi, Smi): bool;
|
|
|
|
extern operator '>' macro SmiGreaterThan(Smi, Smi): bool;
|
|
|
|
extern operator '>=' macro SmiGreaterThanOrEqual(Smi, Smi): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-13 10:10:44 +00:00
|
|
|
extern operator '==' macro ElementsKindEqual(
|
|
|
|
constexpr ElementsKind, constexpr ElementsKind): constexpr bool;
|
|
|
|
extern macro IsFastElementsKind(constexpr ElementsKind): constexpr bool;
|
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro SmiAbove(Smi, Smi): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '==' macro WordEqual(intptr, intptr): bool;
|
|
|
|
extern operator '!=' macro WordNotEqual(intptr, intptr): bool;
|
|
|
|
extern operator '<' macro IntPtrLessThan(intptr, intptr): bool;
|
|
|
|
extern operator '>' macro IntPtrGreaterThan(intptr, intptr): bool;
|
|
|
|
extern operator '<=' macro IntPtrLessThanOrEqual(intptr, intptr): bool;
|
|
|
|
extern operator '>=' macro IntPtrGreaterThanOrEqual(intptr, intptr): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '==' macro Float64Equal(float64, float64): bool;
|
2018-04-25 08:14:09 +00:00
|
|
|
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator
|
2018-05-04 15:55:55 +00:00
|
|
|
'<' macro BranchIfNumberLessThan(Number, Number): never labels Taken, NotTaken;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator
|
2018-05-04 15:55:55 +00:00
|
|
|
'<=' macro BranchIfNumberLessThanOrEqual(Number, Number): never labels Taken,
|
|
|
|
NotTaken;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator
|
2018-05-04 15:55:55 +00:00
|
|
|
'>' macro BranchIfNumberGreaterThan(Number, Number): never labels Taken,
|
|
|
|
NotTaken;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator '>=' macro BranchIfNumberGreaterThanOrEqual(Number, Number):
|
2018-05-04 15:55:55 +00:00
|
|
|
never labels Taken,
|
|
|
|
NotTaken;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '==' macro WordEqual(Object, Object): bool;
|
|
|
|
extern operator '!=' macro WordNotEqual(Object, Object): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern operator '+' macro SmiAdd(Smi, Smi): Smi;
|
|
|
|
extern operator '-' macro SmiSub(Smi, Smi): Smi;
|
2018-06-06 12:30:08 +00:00
|
|
|
extern operator '&' macro SmiAnd(Smi, Smi): Smi;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '>>>' macro SmiShr(Smi, constexpr int31): Smi;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern operator '+' macro IntPtrAdd(intptr, intptr): intptr;
|
|
|
|
extern operator '-' macro IntPtrSub(intptr, intptr): intptr;
|
2018-04-25 08:14:09 +00:00
|
|
|
extern operator '>>>' macro WordShr(intptr, intptr): intptr;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-06-06 12:30:08 +00:00
|
|
|
extern operator '+' macro Int32Add(int32, int32): int32;
|
|
|
|
extern operator '*' macro Int32Mul(int32, int32): int32;
|
|
|
|
extern operator '%' macro Int32Mod(int32, int32): int32;
|
|
|
|
extern operator '&' macro Word32And(int32, int32): int32;
|
|
|
|
extern operator '<<' macro Word32Shl(int32, int32): int32;
|
|
|
|
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator '+' macro NumberAdd(Number, Number): Number;
|
|
|
|
extern operator '-' macro NumberSub(Number, Number): Number;
|
|
|
|
extern operator 'min' macro NumberMin(Number, Number): Number;
|
|
|
|
extern operator 'max' macro NumberMax(Number, Number): Number;
|
|
|
|
|
2018-05-13 10:10:44 +00:00
|
|
|
extern operator '!' macro ConstexprBoolNot(constexpr bool): constexpr bool;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '!' macro Word32BinaryNot(bool): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-09 08:16:07 +00:00
|
|
|
extern operator '.map' macro LoadMap(HeapObject): Map;
|
|
|
|
extern operator '.map=' macro StoreMap(HeapObject, Map);
|
2018-05-29 08:34:01 +00:00
|
|
|
extern operator
|
2018-06-06 15:35:39 +00:00
|
|
|
'.instanceType' macro LoadInstanceType(HeapObject): InstanceType;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern operator '.length' macro LoadStringLengthAsWord(String): intptr;
|
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
extern operator '.length' macro GetArgumentsLength(constexpr Arguments): intptr;
|
|
|
|
extern operator
|
2018-06-06 15:35:39 +00:00
|
|
|
'[]' macro GetArgumentValue(constexpr Arguments, intptr): Object;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator 'is<Smi>' macro TaggedIsSmi(Object): bool;
|
|
|
|
extern operator 'isnt<Smi>' macro TaggedIsNotSmi(Object): bool;
|
2018-06-07 11:48:26 +00:00
|
|
|
extern macro TaggedIsPositiveSmi(Object): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-06-06 15:35:39 +00:00
|
|
|
extern macro TaggedToJSDataView(Object): JSDataView labels CastError;
|
|
|
|
extern macro TaggedToHeapObject(Object): HeapObject labels CastError;
|
|
|
|
extern macro TaggedToSmi(Object): Smi labels CastError;
|
|
|
|
extern macro TaggedToJSArray(Object): JSArray labels CastError;
|
|
|
|
extern macro TaggedToCallable(Object): Callable labels CastError;
|
|
|
|
extern macro ConvertFixedArrayBaseToFixedArray(
|
2018-04-16 09:24:22 +00:00
|
|
|
FixedArrayBase): FixedArray labels CastError;
|
2018-06-06 15:35:39 +00:00
|
|
|
extern macro ConvertFixedArrayBaseToFixedDoubleArray(
|
2018-04-16 09:24:22 +00:00
|
|
|
FixedArrayBase): FixedDoubleArray labels CastError;
|
2018-06-06 15:35:39 +00:00
|
|
|
extern macro TaggedToNumber(Object): Number labels CastError;
|
|
|
|
|
|
|
|
macro cast<A : type>(o: Object): A labels CastError;
|
|
|
|
cast<Number>(o: Object): Number labels CastError {
|
|
|
|
return TaggedToNumber(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
cast<HeapObject>(o: Object): HeapObject labels CastError {
|
|
|
|
return TaggedToHeapObject(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
cast<Smi>(o: Object): Smi labels CastError {
|
|
|
|
return TaggedToSmi(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
cast<JSDataView>(o: Object): JSDataView labels CastError {
|
|
|
|
return TaggedToJSDataView(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
cast<Callable>(o: Object): Callable labels CastError {
|
|
|
|
return TaggedToCallable(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
cast<JSArray>(o: Object): JSArray labels CastError {
|
|
|
|
return TaggedToJSArray(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
macro cast<A : type>(o: FixedArrayBase): A labels CastError;
|
|
|
|
cast<FixedArray>(o: FixedArrayBase): FixedArray labels CastError {
|
|
|
|
return ConvertFixedArrayBaseToFixedArray(o) otherwise CastError;
|
|
|
|
}
|
|
|
|
cast<FixedDoubleArray>(o: FixedArrayBase): FixedDoubleArray labels CastError {
|
|
|
|
return ConvertFixedArrayBaseToFixedDoubleArray(o) otherwise CastError;
|
|
|
|
}
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-09 08:16:07 +00:00
|
|
|
extern macro AllocateHeapNumberWithValue(float64): HeapNumber;
|
|
|
|
|
2018-04-16 09:24:22 +00:00
|
|
|
extern implicit operator
|
2018-05-29 08:34:01 +00:00
|
|
|
'convert<>' macro NumberConstant(constexpr float64): Number;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern implicit operator
|
|
|
|
'convert<>' macro IntPtrConstant(constexpr int31): intptr;
|
|
|
|
extern implicit operator
|
|
|
|
'convert<>' macro Int32Constant(constexpr int31): int32;
|
2018-06-05 11:54:38 +00:00
|
|
|
extern implicit operator
|
|
|
|
'convert<>' macro Int32Constant(constexpr int32): int32;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern implicit operator 'convert<>' macro SmiConstant(constexpr int31): Smi;
|
|
|
|
extern implicit operator
|
|
|
|
'convert<>' macro NumberConstant(constexpr int31): Number;
|
|
|
|
extern implicit operator 'convert<>' macro BoolConstant(constexpr bool): bool;
|
|
|
|
extern implicit operator 'convert<>' macro LanguageModeConstant(
|
|
|
|
constexpr LanguageMode): LanguageMode;
|
2018-05-24 09:25:58 +00:00
|
|
|
extern operator
|
|
|
|
'convert<>' macro Int32Constant(constexpr ElementsKind): ElementsKind;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern implicit operator 'convert<>' macro SmiFromInt32(ElementsKind): Smi;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern operator 'convert<>' macro ChangeInt32ToTagged(int32): Number;
|
2018-06-06 12:30:08 +00:00
|
|
|
extern operator 'convert<>' macro ChangeUint32ToTagged(uint32): Number;
|
|
|
|
extern operator 'convert<>' macro UncheckedCastInt32ToUint32(int32): uint32;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator 'convert<>' macro TruncateWordToWord32(intptr): int32;
|
|
|
|
extern operator 'convert<>' macro SmiTag(intptr): Smi;
|
2018-05-03 07:35:25 +00:00
|
|
|
extern operator 'convert<>' macro SmiFromInt32(int32): Smi;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator 'convert<>' macro SmiUntag(Smi): intptr;
|
2018-06-07 11:48:26 +00:00
|
|
|
extern operator 'convert<>' macro SmiToInt32(Smi): int32;
|
2018-06-05 07:54:49 +00:00
|
|
|
extern operator 'convert<>' macro LoadHeapNumberValue(HeapNumber): float64;
|
|
|
|
extern operator 'convert<>' macro ChangeNumberToFloat64(Number): float64;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:55:55 +00:00
|
|
|
extern macro BranchIfFastJSArray(Object, Context): never labels Taken, NotTaken;
|
|
|
|
extern macro BranchIfNotFastJSArray(Object, Context): never labels Taken,
|
|
|
|
NotTaken;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro IsPrototypeInitialArrayPrototype(Context, Map): bool;
|
|
|
|
extern macro IsNoElementsProtectorCellInvalid(): bool;
|
|
|
|
extern macro IsArraySpeciesProtectorCellInvalid(): bool;
|
|
|
|
extern macro IsTypedArraySpeciesProtectorCellInvalid(): bool;
|
|
|
|
extern macro IsPromiseSpeciesProtectorCellInvalid(): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-04-25 08:14:09 +00:00
|
|
|
extern operator
|
2018-05-04 15:04:42 +00:00
|
|
|
'.buffer' macro LoadTypedArrayBuffer(JSTypedArray): JSArrayBuffer;
|
2018-04-25 08:14:09 +00:00
|
|
|
|
|
|
|
extern operator '.data_ptr' macro LoadDataPtr(JSTypedArray): RawPtr;
|
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern operator '.elements_kind' macro LoadMapElementsKind(Map): ElementsKind;
|
|
|
|
extern operator
|
|
|
|
'.elements_kind' macro LoadElementsKind(JSTypedArray): ElementsKind;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-29 08:34:01 +00:00
|
|
|
extern operator '.elements' macro LoadElements(JSObject): FixedArrayBase;
|
|
|
|
extern operator '.elements=' macro StoreElements(JSObject, FixedArrayBase);
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-04-25 08:14:09 +00:00
|
|
|
extern operator '.length' macro LoadTypedArrayLength(JSTypedArray): Smi;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator '.length' macro LoadJSArrayLength(JSArray): Number;
|
2018-06-05 07:54:49 +00:00
|
|
|
extern operator '.length_fast' macro LoadFastJSArrayLength(JSArray): Smi;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator '.length=' macro StoreJSArrayLength(JSArray, Smi);
|
|
|
|
|
|
|
|
extern operator '.length' macro LoadFixedArrayBaseLength(FixedArrayBase): Smi;
|
|
|
|
extern operator '[]' macro LoadFixedArrayElement(FixedArray, intptr): Object;
|
|
|
|
extern operator '[]' macro LoadFixedArrayElement(FixedArray, Smi): Object;
|
2018-06-07 11:48:26 +00:00
|
|
|
extern operator
|
|
|
|
'[]' macro LoadFixedArrayElementInt(FixedArray, constexpr int31): Object;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern operator
|
|
|
|
'[]=' macro StoreFixedArrayElement(FixedArray, intptr, Object): void;
|
|
|
|
extern operator
|
2018-06-07 11:48:26 +00:00
|
|
|
'[]=' macro StoreFixedArrayElementInt(
|
|
|
|
FixedArray, constexpr int31, Object): void;
|
|
|
|
extern operator
|
2018-04-16 09:24:22 +00:00
|
|
|
'[]=' macro StoreFixedArrayElementSmi(FixedArray, Smi, Object): void;
|
|
|
|
|
2018-06-05 07:54:49 +00:00
|
|
|
extern macro LoadFixedDoubleArrayElement(FixedDoubleArray, Smi): float64;
|
|
|
|
extern macro Float64SilenceNaN(float64): float64;
|
|
|
|
|
|
|
|
extern macro StoreFixedDoubleArrayElement(
|
|
|
|
FixedDoubleArray, Object, float64, constexpr ParameterMode);
|
|
|
|
macro StoreFixedDoubleArrayElementWithSmiIndex(
|
|
|
|
array: FixedDoubleArray, index: Smi, value: float64) {
|
|
|
|
StoreFixedDoubleArrayElement(array, index, value, SMI_PARAMETERS);
|
|
|
|
}
|
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro IsFastElementsKind(ElementsKind): bool;
|
|
|
|
extern macro IsFastSmiOrTaggedElementsKind(ElementsKind): bool;
|
|
|
|
extern macro IsFastSmiElementsKind(ElementsKind): bool;
|
2018-05-09 08:16:07 +00:00
|
|
|
extern macro IsHoleyFastElementsKind(ElementsKind): bool;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-06-07 11:48:26 +00:00
|
|
|
extern macro AllocateFixedArray(constexpr ElementsKind, intptr): FixedArray;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern macro CopyFixedArrayElements(
|
2018-05-04 15:04:42 +00:00
|
|
|
constexpr ElementsKind, FixedArray, constexpr ElementsKind, FixedArray,
|
|
|
|
intptr, intptr, intptr): void;
|
2018-04-16 09:24:22 +00:00
|
|
|
extern macro CopyFixedArrayElements(
|
2018-05-04 15:04:42 +00:00
|
|
|
constexpr ElementsKind, FixedArray, constexpr ElementsKind, FixedArray, Smi,
|
|
|
|
Smi, Smi): void;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro AllocateJSArray(constexpr ElementsKind, Map, intptr, Smi): JSArray;
|
|
|
|
extern macro AllocateJSArray(constexpr ElementsKind, Map, Smi, Smi): JSArray;
|
2018-05-09 08:16:07 +00:00
|
|
|
extern macro IsElementsKindGreaterThan(
|
|
|
|
ElementsKind, constexpr ElementsKind): bool;
|
|
|
|
|
|
|
|
extern macro LoadDoubleWithHoleCheck(FixedDoubleArray, Smi): float64
|
|
|
|
labels IfHole;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern macro Call(Context, Callable, Object, ...): Object;
|
|
|
|
|
|
|
|
extern macro ExtractFixedArray(
|
2018-05-04 15:04:42 +00:00
|
|
|
FixedArray, Smi, Smi, Smi, constexpr ExtractFixedArrayFlags): FixedArray;
|
2018-04-16 09:24:22 +00:00
|
|
|
|
|
|
|
extern builtin ExtractFastJSArray(Context, JSArray, Smi, Smi): JSArray;
|
|
|
|
|
2018-05-22 21:18:42 +00:00
|
|
|
macro LoadElementNoHole<T : type>(a: JSArray, index: Smi): Object labels IfHole;
|
2018-05-18 08:23:25 +00:00
|
|
|
|
|
|
|
LoadElementNoHole<FixedArray>(a: JSArray, index: Smi): Object
|
|
|
|
labels IfHole {
|
|
|
|
try {
|
|
|
|
let elements: FixedArray =
|
|
|
|
cast<FixedArray>(a.elements) otherwise Unexpected;
|
|
|
|
let e: Object = elements[index];
|
|
|
|
if (e == Hole) {
|
|
|
|
goto IfHole;
|
|
|
|
}
|
|
|
|
return e;
|
|
|
|
}
|
|
|
|
label Unexpected {
|
|
|
|
unreachable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LoadElementNoHole<FixedDoubleArray>(a: JSArray, index: Smi): Object
|
|
|
|
labels IfHole {
|
|
|
|
try {
|
|
|
|
let elements: FixedDoubleArray =
|
|
|
|
cast<FixedDoubleArray>(a.elements) otherwise Unexpected;
|
|
|
|
let e: float64 = LoadDoubleWithHoleCheck(elements, index) otherwise IfHole;
|
|
|
|
return AllocateHeapNumberWithValue(e);
|
|
|
|
}
|
|
|
|
label Unexpected {
|
|
|
|
unreachable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-16 09:24:22 +00:00
|
|
|
macro HasPropertyObject(
|
2018-06-06 15:35:39 +00:00
|
|
|
o: Object, p: Object, c: Context,
|
|
|
|
f: constexpr HasPropertyLookupMode): Oddball {
|
2018-04-16 09:24:22 +00:00
|
|
|
try {
|
2018-06-06 15:35:39 +00:00
|
|
|
return HasProperty((cast<HeapObject>(o) otherwise CastError), p, c, f);
|
2018-04-16 09:24:22 +00:00
|
|
|
}
|
|
|
|
label CastError {
|
2018-05-04 15:55:55 +00:00
|
|
|
return False;
|
2018-04-16 09:24:22 +00:00
|
|
|
}
|
|
|
|
}
|
2018-04-25 08:14:09 +00:00
|
|
|
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro IsCallable(HeapObject): bool;
|
2018-06-05 07:54:49 +00:00
|
|
|
extern macro IsJSArray(HeapObject): bool;
|
2018-05-04 15:04:42 +00:00
|
|
|
extern macro TaggedIsCallable(Object): bool;
|
|
|
|
extern macro IsDetachedBuffer(JSArrayBuffer): bool;
|
2018-06-05 07:54:49 +00:00
|
|
|
|
|
|
|
extern macro NumberIsNaN(Number): bool;
|