!1946 Rename the incorrect variables

Merge pull request !1946 from Gargoyle.h/wzfmaster-dev
This commit is contained in:
openharmony_ci 2022-08-01 00:55:57 +00:00 committed by Gitee
commit 8205cd1b10
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 79 additions and 85 deletions

View File

@ -377,9 +377,9 @@ GateRef CircuitBuilder::TaggedObjectIsEcmaObject(GateRef obj)
{
GateRef objectType = GetObjectType(LoadHClass(obj));
auto ret = Int32And(ZExtInt1ToInt32(Int32LessThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_END)))),
Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_LAST)))),
ZExtInt1ToInt32(Int32GreaterThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_BEGIN)))));
Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_FIRST)))));
return TruncInt32ToInt1(ret);
}
@ -395,9 +395,9 @@ GateRef CircuitBuilder::IsJsObject(GateRef obj)
{
GateRef objectType = GetObjectType(LoadHClass(obj));
auto ret1 = Int32And(ZExtInt1ToInt32(Int32LessThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::JS_OBJECT_END)))),
Int32(static_cast<int32_t>(JSType::JS_OBJECT_LAST)))),
ZExtInt1ToInt32(Int32GreaterThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::JS_OBJECT_BEGIN)))));
Int32(static_cast<int32_t>(JSType::JS_OBJECT_FIRST)))));
result = TruncInt32ToInt1(ret1);
Jump(&exit);
}

View File

@ -1005,10 +1005,10 @@ inline GateRef StubBuilder::TaggedObjectIsEcmaObject(GateRef obj)
GateRef objectType = GetObjectType(LoadHClass(obj));
auto ret = Int32And(
ZExtInt1ToInt32(
Int32LessThanOrEqual(objectType, Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_END)))),
Int32LessThanOrEqual(objectType, Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_LAST)))),
ZExtInt1ToInt32(
Int32GreaterThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_BEGIN)))));
Int32(static_cast<int32_t>(JSType::ECMA_OBJECT_FIRST)))));
return TruncInt32ToInt1(ret);
}
@ -1026,10 +1026,10 @@ inline GateRef StubBuilder::IsJSObject(GateRef obj)
GateRef objectType = GetObjectType(LoadHClass(obj));
auto ret1 = Int32And(
ZExtInt1ToInt32(
Int32LessThanOrEqual(objectType, Int32(static_cast<int32_t>(JSType::JS_OBJECT_END)))),
Int32LessThanOrEqual(objectType, Int32(static_cast<int32_t>(JSType::JS_OBJECT_LAST)))),
ZExtInt1ToInt32(
Int32GreaterThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::JS_OBJECT_BEGIN)))));
Int32(static_cast<int32_t>(JSType::JS_OBJECT_FIRST)))));
result = TruncInt32ToInt1(ret1);
Jump(&exit);
}
@ -1468,7 +1468,7 @@ inline GateRef StubBuilder::IsFastTypeArray(GateRef jsType)
{
return TruncInt32ToInt1(Int32And(
ZExtInt1ToInt32(
Int32GreaterThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_TYPED_ARRAY_BEGIN)))),
Int32GreaterThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_TYPED_ARRAY_FIRST)))),
ZExtInt1ToInt32(Int32LessThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_FLOAT64_ARRAY))))));
}
@ -1887,9 +1887,9 @@ inline GateRef StubBuilder::IsJSFunction(GateRef obj)
{
GateRef objectType = GetObjectType(LoadHClass(obj));
GateRef greater = ZExtInt1ToInt32(Int32GreaterThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::JS_FUNCTION_BEGIN))));
Int32(static_cast<int32_t>(JSType::JS_FUNCTION_FIRST))));
GateRef less = ZExtInt1ToInt32(Int32LessThanOrEqual(objectType,
Int32(static_cast<int32_t>(JSType::JS_FUNCTION_END))));
Int32(static_cast<int32_t>(JSType::JS_FUNCTION_LAST))));
return TruncInt32ToInt1(Int32And(greater, less));
}

View File

@ -80,10 +80,10 @@ void AsmInterpreterCall::JSCallDispatch(ExtendedAssembler *assembler)
__ Ldr(tempRegister, MemoryOperand(callTargetRegister, 0)); // hclass
__ Ldr(bitFieldRegister, MemoryOperand(tempRegister, JSHClass::BIT_FIELD_OFFSET));
__ And(functionTypeRegister, bitFieldRegister.W(), LogicalImmediate::Create(0xFF, RegWSize));
__ Mov(tempRegister.W(), Immediate(static_cast<int64_t>(JSType::JS_FUNCTION_BEGIN)));
__ Mov(tempRegister.W(), Immediate(static_cast<int64_t>(JSType::JS_FUNCTION_FIRST)));
__ Cmp(functionTypeRegister, tempRegister.W());
__ B(Condition::LO, &notJSFunction);
__ Mov(tempRegister.W(), Immediate(static_cast<int64_t>(JSType::JS_FUNCTION_END)));
__ Mov(tempRegister.W(), Immediate(static_cast<int64_t>(JSType::JS_FUNCTION_LAST)));
__ Cmp(functionTypeRegister, tempRegister.W());
__ B(Condition::LS, &callJSFunctionEntry);
__ Bind(&notJSFunction);
@ -689,9 +689,9 @@ void AsmInterpreterCall::ResumeRspAndDispatch(ExtendedAssembler *assembler)
__ Ldr(temp, MemoryOperand(ret, 0)); // hclass
__ Ldr(temp, MemoryOperand(temp, JSHClass::BIT_FIELD_OFFSET));
__ And(temp.W(), temp.W(), LogicalImmediate::Create(0xFF, RegWSize));
__ Cmp(temp.W(), Immediate(static_cast<int64_t>(JSType::ECMA_OBJECT_END)));
__ Cmp(temp.W(), Immediate(static_cast<int64_t>(JSType::ECMA_OBJECT_LAST)));
__ B(Condition::HI, &notEcmaObject);
__ Cmp(temp.W(), Immediate(static_cast<int64_t>(JSType::ECMA_OBJECT_BEGIN)));
__ Cmp(temp.W(), Immediate(static_cast<int64_t>(JSType::ECMA_OBJECT_FIRST)));
__ B(Condition::LO, &notEcmaObject);
// acc is ecma object
__ Ldur(sp, MemoryOperand(sp, spOffset)); // update sp

View File

@ -400,11 +400,11 @@ void OptimizedCall::JSCallBody(ExtendedAssembler *assembler, Register jsfunc)
Register jstype(X3, W);
__ And(jstype, bitfield, LogicalImmediate::Create(0xFF, RegWSize));
// 4 : 4 means JSType::JS_FUNCTION_BEGIN
__ Sub(jstype, jstype, Immediate(static_cast<int>(JSType::JS_FUNCTION_BEGIN)));
// 9 : 9 means JSType::JS_FUNCTION_END - JSType::JS_FUNCTION_BEGIN + 1
__ Cmp(jstype, Immediate(static_cast<int>(JSType::JS_FUNCTION_END)
- static_cast<int>(JSType::JS_FUNCTION_BEGIN) + 1));
// 4 : 4 means JSType::JS_FUNCTION_FIRST
__ Sub(jstype, jstype, Immediate(static_cast<int>(JSType::JS_FUNCTION_FIRST)));
// 9 : 9 means JSType::JS_FUNCTION_LAST - JSType::JS_FUNCTION_FIRST + 1
__ Cmp(jstype, Immediate(static_cast<int>(JSType::JS_FUNCTION_LAST)
- static_cast<int>(JSType::JS_FUNCTION_FIRST) + 1));
__ B(Condition::HS, &notJSFunction);
Register method(X2);

View File

@ -134,9 +134,9 @@ void AsmInterpreterCall::JSCallDispatch(ExtendedAssembler *assembler)
Register tempRegister = r11; // can not be used to store any variable
__ Movq(Operand(callTargetRegister, 0), tempRegister); // hclass
__ Movq(Operand(tempRegister, JSHClass::BIT_FIELD_OFFSET), bitFieldRegister);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_BEGIN), bitFieldRegister);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_FIRST), bitFieldRegister);
__ Jb(&notJSFunction);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_END), bitFieldRegister);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_LAST), bitFieldRegister);
__ Jbe(&callJSFunctionEntry);
__ Bind(&notJSFunction);
{
@ -966,9 +966,9 @@ void AsmInterpreterCall::ResumeRspAndDispatch(ExtendedAssembler *assembler)
// acc is heap object
__ Movq(Operand(ret, 0), temp); // hclass
__ Movl(Operand(temp, JSHClass::BIT_FIELD_OFFSET), temp);
__ Cmpb(static_cast<int32_t>(JSType::ECMA_OBJECT_END), temp);
__ Cmpb(static_cast<int32_t>(JSType::ECMA_OBJECT_LAST), temp);
__ Ja(&notEcmaObject);
__ Cmpb(static_cast<int32_t>(JSType::ECMA_OBJECT_BEGIN), temp);
__ Cmpb(static_cast<int32_t>(JSType::ECMA_OBJECT_FIRST), temp);
__ Jb(&notEcmaObject);
// acc is ecma object
__ Movq(Operand(frameStateBaseRegister, AsmInterpretedFrame::GetBaseOffset(false)), spRegister); // update sp

View File

@ -383,9 +383,9 @@ void OptimizedCall::JSProxyCallInternalWithArgV(ExtendedAssembler *assembler)
__ Btl(JSHClass::CallableBit::START_BIT, rax); // IsCallable
__ Jnb(&lNonCallable);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_BEGIN), rax);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_FIRST), rax);
__ Jb(&lNotJSFunction);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_END), rax);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_LAST), rax);
__ Jbe(&lJSFunctionCall);
}
@ -651,9 +651,9 @@ void OptimizedCall::JSCall(ExtendedAssembler *assembler)
__ Btl(JSHClass::CallableBit::START_BIT, rax); // IsCallable
__ Jnb(&lNonCallable);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_BEGIN), rax);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_FIRST), rax);
__ Jb(&lNotJSFunction);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_END), rax);
__ Cmpb(static_cast<int32_t>(JSType::JS_FUNCTION_LAST), rax);
__ Jbe(&lJSFunctionCall); // objecttype in (0x04 ~ 0x0c)
}

View File

@ -1069,7 +1069,7 @@ FrontType NodeTypeConverter::Convert(NodeType type)
fType = FrontType::STRING;
} else if (type == NodeType::JS_OBJECT) {
fType = FrontType::OBJECT;
} else if (type >= NodeType::JS_FUNCTION_BEGIN && type <= NodeType::JS_FUNCTION_END) {
} else if (type >= NodeType::JS_FUNCTION_FIRST && type <= NodeType::JS_FUNCTION_LAST) {
fType = FrontType::CLOSURE;
} else if (type == NodeType::JS_BOUND_FUNCTION) {
fType = FrontType::CLOSURE;

View File

@ -935,7 +935,7 @@ bool FastRuntimeStub::TryStringOrSymbolToIndex(JSTaggedValue key, uint32_t *outp
bool FastRuntimeStub::IsFastTypeArray(JSType jsType)
{
return jsType >= JSType::JS_TYPED_ARRAY_BEGIN && jsType <= JSType::JS_FLOAT64_ARRAY;
return jsType >= JSType::JS_TYPED_ARRAY_FIRST && jsType <= JSType::JS_FLOAT64_ARRAY;
}
JSTaggedValue FastRuntimeStub::FastGetTypeArrayProperty(JSThread *thread, JSTaggedValue receiver, JSTaggedValue holder,

View File

@ -124,7 +124,7 @@ void JSHClass::Initialize(const JSThread *thread, uint32_t size, JSType type, ui
{
DISALLOW_GARBAGE_COLLECTION;
ClearBitField();
if (JSType::JS_OBJECT_BEGIN <= type && type <= JSType::JS_OBJECT_END) {
if (JSType::JS_OBJECT_FIRST <= type && type <= JSType::JS_OBJECT_LAST) {
SetObjectSize(size + inlinedProps * JSTaggedValue::TaggedTypeSize());
SetInlinedPropsStart(size);
SetLayout(thread, thread->GlobalConstants()->GetEmptyLayoutInfo());

View File

@ -31,25 +31,25 @@
*
* Properties JS Object JS HClass
* +------------+ +------------+ +------------------+
* |arrayClass + <---------| |JS HClass +-------------->|HClass class |
* |arrayHClass + <---------| |JS HClass +-------------->| meta hclass |
* +------------+ | +------------+ +------------------+
* |property 0 | | |Hash | |BitField |
* | property 0 | | |Hash | | hclass level |
* +------------+ | +------------+ +------------------+
* |property 1 | |------- |Properties | |BitField1 |
* | property 1 | |------- |Properties | | supers[] |
* +------------+ +------------+ +------------------+
* |... | |------- |Elements | |Proto |
* |... | |------- |Elements | | vtable[] |
* +------------+ | +------------+ +------------------+
* | |in-obj 0 | |Layout |
* | |inl-prop-0 | | prototype |
* Elements | +------------+ +------------------+
* +------------+ | |in-obj 1 | |Transitions |
* |arrayClass + <---------| +------------+ +------------------+
* +------------+ |... | |Parent |
* |value 0 | +------------+ +------------------+
* +------------+ | |inl-prop-1 | | layout |
* |arrayHClass + <---------| +------------+ +------------------+
* +------------+ |... | | transitions |
* | value 0 | +------------+ +------------------+
* +------------+ | paratent |
* | value 1 | +------------------+
* +------------+ |ProtoChangeMarker |
* |value 1 | +------------------+
* +------------+ |ProtoChangeDetails|
* |... | +------------------+
* +------------+ |EnumCache |
* +------------+ | EnumCache |
* +------------------+
*
* Proto: [[Prototype]] in Ecma spec
@ -64,7 +64,7 @@ class ProtoChangeDetails;
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define JSTYPE_DECL /* //////////////////////////////////////////////////////////////////////////////-PADDING */ \
INVALID = 0, /* //////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_OBJECT, /* JS_OBJECT_BEGIN ////////////////////////////////////////////////////////////////////// */ \
JS_OBJECT, /* JS_OBJECT_FIRST ////////////////////////////////////////////////////////////////////// */ \
JS_REALM, /* //////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_FUNCTION_BASE, /* //////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_FUNCTION, /* //////////////////////////////////////////////////////////////////////////////-PADDING */ \
@ -82,14 +82,14 @@ class ProtoChangeDetails;
JS_ASYNC_AWAIT_STATUS_FUNCTION, /* ////////////////////////////////////////////////////////////////-PADDING */ \
JS_BOUND_FUNCTION, /* //////////////////////////////////////////////////////////////////////////////////// */ \
\
JS_ERROR, /* JS_ERROR_BEGIN /////////////////////////////////////////////////////////////-PADDING */ \
JS_ERROR, /* JS_ERROR_FIRST /////////////////////////////////////////////////////////////-PADDING */ \
JS_EVAL_ERROR, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_RANGE_ERROR, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_REFERENCE_ERROR, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_TYPE_ERROR, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_AGGREGATE_ERROR, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_URI_ERROR, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_SYNTAX_ERROR, /* JS_ERROR_END /////////////////////////////////////////////////////////////////////// */ \
JS_SYNTAX_ERROR, /* JS_ERROR_LAST /////////////////////////////////////////////////////////////////////// */\
\
JS_REG_EXP, /* ///////////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_SET, /* ///////////////////////////////////////////////////////////////////////////////////-PADDING */ \
@ -154,7 +154,7 @@ class ProtoChangeDetails;
JS_API_STACK, /* /////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_API_PLAIN_ARRAY, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_API_QUEUE, /* /////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_TYPED_ARRAY, /* JS_TYPED_ARRAY_BEGIN /////////////////////////////////////////////////////////////////// */ \
JS_TYPED_ARRAY, /* JS_TYPED_ARRAY_FIRST /////////////////////////////////////////////////////////////////// */ \
JS_INT8_ARRAY, /* ////////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_UINT8_ARRAY, /* ////////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_UINT8_CLAMPED_ARRAY, /* ////////////////////////////////////////////////////////////////////////-PADDING */ \
@ -165,14 +165,14 @@ class ProtoChangeDetails;
JS_FLOAT32_ARRAY, /* ////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_FLOAT64_ARRAY, /* ////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_BIGINT64_ARRAY, /* ////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_BIGUINT64_ARRAY, /* JS_TYPED_ARRAY_END ///////////////////////////////////////////////////////////// */ \
JS_BIGUINT64_ARRAY, /* JS_TYPED_ARRAY_LAST ///////////////////////////////////////////////////////////// */\
JS_PRIMITIVE_REF, /* number\boolean\string. SPECIAL indexed objects end, DON'T CHANGE HERE ////////-PADDING */ \
JS_MODULE_NAMESPACE, /* ///////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_CJS_MODULE, /* /////////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_CJS_EXPORTS, /* ////////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_CJS_REQUIRE, /* ////////////////////////////////////////////////////////////////////////////////-PADDING */ \
JS_GLOBAL_OBJECT, /* JS_OBJECT_END/////////////////////////////////////////////////////////////////-PADDING */ \
JS_PROXY, /* ECMA_OBJECT_END ////////////////////////////////////////////////////////////////////////////// */ \
JS_GLOBAL_OBJECT, /* JS_OBJECT_LAST/////////////////////////////////////////////////////////////////-PADDING */\
JS_PROXY, /* ECMA_OBJECT_LAST ////////////////////////////////////////////////////////////////////////////// */\
\
HCLASS, /* //////////////////////////////////////////////////////////////////////////////////-PADDING */ \
STRING, /* //////////////////////////////////////////////////////////////////////////////////-PADDING */ \
@ -199,7 +199,7 @@ class ProtoChangeDetails;
TEMPLATE_MAP, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
PROGRAM, /* /////////////////////////////////////////////////////////////////////////////////-PADDING */ \
\
PROMISE_CAPABILITY, /* JS_RECORD_BEGIN //////////////////////////////////////////////////////////////////// */ \
PROMISE_CAPABILITY, /* JS_RECORD_FIRST //////////////////////////////////////////////////////////////////// */ \
PROMISE_RECORD, /* ////////////////////////////////////////////////////////////////////////////-PADDING */ \
RESOLVING_FUNCTIONS_RECORD, /* ////////////////////////////////////////////////////////////////////-PADDING */ \
PROMISE_REACTIONS, /* ////////////////////////////////////////////////////////////////////-PADDING */ \
@ -212,7 +212,7 @@ class ProtoChangeDetails;
EXPORTENTRY_RECORD, /* /////////////////////////////////////////////////////////////////////////-PADDING */ \
RESOLVEDBINDING_RECORD, /* /////////////////////////////////////////////////////////////////////-PADDING */ \
CELL_RECORD, /* //////////////////////////////////////////////////////////////////////////-PADDING */ \
COMPLETION_RECORD, /* JS_RECORD_END /////////////////////////////////////////////////////////////////////// */ \
COMPLETION_RECORD, /* JS_RECORD_LAST /////////////////////////////////////////////////////////////////////// */\
MACHINE_CODE_OBJECT, \
CLASS_INFO_EXTRACTOR, /* //////////////////////////////////////////////////////////////////////////-PADDING */ \
TS_ARRAY_TYPE, /* ////////////////////////////////////////////////////////////////////////////////-PADDING */ \
@ -225,29 +225,29 @@ class ProtoChangeDetails;
TS_INTERFACE_TYPE, /* //////////////////////////////////////////////////////////////////////////-PADDING */ \
TYPE_LAST = TS_INTERFACE_TYPE, /* /////////////////////////////////////////////////////////////////-PADDING */ \
\
JS_FUNCTION_BEGIN = JS_FUNCTION, /* ///////////////////////////////////////////////////////////////-PADDING */ \
JS_FUNCTION_END = JS_ASYNC_AWAIT_STATUS_FUNCTION, /* //////////////////////////////////////////////-PADDING */ \
JS_FUNCTION_FIRST = JS_FUNCTION, /* ///////////////////////////////////////////////////////////////-PADDING */ \
JS_FUNCTION_LAST = JS_ASYNC_AWAIT_STATUS_FUNCTION, /* //////////////////////////////////////////////-PADDING */\
\
JS_OBJECT_BEGIN = JS_OBJECT, /* ///////////////////////////////////////////////////////////////////-PADDING */ \
JS_OBJECT_END = JS_GLOBAL_OBJECT, /* //////////////////////////////////////////////////////////////-PADDING */ \
JS_OBJECT_FIRST = JS_OBJECT, /* ///////////////////////////////////////////////////////////////////-PADDING */ \
JS_OBJECT_LAST = JS_GLOBAL_OBJECT, /* //////////////////////////////////////////////////////////////-PADDING */\
\
ECMA_OBJECT_BEGIN = JS_OBJECT, /* /////////////////////////////////////////////////////////////////-PADDING */ \
ECMA_OBJECT_END = JS_PROXY, /* /////////////////////////////////////////////////////////////////-PADDING */ \
ECMA_OBJECT_FIRST = JS_OBJECT, /* /////////////////////////////////////////////////////////////////-PADDING */ \
ECMA_OBJECT_LAST = JS_PROXY, /* /////////////////////////////////////////////////////////////////-PADDING */\
\
JS_ERROR_BEGIN = JS_ERROR, /* ////////////////////////////////////////////////////////////////-PADDING */ \
JS_ERROR_END = JS_SYNTAX_ERROR, /* ////////////////////////////////////////////////////////////////-PADDING */ \
JS_ERROR_FIRST = JS_ERROR, /* ////////////////////////////////////////////////////////////////-PADDING */ \
JS_ERROR_LAST = JS_SYNTAX_ERROR, /* ////////////////////////////////////////////////////////////////-PADDING */\
\
JS_ITERATOR_BEGIN = JS_ITERATOR, /* //////////////////////////////////////////////////////////-PADDING */ \
JS_ITERATOR_END = JS_STRING_ITERATOR, /* //////////////////////////////////////////////////////////-PADDING */ \
JS_ITERATOR_FIRST = JS_ITERATOR, /* //////////////////////////////////////////////////////////-PADDING */ \
JS_ITERATOR_LAST = JS_STRING_ITERATOR, /* //////////////////////////////////////////////////////////-PADDING */\
\
JS_RECORD_BEGIN = PROMISE_CAPABILITY, /* //////////////////////////////////////////////////////////-PADDING */ \
JS_RECORD_END = COMPLETION_RECORD, /* ///////////////////////////////////////////////////////-PADDING */ \
JS_RECORD_FIRST = PROMISE_CAPABILITY, /* //////////////////////////////////////////////////////////-PADDING */ \
JS_RECORD_LAST = COMPLETION_RECORD, /* ///////////////////////////////////////////////////////-PADDING */ \
\
JS_TYPED_ARRAY_BEGIN = JS_TYPED_ARRAY, /* /////////////////////////////////////////////////////////-PADDING */ \
JS_TYPED_ARRAY_END = JS_BIGUINT64_ARRAY, /* ///////////////////////////////////////////////////////-PADDING */ \
JS_TYPED_ARRAY_FIRST = JS_TYPED_ARRAY, /* /////////////////////////////////////////////////////////-PADDING */ \
JS_TYPED_ARRAY_LAST = JS_BIGUINT64_ARRAY, /* ///////////////////////////////////////////////////////-PADDING */\
\
MODULE_RECORD_BEGIN = MODULE_RECORD, /* ///////////////////////////////////////////////////////////-PADDING */ \
MODULE_RECORD_END = SOURCE_TEXT_MODULE_RECORD /* //////////////////////////////////////////////////-PADDING */
MODULE_RECORD_FIRST = MODULE_RECORD, /* ///////////////////////////////////////////////////////////-PADDING */ \
MODULE_RECORD_LAST = SOURCE_TEXT_MODULE_RECORD /* //////////////////////////////////////////////////-PADDING */
enum class JSType : uint8_t {
@ -407,13 +407,13 @@ public:
inline bool IsJSObject() const
{
JSType jsType = GetObjectType();
return (JSType::JS_OBJECT_BEGIN <= jsType && jsType <= JSType::JS_OBJECT_END);
return (JSType::JS_OBJECT_FIRST <= jsType && jsType <= JSType::JS_OBJECT_LAST);
}
inline bool IsECMAObject() const
{
JSType jsType = GetObjectType();
return (JSType::ECMA_OBJECT_BEGIN <= jsType && jsType <= JSType::ECMA_OBJECT_END);
return (JSType::ECMA_OBJECT_FIRST <= jsType && jsType <= JSType::ECMA_OBJECT_LAST);
}
inline bool IsRealm() const
@ -476,7 +476,7 @@ public:
inline bool IsTypedArray() const
{
JSType jsType = GetObjectType();
return (JSType::JS_TYPED_ARRAY_BEGIN < jsType && jsType <= JSType::JS_TYPED_ARRAY_END);
return (JSType::JS_TYPED_ARRAY_FIRST < jsType && jsType <= JSType::JS_TYPED_ARRAY_LAST);
}
inline bool IsJSTypedArray() const
@ -657,13 +657,13 @@ public:
bool IsJSFunction() const
{
return GetObjectType() >= JSType::JS_FUNCTION_BEGIN && GetObjectType() <= JSType::JS_FUNCTION_END;
return GetObjectType() >= JSType::JS_FUNCTION_FIRST && GetObjectType() <= JSType::JS_FUNCTION_LAST;
}
inline bool IsJSError() const
{
JSType jsType = GetObjectType();
return jsType >= JSType::JS_ERROR_BEGIN && jsType <= JSType::JS_ERROR_END;
return jsType >= JSType::JS_ERROR_FIRST && jsType <= JSType::JS_ERROR_LAST;
}
inline bool IsArguments() const
@ -861,7 +861,7 @@ public:
inline bool IsIterator() const
{
JSType jsType = GetObjectType();
return jsType >= JSType::JS_ITERATOR_BEGIN && jsType <= JSType::JS_ITERATOR_END;
return jsType >= JSType::JS_ITERATOR_FIRST && jsType <= JSType::JS_ITERATOR_LAST;
}
inline bool IsForinIterator() const
@ -1097,7 +1097,7 @@ public:
inline bool IsRecord() const
{
JSType jsType = GetObjectType();
return jsType >= JSType::JS_RECORD_BEGIN && jsType <= JSType::JS_RECORD_END;
return jsType >= JSType::JS_RECORD_FIRST && jsType <= JSType::JS_RECORD_LAST;
}
inline bool IsTemplateMap() const
@ -1107,14 +1107,8 @@ public:
inline bool IsFreeObject() const
{
switch (GetObjectType()) {
case JSType::FREE_OBJECT_WITH_ONE_FIELD:
case JSType::FREE_OBJECT_WITH_NONE_FIELD:
case JSType::FREE_OBJECT_WITH_TWO_FIELD:
return true;
default:
return false;
}
JSType t = GetObjectType();
return (JSType::FREE_OBJECT_WITH_ONE_FIELD <= t) && (t <= JSType::FREE_OBJECT_WITH_TWO_FIELD);
}
inline bool IsFreeObjectWithShortField() const
@ -1191,7 +1185,7 @@ public:
inline bool IsModuleRecord() const
{
JSType jsType = GetObjectType();
return jsType >= JSType::MODULE_RECORD_BEGIN && jsType <= JSType::MODULE_RECORD_END;
return jsType >= JSType::MODULE_RECORD_FIRST && jsType <= JSType::MODULE_RECORD_LAST;
}
inline bool IsSourceTextModule() const
@ -1375,7 +1369,7 @@ public:
inline uint32_t GetInlinedProperties() const
{
JSType type = GetObjectType();
if (JSType::JS_OBJECT_BEGIN <= type && type <= JSType::JS_OBJECT_END) {
if (JSType::JS_OBJECT_FIRST <= type && type <= JSType::JS_OBJECT_LAST) {
uint32_t bits = GetBitField1();
return static_cast<uint32_t>(ObjectSizeInWordsBits::Decode(bits) - InlinedPropsStartBits::Decode(bits));
} else {