mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-06 23:54:03 +00:00
fix tagged CanonicalizeToInt bug
Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
This commit is contained in:
parent
f0c9ac2237
commit
da4dfc9096
@ -2120,7 +2120,7 @@ GateRef BytecodeCircuitBuilder::NewConst(const BytecodeInfo &info)
|
||||
case EcmaBytecode::LDHOLE_PREF:
|
||||
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64, JSTaggedValue::VALUE_HOLE,
|
||||
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
||||
GateType::TaggedNPointer());
|
||||
GateType::TaggedValue());
|
||||
break;
|
||||
case EcmaBytecode::LDAI_DYN_IMM32:
|
||||
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64,
|
||||
|
@ -394,6 +394,7 @@ DEF_CALL_SIGNATURE(SetValueWithBarrier)
|
||||
VariableType::JS_ANY()
|
||||
};
|
||||
callSign->SetParameters(params.data());
|
||||
callSign->SetGCLeafFunction(true);
|
||||
callSign->SetCallConv(CallSignature::CallConv::CCallConv);
|
||||
}
|
||||
|
||||
@ -1008,6 +1009,23 @@ DEF_CALL_SIGNATURE(MarkingBarrier)
|
||||
callSign->SetTargetKind(CallSignature::TargetKind::RUNTIME_STUB_NO_GC);
|
||||
}
|
||||
|
||||
DEF_CALL_SIGNATURE(StoreBarrier)
|
||||
{
|
||||
// 4 : 4 input parameters
|
||||
CallSignature index("StoreBarrier", 0, 4, ArgumentsOrder::DEFAULT_ORDER, VariableType::VOID());
|
||||
*callSign = index;
|
||||
// 4 : 4 input parameters
|
||||
std::array<VariableType, 4> params = {
|
||||
VariableType::NATIVE_POINTER(),
|
||||
VariableType::JS_POINTER(),
|
||||
VariableType::NATIVE_POINTER(),
|
||||
VariableType::JS_POINTER()
|
||||
};
|
||||
callSign->SetParameters(params.data());
|
||||
callSign->SetGCLeafFunction(true);
|
||||
callSign->SetTargetKind(CallSignature::TargetKind::RUNTIME_STUB_NO_GC);
|
||||
}
|
||||
|
||||
DEF_CALL_SIGNATURE(CallArg0)
|
||||
{
|
||||
// 2 : 2 input parameters
|
||||
|
@ -356,6 +356,7 @@ private:
|
||||
V(FloatMod) \
|
||||
V(FindElementWithCache) \
|
||||
V(MarkingBarrier) \
|
||||
V(StoreBarrier) \
|
||||
V(CallArg0) \
|
||||
V(CallArg1) \
|
||||
V(CallArgs2) \
|
||||
|
@ -31,9 +31,9 @@ GateRef CircuitBuilder::False()
|
||||
return TruncInt32ToInt1(Int32(0));
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::Undefined(VariableType type)
|
||||
GateRef CircuitBuilder::Undefined()
|
||||
{
|
||||
return UndefineConstant(type.GetGateType());
|
||||
return UndefineConstant();
|
||||
}
|
||||
|
||||
// memory
|
||||
@ -177,11 +177,14 @@ GateRef CircuitBuilder::Int32ToTaggedPtr(GateRef x)
|
||||
// bit operation
|
||||
GateRef CircuitBuilder::IsSpecial(GateRef x, JSTaggedType type)
|
||||
{
|
||||
return Equal(x, Int64(type));
|
||||
auto specialValue = circuit_->GetConstantGate(
|
||||
MachineType::I64, type, GateType::TaggedValue());
|
||||
return Equal(x, specialValue);
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsInt(GateRef x)
|
||||
{
|
||||
x = ChangeTaggedPointerToInt64(x);
|
||||
return Equal(Int64And(x, Int64(JSTaggedValue::TAG_MARK)),
|
||||
Int64(JSTaggedValue::TAG_INT));
|
||||
}
|
||||
@ -193,6 +196,7 @@ GateRef CircuitBuilder::TaggedIsDouble(GateRef x)
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsObject(GateRef x)
|
||||
{
|
||||
x = ChangeTaggedPointerToInt64(x);
|
||||
return Equal(Int64And(x, Int64(JSTaggedValue::TAG_MARK)),
|
||||
Int64(JSTaggedValue::TAG_OBJECT));
|
||||
}
|
||||
@ -204,33 +208,34 @@ GateRef CircuitBuilder::TaggedIsNumber(GateRef x)
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsHole(GateRef x)
|
||||
{
|
||||
return Equal(x, Int64(JSTaggedValue::VALUE_HOLE));
|
||||
return Equal(x, HoleConstant());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsNotHole(GateRef x)
|
||||
{
|
||||
return NotEqual(x, Int64(JSTaggedValue::VALUE_HOLE));
|
||||
return NotEqual(x, HoleConstant());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsUndefined(GateRef x)
|
||||
{
|
||||
return Equal(x, Int64(JSTaggedValue::VALUE_UNDEFINED));
|
||||
return Equal(x, UndefineConstant());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsException(GateRef x)
|
||||
{
|
||||
return Equal(x, Int64(JSTaggedValue::VALUE_EXCEPTION));
|
||||
return Equal(x, ExceptionConstant());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsSpecial(GateRef x)
|
||||
{
|
||||
return BoolOr(
|
||||
Equal(Int64And(x, Int64(JSTaggedValue::TAG_SPECIAL_MASK)), Int64(JSTaggedValue::TAG_SPECIAL)),
|
||||
Equal(Int64And(ChangeTaggedPointerToInt64(x), Int64(JSTaggedValue::TAG_SPECIAL_MASK)), Int64(JSTaggedValue::TAG_SPECIAL)),
|
||||
TaggedIsHole(x));
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsHeapObject(GateRef x)
|
||||
{
|
||||
x = ChangeTaggedPointerToInt64(x);
|
||||
return Equal(Int64And(x, Int64(JSTaggedValue::TAG_HEAPOBJECT_MASK)), Int64(0));
|
||||
}
|
||||
|
||||
@ -261,7 +266,7 @@ GateRef CircuitBuilder::TaggedIsPropertyBox(GateRef x)
|
||||
GateRef CircuitBuilder::TaggedIsWeak(GateRef x)
|
||||
{
|
||||
return LogicAnd(TaggedIsHeapObject(x),
|
||||
Equal(Int64And(x, Int64(JSTaggedValue::TAG_WEAK)), Int64(1)));
|
||||
Equal(Int64And(ChangeTaggedPointerToInt64(x), Int64(JSTaggedValue::TAG_WEAK)), Int64(1)));
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsPrototypeHandler(GateRef x)
|
||||
@ -282,17 +287,17 @@ GateRef CircuitBuilder::TaggedIsUndefinedOrNull(GateRef x)
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsTrue(GateRef x)
|
||||
{
|
||||
return Equal(x, Int64(JSTaggedValue::VALUE_TRUE));
|
||||
return Equal(x, TaggedTrue());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsFalse(GateRef x)
|
||||
{
|
||||
return Equal(x, Int64(JSTaggedValue::VALUE_FALSE));
|
||||
return Equal(x, TaggedFalse());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsNull(GateRef x)
|
||||
{
|
||||
return Equal(x, Int64(JSTaggedValue::VALUE_NULL));
|
||||
return Equal(x, NullConstant());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedIsBoolean(GateRef x)
|
||||
@ -302,6 +307,7 @@ GateRef CircuitBuilder::TaggedIsBoolean(GateRef x)
|
||||
|
||||
GateRef CircuitBuilder::TaggedGetInt(GateRef x)
|
||||
{
|
||||
x = ChangeTaggedPointerToInt64(x);
|
||||
return TruncInt64ToInt32(Int64And(x, Int64(~JSTaggedValue::TAG_MARK)));
|
||||
}
|
||||
|
||||
@ -342,24 +348,23 @@ GateRef CircuitBuilder::DoubleToTagged(GateRef x)
|
||||
|
||||
GateRef CircuitBuilder::TaggedTrue()
|
||||
{
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_TRUE, GateType::NJSValue());
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_TRUE, GateType::TaggedValue());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::TaggedFalse()
|
||||
{
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_FALSE, GateType::NJSValue());
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_FALSE, GateType::TaggedValue());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::GetValueFromTaggedArray(VariableType returnType, GateRef array, GateRef index)
|
||||
GateRef CircuitBuilder::GetValueFromTaggedArray(GateRef array, GateRef index)
|
||||
{
|
||||
Label subentry(env_);
|
||||
SubCfgEntry(&subentry);
|
||||
Label exit(env_);
|
||||
Label isUndefined(env_);
|
||||
Label notUndefined(env_);
|
||||
GateRef initVal = GetCircuit()->GetConstantGate(returnType.GetMachineType(), JSTaggedValue::VALUE_UNDEFINED,
|
||||
returnType.GetGateType());
|
||||
DEFVAlUE(result, env_, returnType, initVal);
|
||||
GateRef initVal = UndefineConstant();
|
||||
DEFVAlUE(result, env_, VariableType::JS_ANY(), initVal);
|
||||
Branch(TaggedIsUndefined(array), &isUndefined, ¬Undefined);
|
||||
Bind(&isUndefined);
|
||||
{
|
||||
@ -369,7 +374,7 @@ GateRef CircuitBuilder::GetValueFromTaggedArray(VariableType returnType, GateRef
|
||||
{
|
||||
GateRef offset = PtrMul(ChangeInt32ToIntPtr(index), IntPtr(JSTaggedValue::TaggedTypeSize()));
|
||||
GateRef dataOffset = PtrAdd(offset, IntPtr(TaggedArray::DATA_OFFSET));
|
||||
result = Load(returnType, array, dataOffset);
|
||||
result = Load(VariableType::JS_ANY(), array, dataOffset);
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
@ -658,9 +663,9 @@ int CircuitBuilder::NextVariableId()
|
||||
return env_->NextVariableId();
|
||||
}
|
||||
|
||||
void CircuitBuilder::HandleException(GateRef result, Label *success, Label *fail, Label *exit, VariableType type)
|
||||
void CircuitBuilder::HandleException(GateRef result, Label *success, Label *fail, Label *exit)
|
||||
{
|
||||
Branch(Equal(result, ExceptionConstant(type.GetGateType())), fail, success);
|
||||
Branch(Equal(result, ExceptionConstant()), fail, success);
|
||||
Bind(fail);
|
||||
{
|
||||
Jump(exit);
|
||||
|
@ -64,8 +64,9 @@ GateRef CircuitBuilder::Selector(OpCode opcode, GateRef control,
|
||||
return circuit_->NewGate(opcode, valueCounts, inList, type.GetGateType());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::UndefineConstant(GateType type)
|
||||
GateRef CircuitBuilder::UndefineConstant()
|
||||
{
|
||||
auto type = GateType::TaggedValue();
|
||||
return circuit_->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_UNDEFINED, type);
|
||||
}
|
||||
|
||||
@ -224,18 +225,21 @@ GateRef CircuitBuilder::Double(double val)
|
||||
return GetCircuit()->GetConstantGate(MachineType::F64, bit_cast<int64_t>(val), GateType::NJSValue());
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::HoleConstant(GateType type)
|
||||
GateRef CircuitBuilder::HoleConstant()
|
||||
{
|
||||
auto type = GateType::TaggedValue();
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_HOLE, type);
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::NullConstant(GateType type)
|
||||
GateRef CircuitBuilder::NullConstant()
|
||||
{
|
||||
auto type = GateType::TaggedValue();
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_NULL, type);
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::ExceptionConstant(GateType type)
|
||||
GateRef CircuitBuilder::ExceptionConstant()
|
||||
{
|
||||
auto type = GateType::TaggedValue();
|
||||
return GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_EXCEPTION, type);
|
||||
}
|
||||
|
||||
@ -395,9 +399,8 @@ void CircuitBuilder::Store(VariableType type, GateRef glue, GateRef base, GateRe
|
||||
GateRef result = GetCircuit()->NewGate(OpCode(OpCode::STORE), 0, { depend, value, ptr }, type.GetGateType());
|
||||
label->SetDepend(result);
|
||||
if (type == VariableType::JS_POINTER() || type == VariableType::JS_ANY()) {
|
||||
CallStub(glue, CommonStubCSigns::SetValueWithBarrier, {glue, base, offset, value});
|
||||
CallStub(glue, CommonStubCSigns::SetValueWithBarrier, { glue, base, offset, value });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
GateRef CircuitBuilder::Alloca(int size)
|
||||
@ -893,7 +896,7 @@ GateRef Variable::TryRemoveTrivialPhi(GateRef phi)
|
||||
if (same == Gate::InvalidGateRef) {
|
||||
// the phi is unreachable or in the start block
|
||||
GateType type = acc.GetGateType(phi);
|
||||
same = env_->GetBuilder()->UndefineConstant(type);
|
||||
same = env_->GetCircuit()->GetConstantGate(MachineType::I64, JSTaggedValue::VALUE_UNDEFINED, type);
|
||||
}
|
||||
// remove the trivial phi
|
||||
// get all users of phi except self
|
||||
|
@ -221,10 +221,10 @@ public:
|
||||
GateRef IntPtr(int64_t val);
|
||||
GateRef Boolean(bool value);
|
||||
GateRef Double(double value);
|
||||
GateRef UndefineConstant(GateType type = GateType::TaggedValue());
|
||||
GateRef HoleConstant(GateType type = GateType::TaggedValue());
|
||||
GateRef NullConstant(GateType type = GateType::TaggedValue());
|
||||
GateRef ExceptionConstant(GateType type = GateType::TaggedValue());
|
||||
GateRef UndefineConstant();
|
||||
GateRef HoleConstant();
|
||||
GateRef NullConstant();
|
||||
GateRef ExceptionConstant();
|
||||
GateRef RelocatableData(uint64_t val);
|
||||
GateRef Alloca(int size);
|
||||
GateRef Branch(GateRef state, GateRef condition);
|
||||
@ -253,7 +253,7 @@ public:
|
||||
// constant
|
||||
inline GateRef True();
|
||||
inline GateRef False();
|
||||
inline GateRef Undefined(VariableType type = VariableType::JS_ANY());
|
||||
inline GateRef Undefined();
|
||||
|
||||
// call operation
|
||||
GateRef CallBCHandler(GateRef glue, GateRef target, const std::vector<GateRef> &args);
|
||||
@ -365,7 +365,7 @@ public:
|
||||
inline GateRef Int32Equal(GateRef x, GateRef y);
|
||||
template<OpCode::Op Op, MachineType Type>
|
||||
inline GateRef BinaryOp(GateRef x, GateRef y);
|
||||
inline GateRef GetValueFromTaggedArray(VariableType returnType, GateRef array, GateRef index);
|
||||
inline GateRef GetValueFromTaggedArray(GateRef array, GateRef index);
|
||||
inline void SetValueToTaggedArray(VariableType valType, GateRef glue, GateRef array, GateRef index, GateRef val);
|
||||
GateRef TaggedIsString(GateRef obj);
|
||||
GateRef TaggedIsStringOrSymbol(GateRef obj);
|
||||
@ -429,7 +429,7 @@ public:
|
||||
void NewEnvironment(GateRef hir);
|
||||
void DeleteCurrentEnvironment();
|
||||
inline int NextVariableId();
|
||||
inline void HandleException(GateRef result, Label *success, Label *exception, Label *exit, VariableType type);
|
||||
inline void HandleException(GateRef result, Label *success, Label *exception, Label *exit);
|
||||
inline void HandleException(GateRef result, Label *success, Label *fail, Label *exit, GateRef exceptionVal);
|
||||
inline void SubCfgEntry(Label *entry);
|
||||
inline void SubCfgExit();
|
||||
|
@ -30,7 +30,7 @@ void ICStubBuilder::NamedICAccessor(Variable* cachedHandler, Label *tryICHandler
|
||||
{
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
GateRef firstValue = GetValueFromTaggedArray(VariableType::JS_ANY(),
|
||||
GateRef firstValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, slotId_);
|
||||
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, ¬HeapObject);
|
||||
Bind(&isHeapObject);
|
||||
@ -68,7 +68,7 @@ void ICStubBuilder::ValuedICAccessor(Variable* cachedHandler, Label *tryICHandle
|
||||
{
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
GateRef firstValue = GetValueFromTaggedArray(VariableType::JS_ANY(),
|
||||
GateRef firstValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, slotId_);
|
||||
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, ¬HeapObject);
|
||||
Bind(&isHeapObject);
|
||||
@ -102,7 +102,7 @@ void ICStubBuilder::LoadICByName(Variable* result, Label* tryFastPath, Label *sl
|
||||
Label loadWithHandler(env);
|
||||
|
||||
SetLabels(tryFastPath, slowPath, success);
|
||||
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(),
|
||||
GateRef secondValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, Int32Add(slotId_, Int32(1)));
|
||||
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
||||
NamedICAccessor(&cachedHandler, &loadWithHandler);
|
||||
@ -120,7 +120,7 @@ void ICStubBuilder::StoreICByName(Variable* result, Label* tryFastPath, Label *s
|
||||
Label storeWithHandler(env);
|
||||
|
||||
SetLabels(tryFastPath, slowPath, success);
|
||||
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(),
|
||||
GateRef secondValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, Int32Add(slotId_, Int32(1)));
|
||||
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
||||
NamedICAccessor(&cachedHandler, &storeWithHandler);
|
||||
@ -139,7 +139,7 @@ void ICStubBuilder::LoadICByValue(Variable* result, Label* tryFastPath, Label *s
|
||||
Label loadElement(env);
|
||||
|
||||
SetLabels(tryFastPath, slowPath, success);
|
||||
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(),
|
||||
GateRef secondValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, Int32Add(slotId_, Int32(1)));
|
||||
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
||||
ValuedICAccessor(&cachedHandler, &loadWithHandler, &loadElement);
|
||||
@ -164,7 +164,7 @@ void ICStubBuilder::StoreICByValue(Variable* result, Label* tryFastPath, Label *
|
||||
Label storeElement(env);
|
||||
|
||||
SetLabels(tryFastPath, slowPath, success);
|
||||
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(),
|
||||
GateRef secondValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, Int32Add(slotId_, Int32(1)));
|
||||
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
||||
ValuedICAccessor(&cachedHandler, &storeWithHandler, &storeElement);
|
||||
|
@ -392,7 +392,7 @@ GateRef InterpreterStubBuilder::PushUndefined(GateRef glue, GateRef sp, GateRef
|
||||
Label pushUndefinedEnd(env);
|
||||
Branch(Int32LessThan(*i, num), &pushUndefinedBegin, &pushUndefinedEnd);
|
||||
LoopBegin(&pushUndefinedBegin);
|
||||
newSp = PushArg(glue, *newSp, Int64(JSTaggedValue::VALUE_UNDEFINED));
|
||||
newSp = PushArg(glue, *newSp, Undefined());
|
||||
i = Int32Add(*i, Int32(1)); // 1 : set as high 1 bits
|
||||
Branch(Int32LessThan(*i, num), &pushUndefinedAgain, &pushUndefinedEnd);
|
||||
Bind(&pushUndefinedAgain);
|
||||
@ -589,7 +589,7 @@ void InterpreterStubBuilder::DispatchDebuggerLast(GateRef glue, GateRef sp, Gate
|
||||
|
||||
GateRef InterpreterStubBuilder::GetObjectFromConstPool(GateRef constpool, GateRef index)
|
||||
{
|
||||
return GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, index);
|
||||
return GetValueFromTaggedArray(constpool, index);
|
||||
}
|
||||
|
||||
GateRef InterpreterStubBuilder::GetHotnessCounterFromMethod(GateRef method)
|
||||
|
@ -289,14 +289,14 @@ DECLARE_ASM_HANDLER(HandleLdglobal)
|
||||
DECLARE_ASM_HANDLER(HandleLdtrue)
|
||||
{
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
varAcc = Int64ToTaggedPtr(Int64(JSTaggedValue::VALUE_TRUE));
|
||||
varAcc = TaggedTrue();
|
||||
DISPATCH_WITH_ACC(LDTRUE);
|
||||
}
|
||||
|
||||
DECLARE_ASM_HANDLER(HandleLdfalse)
|
||||
{
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
varAcc = Int64ToTaggedPtr(Int64(JSTaggedValue::VALUE_FALSE));
|
||||
varAcc = TaggedFalse();
|
||||
DISPATCH_WITH_ACC(LDFALSE);
|
||||
}
|
||||
|
||||
@ -688,12 +688,12 @@ DECLARE_ASM_HANDLER(HandleNoteqImm8V8)
|
||||
Branch(TaggedIsTrue(*result), &resultIsTrue, &resultNotTrue);
|
||||
Bind(&resultIsTrue);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedFalse());
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&resultNotTrue);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedTrue());
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
}
|
||||
@ -778,12 +778,12 @@ DECLARE_ASM_HANDLER(HandleLessImm8V8)
|
||||
}
|
||||
Bind(&leftLessRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedTrue());
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&leftNotLessRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedFalse());
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
@ -873,12 +873,12 @@ DECLARE_ASM_HANDLER(HandleLesseqImm8V8)
|
||||
}
|
||||
Bind(&leftLessEqRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedTrue());
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&leftNotLessEqRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedFalse());
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
@ -968,12 +968,12 @@ DECLARE_ASM_HANDLER(HandleGreaterImm8V8)
|
||||
}
|
||||
Bind(&leftGreaterRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedTrue());
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&leftNotGreaterRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedFalse());
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
@ -1064,12 +1064,12 @@ DECLARE_ASM_HANDLER(HandleGreatereqImm8V8)
|
||||
}
|
||||
Bind(&leftGreaterEqRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedTrue());
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&leftNotGreaterEQRight);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedFalse());
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
@ -1604,13 +1604,13 @@ DECLARE_ASM_HANDLER(HandleStrictnoteqImm8V8)
|
||||
Branch(FastStrictEqual(glue, left, acc), &strictEqual, ¬StrictEqual);
|
||||
Bind(&strictEqual);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(Int64(JSTaggedValue::VALUE_FALSE));
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
|
||||
Bind(¬StrictEqual);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(Int64(JSTaggedValue::VALUE_TRUE));
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&dispatch);
|
||||
@ -1631,13 +1631,13 @@ DECLARE_ASM_HANDLER(HandleStricteqImm8V8)
|
||||
Branch(FastStrictEqual(glue, left, acc), &strictEqual, ¬StrictEqual);
|
||||
Bind(&strictEqual);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(Int64(JSTaggedValue::VALUE_TRUE));
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
|
||||
Bind(¬StrictEqual);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(Int64(JSTaggedValue::VALUE_FALSE));
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&dispatch);
|
||||
@ -3931,7 +3931,7 @@ DECLARE_ASM_HANDLER(HandleTryldglobalbynameImm8Id16)
|
||||
{
|
||||
DEFVARIABLE(icResult, VariableType::JS_ANY(), Undefined());
|
||||
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
||||
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
Label ldMiss(env);
|
||||
@ -4010,7 +4010,7 @@ DECLARE_ASM_HANDLER(HandleTryldglobalbynameImm16Id16)
|
||||
{
|
||||
DEFVARIABLE(icResult, VariableType::JS_ANY(), Undefined());
|
||||
GateRef slotId = ZExtInt16ToInt32(ReadInst16_0(pc));
|
||||
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
Label ldMiss(env);
|
||||
@ -4088,7 +4088,7 @@ DECLARE_ASM_HANDLER(HandleTrystglobalbynameImm8Id16)
|
||||
Bind(&icAvailable);
|
||||
{
|
||||
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
||||
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Label isHeapObject(env);
|
||||
Label stMiss(env);
|
||||
Branch(TaggedIsHeapObject(handler), &isHeapObject, &stMiss);
|
||||
@ -4156,7 +4156,7 @@ DECLARE_ASM_HANDLER(HandleTrystglobalbynameImm16Id16)
|
||||
Bind(&icAvailable);
|
||||
{
|
||||
GateRef slotId = ZExtInt16ToInt32(ReadInst16_0(pc));
|
||||
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Label isHeapObject(env);
|
||||
Label stMiss(env);
|
||||
Branch(TaggedIsHeapObject(handler), &isHeapObject, &stMiss);
|
||||
@ -4228,7 +4228,7 @@ DECLARE_ASM_HANDLER(HandleLdglobalvarImm16Id16)
|
||||
Bind(&icAvailable);
|
||||
{
|
||||
GateRef slotId = ZExtInt16ToInt32(ReadInst16_0(pc));
|
||||
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
Label ldMiss(env);
|
||||
@ -4285,7 +4285,7 @@ DECLARE_ASM_HANDLER(HandleStglobalvarImm16Id16)
|
||||
Bind(&icAvailable);
|
||||
{
|
||||
GateRef slotId = ZExtInt16ToInt32(ReadInst16_0(pc));
|
||||
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Label isHeapObject(env);
|
||||
Label stMiss(env);
|
||||
Branch(TaggedIsHeapObject(handler), &isHeapObject, &stMiss);
|
||||
@ -4354,12 +4354,12 @@ DECLARE_ASM_HANDLER(HandleIsfalse)
|
||||
Branch(TaggedIsTrue(result), &isTrue, &isFalse);
|
||||
Bind(&isTrue);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedFalse());
|
||||
varAcc = TaggedFalse();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&isFalse);
|
||||
{
|
||||
varAcc = Int64ToTaggedPtr(TaggedTrue());
|
||||
varAcc = TaggedTrue();
|
||||
Jump(&dispatch);
|
||||
}
|
||||
Bind(&dispatch);
|
||||
@ -4755,7 +4755,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedLdobjbyvaluePrefV8V8)
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(LoadICByValue),
|
||||
// 0xFF: invalied slot id
|
||||
{ Undefined(VariableType::INT64()), receiver, propKey, IntToTaggedInt(Int32(0xFF)) });
|
||||
{ Undefined(), receiver, propKey, IntToTaggedInt(Int32(0xFF)) });
|
||||
Jump(&checkException);
|
||||
}
|
||||
Bind(&checkException);
|
||||
@ -5340,7 +5340,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedLdobjbynamePrefId32V8)
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(LoadICByName),
|
||||
// 0xFF: invalied slot id
|
||||
{ Undefined(VariableType::INT64()), receiver, propKey, IntToTaggedInt(Int32(0xFF)) });
|
||||
{ Undefined(), receiver, propKey, IntToTaggedInt(Int32(0xFF)) });
|
||||
Jump(&checkException);
|
||||
}
|
||||
Bind(&checkException);
|
||||
|
@ -1628,14 +1628,7 @@ void LLVMIRBuilder::VisitCmp(GateRef gate, GateRef e1, GateRef e2)
|
||||
}
|
||||
}
|
||||
if (e1ValCode == MachineType::I32 || e1ValCode == MachineType::I64 || e1ValCode == MachineType::ARCH) {
|
||||
if (LLVMGetTypeKind(LLVMTypeOf(e1Value)) == LLVMPointerTypeKind &&
|
||||
LLVMGetTypeKind(LLVMTypeOf(e2Value)) == LLVMPointerTypeKind) {
|
||||
result = LLVMBuildICmp(builder_, intOpcode, e1Value, e2Value, "");
|
||||
} else {
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
result = LLVMBuildICmp(builder_, intOpcode, e1Value, e2Value, "");
|
||||
}
|
||||
result = LLVMBuildICmp(builder_, intOpcode, e1Value, e2Value, "");
|
||||
} else if (e1ValCode == MachineType::F64) {
|
||||
result = LLVMBuildFCmp(builder_, realOpcode, e1Value, e2Value, "");
|
||||
} else {
|
||||
@ -1708,9 +1701,6 @@ void LLVMIRBuilder::VisitIntOr(GateRef gate, GateRef e1, GateRef e2)
|
||||
{
|
||||
LLVMValueRef e1Value = gate2LValue_[e1];
|
||||
LLVMValueRef e2Value = gate2LValue_[e2];
|
||||
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
LLVMValueRef result = LLVMBuildOr(builder_, e1Value, e2Value, "");
|
||||
gate2LValue_[gate] = result;
|
||||
}
|
||||
@ -1726,8 +1716,6 @@ void LLVMIRBuilder::VisitIntAnd(GateRef gate, GateRef e1, GateRef e2)
|
||||
{
|
||||
LLVMValueRef e1Value = gate2LValue_[e1];
|
||||
LLVMValueRef e2Value = gate2LValue_[e2];
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
LLVMValueRef result = LLVMBuildAnd(builder_, e1Value, e2Value, "");
|
||||
gate2LValue_[gate] = result;
|
||||
}
|
||||
@ -1736,8 +1724,6 @@ void LLVMIRBuilder::VisitIntXor(GateRef gate, GateRef e1, GateRef e2)
|
||||
{
|
||||
LLVMValueRef e1Value = gate2LValue_[e1];
|
||||
LLVMValueRef e2Value = gate2LValue_[e2];
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
LLVMValueRef result = LLVMBuildXor(builder_, e1Value, e2Value, "");
|
||||
gate2LValue_[gate] = result;
|
||||
}
|
||||
@ -1746,8 +1732,6 @@ void LLVMIRBuilder::VisitIntLsr(GateRef gate, GateRef e1, GateRef e2)
|
||||
{
|
||||
LLVMValueRef e1Value = gate2LValue_[e1];
|
||||
LLVMValueRef e2Value = gate2LValue_[e2];
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
LLVMValueRef result = LLVMBuildLShr(builder_, e1Value, e2Value, "");
|
||||
gate2LValue_[gate] = result;
|
||||
}
|
||||
@ -1756,8 +1740,6 @@ void LLVMIRBuilder::VisitIntAsr(GateRef gate, GateRef e1, GateRef e2)
|
||||
{
|
||||
LLVMValueRef e1Value = gate2LValue_[e1];
|
||||
LLVMValueRef e2Value = gate2LValue_[e2];
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
LLVMValueRef result = LLVMBuildAShr(builder_, e1Value, e2Value, "");
|
||||
gate2LValue_[gate] = result;
|
||||
}
|
||||
@ -1773,8 +1755,6 @@ void LLVMIRBuilder::VisitIntLsl(GateRef gate, GateRef e1, GateRef e2)
|
||||
{
|
||||
LLVMValueRef e1Value = gate2LValue_[e1];
|
||||
LLVMValueRef e2Value = gate2LValue_[e2];
|
||||
e1Value = CanonicalizeToInt(e1Value);
|
||||
e2Value = CanonicalizeToInt(e2Value);
|
||||
LLVMValueRef result = LLVMBuildShl(builder_, e1Value, e2Value, "");
|
||||
gate2LValue_[gate] = result;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ void SlowPathLowering::ReplaceHirToCall(GateRef hirGate, GateRef callGate, bool
|
||||
GateRef ifBranch;
|
||||
if (!noThrow) {
|
||||
// exception value
|
||||
GateRef exceptionVal = builder_.ExceptionConstant(GateType::TaggedNPointer());
|
||||
GateRef exceptionVal = builder_.ExceptionConstant();
|
||||
// compare with trampolines result
|
||||
GateRef equal = builder_.BinaryLogic(OpCode(OpCode::EQ), callGate, exceptionVal);
|
||||
ifBranch = builder_.Branch(stateInGate, equal);
|
||||
@ -232,7 +232,7 @@ GateRef SlowPathLowering::GetConstPool(GateRef jsFunc)
|
||||
GateRef SlowPathLowering::GetObjectFromConstPool(GateRef jsFunc, GateRef index)
|
||||
{
|
||||
GateRef constPool = GetConstPool(jsFunc);
|
||||
return builder_.GetValueFromTaggedArray(VariableType::JS_ANY(), constPool, index);
|
||||
return builder_.GetValueFromTaggedArray(constPool, index);
|
||||
}
|
||||
|
||||
// labelmanager must be initialized
|
||||
@ -1139,7 +1139,7 @@ void SlowPathLowering::LowerExceptionHandler(GateRef hirGate)
|
||||
GateRef loadException = circuit_->NewGate(OpCode(OpCode::LOAD), VariableType::JS_ANY().GetMachineType(),
|
||||
0, { depend, val }, VariableType::JS_ANY().GetGateType());
|
||||
acc_.SetDep(loadException, depend);
|
||||
GateRef holeCst = builder_.HoleConstant(VariableType::JS_ANY().GetGateType());
|
||||
GateRef holeCst = builder_.HoleConstant();
|
||||
GateRef clearException = circuit_->NewGate(OpCode(OpCode::STORE), 0,
|
||||
{ loadException, holeCst, val }, VariableType::INT64().GetGateType());
|
||||
auto uses = acc_.Uses(hirGate);
|
||||
@ -1466,12 +1466,12 @@ void SlowPathLowering::LowerFastStrictNotEqual(GateRef gate, GateRef glue)
|
||||
¬StrictEqual);
|
||||
builder_.Bind(&strictEqual);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(¬StrictEqual);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&exit);
|
||||
@ -1497,12 +1497,12 @@ void SlowPathLowering::LowerFastStrictEqual(GateRef gate, GateRef glue)
|
||||
¬StrictEqual);
|
||||
builder_.Bind(&strictEqual);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(¬StrictEqual);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&exit);
|
||||
@ -1939,13 +1939,13 @@ void SlowPathLowering::LowerIsTrueOrFalse(GateRef gate, GateRef glue, bool flag)
|
||||
builder_.Bind(&isTrue);
|
||||
{
|
||||
auto trueResult = flag ? builder_.TaggedTrue() : builder_.TaggedFalse();
|
||||
result = builder_.Int64ToTaggedPtr(trueResult);
|
||||
result = trueResult;
|
||||
builder_.Jump(&successExit);
|
||||
}
|
||||
builder_.Bind(&isFalse);
|
||||
{
|
||||
auto falseResult = flag ? builder_.TaggedFalse() : builder_.TaggedTrue();
|
||||
result = builder_.Int64ToTaggedPtr(falseResult);
|
||||
result = falseResult;
|
||||
builder_.Jump(&successExit);
|
||||
}
|
||||
builder_.Bind(&successExit);
|
||||
@ -2896,14 +2896,14 @@ void SlowPathLowering::LowerLdLexVar(GateRef gate, GateRef glue)
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopHead, &afterLoop);
|
||||
builder_.LoopBegin(&loopHead);
|
||||
GateRef index = builder_.Int32(LexicalEnv::PARENT_ENV_INDEX);
|
||||
currentEnv = builder_.GetValueFromTaggedArray(VariableType::JS_ANY(), *currentEnv, index);
|
||||
currentEnv = builder_.GetValueFromTaggedArray(*currentEnv, index);
|
||||
i = builder_.Int32Add(*i, builder_.Int32(1));
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
||||
builder_.Bind(&loopEnd);
|
||||
builder_.LoopEnd(&loopHead);
|
||||
builder_.Bind(&afterLoop);
|
||||
GateRef valueIndex = builder_.Int32Add(slot, builder_.Int32(LexicalEnv::RESERVED_ENV_LENGTH));
|
||||
GateRef result = builder_.GetValueFromTaggedArray(VariableType::JS_ANY(), *currentEnv, valueIndex);
|
||||
GateRef result = builder_.GetValueFromTaggedArray(*currentEnv, valueIndex);
|
||||
successControl.emplace_back(builder_.GetState());
|
||||
successControl.emplace_back(builder_.GetDepend());
|
||||
exceptionControl.emplace_back(Circuit::NullGate());
|
||||
@ -2930,7 +2930,7 @@ void SlowPathLowering::LowerStLexVar(GateRef gate, GateRef glue)
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopHead, &afterLoop);
|
||||
builder_.LoopBegin(&loopHead);
|
||||
GateRef index = builder_.Int32(LexicalEnv::PARENT_ENV_INDEX);
|
||||
currentEnv = builder_.GetValueFromTaggedArray(VariableType::JS_ANY(), *currentEnv, index);
|
||||
currentEnv = builder_.GetValueFromTaggedArray(*currentEnv, index);
|
||||
i = builder_.Int32Add(*i, builder_.Int32(1));
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
||||
builder_.Bind(&loopEnd);
|
||||
|
@ -90,24 +90,24 @@ inline GateRef StubBuilder::Double(double value)
|
||||
return env_->GetBuilder()->Double(value);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::Undefined(VariableType type)
|
||||
inline GateRef StubBuilder::Undefined()
|
||||
{
|
||||
return env_->GetBuilder()->UndefineConstant(type.GetGateType());
|
||||
return env_->GetBuilder()->UndefineConstant();
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::Hole(VariableType type)
|
||||
inline GateRef StubBuilder::Hole()
|
||||
{
|
||||
return env_->GetBuilder()->HoleConstant(type.GetGateType());
|
||||
return env_->GetBuilder()->HoleConstant();
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::Null(VariableType type)
|
||||
inline GateRef StubBuilder::Null()
|
||||
{
|
||||
return env_->GetBuilder()->NullConstant(type.GetGateType());
|
||||
return env_->GetBuilder()->NullConstant();
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::Exception(VariableType type)
|
||||
inline GateRef StubBuilder::Exception()
|
||||
{
|
||||
return env_->GetBuilder()->ExceptionConstant(type.GetGateType());
|
||||
return env_->GetBuilder()->ExceptionConstant();
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::RelocatableData(uint64_t value)
|
||||
@ -1080,7 +1080,7 @@ inline GateRef StubBuilder::IsInlinedProperty(GateRef attr)
|
||||
inline GateRef StubBuilder::GetProtoCell(GateRef object)
|
||||
{
|
||||
GateRef protoCellOffset = IntPtr(PrototypeHandler::PROTO_CELL_OFFSET);
|
||||
return Load(VariableType::INT64(), object, protoCellOffset);
|
||||
return Load(VariableType::JS_POINTER(), object, protoCellOffset);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::GetPrototypeHandlerHolder(GateRef object)
|
||||
@ -1185,7 +1185,7 @@ inline GateRef StubBuilder::IsInternalAccessor(GateRef attr)
|
||||
inline GateRef StubBuilder::IsInvalidPropertyBox(GateRef obj)
|
||||
{
|
||||
GateRef valueOffset = IntPtr(PropertyBox::VALUE_OFFSET);
|
||||
GateRef value = Load(VariableType::INT64(), obj, valueOffset);
|
||||
GateRef value = Load(VariableType::JS_ANY(), obj, valueOffset);
|
||||
return TaggedIsHole(value);
|
||||
}
|
||||
|
||||
@ -1327,12 +1327,12 @@ inline void StubBuilder::SetPropertyInlinedProps(GateRef glue, GateRef obj, Gate
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::GetPropertyInlinedProps(GateRef obj, GateRef hClass,
|
||||
GateRef index, VariableType type)
|
||||
GateRef index)
|
||||
{
|
||||
GateRef inlinedPropsStart = GetInlinedPropsStartFromHClass(hClass);
|
||||
GateRef propOffset = Int32Mul(
|
||||
Int32Add(inlinedPropsStart, index), Int32(JSTaggedValue::TaggedTypeSize()));
|
||||
return Load(type, obj, ZExtInt32ToInt64(propOffset));
|
||||
return Load(VariableType::JS_ANY(), obj, ZExtInt32ToInt64(propOffset));
|
||||
}
|
||||
|
||||
inline void StubBuilder::IncNumberOfProps(GateRef glue, GateRef hClass)
|
||||
@ -1398,12 +1398,12 @@ inline void StubBuilder::SetValueToTaggedArray(VariableType valType, GateRef glu
|
||||
Store(valType, glue, array, dataOffset, val);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::GetValueFromTaggedArray(VariableType returnType, GateRef array, GateRef index)
|
||||
inline GateRef StubBuilder::GetValueFromTaggedArray(GateRef array, GateRef index)
|
||||
{
|
||||
GateRef offset =
|
||||
PtrMul(ChangeInt32ToIntPtr(index), IntPtr(JSTaggedValue::TaggedTypeSize()));
|
||||
GateRef dataOffset = PtrAdd(offset, IntPtr(TaggedArray::DATA_OFFSET));
|
||||
return Load(returnType, array, dataOffset);
|
||||
return Load(VariableType::JS_ANY(), array, dataOffset);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::IsSpecialIndexedObj(GateRef jsType)
|
||||
@ -1436,7 +1436,7 @@ inline GateRef StubBuilder::GetPropAttrFromLayoutInfo(GateRef layout, GateRef en
|
||||
{
|
||||
GateRef index = Int32Add(Int32LSL(entry, Int32(LayoutInfo::ELEMENTS_INDEX_LOG2)),
|
||||
Int32(LayoutInfo::ATTR_INDEX_OFFSET));
|
||||
return GetValueFromTaggedArray(VariableType::INT64(), layout, index);
|
||||
return TaggedCastToInt64(GetValueFromTaggedArray(layout, index));
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::GetPropertyMetaDataFromAttr(GateRef attr)
|
||||
@ -1448,7 +1448,7 @@ inline GateRef StubBuilder::GetPropertyMetaDataFromAttr(GateRef attr)
|
||||
inline GateRef StubBuilder::GetKeyFromLayoutInfo(GateRef layout, GateRef entry)
|
||||
{
|
||||
GateRef index = Int32LSL(entry, Int32(LayoutInfo::ELEMENTS_INDEX_LOG2));
|
||||
return GetValueFromTaggedArray(VariableType::JS_ANY(), layout, index);
|
||||
return GetValueFromTaggedArray(layout, index);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::GetPropertiesAddrFromLayoutInfo(GateRef layout)
|
||||
@ -1716,13 +1716,13 @@ inline GateRef StubBuilder::InYoungGeneration(GateRef region)
|
||||
inline GateRef StubBuilder::GetParentEnv(GateRef object)
|
||||
{
|
||||
GateRef index = Int32(LexicalEnv::PARENT_ENV_INDEX);
|
||||
return GetValueFromTaggedArray(VariableType::JS_ANY(), object, index);
|
||||
return GetValueFromTaggedArray(object, index);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::GetPropertiesFromLexicalEnv(GateRef object, GateRef index)
|
||||
{
|
||||
GateRef valueIndex = Int32Add(index, Int32(LexicalEnv::RESERVED_ENV_LENGTH));
|
||||
return GetValueFromTaggedArray(VariableType::JS_ANY(), object, valueIndex);
|
||||
return GetValueFromTaggedArray(object, valueIndex);
|
||||
}
|
||||
|
||||
inline void StubBuilder::SetPropertiesToLexicalEnv(GateRef glue, GateRef object, GateRef index, GateRef value)
|
||||
|
@ -188,7 +188,7 @@ GateRef StubBuilder::FindElementFromNumberDictionary(GateRef glue, GateRef eleme
|
||||
Label afterLoop(env);
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
GateRef element = GetKeyFromDictionary<NumberDictionary>(VariableType::JS_ANY(), elements, *entry);
|
||||
GateRef element = GetKeyFromDictionary<NumberDictionary>(elements, *entry);
|
||||
Label isHole(env);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(element), &isHole, ¬Hole);
|
||||
@ -271,7 +271,7 @@ GateRef StubBuilder::FindEntryFromNameDictionary(GateRef glue, GateRef elements,
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
GateRef element = GetKeyFromDictionary<NameDictionary>(VariableType::JS_ANY(), elements, *entry);
|
||||
GateRef element = GetKeyFromDictionary<NameDictionary>(elements, *entry);
|
||||
Label isHole(env);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(element), &isHole, ¬Hole);
|
||||
@ -381,7 +381,7 @@ GateRef StubBuilder::FindEntryFromTransitionDictionary(GateRef glue, GateRef ele
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
GateRef element = GetKeyFromDictionary<TransitionsDictionary>(VariableType::JS_ANY(), elements, *entry);
|
||||
GateRef element = GetKeyFromDictionary<TransitionsDictionary>(elements, *entry);
|
||||
Label isHole(env);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(element), &isHole, ¬Hole);
|
||||
@ -437,13 +437,13 @@ GateRef StubBuilder::FindEntryFromTransitionDictionary(GateRef glue, GateRef ele
|
||||
return ret;
|
||||
}
|
||||
|
||||
GateRef StubBuilder::JSObjectGetProperty(VariableType returnType, GateRef obj, GateRef hclass, GateRef attr)
|
||||
GateRef StubBuilder::JSObjectGetProperty(GateRef obj, GateRef hclass, GateRef attr)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label entry(env);
|
||||
env->SubCfgEntry(&entry);
|
||||
Label exit(env);
|
||||
DEFVARIABLE(result, returnType, Undefined(returnType));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label inlinedProp(env);
|
||||
Label notInlinedProp(env);
|
||||
GateRef attrOffset = GetOffsetFieldInPropAttr(attr);
|
||||
@ -451,7 +451,7 @@ GateRef StubBuilder::JSObjectGetProperty(VariableType returnType, GateRef obj, G
|
||||
{
|
||||
Bind(&inlinedProp);
|
||||
{
|
||||
result = GetPropertyInlinedProps(obj, hclass, attrOffset, returnType);
|
||||
result = GetPropertyInlinedProps(obj, hclass, attrOffset);
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(¬InlinedProp);
|
||||
@ -459,7 +459,7 @@ GateRef StubBuilder::JSObjectGetProperty(VariableType returnType, GateRef obj, G
|
||||
// compute outOfLineProp offset, get it and return
|
||||
GateRef array =
|
||||
Load(VariableType::INT64(), obj, IntPtr(JSObject::PROPERTIES_OFFSET));
|
||||
result = GetValueFromTaggedArray(returnType, array, Int32Sub(attrOffset,
|
||||
result = GetValueFromTaggedArray(array, Int32Sub(attrOffset,
|
||||
GetInlinedPropertiesFromHClass(hclass)));
|
||||
Jump(&exit);
|
||||
}
|
||||
@ -907,7 +907,21 @@ void StubBuilder::Store(VariableType type, GateRef glue, GateRef base, GateRef o
|
||||
OpCode(OpCode::STORE), 0, { depend, value, ptr }, type.GetGateType());
|
||||
env_->GetCurrentLabel()->SetDepend(result);
|
||||
if (type == VariableType::JS_POINTER() || type == VariableType::JS_ANY()) {
|
||||
SetValueWithBarrier(glue, base, offset, value);
|
||||
auto env = GetEnvironment();
|
||||
Label entry(env);
|
||||
env->SubCfgEntry(&entry);
|
||||
Label exit(env);
|
||||
Label isHeapObject(env);
|
||||
|
||||
Branch(TaggedIsHeapObject(value), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
UpdateLeaveFrameAndCallNGCRuntime(
|
||||
glue, RTSTUB_ID(StoreBarrier), { glue, base, offset, value });
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
env->SubCfgExit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -980,7 +994,6 @@ void StubBuilder::SetValueWithBarrier(GateRef glue, GateRef obj, GateRef offset,
|
||||
}
|
||||
Bind(&exit);
|
||||
env->SubCfgExit();
|
||||
return;
|
||||
}
|
||||
|
||||
GateRef StubBuilder::TaggedIsBigInt(GateRef obj)
|
||||
@ -1221,7 +1234,7 @@ GateRef StubBuilder::LoadFromField(GateRef receiver, GateRef handlerInfo)
|
||||
}
|
||||
Bind(&handlerInfoNotInlinedProps);
|
||||
{
|
||||
result = GetValueFromTaggedArray(VariableType::JS_ANY(), GetPropertiesArray(receiver), index);
|
||||
result = GetValueFromTaggedArray(GetPropertiesArray(receiver), index);
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
@ -1278,10 +1291,10 @@ GateRef StubBuilder::CheckPolyHClass(GateRef cachedValue, GateRef hclass)
|
||||
Branch(Int32UnsignedLessThan(*i, length), &iLessLength, &exit);
|
||||
Bind(&iLessLength);
|
||||
{
|
||||
GateRef element = GetValueFromTaggedArray(VariableType::JS_ANY(), cachedValue, *i);
|
||||
GateRef element = GetValueFromTaggedArray(cachedValue, *i);
|
||||
Branch(Equal(LoadObjectFromWeakRef(element), hclass), &hasHclass, &loopEnd);
|
||||
Bind(&hasHclass);
|
||||
result = GetValueFromTaggedArray(VariableType::JS_ANY(), cachedValue,
|
||||
result = GetValueFromTaggedArray(cachedValue,
|
||||
Int32Add(*i, Int32(1)));
|
||||
Jump(&exit);
|
||||
}
|
||||
@ -1392,7 +1405,7 @@ GateRef StubBuilder::LoadElement(GateRef receiver, GateRef key)
|
||||
Bind(&lengthLessIndex);
|
||||
Jump(&exit);
|
||||
Bind(&lengthNotLessIndex);
|
||||
result = GetValueFromTaggedArray(VariableType::JS_ANY(), elements, index);
|
||||
result = GetValueFromTaggedArray(elements, index);
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
@ -1717,28 +1730,29 @@ GateRef StubBuilder::GetAttributesFromDictionary(GateRef elements, GateRef entry
|
||||
Int32Mul(entry, Int32(DictionaryT::ENTRY_SIZE)));
|
||||
GateRef attributesIndex =
|
||||
Int32Add(arrayIndex, Int32(DictionaryT::ENTRY_DETAILS_INDEX));
|
||||
return TaggedCastToInt32(GetValueFromTaggedArray(VariableType::INT64(), elements, attributesIndex));
|
||||
auto attrValue = GetValueFromTaggedArray(elements, attributesIndex);
|
||||
return TaggedCastToInt32(attrValue);
|
||||
}
|
||||
|
||||
template<typename DictionaryT>
|
||||
GateRef StubBuilder::GetValueFromDictionary(VariableType returnType, GateRef elements, GateRef entry)
|
||||
GateRef StubBuilder::GetValueFromDictionary(GateRef elements, GateRef entry)
|
||||
{
|
||||
GateRef arrayIndex =
|
||||
Int32Add(Int32(DictionaryT::TABLE_HEADER_SIZE),
|
||||
Int32Mul(entry, Int32(DictionaryT::ENTRY_SIZE)));
|
||||
GateRef valueIndex =
|
||||
Int32Add(arrayIndex, Int32(DictionaryT::ENTRY_VALUE_INDEX));
|
||||
return GetValueFromTaggedArray(returnType, elements, valueIndex);
|
||||
return GetValueFromTaggedArray(elements, valueIndex);
|
||||
}
|
||||
|
||||
template<typename DictionaryT>
|
||||
GateRef StubBuilder::GetKeyFromDictionary(VariableType returnType, GateRef elements, GateRef entry)
|
||||
GateRef StubBuilder::GetKeyFromDictionary(GateRef elements, GateRef entry)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
Label exit(env);
|
||||
DEFVARIABLE(result, returnType, Undefined());
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label ltZero(env);
|
||||
Label notLtZero(env);
|
||||
Label gtLength(env);
|
||||
@ -1756,7 +1770,7 @@ GateRef StubBuilder::GetKeyFromDictionary(VariableType returnType, GateRef eleme
|
||||
Bind(>Length);
|
||||
Jump(&exit);
|
||||
Bind(¬GtLength);
|
||||
result = GetValueFromTaggedArray(returnType, elements, arrayIndex);
|
||||
result = GetValueFromTaggedArray(elements, arrayIndex);
|
||||
Jump(&exit);
|
||||
Bind(&exit);
|
||||
auto ret = *result;
|
||||
@ -1854,7 +1868,7 @@ GateRef StubBuilder::GetPropertyByIndex(GateRef glue, GateRef receiver, GateRef
|
||||
{
|
||||
Label notHole(env);
|
||||
Label isHole(env);
|
||||
GateRef value = GetValueFromTaggedArray(VariableType::JS_ANY(), elements, index);
|
||||
GateRef value = GetValueFromTaggedArray(elements, index);
|
||||
Branch(TaggedIsNotHole(value), ¬Hole, &isHole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
@ -1881,7 +1895,7 @@ GateRef StubBuilder::GetPropertyByIndex(GateRef glue, GateRef receiver, GateRef
|
||||
Bind(¬NegtiveOne);
|
||||
{
|
||||
GateRef attr = GetAttributesFromDictionary<NumberDictionary>(elements, entryA);
|
||||
GateRef value = GetValueFromDictionary<NumberDictionary>(VariableType::JS_ANY(), elements, entryA);
|
||||
GateRef value = GetValueFromDictionary<NumberDictionary>(elements, entryA);
|
||||
Label isAccessor(env);
|
||||
Label notAccessor(env);
|
||||
Branch(IsAccessor(attr), &isAccessor, ¬Accessor);
|
||||
@ -2060,7 +2074,7 @@ GateRef StubBuilder::GetPropertyByName(GateRef glue, GateRef receiver, GateRef k
|
||||
// PropertyAttributes attr(layoutInfo->GetAttr(entry))
|
||||
GateRef propAttr = GetPropAttrFromLayoutInfo(layOutInfo, entryA);
|
||||
GateRef attr = TaggedCastToInt32(propAttr);
|
||||
GateRef value = JSObjectGetProperty(VariableType::JS_ANY(), *holder, hclass, attr);
|
||||
GateRef value = JSObjectGetProperty(*holder, hclass, attr);
|
||||
Label isAccessor(env);
|
||||
Label notAccessor(env);
|
||||
Branch(IsAccessor(attr), &isAccessor, ¬Accessor);
|
||||
@ -2094,7 +2108,7 @@ GateRef StubBuilder::GetPropertyByName(GateRef glue, GateRef receiver, GateRef k
|
||||
// auto value = dict->GetValue(entry)
|
||||
GateRef attr = GetAttributesFromDictionary<NameDictionary>(array, entryB);
|
||||
// auto attr = dict->GetAttributes(entry)
|
||||
GateRef value = GetValueFromDictionary<NameDictionary>(VariableType::JS_ANY(), array, entryB);
|
||||
GateRef value = GetValueFromDictionary<NameDictionary>(array, entryB);
|
||||
Label isAccessor1(env);
|
||||
Label notAccessor1(env);
|
||||
Branch(IsAccessor(attr), &isAccessor1, ¬Accessor1);
|
||||
@ -2141,10 +2155,9 @@ void StubBuilder::CopyAllHClass(GateRef glue, GateRef dstHClass, GateRef srcHCla
|
||||
SetPrototypeToHClass(VariableType::JS_POINTER(), glue, dstHClass, proto);
|
||||
SetBitFieldToHClass(glue, dstHClass, GetBitFieldFromHClass(srcHClass));
|
||||
SetNumberOfPropsToHClass(glue, dstHClass, GetNumberOfPropsFromHClass(srcHClass));
|
||||
SetTransitionsToHClass(VariableType::INT64(), glue, dstHClass, Int64(JSTaggedValue::VALUE_UNDEFINED));
|
||||
SetProtoChangeDetailsToHClass(VariableType::INT64(), glue, dstHClass,
|
||||
Int64(JSTaggedValue::VALUE_NULL));
|
||||
SetEnumCacheToHClass(VariableType::INT64(), glue, dstHClass, Int64(JSTaggedValue::VALUE_NULL));
|
||||
SetTransitionsToHClass(VariableType::INT64(), glue, dstHClass, Undefined());
|
||||
SetProtoChangeDetailsToHClass(VariableType::INT64(), glue, dstHClass, Null());
|
||||
SetEnumCacheToHClass(VariableType::INT64(), glue, dstHClass, Null());
|
||||
SetLayoutToHClass(VariableType::JS_POINTER(), glue, dstHClass, GetLayoutFromHClass(srcHClass));
|
||||
env->SubCfgExit();
|
||||
return;
|
||||
@ -2206,8 +2219,7 @@ GateRef StubBuilder::FindTransitions(GateRef glue, GateRef receiver, GateRef hcl
|
||||
Label notFound(env);
|
||||
Branch(Int32NotEqual(entryA, Int32(-1)), &isFound, ¬Found);
|
||||
Bind(&isFound);
|
||||
auto value = GetValueFromDictionary<TransitionsDictionary>(
|
||||
VariableType::JS_POINTER(), transition, entryA);
|
||||
auto value = GetValueFromDictionary<TransitionsDictionary>(transition, entryA);
|
||||
Label valueUndefined(env);
|
||||
Label valueNotUndefined(env);
|
||||
Branch(Int64NotEqual(value, Undefined()), &valueNotUndefined,
|
||||
@ -2301,7 +2313,7 @@ GateRef StubBuilder::SetPropertyByIndex(GateRef glue, GateRef receiver, GateRef
|
||||
}
|
||||
Bind(&inRange);
|
||||
{
|
||||
GateRef value1 = GetValueFromTaggedArray(VariableType::JS_ANY(), elements, index);
|
||||
GateRef value1 = GetValueFromTaggedArray(elements, index);
|
||||
Label notHole(env);
|
||||
if (useOwn) {
|
||||
Branch(Int64NotEqual(value1, Hole()), ¬Hole, &ifEnd);
|
||||
@ -2466,7 +2478,7 @@ GateRef StubBuilder::SetPropertyByName(GateRef glue, GateRef receiver, GateRef k
|
||||
Bind(&isAccessor);
|
||||
{
|
||||
// auto accessor = JSObject::Cast(holder)->GetProperty(hclass, attr)
|
||||
GateRef accessor = JSObjectGetProperty(VariableType::JS_ANY(), *holder, hclass, attr);
|
||||
GateRef accessor = JSObjectGetProperty(*holder, hclass, attr);
|
||||
Label shouldCall(env);
|
||||
// ShouldCallSetter(receiver, *holder, accessor, attr)
|
||||
Branch(ShouldCallSetter(receiver, *holder, accessor, attr), &shouldCall, ¬Accessor);
|
||||
@ -2531,8 +2543,7 @@ GateRef StubBuilder::SetPropertyByName(GateRef glue, GateRef receiver, GateRef k
|
||||
Bind(&isAccessor1);
|
||||
{
|
||||
// auto accessor = dict->GetValue(entry)
|
||||
GateRef accessor1 = GetValueFromDictionary<NameDictionary>(VariableType::JS_ANY(),
|
||||
array, entry1);
|
||||
GateRef accessor1 = GetValueFromDictionary<NameDictionary>(array, entry1);
|
||||
Label shouldCall1(env);
|
||||
Branch(ShouldCallSetter(receiver, *holder, accessor1, attr1), &shouldCall1, ¬Accessor1);
|
||||
Bind(&shouldCall1);
|
||||
@ -3011,13 +3022,13 @@ GateRef StubBuilder::FastEqual(GateRef left, GateRef right)
|
||||
Branch(DoubleIsNAN(doubleLeft), &leftIsNan, &leftNotDoubleOrLeftNotNan);
|
||||
Bind(&leftIsNan);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedFalse());
|
||||
result = TaggedFalse();
|
||||
Jump(&exit);
|
||||
}
|
||||
}
|
||||
Bind(&leftNotDoubleOrLeftNotNan);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedTrue());
|
||||
result = TaggedTrue();
|
||||
Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -3036,7 +3047,7 @@ GateRef StubBuilder::FastEqual(GateRef left, GateRef right)
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &leftNotNumberOrLeftNotIntOrRightNotInt);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedFalse());
|
||||
result = TaggedFalse();
|
||||
Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -3053,7 +3064,7 @@ GateRef StubBuilder::FastEqual(GateRef left, GateRef right)
|
||||
Branch(TaggedIsHeapObject(left), &leftIsHeapObject, &leftNotHeapObject);
|
||||
Bind(&leftIsHeapObject);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedFalse());
|
||||
result = TaggedFalse();
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&leftNotHeapObject);
|
||||
@ -3062,7 +3073,7 @@ GateRef StubBuilder::FastEqual(GateRef left, GateRef right)
|
||||
Branch(TaggedIsUndefinedOrNull(left), &leftIsUndefinedOrNull, &leftOrRightNotUndefinedOrNull);
|
||||
Bind(&leftIsUndefinedOrNull);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedTrue());
|
||||
result = TaggedTrue();
|
||||
Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -3078,7 +3089,7 @@ GateRef StubBuilder::FastEqual(GateRef left, GateRef right)
|
||||
Branch(TaggedIsSpecial(right), &rightIsSpecial, &leftNotBoolOrRightNotSpecial);
|
||||
Bind(&rightIsSpecial);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedFalse());
|
||||
result = TaggedFalse();
|
||||
Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -3166,12 +3177,12 @@ GateRef StubBuilder::FastToBoolean(GateRef value)
|
||||
}
|
||||
Bind(&returnTrue);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedTrue());
|
||||
result = TaggedTrue();
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&returnFalse);
|
||||
{
|
||||
result = Int64ToTaggedPtr(TaggedFalse());
|
||||
result = TaggedFalse();
|
||||
Jump(&exit);
|
||||
}
|
||||
|
||||
@ -3594,7 +3605,7 @@ GateRef StubBuilder::JSAPIContainerGet(GateRef glue, GateRef receiver, GateRef i
|
||||
Bind(&isVailedIndex);
|
||||
{
|
||||
GateRef elements = GetElementsArray(receiver);
|
||||
result = GetValueFromTaggedArray(VariableType::JS_ANY(), elements, index);
|
||||
result = GetValueFromTaggedArray(elements, index);
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(¬ValidIndex);
|
||||
@ -3655,7 +3666,7 @@ void StubBuilder::ReturnExceptionIfAbruptCompletion(GateRef glue)
|
||||
Label hasPendingException(env);
|
||||
GateRef exceptionOffset = IntPtr(JSThread::GlueData::GetExceptionOffset(env->IsArch32Bit()));
|
||||
GateRef exception = Load(VariableType::JS_ANY(), glue, exceptionOffset);
|
||||
Branch(Int64NotEqual(exception, Int64(JSTaggedValue::VALUE_HOLE)), &hasPendingException, &exit);
|
||||
Branch(TaggedIsNotHole(exception), &hasPendingException, &exit);
|
||||
Bind(&hasPendingException);
|
||||
Return(Exception());
|
||||
Bind(&exit);
|
||||
|
@ -59,10 +59,10 @@ public:
|
||||
GateRef False();
|
||||
GateRef Boolean(bool value);
|
||||
GateRef Double(double value);
|
||||
GateRef Undefined(VariableType type = VariableType::JS_ANY());
|
||||
GateRef Hole(VariableType type = VariableType::JS_ANY());
|
||||
GateRef Null(VariableType type = VariableType::JS_ANY());
|
||||
GateRef Exception(VariableType type = VariableType::JS_ANY());
|
||||
GateRef Undefined();
|
||||
GateRef Hole();
|
||||
GateRef Null();
|
||||
GateRef Exception();
|
||||
// parameter
|
||||
GateRef Argument(size_t index);
|
||||
GateRef Int1Argument(size_t index);
|
||||
@ -290,7 +290,7 @@ public:
|
||||
void SetPropertyInlinedProps(GateRef glue, GateRef obj, GateRef hClass,
|
||||
GateRef value, GateRef attrOffset, VariableType type = VariableType::JS_ANY());
|
||||
GateRef GetPropertyInlinedProps(GateRef obj, GateRef hClass,
|
||||
GateRef index, VariableType type = VariableType::JS_ANY());
|
||||
GateRef index);
|
||||
|
||||
void IncNumberOfProps(GateRef glue, GateRef hClass);
|
||||
GateRef GetNumberOfPropsFromHClass(GateRef hClass);
|
||||
@ -299,7 +299,7 @@ public:
|
||||
GateRef GetInlinedPropsStartFromHClass(GateRef hClass);
|
||||
GateRef GetInlinedPropertiesFromHClass(GateRef hClass);
|
||||
void ThrowTypeAndReturn(GateRef glue, int messageId, GateRef val);
|
||||
GateRef GetValueFromTaggedArray(VariableType returnType, GateRef elements, GateRef index);
|
||||
GateRef GetValueFromTaggedArray(GateRef elements, GateRef index);
|
||||
void SetValueToTaggedArray(VariableType valType, GateRef glue, GateRef array, GateRef index, GateRef val);
|
||||
void UpdateValueAndAttributes(GateRef glue, GateRef elements, GateRef index, GateRef value, GateRef attr);
|
||||
GateRef IsSpecialIndexedObj(GateRef jsType);
|
||||
@ -308,9 +308,9 @@ public:
|
||||
template<typename DictionaryT>
|
||||
GateRef GetAttributesFromDictionary(GateRef elements, GateRef entry);
|
||||
template<typename DictionaryT>
|
||||
GateRef GetValueFromDictionary(VariableType returnType, GateRef elements, GateRef entry);
|
||||
GateRef GetValueFromDictionary(GateRef elements, GateRef entry);
|
||||
template<typename DictionaryT>
|
||||
GateRef GetKeyFromDictionary(VariableType returnType, GateRef elements, GateRef entry);
|
||||
GateRef GetKeyFromDictionary(GateRef elements, GateRef entry);
|
||||
GateRef GetPropAttrFromLayoutInfo(GateRef layout, GateRef entry);
|
||||
GateRef GetPropertiesAddrFromLayoutInfo(GateRef layout);
|
||||
GateRef GetPropertyMetaDataFromAttr(GateRef attr);
|
||||
@ -321,7 +321,7 @@ public:
|
||||
GateRef FindEntryFromNameDictionary(GateRef glue, GateRef elements, GateRef key);
|
||||
GateRef IsMatchInTransitionDictionary(GateRef element, GateRef key, GateRef metaData, GateRef attr);
|
||||
GateRef FindEntryFromTransitionDictionary(GateRef glue, GateRef elements, GateRef key, GateRef metaData);
|
||||
GateRef JSObjectGetProperty(VariableType returnType, GateRef obj, GateRef hClass, GateRef propAttr);
|
||||
GateRef JSObjectGetProperty(GateRef obj, GateRef hClass, GateRef propAttr);
|
||||
void JSObjectSetProperty(GateRef glue, GateRef obj, GateRef hClass, GateRef attr, GateRef value);
|
||||
GateRef ShouldCallSetter(GateRef receiver, GateRef holder, GateRef accessor, GateRef attr);
|
||||
GateRef CallSetterHelper(GateRef glue, GateRef holder, GateRef accessor, GateRef value);
|
||||
|
@ -243,11 +243,11 @@ private:
|
||||
static constexpr uint32_t EMPTY_TYPE = 1 << 28; // 1 : means offset of empty type
|
||||
static constexpr uint32_t MIR_TYPE_MASK = MIR_BASE_BITS | EMPTY_TYPE;
|
||||
|
||||
static constexpr uint32_t NJS_VALUE = MIR_BASE_BITS; // (1110)
|
||||
static constexpr uint32_t NJS_VALUE = MIR_BASE_BITS; // (1110)
|
||||
static constexpr uint32_t TAGGED_VALUE = MIR_BASE_BITS & GC_MASK & NO_GC_MASK; // (1000)
|
||||
static constexpr uint32_t TAGGED_POINTER = MIR_BASE_BITS & GC_MASK; // (1010)
|
||||
static constexpr uint32_t TAGGED_NPOINTER = MIR_BASE_BITS & NO_GC_MASK; // (1100)
|
||||
static constexpr uint32_t EMPTY = NJS_VALUE + EMPTY_TYPE; // (1111)
|
||||
static constexpr uint32_t TAGGED_POINTER = MIR_BASE_BITS & GC_MASK; // (1010)
|
||||
static constexpr uint32_t TAGGED_NPOINTER = MIR_BASE_BITS & NO_GC_MASK; // (1100)
|
||||
static constexpr uint32_t EMPTY = NJS_VALUE + EMPTY_TYPE; // (1111)
|
||||
static constexpr uint32_t SIZE_BITS = 4;
|
||||
|
||||
static constexpr uint32_t VALID_BITS = sizeof(uint32_t) * 8;
|
||||
|
@ -431,7 +431,7 @@ void TypeLowering::ReplaceHirToCall(GateRef hirGate, GateRef callGate, bool noTh
|
||||
GateRef ifBranch;
|
||||
if (!noThrow) {
|
||||
// exception value
|
||||
GateRef exceptionVal = builder_.ExceptionConstant(GateType::TaggedNPointer());
|
||||
GateRef exceptionVal = builder_.ExceptionConstant();
|
||||
// compare with trampolines result
|
||||
GateRef equal = builder_.BinaryLogic(OpCode(OpCode::EQ), callGate, exceptionVal);
|
||||
ifBranch = builder_.Branch(stateInGate, equal);
|
||||
@ -740,12 +740,12 @@ GateRef TypeLowering::Less2Number(GateRef left, GateRef right)
|
||||
}
|
||||
builder_.Bind(&leftLessRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&leftGreaterEqRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&exit);
|
||||
@ -817,12 +817,12 @@ GateRef TypeLowering::LessEq2Number(GateRef left, GateRef right)
|
||||
}
|
||||
builder_.Bind(&leftLessEqRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&leftGreaterRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&exit);
|
||||
@ -1088,12 +1088,12 @@ GateRef TypeLowering::Less(GateRef left, GateRef right)
|
||||
}
|
||||
builder_.Bind(&leftLessRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&leftGreaterEqRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&exit);
|
||||
@ -1175,12 +1175,12 @@ GateRef TypeLowering::LessEq(GateRef left, GateRef right)
|
||||
}
|
||||
builder_.Bind(&leftLessEqRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&leftGreaterRight);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&exit);
|
||||
@ -1320,13 +1320,13 @@ GateRef TypeLowering::FastEqual(GateRef left, GateRef right)
|
||||
builder_.Branch(builder_.DoubleIsNAN(doubleLeft), &leftIsNan, &leftNotDoubleOrLeftNotNan);
|
||||
builder_.Bind(&leftIsNan);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
}
|
||||
builder_.Bind(&leftNotDoubleOrLeftNotNan);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -1346,7 +1346,7 @@ GateRef TypeLowering::FastEqual(GateRef left, GateRef right)
|
||||
builder_.Branch(builder_.TaggedIsInt(right), &rightIsInt, &leftNotNumberOrLeftNotIntOrRightNotInt);
|
||||
builder_.Bind(&rightIsInt);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -1365,7 +1365,7 @@ GateRef TypeLowering::FastEqual(GateRef left, GateRef right)
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(left), &leftIsHeapObject, &leftNotHeapObject);
|
||||
builder_.Bind(&leftIsHeapObject);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
builder_.Bind(&leftNotHeapObject);
|
||||
@ -1375,7 +1375,7 @@ GateRef TypeLowering::FastEqual(GateRef left, GateRef right)
|
||||
&leftOrRightNotUndefinedOrNull);
|
||||
builder_.Bind(&leftIsUndefinedOrNull);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -1391,7 +1391,7 @@ GateRef TypeLowering::FastEqual(GateRef left, GateRef right)
|
||||
builder_.Branch(builder_.TaggedIsSpecial(right), &rightIsSpecial, &leftNotBooleanOrRightNotSpecial);
|
||||
builder_.Bind(&rightIsSpecial);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&exit);
|
||||
}
|
||||
}
|
||||
@ -1758,12 +1758,12 @@ void TypeLowering::LowerTypeNotEq(GateRef gate)
|
||||
builder_.Branch(builder_.TaggedIsTrue(*result), &resultIsTrue, &resultIsFalse);
|
||||
builder_.Bind(&resultIsTrue);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedFalse());
|
||||
result = builder_.TaggedFalse();
|
||||
builder_.Jump(&successExit);
|
||||
}
|
||||
builder_.Bind(&resultIsFalse);
|
||||
{
|
||||
result = builder_.Int64ToTaggedPtr(builder_.TaggedTrue());
|
||||
result = builder_.TaggedTrue();
|
||||
builder_.Jump(&successExit);
|
||||
}
|
||||
}
|
||||
|
@ -2009,6 +2009,23 @@ void RuntimeStubs::MarkingBarrier([[maybe_unused]]uintptr_t argGlue,
|
||||
Barriers::Update(slotAddr, objectRegion, value, valueRegion);
|
||||
}
|
||||
|
||||
void RuntimeStubs::StoreBarrier([[maybe_unused]]uintptr_t argGlue,
|
||||
uintptr_t object, size_t offset, TaggedObject *value)
|
||||
{
|
||||
uintptr_t slotAddr = object + offset;
|
||||
Region *objectRegion = Region::ObjectAddressToRange(object);
|
||||
Region *valueRegion = Region::ObjectAddressToRange(value);
|
||||
if (!objectRegion->InYoungSpace() && valueRegion->InYoungSpace()) {
|
||||
// Should align with '8' in 64 and 32 bit platform
|
||||
ASSERT((slotAddr % static_cast<uint8_t>(MemAlignment::MEM_ALIGN_OBJECT)) == 0);
|
||||
objectRegion->InsertOldToNewRSet(slotAddr);
|
||||
}
|
||||
if (!valueRegion->IsMarking()) {
|
||||
return;
|
||||
}
|
||||
Barriers::Update(slotAddr, objectRegion, value, valueRegion);
|
||||
}
|
||||
|
||||
bool RuntimeStubs::StringsAreEquals(EcmaString *str1, EcmaString *str2)
|
||||
{
|
||||
return EcmaString::StringsAreEqualSameUtfEncoding(str1, str2);
|
||||
|
@ -86,6 +86,7 @@ using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uintptr_t prevFp,
|
||||
V(FatalPrint) \
|
||||
V(InsertOldToNewRSet) \
|
||||
V(MarkingBarrier) \
|
||||
V(StoreBarrier) \
|
||||
V(DoubleToInt) \
|
||||
V(FloatMod) \
|
||||
V(FindElementWithCache) \
|
||||
@ -323,6 +324,8 @@ public:
|
||||
static void FatalPrint(int fmtMessageId, ...);
|
||||
static void MarkingBarrier([[maybe_unused]]uintptr_t argGlue,
|
||||
uintptr_t object, size_t offset, TaggedObject *value);
|
||||
static void StoreBarrier([[maybe_unused]]uintptr_t argGlue,
|
||||
uintptr_t object, size_t offset, TaggedObject *value);
|
||||
static JSTaggedType CreateArrayFromList([[maybe_unused]]uintptr_t argGlue, int32_t argc, JSTaggedValue *argv);
|
||||
static void InsertOldToNewRSet([[maybe_unused]]uintptr_t argGlue, uintptr_t object, size_t offset);
|
||||
static int32_t DoubleToInt(double x);
|
||||
|
Loading…
Reference in New Issue
Block a user