mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-06 23:54:03 +00:00
Code comment Enhancement
1. Add code commment for Branch 2. Complete code comment for Call Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I98RSO?from=project-issue Signed-off-by: zhangyukun8 <zhangyukun8@huawei.com> Change-Id: I7bd9e8914ed792eac9455db562fd61357e1b2562
This commit is contained in:
parent
c4e2e5053c
commit
bf154699e8
@ -40,7 +40,7 @@ GateRef AccessObjectStubBuilder::LoadObjByName(GateRef glue, GateRef receiver, G
|
||||
{
|
||||
GateRef propKey = ResolvePropKey(glue, prop, info);
|
||||
result = GetPropertyByName(glue, receiver, propKey, callback, True());
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -67,11 +67,11 @@ GateRef AccessObjectStubBuilder::DeprecatedLoadObjByName(GateRef glue, GateRef r
|
||||
Label slowPath(env);
|
||||
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
Bind(&fastPath);
|
||||
{
|
||||
result = GetPropertyByName(glue, receiver, propKey, ProfileOperation(), True());
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -104,7 +104,7 @@ GateRef AccessObjectStubBuilder::StoreObjByName(GateRef glue, GateRef receiver,
|
||||
{
|
||||
GateRef propKey = ResolvePropKey(glue, prop, info);
|
||||
result = SetPropertyByName(glue, receiver, propKey, value, false, True(), callback);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -154,7 +154,7 @@ GateRef AccessObjectStubBuilder::LoadObjByValue(GateRef glue, GateRef receiver,
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
result = GetPropertyByValue(glue, receiver, key, callback);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -180,11 +180,11 @@ GateRef AccessObjectStubBuilder::DeprecatedLoadObjByValue(GateRef glue, GateRef
|
||||
Label slowPath(env);
|
||||
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
Bind(&fastPath);
|
||||
{
|
||||
result = GetPropertyByValue(glue, receiver, key, ProfileOperation());
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -215,7 +215,7 @@ GateRef AccessObjectStubBuilder::StoreObjByValue(GateRef glue, GateRef receiver,
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
result = SetPropertyByValue(glue, receiver, key, value, false, callback);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -246,16 +246,16 @@ GateRef AccessObjectStubBuilder::StoreOwnByIndex(GateRef glue, GateRef receiver,
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
Label isHeapObject(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
Bind(&isHeapObject);
|
||||
Label notClassConstructor(env);
|
||||
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
Label notClassPrototype(env);
|
||||
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
BRANCH(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
Bind(¬ClassPrototype);
|
||||
result = SetPropertyByIndex(glue, receiver, index, value, true);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -293,7 +293,7 @@ GateRef AccessObjectStubBuilder::TryLoadGlobalByName(GateRef glue, GateRef prop,
|
||||
GateRef record = LdGlobalRecord(glue, propKey);
|
||||
Label foundInRecord(env);
|
||||
Label notFoundInRecord(env);
|
||||
Branch(TaggedIsUndefined(record), ¬FoundInRecord, &foundInRecord);
|
||||
BRANCH(TaggedIsUndefined(record), ¬FoundInRecord, &foundInRecord);
|
||||
Bind(&foundInRecord);
|
||||
{
|
||||
result = Load(VariableType::JS_ANY(), record, IntPtr(PropertyBox::VALUE_OFFSET));
|
||||
@ -303,7 +303,7 @@ GateRef AccessObjectStubBuilder::TryLoadGlobalByName(GateRef glue, GateRef prop,
|
||||
{
|
||||
GateRef globalObject = GetGlobalObject(glue);
|
||||
result = GetGlobalOwnProperty(glue, globalObject, propKey, callback);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
}
|
||||
Bind(&slowPath);
|
||||
@ -342,7 +342,7 @@ GateRef AccessObjectStubBuilder::TryStoreGlobalByName(GateRef glue, GateRef prop
|
||||
GateRef record = LdGlobalRecord(glue, propKey);
|
||||
Label foundInRecord(env);
|
||||
Label notFoundInRecord(env);
|
||||
Branch(TaggedIsUndefined(record), ¬FoundInRecord, &foundInRecord);
|
||||
BRANCH(TaggedIsUndefined(record), ¬FoundInRecord, &foundInRecord);
|
||||
Bind(&foundInRecord);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(TryUpdateGlobalRecord), { propKey, value });
|
||||
@ -354,7 +354,7 @@ GateRef AccessObjectStubBuilder::TryStoreGlobalByName(GateRef glue, GateRef prop
|
||||
result = GetGlobalOwnProperty(glue, globalObject, propKey, callback);
|
||||
Label isFoundInGlobal(env);
|
||||
Label notFoundInGlobal(env);
|
||||
Branch(TaggedIsHole(*result), ¬FoundInGlobal, &isFoundInGlobal);
|
||||
BRANCH(TaggedIsHole(*result), ¬FoundInGlobal, &isFoundInGlobal);
|
||||
Bind(&isFoundInGlobal);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(StGlobalVar), { propKey, value });
|
||||
@ -404,7 +404,7 @@ GateRef AccessObjectStubBuilder::LoadGlobalVar(GateRef glue, GateRef prop, const
|
||||
GateRef globalObject = GetGlobalObject(glue);
|
||||
GateRef propKey = ResolvePropKey(glue, prop, info);
|
||||
result = GetGlobalOwnProperty(glue, globalObject, propKey, callback);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -468,17 +468,17 @@ GateRef AccessObjectStubBuilder::StOwnByIndex(GateRef glue, GateRef receiver, Ga
|
||||
Label isHeapObject(env);
|
||||
Label slowPath(env);
|
||||
Label exit(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
Bind(&isHeapObject);
|
||||
Label notClassConstructor(env);
|
||||
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
Label notClassPrototype(env);
|
||||
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
BRANCH(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
Bind(¬ClassPrototype);
|
||||
{
|
||||
result = SetPropertyByIndex(glue, receiver, TruncInt64ToInt32(index), value, true);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -500,17 +500,17 @@ GateRef AccessObjectStubBuilder::StOwnByValue(GateRef glue, GateRef receiver, Ga
|
||||
Label isHeapObject(env);
|
||||
Label slowPath(env);
|
||||
Label exit(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
Bind(&isHeapObject);
|
||||
Label notClassConstructor(env);
|
||||
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
Label notClassPrototype(env);
|
||||
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
BRANCH(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
Bind(¬ClassPrototype);
|
||||
{
|
||||
result = SetPropertyByValue(glue, receiver, key, value, true);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -532,17 +532,17 @@ GateRef AccessObjectStubBuilder::StOwnByName(GateRef glue, GateRef receiver, Gat
|
||||
Label isJSObject(env);
|
||||
Label slowPath(env);
|
||||
Label exit(env);
|
||||
Branch(IsJSObject(receiver), &isJSObject, &slowPath);
|
||||
BRANCH(IsJSObject(receiver), &isJSObject, &slowPath);
|
||||
Bind(&isJSObject);
|
||||
Label notClassConstructor(env);
|
||||
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
Label notClassPrototype(env);
|
||||
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
BRANCH(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
Bind(¬ClassPrototype);
|
||||
{
|
||||
result = SetPropertyByName(glue, receiver, key, value, true, True());
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -567,21 +567,21 @@ GateRef AccessObjectStubBuilder::StOwnByValueWithNameSet(GateRef glue, GateRef r
|
||||
Label notClassPrototype(env);
|
||||
Label notHole(env);
|
||||
Label exit(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
{
|
||||
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
BRANCH(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
||||
Bind(¬ClassPrototype);
|
||||
{
|
||||
result = SetPropertyByValue(glue, receiver, key, value, true, ProfileOperation(), true);
|
||||
Branch(TaggedIsHole(*result), &slowPath, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
Label notexception(env);
|
||||
Branch(TaggedIsException(*result), &exit, ¬exception);
|
||||
BRANCH(TaggedIsException(*result), &exit, ¬exception);
|
||||
Bind(¬exception);
|
||||
CallRuntime(glue, RTSTUB_ID(SetFunctionNameNoPrefix), { value, key });
|
||||
Jump(&exit);
|
||||
@ -612,21 +612,21 @@ GateRef AccessObjectStubBuilder::StOwnByNameWithNameSet(GateRef glue, GateRef re
|
||||
Label notClassPrototype(env);
|
||||
Label notHole(env);
|
||||
Label exit(env);
|
||||
Branch(IsJSObject(receiver), &isJSObject, ¬JSObject);
|
||||
BRANCH(IsJSObject(receiver), &isJSObject, ¬JSObject);
|
||||
Bind(&isJSObject);
|
||||
{
|
||||
Branch(IsClassConstructor(receiver), ¬JSObject, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructor(receiver), ¬JSObject, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
{
|
||||
Branch(IsClassPrototype(receiver), ¬JSObject, ¬ClassPrototype);
|
||||
BRANCH(IsClassPrototype(receiver), ¬JSObject, ¬ClassPrototype);
|
||||
Bind(¬ClassPrototype);
|
||||
{
|
||||
result = SetPropertyByName(glue, receiver, key, value, true, True(), ProfileOperation(), false, true);
|
||||
Branch(TaggedIsHole(*result), ¬JSObject, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*result), ¬JSObject, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
Label notException(env);
|
||||
Branch(TaggedIsException(*result), &exit, ¬Exception);
|
||||
BRANCH(TaggedIsException(*result), &exit, ¬Exception);
|
||||
Bind(¬Exception);
|
||||
CallRuntime(glue, RTSTUB_ID(SetFunctionNameNoPrefix), {value, key});
|
||||
Jump(&exit);
|
||||
@ -654,11 +654,11 @@ GateRef AccessObjectStubBuilder::StObjByIndex(GateRef glue, GateRef receiver, Ga
|
||||
Label exit(env);
|
||||
Label fastPath(env);
|
||||
Label slowPath(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
Bind(&fastPath);
|
||||
{
|
||||
result = SetPropertyByIndex(glue, receiver, TruncInt64ToInt32(index), value, false);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -680,11 +680,11 @@ GateRef AccessObjectStubBuilder::LdObjByIndex(GateRef glue, GateRef receiver, Ga
|
||||
Label fastPath(env);
|
||||
Label slowPath(env);
|
||||
Label exit(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
Bind(&fastPath);
|
||||
{
|
||||
varAcc = GetPropertyByIndex(glue, receiver, TruncInt64ToInt32(index), ProfileOperation());
|
||||
Branch(TaggedIsHole(*varAcc), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*varAcc), &slowPath, &exit);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ void AsyncFunctionLowering::ProcessJumpTable()
|
||||
GateRef newTarget = argAccessor_.GetCommonArgGate(CommonArgIdx::NEW_TARGET);
|
||||
GateRef isEqual = builder_.Equal(newTarget, builder_.Undefined());
|
||||
auto firstUse = accessor_.ConstUses(stateEntry_).begin();
|
||||
GateRef ifBranchCondition = builder_.Branch(stateEntry_, isEqual);
|
||||
GateRef ifBranchCondition = builder_.Branch(stateEntry_, isEqual, 1, 1, "checkNewTarget");
|
||||
GateRef ifTrueCondition = builder_.IfTrue(ifBranchCondition);
|
||||
GateRef ifFalseCondition = builder_.IfFalse(ifBranchCondition);
|
||||
while (accessor_.GetOpCode(*firstUse) == OpCode::STATE_SPLIT) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@ void BuiltinsCollectionStubBuilder<CollectionType>::CheckCollectionObj(Label *th
|
||||
// check target obj
|
||||
auto jsType = std::is_same_v<CollectionType, JSSet> ? JSType::JS_SET : JSType::JS_MAP;
|
||||
GateRef isJsCollectionObj = IsJSObjectType(thisValue_, jsType);
|
||||
Branch(isJsCollectionObj, thisCollectionObj, slowPath);
|
||||
BRANCH(isJsCollectionObj, thisCollectionObj, slowPath);
|
||||
}
|
||||
|
||||
template <typename CollectionType>
|
||||
@ -54,7 +54,7 @@ void BuiltinsCollectionStubBuilder<CollectionType>::Clear(Variable *result, Labe
|
||||
|
||||
Label exception(env);
|
||||
Label noException(env);
|
||||
Branch(TaggedIsException(res), &exception, &noException);
|
||||
BRANCH(TaggedIsException(res), &exception, &noException);
|
||||
Bind(&noException);
|
||||
SetLinked(res);
|
||||
Jump(exit);
|
||||
@ -128,9 +128,9 @@ void BuiltinsCollectionStubBuilder<CollectionType>::ForEach(Variable *result, La
|
||||
Label callable(env);
|
||||
// check heap obj
|
||||
Label heapObj(env);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &heapObj, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &heapObj, slowPath);
|
||||
Bind(&heapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &callable, slowPath);
|
||||
BRANCH(IsCallable(callbackFnHandle), &callable, slowPath);
|
||||
Bind(&callable);
|
||||
|
||||
GateRef linkedTable = GetLinked();
|
||||
@ -144,7 +144,7 @@ void BuiltinsCollectionStubBuilder<CollectionType>::ForEach(Variable *result, La
|
||||
}
|
||||
|
||||
Label exception(env);
|
||||
Branch(TaggedIsException(res), &exception, exit);
|
||||
BRANCH(TaggedIsException(res), &exception, exit);
|
||||
Bind(&exception);
|
||||
*result = res;
|
||||
Jump(exit);
|
||||
@ -165,7 +165,7 @@ void BuiltinsCollectionStubBuilder<CollectionType>::MapSetOrSetAdd(
|
||||
GateRef key = GetCallArg0(numArgs_);
|
||||
// check key
|
||||
Label keyNotHole(env);
|
||||
Branch(TaggedIsHole(key), slowPath, &keyNotHole);
|
||||
BRANCH(TaggedIsHole(key), slowPath, &keyNotHole);
|
||||
Bind(&keyNotHole);
|
||||
GateRef value = isJsMapSet ? GetCallArg1(numArgs_) : key;
|
||||
GateRef linkedTable = GetLinked();
|
||||
|
@ -31,16 +31,16 @@ void BuiltinsFunctionStubBuilder::Apply(GateRef glue, GateRef thisValue,
|
||||
Label targetNotUndefined(env);
|
||||
Label isHeapObject(env);
|
||||
//1. If IsCallable(func) is false, throw a TypeError exception
|
||||
Branch(TaggedIsHeapObject(thisValue), &isHeapObject, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(thisValue), &isHeapObject, slowPath);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
Branch(IsCallable(thisValue), &targetIsCallable, slowPath);
|
||||
BRANCH(IsCallable(thisValue), &targetIsCallable, slowPath);
|
||||
Bind(&targetIsCallable);
|
||||
{
|
||||
GateRef thisArg = GetCallArg0(numArgs);
|
||||
GateRef arrayObj = GetCallArg1(numArgs);
|
||||
// 2. If argArray is null or undefined, then
|
||||
Branch(TaggedIsUndefined(arrayObj), &targetIsUndefined, &targetNotUndefined);
|
||||
BRANCH(TaggedIsUndefined(arrayObj), &targetIsUndefined, &targetNotUndefined);
|
||||
Bind(&targetIsUndefined);
|
||||
{
|
||||
// a. Return Call(func, thisArg).
|
||||
@ -54,7 +54,7 @@ void BuiltinsFunctionStubBuilder::Apply(GateRef glue, GateRef thisValue,
|
||||
GateRef elements = BuildArgumentsListFastElements(glue, arrayObj);
|
||||
Label targetIsHole(env);
|
||||
Label targetNotHole(env);
|
||||
Branch(TaggedIsHole(elements), &targetIsHole, &targetNotHole);
|
||||
BRANCH(TaggedIsHole(elements), &targetIsHole, &targetNotHole);
|
||||
Bind(&targetIsHole);
|
||||
{
|
||||
BuiltinsObjectStubBuilder objectStubBuilder(this);
|
||||
@ -62,7 +62,7 @@ void BuiltinsFunctionStubBuilder::Apply(GateRef glue, GateRef thisValue,
|
||||
// 4. ReturnIfAbrupt(argList).
|
||||
Label isPendingException(env);
|
||||
Label noPendingException(env);
|
||||
Branch(HasPendingException(glue), &isPendingException, &noPendingException);
|
||||
BRANCH(HasPendingException(glue), &isPendingException, &noPendingException);
|
||||
Bind(&isPendingException);
|
||||
{
|
||||
Jump(slowPath);
|
||||
@ -81,7 +81,7 @@ void BuiltinsFunctionStubBuilder::Apply(GateRef glue, GateRef thisValue,
|
||||
// 6. Return Call(func, thisArg, argList).
|
||||
Label taggedIsStableJsArg(env);
|
||||
Label taggedNotStableJsArg(env);
|
||||
Branch(IsStableJSArguments(glue, arrayObj), &taggedIsStableJsArg, &taggedNotStableJsArg);
|
||||
BRANCH(IsStableJSArguments(glue, arrayObj), &taggedIsStableJsArg, &taggedNotStableJsArg);
|
||||
Bind(&taggedIsStableJsArg);
|
||||
{
|
||||
GateRef hClass = LoadHClass(arrayObj);
|
||||
@ -125,10 +125,10 @@ GateRef BuiltinsFunctionStubBuilder::BuildArgumentsListFastElements(GateRef glue
|
||||
Label targetIsStableJSArray(env);
|
||||
Label targetNotStableJSArray(env);
|
||||
|
||||
Branch(HasStableElements(glue, arrayObj), &hasStableElements, &exit);
|
||||
BRANCH(HasStableElements(glue, arrayObj), &hasStableElements, &exit);
|
||||
Bind(&hasStableElements);
|
||||
{
|
||||
Branch(IsStableJSArguments(glue, arrayObj), &targetIsStableJSArguments, &targetNotStableJSArguments);
|
||||
BRANCH(IsStableJSArguments(glue, arrayObj), &targetIsStableJSArguments, &targetNotStableJSArguments);
|
||||
Bind(&targetIsStableJSArguments);
|
||||
{
|
||||
GateRef hClass = LoadHClass(arrayObj);
|
||||
@ -136,17 +136,17 @@ GateRef BuiltinsFunctionStubBuilder::BuildArgumentsListFastElements(GateRef glue
|
||||
GateRef glueGlobalEnv = Load(VariableType::NATIVE_POINTER(), glue, glueGlobalEnvOffset);
|
||||
GateRef argmentsClass = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv,
|
||||
GlobalEnv::ARGUMENTS_CLASS);
|
||||
Branch(Int64Equal(hClass, argmentsClass), &hClassEqual, &exit);
|
||||
BRANCH(Int64Equal(hClass, argmentsClass), &hClassEqual, &exit);
|
||||
Bind(&hClassEqual);
|
||||
{
|
||||
GateRef PropertyInlinedPropsOffset = IntPtr(JSArguments::LENGTH_INLINE_PROPERTY_INDEX);
|
||||
GateRef result = GetPropertyInlinedProps(arrayObj, hClass, PropertyInlinedPropsOffset);
|
||||
Branch(TaggedIsInt(result), &targetIsInt, &exit);
|
||||
BRANCH(TaggedIsInt(result), &targetIsInt, &exit);
|
||||
Bind(&targetIsInt);
|
||||
{
|
||||
res = GetElementsArray(arrayObj);
|
||||
Label isMutantTaggedArray(env);
|
||||
Branch(IsMutantTaggedArray(*res), &isMutantTaggedArray, &exit);
|
||||
BRANCH(IsMutantTaggedArray(*res), &isMutantTaggedArray, &exit);
|
||||
Bind(&isMutantTaggedArray);
|
||||
{
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
@ -160,7 +160,7 @@ GateRef BuiltinsFunctionStubBuilder::BuildArgumentsListFastElements(GateRef glue
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, elementsLength), &storeValue, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*index, elementsLength), &storeValue, &afterLoop);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
GateRef value = GetTaggedValueWithElementsKind(arrayObj, *index);
|
||||
@ -182,12 +182,12 @@ GateRef BuiltinsFunctionStubBuilder::BuildArgumentsListFastElements(GateRef glue
|
||||
}
|
||||
Bind(&targetNotStableJSArguments);
|
||||
{
|
||||
Branch(IsStableJSArray(glue, arrayObj), &targetIsStableJSArray, &targetNotStableJSArray);
|
||||
BRANCH(IsStableJSArray(glue, arrayObj), &targetIsStableJSArray, &targetNotStableJSArray);
|
||||
Bind(&targetIsStableJSArray);
|
||||
{
|
||||
res = GetElementsArray(arrayObj);
|
||||
Label isMutantTaggedArray(env);
|
||||
Branch(IsMutantTaggedArray(*res), &isMutantTaggedArray, &exit);
|
||||
BRANCH(IsMutantTaggedArray(*res), &isMutantTaggedArray, &exit);
|
||||
Bind(&isMutantTaggedArray);
|
||||
{
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
@ -201,7 +201,7 @@ GateRef BuiltinsFunctionStubBuilder::BuildArgumentsListFastElements(GateRef glue
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, elementsLength), &storeValue, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*index, elementsLength), &storeValue, &afterLoop);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
GateRef value = GetTaggedValueWithElementsKind(arrayObj, *index);
|
||||
@ -242,7 +242,7 @@ GateRef BuiltinsFunctionStubBuilder::MakeArgListWithHole(GateRef glue, GateRef a
|
||||
Label exit(env);
|
||||
Label greatThanZero(env);
|
||||
Label lessThanZero(env);
|
||||
Branch(Int32GreaterThan(length, Int32(0)), &greatThanZero, &lessThanZero);
|
||||
BRANCH(Int32GreaterThan(length, Int32(0)), &greatThanZero, &lessThanZero);
|
||||
Bind(&lessThanZero);
|
||||
{
|
||||
res = Int32(0);
|
||||
@ -252,7 +252,7 @@ GateRef BuiltinsFunctionStubBuilder::MakeArgListWithHole(GateRef glue, GateRef a
|
||||
GateRef argsLength = GetLengthOfTaggedArray(argv);
|
||||
Label lengthGreaterThanArgsLength(env);
|
||||
Label lengthLessThanArgsLength(env);
|
||||
Branch(Int32GreaterThan(length, argsLength), &lengthGreaterThanArgsLength, &lengthLessThanArgsLength);
|
||||
BRANCH(Int32GreaterThan(length, argsLength), &lengthGreaterThanArgsLength, &lengthLessThanArgsLength);
|
||||
Bind(&lengthGreaterThanArgsLength);
|
||||
{
|
||||
res = argsLength;
|
||||
@ -264,11 +264,11 @@ GateRef BuiltinsFunctionStubBuilder::MakeArgListWithHole(GateRef glue, GateRef a
|
||||
Label loopEnd(env);
|
||||
Label targetIsHole(env);
|
||||
Label targetNotHole(env);
|
||||
Branch(Int32UnsignedLessThan(*i, *res), &loopHead, &exit);
|
||||
BRANCH(Int32UnsignedLessThan(*i, *res), &loopHead, &exit);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
GateRef value = GetValueFromTaggedArray(argv, *i);
|
||||
Branch(TaggedIsHole(value), &targetIsHole, &targetNotHole);
|
||||
BRANCH(TaggedIsHole(value), &targetIsHole, &targetNotHole);
|
||||
Bind(&targetIsHole);
|
||||
{
|
||||
SetValueToTaggedArray(VariableType::JS_ANY(), glue, argv, *i, Undefined());
|
||||
@ -276,7 +276,7 @@ GateRef BuiltinsFunctionStubBuilder::MakeArgListWithHole(GateRef glue, GateRef a
|
||||
}
|
||||
Bind(&targetNotHole);
|
||||
i = Int32Add(*i, Int32(1));
|
||||
Branch(Int32UnsignedLessThan(*i, *res), &loopEnd, &exit);
|
||||
BRANCH(Int32UnsignedLessThan(*i, *res), &loopEnd, &exit);
|
||||
}
|
||||
Bind(&loopEnd);
|
||||
LoopEnd(&loopHead);
|
||||
|
@ -26,7 +26,7 @@ void BuiltinsNumberStubBuilder::ParseFloat(Variable *result, Label *exit, Label
|
||||
Label definedMsg(env);
|
||||
Label undefinedMsg(env);
|
||||
GateRef msg = GetCallArg0(numArgs_);
|
||||
Branch(TaggedIsUndefined(msg), &undefinedMsg, &definedMsg);
|
||||
BRANCH(TaggedIsUndefined(msg), &undefinedMsg, &definedMsg);
|
||||
Bind(&undefinedMsg);
|
||||
{
|
||||
*result = DoubleToTaggedDoublePtr(Double(base::NAN_VALUE));
|
||||
@ -36,9 +36,9 @@ void BuiltinsNumberStubBuilder::ParseFloat(Variable *result, Label *exit, Label
|
||||
{
|
||||
Label heapObj(env);
|
||||
Label stringObj(env);
|
||||
Branch(TaggedIsHeapObject(msg), &heapObj, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(msg), &heapObj, slowPath);
|
||||
Bind(&heapObj);
|
||||
Branch(IsString(msg), &stringObj, slowPath);
|
||||
BRANCH(IsString(msg), &stringObj, slowPath);
|
||||
Bind(&stringObj);
|
||||
{
|
||||
*result = CallNGCRuntime(glue_, RTSTUB_ID(NumberHelperStringToDouble), { msg });
|
||||
|
@ -38,9 +38,9 @@ GateRef BuiltinsObjectStubBuilder::CreateListFromArrayLike(GateRef glue, GateRef
|
||||
Label targetIsHeapObject(env);
|
||||
Label targetIsEcmaObject(env);
|
||||
Label targetNotEcmaObject(env);
|
||||
Branch(TaggedIsHeapObject(arrayObj), &targetIsHeapObject, &targetNotEcmaObject);
|
||||
BRANCH(TaggedIsHeapObject(arrayObj), &targetIsHeapObject, &targetNotEcmaObject);
|
||||
Bind(&targetIsHeapObject);
|
||||
Branch(TaggedObjectIsEcmaObject(arrayObj), &targetIsEcmaObject, &targetNotEcmaObject);
|
||||
BRANCH(TaggedObjectIsEcmaObject(arrayObj), &targetIsEcmaObject, &targetNotEcmaObject);
|
||||
Bind(&targetNotEcmaObject);
|
||||
{
|
||||
GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(TargetTypeNotObject));
|
||||
@ -51,7 +51,7 @@ GateRef BuiltinsObjectStubBuilder::CreateListFromArrayLike(GateRef glue, GateRef
|
||||
{
|
||||
Label targetIsTypeArray(env);
|
||||
Label targetNotTypeArray(env);
|
||||
Branch(IsTypedArray(arrayObj), &targetIsTypeArray, &targetNotTypeArray);
|
||||
BRANCH(IsTypedArray(arrayObj), &targetIsTypeArray, &targetNotTypeArray);
|
||||
Bind(&targetIsTypeArray);
|
||||
{
|
||||
GateRef int32Len = GetLengthOfJSTypedArray(arrayObj);
|
||||
@ -62,7 +62,7 @@ GateRef BuiltinsObjectStubBuilder::CreateListFromArrayLike(GateRef glue, GateRef
|
||||
// c. ReturnIfAbrupt(next).
|
||||
Label isPendingException2(env);
|
||||
Label noPendingException2(env);
|
||||
Branch(HasPendingException(glue), &isPendingException2, &noPendingException2);
|
||||
BRANCH(HasPendingException(glue), &isPendingException2, &noPendingException2);
|
||||
Bind(&isPendingException2);
|
||||
{
|
||||
Jump(&exit);
|
||||
@ -82,7 +82,7 @@ GateRef BuiltinsObjectStubBuilder::CreateListFromArrayLike(GateRef glue, GateRef
|
||||
// 5. ReturnIfAbrupt(len).
|
||||
Label isPendingException1(env);
|
||||
Label noPendingException1(env);
|
||||
Branch(HasPendingException(glue), &isPendingException1, &noPendingException1);
|
||||
BRANCH(HasPendingException(glue), &isPendingException1, &noPendingException1);
|
||||
Bind(&isPendingException1);
|
||||
{
|
||||
Jump(&exit);
|
||||
@ -93,7 +93,7 @@ GateRef BuiltinsObjectStubBuilder::CreateListFromArrayLike(GateRef glue, GateRef
|
||||
Label indexOutRange(env);
|
||||
|
||||
GateRef doubleLen = GetDoubleOfTNumber(number);
|
||||
Branch(DoubleGreaterThan(doubleLen, Double(JSObject::MAX_ELEMENT_INDEX)), &indexOutRange, &indexInRange);
|
||||
BRANCH(DoubleGreaterThan(doubleLen, Double(JSObject::MAX_ELEMENT_INDEX)), &indexOutRange, &indexInRange);
|
||||
Bind(&indexOutRange);
|
||||
{
|
||||
GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(LenGreaterThanMax));
|
||||
@ -115,12 +115,12 @@ GateRef BuiltinsObjectStubBuilder::CreateListFromArrayLike(GateRef glue, GateRef
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, int32Length), &storeValue, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*index, int32Length), &storeValue, &afterLoop);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
GateRef next = FastGetPropertyByIndex(glue, arrayObj, *index, ProfileOperation());
|
||||
// c. ReturnIfAbrupt(next).
|
||||
Branch(HasPendingException(glue), &isPendingException3, &noPendingException3);
|
||||
BRANCH(HasPendingException(glue), &isPendingException3, &noPendingException3);
|
||||
Bind(&isPendingException3);
|
||||
{
|
||||
Jump(&exit);
|
||||
@ -174,7 +174,7 @@ void BuiltinsObjectStubBuilder::ToString(Variable *result, Label *exit, Label *s
|
||||
// undefined
|
||||
Label undefined(env);
|
||||
Label checknull(env);
|
||||
Branch(TaggedIsUndefined(thisValue_), &undefined, &checknull);
|
||||
BRANCH(TaggedIsUndefined(thisValue_), &undefined, &checknull);
|
||||
Bind(&undefined);
|
||||
{
|
||||
*result = GetGlobalConstantValue(VariableType::JS_POINTER(), glue_, ConstantIndex::UNDEFINED_TO_STRING_INDEX);
|
||||
@ -184,7 +184,7 @@ void BuiltinsObjectStubBuilder::ToString(Variable *result, Label *exit, Label *s
|
||||
Bind(&checknull);
|
||||
Label null(env);
|
||||
Label checkObject(env);
|
||||
Branch(TaggedIsUndefined(thisValue_), &null, &checkObject);
|
||||
BRANCH(TaggedIsUndefined(thisValue_), &null, &checkObject);
|
||||
Bind(&null);
|
||||
{
|
||||
*result = GetGlobalConstantValue(VariableType::JS_POINTER(), glue_, ConstantIndex::NULL_TO_STRING_INDEX);
|
||||
@ -192,7 +192,7 @@ void BuiltinsObjectStubBuilder::ToString(Variable *result, Label *exit, Label *s
|
||||
}
|
||||
|
||||
Bind(&checkObject);
|
||||
Branch(IsEcmaObject(thisValue_), &ecmaObj, slowPath);
|
||||
BRANCH(IsEcmaObject(thisValue_), &ecmaObj, slowPath);
|
||||
Bind(&ecmaObj);
|
||||
{
|
||||
GateRef glueGlobalEnvOffset = IntPtr(JSThread::GlueData::GetGlueGlobalEnvOffset(env->Is32Bit()));
|
||||
@ -202,12 +202,12 @@ void BuiltinsObjectStubBuilder::ToString(Variable *result, Label *exit, Label *s
|
||||
GateRef tag = FastGetPropertyByName(glue_, thisValue_, toStringTagSymbol, ProfileOperation());
|
||||
|
||||
Label defaultToString(env);
|
||||
Branch(TaggedIsString(tag), slowPath, &defaultToString);
|
||||
BRANCH(TaggedIsString(tag), slowPath, &defaultToString);
|
||||
Bind(&defaultToString);
|
||||
{
|
||||
// default object
|
||||
Label objectTag(env);
|
||||
Branch(IsJSObjectType(thisValue_, JSType::JS_OBJECT), &objectTag, slowPath);
|
||||
BRANCH(IsJSObjectType(thisValue_, JSType::JS_OBJECT), &objectTag, slowPath);
|
||||
Bind(&objectTag);
|
||||
{
|
||||
// [object object]
|
||||
@ -232,7 +232,7 @@ GateRef BuiltinsObjectStubBuilder::TransProtoWithoutLayout(GateRef hClass, GateR
|
||||
GateRef newClass = CallNGCRuntime(glue_, RTSTUB_ID(JSHClassFindProtoTransitions), { hClass, key, proto });
|
||||
Label undef(env);
|
||||
Label find(env);
|
||||
Branch(IntPtrEqual(TaggedCastToIntPtr(newClass), IntPtr(0)), &undef, &find);
|
||||
BRANCH(IntPtrEqual(TaggedCastToIntPtr(newClass), IntPtr(0)), &undef, &find);
|
||||
Bind(&find);
|
||||
{
|
||||
result = newClass;
|
||||
@ -262,7 +262,7 @@ GateRef BuiltinsObjectStubBuilder::OrdinaryNewJSObjectCreate(GateRef proto)
|
||||
GateRef newClass = TransProtoWithoutLayout(hClass, proto);
|
||||
Label exception(env);
|
||||
Label noexception(env);
|
||||
Branch(TaggedIsException(newClass), &exception, &noexception);
|
||||
BRANCH(TaggedIsException(newClass), &exception, &noexception);
|
||||
Bind(&exception);
|
||||
{
|
||||
result = Exception();
|
||||
@ -273,7 +273,7 @@ GateRef BuiltinsObjectStubBuilder::OrdinaryNewJSObjectCreate(GateRef proto)
|
||||
GateRef newObj = newBuilder.NewJSObject(glue_, newClass);
|
||||
Label exceptionNewObj(env);
|
||||
Label noexceptionNewObj(env);
|
||||
Branch(TaggedIsException(newObj), &exceptionNewObj, &noexceptionNewObj);
|
||||
BRANCH(TaggedIsException(newObj), &exceptionNewObj, &noexceptionNewObj);
|
||||
Bind(&exceptionNewObj);
|
||||
{
|
||||
result = Exception();
|
||||
@ -300,12 +300,12 @@ void BuiltinsObjectStubBuilder::Create(Variable *result, Label *exit, Label *slo
|
||||
GateRef protoIsNull = TaggedIsNull(proto);
|
||||
GateRef protoIsEcmaObj = IsEcmaObject(proto);
|
||||
GateRef protoIsJSShared = TaggedIsShared(proto);
|
||||
Branch(BoolOr(BoolAnd(BoolNot(protoIsEcmaObj), BoolNot(protoIsNull)), protoIsJSShared), slowPath, &newObject);
|
||||
BRANCH(BoolOr(BoolAnd(BoolNot(protoIsEcmaObj), BoolNot(protoIsNull)), protoIsJSShared), slowPath, &newObject);
|
||||
Bind(&newObject);
|
||||
{
|
||||
Label noProperties(env);
|
||||
GateRef propertiesObject = GetCallArg1(numArgs_);
|
||||
Branch(TaggedIsUndefined(propertiesObject), &noProperties, slowPath);
|
||||
BRANCH(TaggedIsUndefined(propertiesObject), &noProperties, slowPath);
|
||||
Bind(&noProperties);
|
||||
{
|
||||
// OrdinaryNewJSObjectCreate
|
||||
@ -326,7 +326,7 @@ void BuiltinsObjectStubBuilder::AssignEnumElementProperty(Variable *result, Labe
|
||||
GateRef elements = GetElementsArray(source);
|
||||
Label dictionaryMode(env);
|
||||
Label notDictionaryMode(env);
|
||||
Branch(IsDictionaryMode(elements), &dictionaryMode, ¬DictionaryMode);
|
||||
BRANCH(IsDictionaryMode(elements), &dictionaryMode, ¬DictionaryMode);
|
||||
Bind(¬DictionaryMode);
|
||||
{
|
||||
GateRef len = GetLengthOfTaggedArray(elements);
|
||||
@ -339,17 +339,17 @@ void BuiltinsObjectStubBuilder::AssignEnumElementProperty(Variable *result, Labe
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*idx, len), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*idx, len), &next, &loopExit);
|
||||
Bind(&next);
|
||||
GateRef value = GetTaggedValueWithElementsKind(source, *idx);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(value), &loopEnd, ¬Hole);
|
||||
BRANCH(TaggedIsHole(value), &loopEnd, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
// key, value
|
||||
FastSetPropertyByIndex(glue_, toAssign, *idx, value);
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, &loopEnd);
|
||||
BRANCH(HasPendingException(glue_), &exception, &loopEnd);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -377,27 +377,27 @@ void BuiltinsObjectStubBuilder::AssignEnumElementProperty(Variable *result, Labe
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*idx, size), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*idx, size), &next, &loopExit);
|
||||
Bind(&next);
|
||||
GateRef key = GetKeyFromDictionary<NumberDictionary>(elements, *idx);
|
||||
Label checkEnumerable(env);
|
||||
Branch(BoolOr(TaggedIsUndefined(key), TaggedIsHole(key)), &loopEnd, &checkEnumerable);
|
||||
BRANCH(BoolOr(TaggedIsUndefined(key), TaggedIsHole(key)), &loopEnd, &checkEnumerable);
|
||||
Bind(&checkEnumerable);
|
||||
{
|
||||
GateRef attr = GetAttributesFromDictionary<NumberDictionary>(elements, *idx);
|
||||
Label enumerable(env);
|
||||
Branch(IsEnumerable(attr), &enumerable, &loopEnd);
|
||||
BRANCH(IsEnumerable(attr), &enumerable, &loopEnd);
|
||||
Bind(&enumerable);
|
||||
{
|
||||
GateRef value = GetValueFromDictionary<NumberDictionary>(elements, *idx);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(value), &loopEnd, ¬Hole);
|
||||
BRANCH(TaggedIsHole(value), &loopEnd, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
// value
|
||||
FastSetPropertyByIndex(glue_, toAssign, *idx, value);
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, &loopEnd);
|
||||
BRANCH(HasPendingException(glue_), &exception, &loopEnd);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -438,17 +438,17 @@ void BuiltinsObjectStubBuilder::LayoutInfoAssignAllEnumProperty(Variable *result
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*idx, num), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*idx, num), &next, &loopExit);
|
||||
Bind(&next);
|
||||
|
||||
GateRef key = GetKeyFromLayoutInfo(layout, *idx);
|
||||
GateRef attr = TruncInt64ToInt32(GetPropAttrFromLayoutInfo(layout, *idx));
|
||||
Label stringKey(env);
|
||||
Branch(TaggedIsString(key), &stringKey, &loopEnd);
|
||||
BRANCH(TaggedIsString(key), &stringKey, &loopEnd);
|
||||
Bind(&stringKey);
|
||||
{
|
||||
Label enumerable(env);
|
||||
Branch(IsEnumerable(attr), &enumerable, &loopEnd);
|
||||
BRANCH(IsEnumerable(attr), &enumerable, &loopEnd);
|
||||
Bind(&enumerable);
|
||||
{
|
||||
DEFVARIABLE(value, VariableType::JS_ANY(), Undefined());
|
||||
@ -456,7 +456,7 @@ void BuiltinsObjectStubBuilder::LayoutInfoAssignAllEnumProperty(Variable *result
|
||||
// exception
|
||||
Label exception0(env);
|
||||
Label noexception0(env);
|
||||
Branch(HasPendingException(glue_), &exception0, &noexception0);
|
||||
BRANCH(HasPendingException(glue_), &exception0, &noexception0);
|
||||
Bind(&exception0);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -466,7 +466,7 @@ void BuiltinsObjectStubBuilder::LayoutInfoAssignAllEnumProperty(Variable *result
|
||||
Label propertyBox(env);
|
||||
Label checkAccessor(env);
|
||||
Label setValue(env);
|
||||
Branch(TaggedIsPropertyBox(*value), &propertyBox, &checkAccessor);
|
||||
BRANCH(TaggedIsPropertyBox(*value), &propertyBox, &checkAccessor);
|
||||
Bind(&propertyBox);
|
||||
{
|
||||
value = GetValueFromPropertyBox(*value);
|
||||
@ -474,12 +474,12 @@ void BuiltinsObjectStubBuilder::LayoutInfoAssignAllEnumProperty(Variable *result
|
||||
}
|
||||
Bind(&checkAccessor);
|
||||
Label isAccessor(env);
|
||||
Branch(IsAccessor(attr), &isAccessor, &setValue);
|
||||
BRANCH(IsAccessor(attr), &isAccessor, &setValue);
|
||||
Bind(&isAccessor);
|
||||
{
|
||||
value = CallGetterHelper(glue_, source, source, *value, ProfileOperation());
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, &setValue);
|
||||
BRANCH(HasPendingException(glue_), &exception, &setValue);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -490,7 +490,7 @@ void BuiltinsObjectStubBuilder::LayoutInfoAssignAllEnumProperty(Variable *result
|
||||
{
|
||||
FastSetPropertyByName(glue_, toAssign, key, *value);
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, &loopEnd);
|
||||
BRANCH(HasPendingException(glue_), &exception, &loopEnd);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -530,33 +530,33 @@ void BuiltinsObjectStubBuilder::NameDictionaryAssignAllEnumProperty(Variable *re
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*idx, size), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*idx, size), &next, &loopExit);
|
||||
Bind(&next);
|
||||
GateRef key = GetKeyFromDictionary<NameDictionary>(properties, *idx);
|
||||
Label stringKey(env);
|
||||
Branch(TaggedIsString(key), &stringKey, &loopEnd);
|
||||
BRANCH(TaggedIsString(key), &stringKey, &loopEnd);
|
||||
Bind(&stringKey);
|
||||
{
|
||||
GateRef attr = GetAttributesFromDictionary<NameDictionary>(properties, *idx);
|
||||
Label enumerable(env);
|
||||
Branch(IsEnumerable(attr), &enumerable, &loopEnd);
|
||||
BRANCH(IsEnumerable(attr), &enumerable, &loopEnd);
|
||||
Bind(&enumerable);
|
||||
{
|
||||
DEFVARIABLE(value, VariableType::JS_ANY(), Undefined());
|
||||
value = GetValueFromDictionary<NameDictionary>(properties, *idx);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(*value), &loopEnd, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*value), &loopEnd, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
Label isAccessor(env);
|
||||
Label notAccessor(env);
|
||||
Branch(IsAccessor(attr), &isAccessor, ¬Accessor);
|
||||
BRANCH(IsAccessor(attr), &isAccessor, ¬Accessor);
|
||||
Bind(&isAccessor);
|
||||
{
|
||||
value = CallGetterHelper(glue_, source, source, *value, ProfileOperation());
|
||||
// exception
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, ¬Accessor);
|
||||
BRANCH(HasPendingException(glue_), &exception, ¬Accessor);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -567,7 +567,7 @@ void BuiltinsObjectStubBuilder::NameDictionaryAssignAllEnumProperty(Variable *re
|
||||
{
|
||||
FastSetPropertyByName(glue_, toAssign, key, *value);
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, &loopEnd);
|
||||
BRANCH(HasPendingException(glue_), &exception, &loopEnd);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -599,7 +599,7 @@ void BuiltinsObjectStubBuilder::AssignAllEnumProperty(Variable *res, Label *func
|
||||
GateRef properties = GetPropertiesArray(source);
|
||||
Label dictionaryMode(env);
|
||||
Label notDictionaryMode(env);
|
||||
Branch(IsDictionaryMode(properties), &dictionaryMode, ¬DictionaryMode);
|
||||
BRANCH(IsDictionaryMode(properties), &dictionaryMode, ¬DictionaryMode);
|
||||
Bind(¬DictionaryMode);
|
||||
{
|
||||
LayoutInfoAssignAllEnumProperty(res, funcExit, toAssign, source);
|
||||
@ -623,7 +623,7 @@ void BuiltinsObjectStubBuilder::SlowAssign(Variable *result, Label *funcExit, Ga
|
||||
CallRuntime(glue_, RTSTUB_ID(ObjectSlowAssign), { toAssign, source });
|
||||
|
||||
Label exception(env);
|
||||
Branch(HasPendingException(glue_), &exception, &exit);
|
||||
BRANCH(HasPendingException(glue_), &exception, &exit);
|
||||
Bind(&exception);
|
||||
{
|
||||
*result = Exception();
|
||||
@ -645,12 +645,12 @@ void BuiltinsObjectStubBuilder::Assign(Variable *res, Label *nextIt, Label *func
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label checkJsObj(env);
|
||||
Branch(BoolOr(TaggedIsNull(source), TaggedIsUndefined(source)), nextIt, &checkJsObj);
|
||||
BRANCH(BoolOr(TaggedIsNull(source), TaggedIsUndefined(source)), nextIt, &checkJsObj);
|
||||
Bind(&checkJsObj);
|
||||
{
|
||||
Label fastAssign(env);
|
||||
Label slowAssign(env);
|
||||
Branch(IsJSObjectType(source, JSType::JS_OBJECT), &fastAssign, &slowAssign);
|
||||
BRANCH(IsJSObjectType(source, JSType::JS_OBJECT), &fastAssign, &slowAssign);
|
||||
Bind(&fastAssign);
|
||||
{
|
||||
FastAssign(res, funcExit, toAssign, source);
|
||||
@ -672,12 +672,12 @@ void BuiltinsObjectStubBuilder::Assign(Variable *result, Label *exit, Label *slo
|
||||
GateRef target = GetCallArg0(numArgs_);
|
||||
*result = target;
|
||||
Label jsObject(env);
|
||||
Branch(IsJSObjectType(target, JSType::JS_OBJECT), &jsObject, slowPath);
|
||||
BRANCH(IsJSObjectType(target, JSType::JS_OBJECT), &jsObject, slowPath);
|
||||
Bind(&jsObject);
|
||||
{
|
||||
Label twoArg(env);
|
||||
Label notTwoArg(env);
|
||||
Branch(Int64Equal(numArgs_, IntPtr(2)), &twoArg, ¬TwoArg); // 2 : two args
|
||||
BRANCH(Int64Equal(numArgs_, IntPtr(2)), &twoArg, ¬TwoArg); // 2 : two args
|
||||
Bind(&twoArg);
|
||||
{
|
||||
GateRef source = GetCallArg1(numArgs_);
|
||||
@ -689,7 +689,7 @@ void BuiltinsObjectStubBuilder::Assign(Variable *result, Label *exit, Label *slo
|
||||
Bind(¬TwoArg);
|
||||
Label threeArg(env);
|
||||
Label notThreeArg(env);
|
||||
Branch(Int64Equal(numArgs_, IntPtr(3)), &threeArg, ¬ThreeArg); // 3 : three args
|
||||
BRANCH(Int64Equal(numArgs_, IntPtr(3)), &threeArg, ¬ThreeArg); // 3 : three args
|
||||
Bind(&threeArg);
|
||||
{
|
||||
Label nextArg(env);
|
||||
@ -717,40 +717,40 @@ void BuiltinsObjectStubBuilder::HasOwnProperty(Variable *result, Label *exit, La
|
||||
Label valid(env);
|
||||
Label isHeapObject(env);
|
||||
GateRef prop = GetCallArg0(numArgs_);
|
||||
Branch(TaggedIsHeapObject(thisValue_), &isHeapObject, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(thisValue_), &isHeapObject, slowPath);
|
||||
Bind(&isHeapObject);
|
||||
Branch(TaggedIsRegularObject(thisValue_), &valid, slowPath);
|
||||
BRANCH(TaggedIsRegularObject(thisValue_), &valid, slowPath);
|
||||
Bind(&valid);
|
||||
{
|
||||
Label isIndex(env);
|
||||
Label notIndex(env);
|
||||
Branch(TaggedIsString(prop), &keyIsString, slowPath); // 2 : two args
|
||||
BRANCH(TaggedIsString(prop), &keyIsString, slowPath); // 2 : two args
|
||||
Bind(&keyIsString);
|
||||
{
|
||||
GateRef res = CallNGCRuntime(glue_, RTSTUB_ID(TryToElementsIndexOrFindInStringTable), { glue_, prop });
|
||||
Branch(TaggedIsNumber(res), &isIndex, ¬Index);
|
||||
BRANCH(TaggedIsNumber(res), &isIndex, ¬Index);
|
||||
Bind(&isIndex);
|
||||
{
|
||||
GateRef index = NumberGetInt(glue_, res);
|
||||
Label findByIndex(env);
|
||||
GateRef elements = GetElementsArray(thisValue_);
|
||||
GateRef len = GetLengthOfTaggedArray(elements);
|
||||
Branch(Int32Equal(len, Int32(0)), exit, &findByIndex);
|
||||
BRANCH(Int32Equal(len, Int32(0)), exit, &findByIndex);
|
||||
Bind(&findByIndex);
|
||||
{
|
||||
Label isDictionaryElement(env);
|
||||
Label notDictionaryElement(env);
|
||||
Branch(IsDictionaryMode(elements), &isDictionaryElement, ¬DictionaryElement);
|
||||
BRANCH(IsDictionaryMode(elements), &isDictionaryElement, ¬DictionaryElement);
|
||||
Bind(¬DictionaryElement);
|
||||
{
|
||||
Label lessThanLength(env);
|
||||
Label notLessThanLength(env);
|
||||
Branch(Int32UnsignedLessThanOrEqual(len, index), exit, &lessThanLength);
|
||||
BRANCH(Int32UnsignedLessThanOrEqual(len, index), exit, &lessThanLength);
|
||||
Bind(&lessThanLength);
|
||||
{
|
||||
Label notHole(env);
|
||||
GateRef value = GetTaggedValueWithElementsKind(thisValue_, index);
|
||||
Branch(TaggedIsNotHole(value), ¬Hole, exit);
|
||||
BRANCH(TaggedIsNotHole(value), ¬Hole, exit);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
*result = TaggedTrue();
|
||||
@ -762,7 +762,7 @@ void BuiltinsObjectStubBuilder::HasOwnProperty(Variable *result, Label *exit, La
|
||||
{
|
||||
GateRef entryA = FindElementFromNumberDictionary(glue_, elements, index);
|
||||
Label notNegtiveOne(env);
|
||||
Branch(Int32NotEqual(entryA, Int32(-1)), ¬NegtiveOne, exit);
|
||||
BRANCH(Int32NotEqual(entryA, Int32(-1)), ¬NegtiveOne, exit);
|
||||
Bind(¬NegtiveOne);
|
||||
{
|
||||
*result = TaggedTrue();
|
||||
@ -774,13 +774,13 @@ void BuiltinsObjectStubBuilder::HasOwnProperty(Variable *result, Label *exit, La
|
||||
Bind(¬Index);
|
||||
{
|
||||
Label findInStringTabel(env);
|
||||
Branch(TaggedIsHole(res), exit, &findInStringTabel);
|
||||
BRANCH(TaggedIsHole(res), exit, &findInStringTabel);
|
||||
Bind(&findInStringTabel);
|
||||
{
|
||||
Label isDicMode(env);
|
||||
Label notDicMode(env);
|
||||
GateRef hclass = LoadHClass(thisValue_);
|
||||
Branch(IsDictionaryModeByHClass(hclass), &isDicMode, ¬DicMode);
|
||||
BRANCH(IsDictionaryModeByHClass(hclass), &isDicMode, ¬DicMode);
|
||||
Bind(¬DicMode);
|
||||
{
|
||||
GateRef layOutInfo = GetLayoutFromHClass(hclass);
|
||||
@ -789,7 +789,7 @@ void BuiltinsObjectStubBuilder::HasOwnProperty(Variable *result, Label *exit, La
|
||||
GateRef entryA = FindElementWithCache(glue_, layOutInfo, hclass, res, propsNum);
|
||||
Label hasEntry(env);
|
||||
// if branch condition : entry != -1
|
||||
Branch(Int32NotEqual(entryA, Int32(-1)), &hasEntry, exit);
|
||||
BRANCH(Int32NotEqual(entryA, Int32(-1)), &hasEntry, exit);
|
||||
Bind(&hasEntry);
|
||||
{
|
||||
*result = TaggedTrue();
|
||||
@ -803,7 +803,7 @@ void BuiltinsObjectStubBuilder::HasOwnProperty(Variable *result, Label *exit, La
|
||||
GateRef entryB = FindEntryFromNameDictionary(glue_, array, res);
|
||||
Label notNegtiveOne(env);
|
||||
// if branch condition : entry != -1
|
||||
Branch(Int32NotEqual(entryB, Int32(-1)), ¬NegtiveOne, exit);
|
||||
BRANCH(Int32NotEqual(entryB, Int32(-1)), ¬NegtiveOne, exit);
|
||||
Bind(¬NegtiveOne);
|
||||
{
|
||||
*result = TaggedTrue();
|
||||
@ -834,15 +834,15 @@ GateRef BuiltinsObjectStubBuilder::GetNumKeysFromLayoutInfo(GateRef object, Gate
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*i, end), &iLessEnd, &exit);
|
||||
BRANCH(Int32UnsignedLessThan(*i, end), &iLessEnd, &exit);
|
||||
Bind(&iLessEnd);
|
||||
{
|
||||
GateRef key = GetKey(layoutInfo, *i);
|
||||
Branch(TaggedIsString(key), &isString, &loopEnd);
|
||||
BRANCH(TaggedIsString(key), &isString, &loopEnd);
|
||||
Bind(&isString);
|
||||
Branch(IsUninitializedProperty(object, *i, layoutInfo), &loopEnd, &initializedProp);
|
||||
BRANCH(IsUninitializedProperty(object, *i, layoutInfo), &loopEnd, &initializedProp);
|
||||
Bind(&initializedProp);
|
||||
Branch(IsEnumerable(GetAttr(layoutInfo, *i)), &isEnumerable, &loopEnd);
|
||||
BRANCH(IsEnumerable(GetAttr(layoutInfo, *i)), &isEnumerable, &loopEnd);
|
||||
Bind(&isEnumerable);
|
||||
result = Int32Add(*result, Int32(1));
|
||||
Jump(&loopEnd);
|
||||
@ -870,14 +870,14 @@ GateRef BuiltinsObjectStubBuilder::IsUninitializedProperty(GateRef object, GateR
|
||||
GateRef attr = GetAttr(layoutInfo, index);
|
||||
GateRef rep = GetRepInPropAttr(attr);
|
||||
GateRef hclass = LoadHClass(object);
|
||||
Branch(IsInlinedProperty(attr), &inlinedProp, &exit);
|
||||
BRANCH(IsInlinedProperty(attr), &inlinedProp, &exit);
|
||||
Bind(&inlinedProp);
|
||||
{
|
||||
value = GetPropertyInlinedProps(object, hclass, index);
|
||||
result = TaggedIsHole(*value);
|
||||
Label nonDoubleToTagged(env);
|
||||
Label doubleToTagged(env);
|
||||
Branch(IsDoubleRepInPropAttr(rep), &doubleToTagged, &nonDoubleToTagged);
|
||||
BRANCH(IsDoubleRepInPropAttr(rep), &doubleToTagged, &nonDoubleToTagged);
|
||||
Bind(&doubleToTagged);
|
||||
{
|
||||
value = TaggedPtrToTaggedDoublePtr(*value);
|
||||
@ -887,7 +887,7 @@ GateRef BuiltinsObjectStubBuilder::IsUninitializedProperty(GateRef object, GateR
|
||||
Bind(&nonDoubleToTagged);
|
||||
{
|
||||
Label intToTagged(env);
|
||||
Branch(IsIntRepInPropAttr(rep), &intToTagged, &exit);
|
||||
BRANCH(IsIntRepInPropAttr(rep), &intToTagged, &exit);
|
||||
Bind(&intToTagged);
|
||||
{
|
||||
value = TaggedPtrToTaggedIntPtr(*value);
|
||||
@ -926,14 +926,14 @@ GateRef BuiltinsObjectStubBuilder::GetNumKeysFromDictionary(GateRef array)
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*i, size), &iLessSize, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*i, size), &iLessSize, &afterLoop);
|
||||
Bind(&iLessSize);
|
||||
{
|
||||
GateRef key = GetKeyFromDictionary<NameDictionary>(array, *i);
|
||||
Branch(TaggedIsString(key), &isString, &loopEnd);
|
||||
BRANCH(TaggedIsString(key), &isString, &loopEnd);
|
||||
Bind(&isString);
|
||||
GateRef attr = GetAttributesFromDictionary<NameDictionary>(array, *i);
|
||||
Branch(IsEnumerable(attr), &isEnumerable, &loopEnd);
|
||||
BRANCH(IsEnumerable(attr), &isEnumerable, &loopEnd);
|
||||
Bind(&isEnumerable);
|
||||
result = Int32Add(*result, Int32(1));
|
||||
Jump(&loopEnd);
|
||||
@ -969,13 +969,13 @@ void BuiltinsObjectStubBuilder::LayoutInfoGetAllEnumKeys(GateRef end, GateRef of
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*i, end), &iLessEnd, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*i, end), &iLessEnd, &afterLoop);
|
||||
Bind(&iLessEnd);
|
||||
{
|
||||
GateRef key = GetKey(layoutInfo, *i);
|
||||
Branch(BoolAnd(TaggedIsString(key), IsEnumerable(GetAttr(layoutInfo, *i))), &isEnumerable, &loopEnd);
|
||||
BRANCH(BoolAnd(TaggedIsString(key), IsEnumerable(GetAttr(layoutInfo, *i))), &isEnumerable, &loopEnd);
|
||||
Bind(&isEnumerable);
|
||||
Branch(IsUninitializedProperty(object, *i, layoutInfo), &loopEnd, &initializedProp);
|
||||
BRANCH(IsUninitializedProperty(object, *i, layoutInfo), &loopEnd, &initializedProp);
|
||||
Bind(&initializedProp);
|
||||
SetValueToTaggedArray(VariableType::JS_ANY(), glue_, array, Int32Add(*enumKeys, offset), key);
|
||||
enumKeys = Int32Add(*enumKeys, Int32(1));
|
||||
@ -1006,7 +1006,7 @@ GateRef BuiltinsObjectStubBuilder::CopyFromEnumCache(GateRef glue, GateRef eleme
|
||||
Label lenNotZero(env);
|
||||
Label afterLenCon(env);
|
||||
GateRef oldLen = GetLengthOfTaggedArray(elements);
|
||||
Branch(Int32Equal(oldLen, Int32(0)), &lenIsZero, &lenNotZero);
|
||||
BRANCH(Int32Equal(oldLen, Int32(0)), &lenIsZero, &lenNotZero);
|
||||
{
|
||||
Bind(&lenIsZero);
|
||||
{
|
||||
@ -1029,7 +1029,7 @@ GateRef BuiltinsObjectStubBuilder::CopyFromEnumCache(GateRef glue, GateRef eleme
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, *newLen), &storeValue, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*index, *newLen), &storeValue, &afterLoop);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
GateRef value = GetValueFromTaggedArray(elements, Int32Add(*index,
|
||||
@ -1062,13 +1062,13 @@ GateRef BuiltinsObjectStubBuilder::GetAllEnumKeys(GateRef glue, GateRef obj)
|
||||
Label notDictionary(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
GateRef array = GetPropertiesArray(obj);
|
||||
Branch(IsDictionaryMode(array), &isDictionary, ¬Dictionary);
|
||||
BRANCH(IsDictionaryMode(array), &isDictionary, ¬Dictionary);
|
||||
Bind(&isDictionary);
|
||||
{
|
||||
Label propsNotZero(env);
|
||||
Label propsIsZero(env);
|
||||
GateRef numOfKeys = GetNumKeysFromDictionary(array);
|
||||
Branch(Int32GreaterThan(numOfKeys, Int32(0)), &propsNotZero, &propsIsZero);
|
||||
BRANCH(Int32GreaterThan(numOfKeys, Int32(0)), &propsNotZero, &propsIsZero);
|
||||
Bind(&propsNotZero);
|
||||
result = CallRuntime(glue, RTSTUB_ID(NameDictionaryGetAllEnumKeys), { obj, IntToTaggedInt(numOfKeys) });
|
||||
Jump(&exit);
|
||||
@ -1084,7 +1084,7 @@ GateRef BuiltinsObjectStubBuilder::GetAllEnumKeys(GateRef glue, GateRef obj)
|
||||
GateRef hclass = LoadHClass(obj);
|
||||
// JSObject::GetNumberOfEnumKeys()
|
||||
GateRef num = GetNumberOfPropsFromHClass(hclass);
|
||||
Branch(Int32GreaterThan(num, Int32(0)), &hasProps, ¬HasProps);
|
||||
BRANCH(Int32GreaterThan(num, Int32(0)), &hasProps, ¬HasProps);
|
||||
Bind(&hasProps);
|
||||
{
|
||||
Label isOnlyOwnKeys(env);
|
||||
@ -1094,7 +1094,7 @@ GateRef BuiltinsObjectStubBuilder::GetAllEnumKeys(GateRef glue, GateRef obj)
|
||||
// JSObject::GetAllEnumKeys
|
||||
GateRef enumCache = GetEnumCacheFromHClass(hclass);
|
||||
GateRef kind = GetEnumCacheKind(glue, enumCache);
|
||||
Branch(Int32Equal(kind, Int32(static_cast<int32_t>(EnumCacheKind::ONLY_OWN_KEYS))),
|
||||
BRANCH(Int32Equal(kind, Int32(static_cast<int32_t>(EnumCacheKind::ONLY_OWN_KEYS))),
|
||||
&isOnlyOwnKeys, ¬OnlyOwnKeys);
|
||||
Bind(&isOnlyOwnKeys);
|
||||
{
|
||||
@ -1104,7 +1104,7 @@ GateRef BuiltinsObjectStubBuilder::GetAllEnumKeys(GateRef glue, GateRef obj)
|
||||
Bind(¬OnlyOwnKeys);
|
||||
{
|
||||
Label numNotZero(env);
|
||||
Branch(Int32GreaterThan(numOfKeys, Int32(0)), &numNotZero, ¬HasProps);
|
||||
BRANCH(Int32GreaterThan(numOfKeys, Int32(0)), &numNotZero, ¬HasProps);
|
||||
Bind(&numNotZero);
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
GateRef keyArray = newBuilder.NewTaggedArray(glue,
|
||||
@ -1145,7 +1145,7 @@ GateRef BuiltinsObjectStubBuilder::GetEnumElementKeys(GateRef glue, GateRef obj)
|
||||
Label propsNotZero(env);
|
||||
Label propsIsZero(env);
|
||||
GateRef numOfElements = GetNumberOfElements(obj);
|
||||
Branch(Int32GreaterThan(numOfElements, Int32(0)), &propsNotZero, &propsIsZero);
|
||||
BRANCH(Int32GreaterThan(numOfElements, Int32(0)), &propsNotZero, &propsIsZero);
|
||||
Bind(&propsNotZero);
|
||||
{
|
||||
Label isJSPrimitiveRef(env);
|
||||
@ -1156,10 +1156,10 @@ GateRef BuiltinsObjectStubBuilder::GetEnumElementKeys(GateRef glue, GateRef obj)
|
||||
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
GateRef elementArray = newBuilder.NewTaggedArray(glue, numOfElements);
|
||||
Branch(IsJSPrimitiveRef(obj), &isJSPrimitiveRef, ¬PrimitiveString);
|
||||
BRANCH(IsJSPrimitiveRef(obj), &isJSPrimitiveRef, ¬PrimitiveString);
|
||||
Bind(&isJSPrimitiveRef);
|
||||
GateRef value = Load(VariableType::JS_ANY(), obj, IntPtr(JSPrimitiveRef::VALUE_OFFSET));
|
||||
Branch(TaggedIsString(value), &isPrimitiveString, ¬PrimitiveString);
|
||||
BRANCH(TaggedIsString(value), &isPrimitiveString, ¬PrimitiveString);
|
||||
Bind(&isPrimitiveString);
|
||||
{
|
||||
Label loopHead(env);
|
||||
@ -1169,7 +1169,7 @@ GateRef BuiltinsObjectStubBuilder::GetEnumElementKeys(GateRef glue, GateRef obj)
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*i, strLen), &iLessLength, ¬PrimitiveString);
|
||||
BRANCH(Int32UnsignedLessThan(*i, strLen), &iLessLength, ¬PrimitiveString);
|
||||
Bind(&iLessLength);
|
||||
{
|
||||
GateRef str = IntToEcmaString(glue, *i);
|
||||
@ -1185,7 +1185,7 @@ GateRef BuiltinsObjectStubBuilder::GetEnumElementKeys(GateRef glue, GateRef obj)
|
||||
}
|
||||
Bind(¬PrimitiveString);
|
||||
GateRef elements = GetElementsArray(obj);
|
||||
Branch(IsDictionaryMode(elements), &isDictMode, ¬DictMode);
|
||||
BRANCH(IsDictionaryMode(elements), &isDictMode, ¬DictMode);
|
||||
Bind(¬DictMode);
|
||||
{
|
||||
Label loopHead(env);
|
||||
@ -1197,11 +1197,11 @@ GateRef BuiltinsObjectStubBuilder::GetEnumElementKeys(GateRef glue, GateRef obj)
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*j, elementsLen), &iLessLength, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*j, elementsLen), &iLessLength, &afterLoop);
|
||||
Bind(&iLessLength);
|
||||
{
|
||||
GateRef element = GetTaggedValueWithElementsKind(obj, *j);
|
||||
Branch(TaggedIsHole(element), &loopEnd, ¬Hole);
|
||||
BRANCH(TaggedIsHole(element), &loopEnd, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
GateRef str = IntToEcmaString(glue, *j);
|
||||
SetValueToTaggedArray(VariableType::JS_ANY(), glue, elementArray,
|
||||
@ -1249,7 +1249,7 @@ void BuiltinsObjectStubBuilder::Keys(Variable *result, Label *exit, Label *slowP
|
||||
GateRef obj = ToObject(glue_, msg);
|
||||
Label isPendingException(env);
|
||||
Label noPendingException(env);
|
||||
Branch(HasPendingException(glue_), &isPendingException, &noPendingException);
|
||||
BRANCH(HasPendingException(glue_), &isPendingException, &noPendingException);
|
||||
Bind(&isPendingException);
|
||||
Jump(exit);
|
||||
Bind(&noPendingException);
|
||||
@ -1257,7 +1257,7 @@ void BuiltinsObjectStubBuilder::Keys(Variable *result, Label *exit, Label *slowP
|
||||
// EnumerableOwnNames(obj)
|
||||
GateRef isSpecialKey = BoolOr(IsTypedArray(obj), IsModuleNamespace(obj));
|
||||
GateRef notSlowObjectKey = BoolNot(BoolOr(isSpecialKey, IsJSGlobalObject(obj)));
|
||||
Branch(BoolAnd(IsJSObject(obj), notSlowObjectKey), &isFast, slowPath);
|
||||
BRANCH(BoolAnd(IsJSObject(obj), notSlowObjectKey), &isFast, slowPath);
|
||||
Bind(&isFast);
|
||||
{
|
||||
Label hasKeyAndEle(env);
|
||||
@ -1267,7 +1267,7 @@ void BuiltinsObjectStubBuilder::Keys(Variable *result, Label *exit, Label *slowP
|
||||
GateRef lengthOfKeys = GetLengthOfTaggedArray(keyArray);
|
||||
GateRef lengthOfElements = GetLengthOfTaggedArray(elementArray);
|
||||
GateRef KeyAndEle = BoolAnd(Int32NotEqual(lengthOfElements, Int32(0)), Int32NotEqual(lengthOfKeys, Int32(0)));
|
||||
Branch(KeyAndEle, &hasKeyAndEle, &nonKeyAndEle);
|
||||
BRANCH(KeyAndEle, &hasKeyAndEle, &nonKeyAndEle);
|
||||
Bind(&hasKeyAndEle);
|
||||
{
|
||||
GateRef allKeys = AppendSkipHole(glue_, elementArray, keyArray, Int32Add(lengthOfKeys, lengthOfElements));
|
||||
@ -1278,7 +1278,7 @@ void BuiltinsObjectStubBuilder::Keys(Variable *result, Label *exit, Label *slowP
|
||||
{
|
||||
Label hasKey(env);
|
||||
Label nonKey(env);
|
||||
Branch(Int32NotEqual(lengthOfKeys, Int32(0)), &hasKey, &nonKey);
|
||||
BRANCH(Int32NotEqual(lengthOfKeys, Int32(0)), &hasKey, &nonKey);
|
||||
Bind(&hasKey);
|
||||
{
|
||||
*result = CreateArrayFromList(glue_, keyArray);
|
||||
@ -1288,7 +1288,7 @@ void BuiltinsObjectStubBuilder::Keys(Variable *result, Label *exit, Label *slowP
|
||||
{
|
||||
Label hasEle(env);
|
||||
Label nonEle(env);
|
||||
Branch(Int32NotEqual(lengthOfElements, Int32(0)), &hasEle, &nonEle);
|
||||
BRANCH(Int32NotEqual(lengthOfElements, Int32(0)), &hasEle, &nonEle);
|
||||
Bind(&hasEle);
|
||||
{
|
||||
*result = CreateArrayFromList(glue_, elementArray);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -78,7 +78,7 @@ GateRef BuiltinsStubBuilder::GetArg(GateRef numArgs, GateRef index)
|
||||
DEFVARIABLE(arg, VariableType::JS_ANY(), Undefined());
|
||||
Label validIndex(env);
|
||||
Label exit(env);
|
||||
Branch(IntPtrGreaterThan(numArgs, index), &validIndex, &exit);
|
||||
BRANCH(IntPtrGreaterThan(numArgs, index), &validIndex, &exit);
|
||||
Bind(&validIndex);
|
||||
{
|
||||
GateRef argv = GetArgv();
|
||||
@ -106,7 +106,7 @@ GateRef BuiltinsStubBuilder::CallSlowPath(GateRef nativeCode, GateRef glue, Gate
|
||||
Label callThis3(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
GateRef runtimeCallInfoArgs = PtrAdd(numArgs, IntPtr(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
Branch(Int64Equal(numArgs, IntPtr(0)), &callThis0, ¬callThis0);
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(0)), &callThis0, ¬callThis0);
|
||||
Bind(&callThis0);
|
||||
{
|
||||
auto args = { nativeCode, glue, runtimeCallInfoArgs, func, newTarget, thisValue };
|
||||
@ -115,7 +115,7 @@ GateRef BuiltinsStubBuilder::CallSlowPath(GateRef nativeCode, GateRef glue, Gate
|
||||
}
|
||||
Bind(¬callThis0);
|
||||
{
|
||||
Branch(Int64Equal(numArgs, IntPtr(1)), &callThis1, ¬callThis1);
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(1)), &callThis1, ¬callThis1);
|
||||
Bind(&callThis1);
|
||||
{
|
||||
GateRef arg0 = GetCallArg0(numArgs);
|
||||
@ -125,7 +125,7 @@ GateRef BuiltinsStubBuilder::CallSlowPath(GateRef nativeCode, GateRef glue, Gate
|
||||
}
|
||||
Bind(¬callThis1);
|
||||
{
|
||||
Branch(Int64Equal(numArgs, IntPtr(2)), &callThis2, &callThis3); // 2: args2
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(2)), &callThis2, &callThis3); // 2: args2
|
||||
Bind(&callThis2);
|
||||
{
|
||||
GateRef arg0 = GetCallArg0(numArgs);
|
||||
@ -376,15 +376,15 @@ DECLARE_BUILTINS(BooleanConstructor)
|
||||
Label slowPath2(env);
|
||||
Label exit(env);
|
||||
|
||||
Branch(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
BRANCH(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
Bind(&newTargetIsHeapObject);
|
||||
Branch(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
BRANCH(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
Bind(&newTargetIsJSFunction);
|
||||
{
|
||||
Label intialHClassIsHClass(env);
|
||||
GateRef intialHClass = Load(VariableType::JS_ANY(), newTarget,
|
||||
IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET));
|
||||
Branch(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
BRANCH(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
Bind(&intialHClassIsHClass);
|
||||
{
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
@ -440,14 +440,14 @@ DECLARE_BUILTINS(NumberConstructor)
|
||||
Label hasArg(env);
|
||||
Label numberCreate(env);
|
||||
Label newTargetIsHeapObject(env);
|
||||
Branch(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
BRANCH(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
Bind(&newTargetIsHeapObject);
|
||||
Branch(Int64GreaterThan(numArgs, IntPtr(0)), &hasArg, &numberCreate);
|
||||
BRANCH(Int64GreaterThan(numArgs, IntPtr(0)), &hasArg, &numberCreate);
|
||||
Bind(&hasArg);
|
||||
{
|
||||
GateRef value = GetArgNCheck(Int32(0));
|
||||
Label number(env);
|
||||
Branch(TaggedIsNumber(value), &number, &slowPath);
|
||||
BRANCH(TaggedIsNumber(value), &number, &slowPath);
|
||||
Bind(&number);
|
||||
{
|
||||
numberValue = value;
|
||||
@ -459,16 +459,16 @@ DECLARE_BUILTINS(NumberConstructor)
|
||||
Bind(&numberCreate);
|
||||
Label newObj(env);
|
||||
Label newTargetIsJSFunction(env);
|
||||
Branch(TaggedIsUndefined(newTarget), &exit, &newObj);
|
||||
BRANCH(TaggedIsUndefined(newTarget), &exit, &newObj);
|
||||
Bind(&newObj);
|
||||
{
|
||||
Branch(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
BRANCH(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
Bind(&newTargetIsJSFunction);
|
||||
{
|
||||
Label intialHClassIsHClass(env);
|
||||
GateRef intialHClass = Load(VariableType::JS_ANY(), newTarget,
|
||||
IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET));
|
||||
Branch(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
BRANCH(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
Bind(&intialHClassIsHClass);
|
||||
{
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
@ -522,27 +522,27 @@ DECLARE_BUILTINS(DateConstructor)
|
||||
Label slowPath2(env);
|
||||
Label exit(env);
|
||||
|
||||
Branch(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
BRANCH(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
Bind(&newTargetIsHeapObject);
|
||||
Branch(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
BRANCH(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
Bind(&newTargetIsJSFunction);
|
||||
{
|
||||
Label intialHClassIsHClass(env);
|
||||
GateRef intialHClass = Load(VariableType::JS_ANY(), newTarget,
|
||||
IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET));
|
||||
Branch(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
BRANCH(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
Bind(&intialHClassIsHClass);
|
||||
{
|
||||
Label oneArg(env);
|
||||
Label notOneArg(env);
|
||||
Label newJSDate(env);
|
||||
DEFVARIABLE(timeValue, VariableType::FLOAT64(), Double(0));
|
||||
Branch(Int64Equal(numArgs, IntPtr(1)), &oneArg, ¬OneArg);
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(1)), &oneArg, ¬OneArg);
|
||||
Bind(&oneArg);
|
||||
{
|
||||
Label valueIsNumber(env);
|
||||
GateRef value = GetArgNCheck(IntPtr(0));
|
||||
Branch(TaggedIsNumber(value), &valueIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(value), &valueIsNumber, &slowPath);
|
||||
Bind(&valueIsNumber);
|
||||
{
|
||||
timeValue = CallNGCRuntime(glue, RTSTUB_ID(TimeClip), {GetDoubleOfTNumber(value)});
|
||||
@ -552,14 +552,14 @@ DECLARE_BUILTINS(DateConstructor)
|
||||
Bind(¬OneArg);
|
||||
{
|
||||
Label threeArgs(env);
|
||||
Branch(Int64Equal(numArgs, IntPtr(3)), &threeArgs, &slowPath); // 3: year month day
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(3)), &threeArgs, &slowPath); // 3: year month day
|
||||
Bind(&threeArgs);
|
||||
{
|
||||
Label numberYearMonthDay(env);
|
||||
GateRef year = GetArgNCheck(IntPtr(0));
|
||||
GateRef month = GetArgNCheck(IntPtr(1));
|
||||
GateRef day = GetArgNCheck(IntPtr(2));
|
||||
Branch(IsNumberYearMonthDay(year, month, day), &numberYearMonthDay, &slowPath);
|
||||
BRANCH(IsNumberYearMonthDay(year, month, day), &numberYearMonthDay, &slowPath);
|
||||
Bind(&numberYearMonthDay);
|
||||
{
|
||||
GateRef y = GetDoubleOfTNumber(year);
|
||||
@ -623,9 +623,9 @@ DECLARE_BUILTINS(ArrayConstructor)
|
||||
Label slowPath2(env);
|
||||
Label exit(env);
|
||||
|
||||
Branch(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
BRANCH(TaggedIsHeapObject(newTarget), &newTargetIsHeapObject, &slowPath1);
|
||||
Bind(&newTargetIsHeapObject);
|
||||
Branch(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
BRANCH(IsJSFunction(newTarget), &newTargetIsJSFunction, &slowPath);
|
||||
Bind(&newTargetIsJSFunction);
|
||||
{
|
||||
Label fastGetHclass(env);
|
||||
@ -633,17 +633,17 @@ DECLARE_BUILTINS(ArrayConstructor)
|
||||
GateRef glueGlobalEnvOffset = IntPtr(JSThread::GlueData::GetGlueGlobalEnvOffset(env->Is32Bit()));
|
||||
GateRef glueGlobalEnv = Load(VariableType::NATIVE_POINTER(), glue, glueGlobalEnvOffset);
|
||||
auto arrayFunc = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::ARRAY_FUNCTION_INDEX);
|
||||
Branch(Equal(arrayFunc, newTarget), &fastGetHclass, &slowPath2);
|
||||
BRANCH(Equal(arrayFunc, newTarget), &fastGetHclass, &slowPath2);
|
||||
Bind(&fastGetHclass);
|
||||
GateRef intialHClass = Load(VariableType::JS_ANY(), newTarget, IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET));
|
||||
DEFVARIABLE(arrayLength, VariableType::INT64(), Int64(0));
|
||||
Branch(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
BRANCH(IsJSHClass(intialHClass), &intialHClassIsHClass, &slowPath2);
|
||||
Bind(&intialHClassIsHClass);
|
||||
{
|
||||
Label noArg(env);
|
||||
Label hasArg(env);
|
||||
Label arrayCreate(env);
|
||||
Branch(Int64Equal(numArgs, IntPtr(0)), &noArg, &hasArg);
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(0)), &noArg, &hasArg);
|
||||
Bind(&noArg);
|
||||
{
|
||||
Jump(&arrayCreate);
|
||||
@ -651,24 +651,24 @@ DECLARE_BUILTINS(ArrayConstructor)
|
||||
Bind(&hasArg);
|
||||
{
|
||||
Label hasOneArg(env);
|
||||
Branch(Int64Equal(numArgs, IntPtr(1)), &hasOneArg, &slowPath);
|
||||
BRANCH(Int64Equal(numArgs, IntPtr(1)), &hasOneArg, &slowPath);
|
||||
Bind(&hasOneArg);
|
||||
{
|
||||
Label argIsNumber(env);
|
||||
GateRef arg0 = GetArg(numArgs, IntPtr(0));
|
||||
Branch(TaggedIsNumber(arg0), &argIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(arg0), &argIsNumber, &slowPath);
|
||||
Bind(&argIsNumber);
|
||||
{
|
||||
Label argIsInt(env);
|
||||
Label argIsDouble(env);
|
||||
Branch(TaggedIsInt(arg0), &argIsInt, &argIsDouble);
|
||||
BRANCH(TaggedIsInt(arg0), &argIsInt, &argIsDouble);
|
||||
Bind(&argIsInt);
|
||||
{
|
||||
Label validIntLength(env);
|
||||
GateRef intLen = GetInt64OfTInt(arg0);
|
||||
GateRef isGEZero = Int64GreaterThanOrEqual(intLen, Int64(0));
|
||||
GateRef isLEMaxLen = Int64LessThanOrEqual(intLen, Int64(JSArray::MAX_ARRAY_INDEX));
|
||||
Branch(BoolAnd(isGEZero, isLEMaxLen), &validIntLength, &slowPath);
|
||||
BRANCH(BoolAnd(isGEZero, isLEMaxLen), &validIntLength, &slowPath);
|
||||
Bind(&validIntLength);
|
||||
{
|
||||
arrayLength = intLen;
|
||||
@ -684,7 +684,7 @@ DECLARE_BUILTINS(ArrayConstructor)
|
||||
GateRef doubleEqual = DoubleEqual(doubleLength, intToDouble);
|
||||
GateRef doubleLEMaxLen =
|
||||
DoubleLessThanOrEqual(doubleLength, Double(JSArray::MAX_ARRAY_INDEX));
|
||||
Branch(BoolAnd(doubleEqual, doubleLEMaxLen), &validDoubleLength, &slowPath);
|
||||
BRANCH(BoolAnd(doubleEqual, doubleLEMaxLen), &validDoubleLength, &slowPath);
|
||||
Bind(&validDoubleLength);
|
||||
{
|
||||
arrayLength = SExtInt32ToInt64(doubleToInt);
|
||||
@ -697,7 +697,7 @@ DECLARE_BUILTINS(ArrayConstructor)
|
||||
Bind(&arrayCreate);
|
||||
{
|
||||
Label lengthValid(env);
|
||||
Branch(Int64GreaterThan(*arrayLength, Int64(JSObject::MAX_GAP)), &slowPath, &lengthValid);
|
||||
BRANCH(Int64GreaterThan(*arrayLength, Int64(JSObject::MAX_GAP)), &slowPath, &lengthValid);
|
||||
Bind(&lengthValid);
|
||||
{
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
Branch(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(0)), &isValid, &exit);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(0)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG0_OR_ARGV));
|
||||
@ -92,7 +92,7 @@ public:
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
Branch(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(1)), &isValid, &exit);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(1)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG1));
|
||||
@ -113,7 +113,7 @@ public:
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
// 2: 2 args
|
||||
Branch(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(2)), &isValid, &exit);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(2)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG2));
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
DEFVARIABLE(length, VariableType::INT32(), Int32(0));
|
||||
GateRef begin = Load(VariableType::INT32(), obj, IntPtr(JSAPIQueue::FRONT_OFFSET));
|
||||
GateRef end = Load(VariableType::INT32(), obj, IntPtr(JSAPIQueue::TAIL_OFFSET));
|
||||
Branch(Int32GreaterThanOrEqual(end, begin), &endGreatBeging, &endNotGreatBeging);
|
||||
BRANCH(Int32GreaterThanOrEqual(end, begin), &endGreatBeging, &endNotGreatBeging);
|
||||
Bind(&endGreatBeging);
|
||||
{
|
||||
length = Int32Sub(end, begin);
|
||||
|
@ -43,14 +43,14 @@ void ContainersStubBuilder::ContainersCommonFuncCall(GateRef glue, GateRef thisV
|
||||
Label next(env);
|
||||
Label afterLoop(env);
|
||||
GateRef callbackFnHandle;
|
||||
Branch(IsContainer(*thisObj, type), &valueIsJSAPIVector, &valueNotJSAPIVector);
|
||||
BRANCH(IsContainer(*thisObj, type), &valueIsJSAPIVector, &valueNotJSAPIVector);
|
||||
Bind(&valueNotJSAPIVector);
|
||||
{
|
||||
Branch(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
BRANCH(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
Bind(&objIsJSProxy);
|
||||
{
|
||||
GateRef tempObj = GetTarget(*thisObj);
|
||||
Branch(IsContainer(tempObj, type), &objIsJSAPIVector, slowPath);
|
||||
BRANCH(IsContainer(tempObj, type), &objIsJSAPIVector, slowPath);
|
||||
Bind(&objIsJSAPIVector);
|
||||
{
|
||||
thisObj = tempObj;
|
||||
@ -62,7 +62,7 @@ void ContainersStubBuilder::ContainersCommonFuncCall(GateRef glue, GateRef thisV
|
||||
}
|
||||
Bind(&valueIsJSAPIVector);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
Bind(&callbackUndefined);
|
||||
Jump(slowPath);
|
||||
Bind(&callbackNotUndefined);
|
||||
@ -71,14 +71,14 @@ void ContainersStubBuilder::ContainersCommonFuncCall(GateRef glue, GateRef thisV
|
||||
Label notCall(env);
|
||||
Label isHeapObj(env);
|
||||
callbackFnHandle = GetCallArg0(numArgs);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
Bind(&isHeapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
BRANCH(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
Bind(¬Call);
|
||||
Jump(slowPath);
|
||||
Bind(&isCall);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
Bind(&thisArgUndefined);
|
||||
Jump(&nextCount);
|
||||
Bind(&thisArgNotUndefined);
|
||||
@ -97,7 +97,7 @@ void ContainersStubBuilder::ContainersCommonFuncCall(GateRef glue, GateRef thisV
|
||||
Label hasException(env);
|
||||
Label notHasException(env);
|
||||
Label setValue(env);
|
||||
Branch(Int32LessThan(*k, *length), &next, &afterLoop);
|
||||
BRANCH(Int32LessThan(*k, *length), &next, &afterLoop);
|
||||
Bind(&next);
|
||||
{
|
||||
kValue = ContainerGetValue(*thisObj, *k, type);
|
||||
@ -108,7 +108,7 @@ void ContainersStubBuilder::ContainersCommonFuncCall(GateRef glue, GateRef thisV
|
||||
}
|
||||
GateRef retValue = JSCallDispatch(glue, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN, { *thisArg, *kValue, *key, *thisObj });
|
||||
Branch(HasPendingException(glue), &hasException, ¬HasException);
|
||||
BRANCH(HasPendingException(glue), &hasException, ¬HasException);
|
||||
Bind(&hasException);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
@ -116,10 +116,10 @@ void ContainersStubBuilder::ContainersCommonFuncCall(GateRef glue, GateRef thisV
|
||||
}
|
||||
Bind(¬HasException);
|
||||
GateRef tempLen = ContainerGetSize(*thisObj, type);
|
||||
Branch(Int32NotEqual(tempLen, *length), &lenChange, &setValue);
|
||||
BRANCH(Int32NotEqual(tempLen, *length), &lenChange, &setValue);
|
||||
Bind(&lenChange);
|
||||
length = tempLen;
|
||||
Branch(Int32GreaterThanOrEqual(*k, *length), &afterLoop, &setValue);
|
||||
BRANCH(Int32GreaterThanOrEqual(*k, *length), &afterLoop, &setValue);
|
||||
Bind(&setValue);
|
||||
if (IsReplaceAllElements(type)) {
|
||||
ContainerSet(glue, *thisObj, *k, retValue, type);
|
||||
@ -161,14 +161,14 @@ void ContainersStubBuilder::QueueCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
Label next(env);
|
||||
Label afterLoop(env);
|
||||
GateRef callbackFnHandle;
|
||||
Branch(IsContainer(*thisObj, type), &valueIsJSAPIVector, &valueNotJSAPIVector);
|
||||
BRANCH(IsContainer(*thisObj, type), &valueIsJSAPIVector, &valueNotJSAPIVector);
|
||||
Bind(&valueNotJSAPIVector);
|
||||
{
|
||||
Branch(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
BRANCH(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
Bind(&objIsJSProxy);
|
||||
{
|
||||
GateRef tempObj = GetTarget(*thisObj);
|
||||
Branch(IsContainer(tempObj, type), &objIsJSAPIVector, slowPath);
|
||||
BRANCH(IsContainer(tempObj, type), &objIsJSAPIVector, slowPath);
|
||||
Bind(&objIsJSAPIVector);
|
||||
{
|
||||
thisObj = tempObj;
|
||||
@ -180,7 +180,7 @@ void ContainersStubBuilder::QueueCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
}
|
||||
Bind(&valueIsJSAPIVector);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
Bind(&callbackUndefined);
|
||||
Jump(slowPath);
|
||||
Bind(&callbackNotUndefined);
|
||||
@ -189,14 +189,14 @@ void ContainersStubBuilder::QueueCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
Label notCall(env);
|
||||
Label isHeapObj(env);
|
||||
callbackFnHandle = GetCallArg0(numArgs);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
Bind(&isHeapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
BRANCH(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
Bind(¬Call);
|
||||
Jump(slowPath);
|
||||
Bind(&isCall);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
Bind(&thisArgUndefined);
|
||||
Jump(&nextCount);
|
||||
Bind(&thisArgNotUndefined);
|
||||
@ -215,7 +215,7 @@ void ContainersStubBuilder::QueueCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
Label hasException(env);
|
||||
Label notHasException(env);
|
||||
Label setValue(env);
|
||||
Branch(Int32LessThan(*k, *length), &next, &afterLoop);
|
||||
BRANCH(Int32LessThan(*k, *length), &next, &afterLoop);
|
||||
Bind(&next);
|
||||
{
|
||||
kValue = ContainerGetValue(*thisObj, *index, type);
|
||||
@ -223,7 +223,7 @@ void ContainersStubBuilder::QueueCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
key = IntToTaggedInt(*k);
|
||||
GateRef retValue = JSCallDispatch(glue, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN, { *thisArg, *kValue, *key, *thisObj });
|
||||
Branch(HasPendingException(glue), &hasException, ¬HasException);
|
||||
BRANCH(HasPendingException(glue), &hasException, ¬HasException);
|
||||
Bind(&hasException);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
@ -267,14 +267,14 @@ void ContainersStubBuilder::DequeCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
Label next(env);
|
||||
Label afterLoop(env);
|
||||
GateRef callbackFnHandle;
|
||||
Branch(IsContainer(*thisObj, type), &valueIsJSAPIVector, &valueNotJSAPIVector);
|
||||
BRANCH(IsContainer(*thisObj, type), &valueIsJSAPIVector, &valueNotJSAPIVector);
|
||||
Bind(&valueNotJSAPIVector);
|
||||
{
|
||||
Branch(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
BRANCH(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
Bind(&objIsJSProxy);
|
||||
{
|
||||
GateRef tempObj = GetTarget(*thisObj);
|
||||
Branch(IsContainer(tempObj, type), &objIsJSAPIVector, slowPath);
|
||||
BRANCH(IsContainer(tempObj, type), &objIsJSAPIVector, slowPath);
|
||||
Bind(&objIsJSAPIVector);
|
||||
{
|
||||
thisObj = tempObj;
|
||||
@ -286,7 +286,7 @@ void ContainersStubBuilder::DequeCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
}
|
||||
Bind(&valueIsJSAPIVector);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
Bind(&callbackUndefined);
|
||||
Jump(slowPath);
|
||||
Bind(&callbackNotUndefined);
|
||||
@ -295,14 +295,14 @@ void ContainersStubBuilder::DequeCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
Label notCall(env);
|
||||
Label isHeapObj(env);
|
||||
callbackFnHandle = GetCallArg0(numArgs);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
Bind(&isHeapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
BRANCH(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
Bind(¬Call);
|
||||
Jump(slowPath);
|
||||
Bind(&isCall);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
Bind(&thisArgUndefined);
|
||||
Jump(&nextCount);
|
||||
Bind(&thisArgNotUndefined);
|
||||
@ -324,14 +324,14 @@ void ContainersStubBuilder::DequeCommonFuncCall(GateRef glue, GateRef thisValue,
|
||||
Label hasException(env);
|
||||
Label notHasException(env);
|
||||
Label setValue(env);
|
||||
Branch(Int32NotEqual(*first, last), &next, &afterLoop);
|
||||
BRANCH(Int32NotEqual(*first, last), &next, &afterLoop);
|
||||
Bind(&next);
|
||||
{
|
||||
kValue = ContainerGetValue(*thisObj, *index, type);
|
||||
key = IntToTaggedInt(*index);
|
||||
GateRef retValue = JSCallDispatch(glue, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN, { *thisArg, *kValue, *key, *thisObj });
|
||||
Branch(HasPendingException(glue), &hasException, ¬HasException);
|
||||
BRANCH(HasPendingException(glue), &hasException, ¬HasException);
|
||||
Bind(&hasException);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
@ -375,14 +375,14 @@ void ContainersStubBuilder::ContainersLightWeightCall(GateRef glue, GateRef this
|
||||
Label next(env);
|
||||
Label afterLoop(env);
|
||||
GateRef callbackFnHandle;
|
||||
Branch(IsContainer(*thisObj, type), &valueIsJSAPILightWeight, &valueNotJSAPILightWeight);
|
||||
BRANCH(IsContainer(*thisObj, type), &valueIsJSAPILightWeight, &valueNotJSAPILightWeight);
|
||||
Bind(&valueNotJSAPILightWeight);
|
||||
{
|
||||
Branch(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
BRANCH(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
Bind(&objIsJSProxy);
|
||||
{
|
||||
GateRef tempObj = GetTarget(*thisObj);
|
||||
Branch(IsContainer(tempObj, type), &objIsJSAPILightWeight, slowPath);
|
||||
BRANCH(IsContainer(tempObj, type), &objIsJSAPILightWeight, slowPath);
|
||||
Bind(&objIsJSAPILightWeight);
|
||||
{
|
||||
thisObj = tempObj;
|
||||
@ -394,7 +394,7 @@ void ContainersStubBuilder::ContainersLightWeightCall(GateRef glue, GateRef this
|
||||
}
|
||||
Bind(&valueIsJSAPILightWeight);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
Bind(&callbackUndefined);
|
||||
Jump(slowPath);
|
||||
Bind(&callbackNotUndefined);
|
||||
@ -403,14 +403,14 @@ void ContainersStubBuilder::ContainersLightWeightCall(GateRef glue, GateRef this
|
||||
Label notCall(env);
|
||||
Label isHeapObj(env);
|
||||
callbackFnHandle = GetCallArg0(numArgs);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, slowPath);
|
||||
Bind(&isHeapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
BRANCH(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
Bind(¬Call);
|
||||
Jump(slowPath);
|
||||
Bind(&isCall);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
Bind(&thisArgUndefined);
|
||||
Jump(&nextCount);
|
||||
Bind(&thisArgNotUndefined);
|
||||
@ -428,14 +428,14 @@ void ContainersStubBuilder::ContainersLightWeightCall(GateRef glue, GateRef this
|
||||
Label lenChange(env);
|
||||
Label hasException(env);
|
||||
Label notHasException(env);
|
||||
Branch(Int32LessThan(*index, *length), &next, &afterLoop);
|
||||
BRANCH(Int32LessThan(*index, *length), &next, &afterLoop);
|
||||
Bind(&next);
|
||||
{
|
||||
value = ContainerGetValue(*thisObj, *index, type);
|
||||
key = ContainerGetKey(*thisObj, *index, type);
|
||||
GateRef retValue = JSCallDispatch(glue, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN, { *thisArg, *value, *key, *thisObj });
|
||||
Branch(HasPendingException(glue), &hasException, ¬HasException);
|
||||
BRANCH(HasPendingException(glue), &hasException, ¬HasException);
|
||||
Bind(&hasException);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
@ -443,7 +443,7 @@ void ContainersStubBuilder::ContainersLightWeightCall(GateRef glue, GateRef this
|
||||
}
|
||||
Bind(¬HasException);
|
||||
GateRef currentLen = ContainerGetSize(*thisObj, type);
|
||||
Branch(Int32NotEqual(currentLen, *length), &lenChange, &loopEnd);
|
||||
BRANCH(Int32NotEqual(currentLen, *length), &lenChange, &loopEnd);
|
||||
Bind(&lenChange);
|
||||
length = currentLen;
|
||||
Jump(&loopEnd);
|
||||
@ -487,14 +487,14 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
Label next(env);
|
||||
Label afterLoop(env);
|
||||
GateRef callbackFnHandle;
|
||||
Branch(IsContainer(*thisObj, type), &valueIsJSAPIHash, &valueNotJSAPIHash);
|
||||
BRANCH(IsContainer(*thisObj, type), &valueIsJSAPIHash, &valueNotJSAPIHash);
|
||||
Bind(&valueNotJSAPIHash);
|
||||
{
|
||||
Branch(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
BRANCH(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
Bind(&objIsJSProxy);
|
||||
{
|
||||
GateRef tempObj = GetTarget(*thisObj);
|
||||
Branch(IsContainer(tempObj, type), &objIsJSAPIHash, slowPath);
|
||||
BRANCH(IsContainer(tempObj, type), &objIsJSAPIHash, slowPath);
|
||||
Bind(&objIsJSAPIHash);
|
||||
{
|
||||
thisObj = tempObj;
|
||||
@ -506,7 +506,7 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
}
|
||||
Bind(&valueIsJSAPIHash);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
Bind(&callbackUndefined);
|
||||
Jump(slowPath);
|
||||
Bind(&callbackNotUndefined);
|
||||
@ -515,14 +515,14 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
Label notCall(env);
|
||||
Label isHeapObj(env);
|
||||
callbackFnHandle = GetCallArg0(numArgs);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, ¬Call);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, ¬Call);
|
||||
Bind(&isHeapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
BRANCH(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
Bind(¬Call);
|
||||
Jump(slowPath);
|
||||
Bind(&isCall);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
Bind(&thisArgUndefined);
|
||||
Jump(&nextCount);
|
||||
Bind(&thisArgNotUndefined);
|
||||
@ -541,13 +541,13 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
Label notHasExceptionLinked(env);
|
||||
Label hasExceptionRBTree(env);
|
||||
Label notHasExceptionRBTree(env);
|
||||
Branch(Int32LessThan(*index, *length), &next, &afterLoop);
|
||||
BRANCH(Int32LessThan(*index, *length), &next, &afterLoop);
|
||||
Bind(&next);
|
||||
{
|
||||
node = ContainerGetNode(*thisObj, *index, type);
|
||||
Branch(TaggedIsHole(*node), &loopEnd, &nodeNotHole);
|
||||
BRANCH(TaggedIsHole(*node), &loopEnd, &nodeNotHole);
|
||||
Bind(&nodeNotHole);
|
||||
Branch(IsLinkedNode(*node), &nodeIsLinked, &nodeIsRBTree);
|
||||
BRANCH(IsLinkedNode(*node), &nodeIsLinked, &nodeIsRBTree);
|
||||
LoopBegin(&nodeIsLinked);
|
||||
{
|
||||
value = Load(VariableType::JS_POINTER(), *node, IntPtr(
|
||||
@ -556,7 +556,7 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
GateRef retValue = JSCallDispatch(glue, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN,
|
||||
{ *thisArg, *value, *key, *thisObj });
|
||||
Branch(HasPendingException(glue), &hasExceptionLinked, ¬HasExceptionLinked);
|
||||
BRANCH(HasPendingException(glue), &hasExceptionLinked, ¬HasExceptionLinked);
|
||||
Bind(&hasExceptionLinked);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
@ -564,7 +564,7 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
}
|
||||
Bind(¬HasExceptionLinked);
|
||||
node = Load(VariableType::JS_POINTER(), *node, IntPtr(LinkedNode::NEXT_OFFSET));
|
||||
Branch(TaggedIsHole(*node), &loopEnd, &loopLinked);
|
||||
BRANCH(TaggedIsHole(*node), &loopEnd, &loopLinked);
|
||||
}
|
||||
Bind(&loopLinked);
|
||||
LoopEnd(&nodeIsLinked);
|
||||
@ -573,7 +573,7 @@ void ContainersStubBuilder::ContainersHashCall(GateRef glue, GateRef thisValue,
|
||||
GateRef retValue = CallRuntime(glue, RTSTUB_ID(ContainerRBTreeForEach),
|
||||
{ *node, callbackFnHandle, *thisArg, *thisObj,
|
||||
IntToTaggedInt(Int32(static_cast<int32_t>(type))) });
|
||||
Branch(HasPendingException(glue), &hasExceptionRBTree, ¬HasExceptionRBTree);
|
||||
BRANCH(HasPendingException(glue), &hasExceptionRBTree, ¬HasExceptionRBTree);
|
||||
Bind(&hasExceptionRBTree);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
@ -619,14 +619,14 @@ void ContainersStubBuilder::ContainersLinkedListCall(GateRef glue, GateRef thisV
|
||||
Label next(env);
|
||||
Label afterLoop(env);
|
||||
GateRef callbackFnHandle;
|
||||
Branch(IsContainer(*thisObj, type), &valueIsJSAPILinkedList, &valueNotJSAPILinkedList);
|
||||
BRANCH(IsContainer(*thisObj, type), &valueIsJSAPILinkedList, &valueNotJSAPILinkedList);
|
||||
Bind(&valueNotJSAPILinkedList);
|
||||
{
|
||||
Branch(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
BRANCH(IsJsProxy(*thisObj), &objIsJSProxy, &objNotJSProxy);
|
||||
Bind(&objIsJSProxy);
|
||||
{
|
||||
GateRef tempObj = GetTarget(*thisObj);
|
||||
Branch(IsContainer(tempObj, type), &objIsJSAPILinkedList, slowPath);
|
||||
BRANCH(IsContainer(tempObj, type), &objIsJSAPILinkedList, slowPath);
|
||||
Bind(&objIsJSAPILinkedList);
|
||||
{
|
||||
thisObj = tempObj;
|
||||
@ -638,7 +638,7 @@ void ContainersStubBuilder::ContainersLinkedListCall(GateRef glue, GateRef thisV
|
||||
}
|
||||
Bind(&valueIsJSAPILinkedList);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(0), numArgs), &callbackUndefined, &callbackNotUndefined);
|
||||
Bind(&callbackUndefined);
|
||||
Jump(slowPath);
|
||||
Bind(&callbackNotUndefined);
|
||||
@ -647,14 +647,14 @@ void ContainersStubBuilder::ContainersLinkedListCall(GateRef glue, GateRef thisV
|
||||
Label notCall(env);
|
||||
Label isHeapObj(env);
|
||||
callbackFnHandle = GetCallArg0(numArgs);
|
||||
Branch(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, ¬Call);
|
||||
BRANCH(TaggedIsHeapObject(callbackFnHandle), &isHeapObj, ¬Call);
|
||||
Bind(&isHeapObj);
|
||||
Branch(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
BRANCH(IsCallable(callbackFnHandle), &isCall, ¬Call);
|
||||
Bind(¬Call);
|
||||
Jump(slowPath);
|
||||
Bind(&isCall);
|
||||
{
|
||||
Branch(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
BRANCH(Int64GreaterThanOrEqual(IntPtr(1), numArgs), &thisArgUndefined, &thisArgNotUndefined);
|
||||
Bind(&thisArgUndefined);
|
||||
Jump(&nextCount);
|
||||
Bind(&thisArgNotUndefined);
|
||||
@ -672,18 +672,18 @@ void ContainersStubBuilder::ContainersLinkedListCall(GateRef glue, GateRef thisV
|
||||
{
|
||||
Label hasException(env);
|
||||
Label notHasException(env);
|
||||
Branch(Int32LessThan(*index, *length), &next, &afterLoop);
|
||||
BRANCH(Int32LessThan(*index, *length), &next, &afterLoop);
|
||||
Bind(&next);
|
||||
{
|
||||
valueNode = TaggedGetInt(ContainerGetNode(*thisObj,
|
||||
Int32Add(*valueNode, Int32(TaggedList<TaggedArray>::NEXT_PTR_OFFSET)), type));
|
||||
value = ContainerGetNode(*thisObj, *valueNode, type);
|
||||
Branch(TaggedIsHole(*value), &loopEnd, &valueNotHole);
|
||||
BRANCH(TaggedIsHole(*value), &loopEnd, &valueNotHole);
|
||||
Bind(&valueNotHole);
|
||||
key = IntToTaggedInt(*index);
|
||||
GateRef retValue = JSCallDispatch(glue, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN, { *thisArg, *value, *key, *thisObj });
|
||||
Branch(HasPendingException(glue), &hasException, ¬HasException);
|
||||
BRANCH(HasPendingException(glue), &hasException, ¬HasException);
|
||||
Bind(&hasException);
|
||||
{
|
||||
result->WriteVariable(retValue);
|
||||
|
@ -46,14 +46,14 @@ void LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::Reh
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*i, numberOfAllElements), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*i, numberOfAllElements), &next, &loopExit);
|
||||
Bind(&next);
|
||||
|
||||
GateRef fromIndex = EntryToIndex(linkedTable, *i);
|
||||
DEFVARIABLE(key, VariableType::JS_ANY(), GetElement(linkedTable, fromIndex));
|
||||
Label hole(env);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(*key), &hole, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*key), &hole, ¬Hole);
|
||||
Bind(&hole);
|
||||
{
|
||||
currentDeletedElements = Int32Add(*currentDeletedElements, Int32(1));
|
||||
@ -64,7 +64,7 @@ void LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::Reh
|
||||
{
|
||||
Label weak(env);
|
||||
Label notWeak(env);
|
||||
Branch(TaggedIsWeak(*key), &weak, ¬Weak);
|
||||
BRANCH(TaggedIsWeak(*key), &weak, ¬Weak);
|
||||
Bind(&weak);
|
||||
{
|
||||
key = RemoveTaggedWeakTag(*key);
|
||||
@ -85,7 +85,7 @@ void LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::Reh
|
||||
Jump(&loopHead1);
|
||||
LoopBegin(&loopHead1);
|
||||
{
|
||||
Branch(Int32LessThan(*j, Int32(LinkedHashTableObject::ENTRY_SIZE)), &next1, &loopExit1);
|
||||
BRANCH(Int32LessThan(*j, Int32(LinkedHashTableObject::ENTRY_SIZE)), &next1, &loopExit1);
|
||||
Bind(&next1);
|
||||
GateRef ele = GetElement(linkedTable, Int32Add(fromIndex, *j));
|
||||
SetElement(newTable, Int32Add(desIndex, *j), ele);
|
||||
@ -121,7 +121,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
|
||||
GateRef hasSufficient = HasSufficientCapacity(linkedTable, numberOfAddedElements);
|
||||
Label grow(env);
|
||||
Branch(hasSufficient, &exit, &grow);
|
||||
BRANCH(hasSufficient, &exit, &grow);
|
||||
Bind(&grow);
|
||||
{
|
||||
GateRef newCapacity = ComputeCapacity(Int32Add(GetNumberOfElements(linkedTable), numberOfAddedElements));
|
||||
@ -167,7 +167,7 @@ void LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::Rem
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*i, Int32(LinkedHashTableObject::ENTRY_SIZE)), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*i, Int32(LinkedHashTableObject::ENTRY_SIZE)), &next, &loopExit);
|
||||
Bind(&next);
|
||||
|
||||
GateRef idx = Int32Add(index, *i);
|
||||
@ -205,11 +205,11 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
GateRef lessHalf = Int32LessThanOrEqual(numOfDelElements, half);
|
||||
|
||||
Label lessLable(env);
|
||||
Branch(BoolAnd(less, lessHalf), &lessLable, &exit);
|
||||
BRANCH(BoolAnd(less, lessHalf), &lessLable, &exit);
|
||||
Bind(&lessLable);
|
||||
{
|
||||
Label need(env);
|
||||
Branch(Int32LessThanOrEqual(Int32Add(nof, Int32Div(nof, Int32(2))), capacity), &need, &exit);
|
||||
BRANCH(Int32LessThanOrEqual(Int32Add(nof, Int32Div(nof, Int32(2))), capacity), &need, &exit); // 2: half
|
||||
Bind(&need);
|
||||
{
|
||||
res = True();
|
||||
@ -233,7 +233,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
|
||||
Label symbolKey(env);
|
||||
Label stringCheck(env);
|
||||
Branch(TaggedIsSymbol(key), &symbolKey, &stringCheck);
|
||||
BRANCH(TaggedIsSymbol(key), &symbolKey, &stringCheck);
|
||||
Bind(&symbolKey);
|
||||
{
|
||||
res = Load(VariableType::INT32(), key, IntPtr(JSSymbol::HASHFIELD_OFFSET));
|
||||
@ -242,7 +242,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Bind(&stringCheck);
|
||||
Label stringKey(env);
|
||||
Label slowGetHash(env);
|
||||
Branch(TaggedIsString(key), &stringKey, &slowGetHash);
|
||||
BRANCH(TaggedIsString(key), &stringKey, &slowGetHash);
|
||||
Bind(&stringKey);
|
||||
{
|
||||
res = GetHashcodeFromString(glue_, key);
|
||||
@ -279,7 +279,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
DEFVARIABLE(res, VariableType::INT32(), Int32(-1));
|
||||
Label exit(env);
|
||||
Label isKey(env);
|
||||
Branch(IsKey(key), &isKey, &exit);
|
||||
BRANCH(IsKey(key), &isKey, &exit);
|
||||
Bind(&isKey);
|
||||
{
|
||||
GateRef bucket = HashToBucket(linkedTable, hash);
|
||||
@ -293,17 +293,17 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(TaggedIsHole(*entry), &loopExit, &next);
|
||||
BRANCH(TaggedIsHole(*entry), &loopExit, &next);
|
||||
Bind(&next);
|
||||
|
||||
DEFVARIABLE(element, VariableType::JS_ANY(), GetKey(linkedTable, TaggedGetInt(*entry)));
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(*element), &loopEnd, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*element), &loopEnd, ¬Hole);
|
||||
Bind(¬Hole);
|
||||
{
|
||||
Label weak(env);
|
||||
Label notWeak(env);
|
||||
Branch(TaggedIsWeak(*element), &weak, ¬Weak);
|
||||
BRANCH(TaggedIsWeak(*element), &weak, ¬Weak);
|
||||
Bind(&weak);
|
||||
{
|
||||
element = RemoveTaggedWeakTag(*element);
|
||||
@ -311,7 +311,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
}
|
||||
Bind(¬Weak);
|
||||
Label match(env);
|
||||
Branch(HashObjectIsMatch(key, *element), &match, &loopEnd);
|
||||
BRANCH(HashObjectIsMatch(key, *element), &match, &loopEnd);
|
||||
Bind(&match);
|
||||
{
|
||||
res = TaggedGetInt(*entry);
|
||||
@ -349,11 +349,11 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32GreaterThanOrEqual(*currentEntry, Int32(0)), &next, &loopExit);
|
||||
BRANCH(Int32GreaterThanOrEqual(*currentEntry, Int32(0)), &next, &loopExit);
|
||||
Bind(&next);
|
||||
GateRef key = GetKey(linkedTable, *currentEntry);
|
||||
Label hole(env);
|
||||
Branch(TaggedIsHole(key), &hole, &loopEnd);
|
||||
BRANCH(TaggedIsHole(key), &hole, &loopEnd);
|
||||
Bind(&hole);
|
||||
{
|
||||
GateRef deletedNum = GetDeletedNum(linkedTable, *currentEntry);
|
||||
@ -386,7 +386,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
GateRef array = newBuilder.NewTaggedArray(glue_, length);
|
||||
|
||||
Label noException(env);
|
||||
Branch(TaggedIsException(array), &exit, &noException);
|
||||
BRANCH(TaggedIsException(array), &exit, &noException);
|
||||
Bind(&noException);
|
||||
{
|
||||
// SetNumberOfElements
|
||||
@ -413,12 +413,12 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
|
||||
GateRef newTable = Create(Int32(LinkedHashTableType::MIN_CAPACITY));
|
||||
Label noException(env);
|
||||
Branch(TaggedIsException(newTable), &exit, &noException);
|
||||
BRANCH(TaggedIsException(newTable), &exit, &noException);
|
||||
Bind(&noException);
|
||||
|
||||
GateRef cap = GetCapacity(linkedTable);
|
||||
Label capGreaterZero(env);
|
||||
Branch(Int32GreaterThan(cap, Int32(0)), &capGreaterZero, &exit);
|
||||
BRANCH(Int32GreaterThan(cap, Int32(0)), &capGreaterZero, &exit);
|
||||
Bind(&capGreaterZero);
|
||||
{
|
||||
// NextTable
|
||||
@ -464,14 +464,14 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32LessThan(*index, *totalElements), &next, &loopExit);
|
||||
BRANCH(Int32LessThan(*index, *totalElements), &next, &loopExit);
|
||||
Bind(&next);
|
||||
GateRef valueIndex = *index;
|
||||
|
||||
GateRef key = GetKey(*linkedTable, *index);
|
||||
index = Int32Add(*index, Int32(1));
|
||||
Label keyNotHole(env);
|
||||
Branch(TaggedIsHole(key), &loopEnd, &keyNotHole);
|
||||
BRANCH(TaggedIsHole(key), &loopEnd, &keyNotHole);
|
||||
Bind(&keyNotHole);
|
||||
|
||||
GateRef value = key;
|
||||
@ -482,7 +482,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Label notHasException(env);
|
||||
GateRef retValue = JSCallDispatch(glue_, callbackFnHandle, Int32(NUM_MANDATORY_JSFUNC_ARGS), 0,
|
||||
Circuit::NullGate(), JSCallMode::CALL_THIS_ARG3_WITH_RETURN, { thisArg, value, key, thisValue });
|
||||
Branch(HasPendingException(glue_), &hasException, ¬HasException);
|
||||
BRANCH(HasPendingException(glue_), &hasException, ¬HasException);
|
||||
Bind(&hasException);
|
||||
{
|
||||
res = retValue;
|
||||
@ -500,7 +500,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Jump(&loopHead1);
|
||||
LoopBegin(&loopHead1);
|
||||
{
|
||||
Branch(TaggedIsHole(*nextTable), &loopExit1, &next1);
|
||||
BRANCH(TaggedIsHole(*nextTable), &loopExit1, &next1);
|
||||
Bind(&next1);
|
||||
GateRef deleted = GetDeletedElementsAt(*linkedTable, *index);
|
||||
index = Int32Sub(*index, deleted);
|
||||
@ -546,7 +546,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
GateRef entry = FindElement(linkedTable, key, hash);
|
||||
Label findEntry(env);
|
||||
Label notFind(env);
|
||||
Branch(Int32Equal(entry, Int32(-1)), ¬Find, &findEntry);
|
||||
BRANCH(Int32Equal(entry, Int32(-1)), ¬Find, &findEntry);
|
||||
Bind(&findEntry);
|
||||
{
|
||||
SetValue(linkedTable, entry, value);
|
||||
@ -591,7 +591,7 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
GateRef hash = GetHash(key);
|
||||
GateRef entry = FindElement(linkedTable, key, hash);
|
||||
Label findEntry(env);
|
||||
Branch(Int32Equal(entry, Int32(-1)), &exit, &findEntry);
|
||||
BRANCH(Int32Equal(entry, Int32(-1)), &exit, &findEntry);
|
||||
Bind(&findEntry);
|
||||
{
|
||||
RemoveEntry(linkedTable, entry);
|
||||
@ -621,12 +621,12 @@ GateRef LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::
|
||||
Label nonEmpty(env);
|
||||
DEFVARIABLE(res, VariableType::JS_ANY(), TaggedFalse());
|
||||
GateRef size = GetNumberOfElements(linkedTable);
|
||||
Branch(Int32Equal(size, Int32(0)), &exit, &nonEmpty);
|
||||
BRANCH(Int32Equal(size, Int32(0)), &exit, &nonEmpty);
|
||||
Bind(&nonEmpty);
|
||||
GateRef hash = GetHash(key);
|
||||
GateRef entry = FindElement(linkedTable, key, hash);
|
||||
Label findEntry(env);
|
||||
Branch(Int32Equal(entry, Int32(-1)), &exit, &findEntry);
|
||||
BRANCH(Int32Equal(entry, Int32(-1)), &exit, &findEntry);
|
||||
Bind(&findEntry);
|
||||
{
|
||||
res = TaggedTrue();
|
||||
@ -680,10 +680,10 @@ void LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::Gen
|
||||
Label exit(env);
|
||||
|
||||
// 1.If NewTarget is undefined, throw a TypeError exception
|
||||
Branch(TaggedIsHeapObject(newTarget), &newTargetObject, &newTargetNotObject);
|
||||
BRANCH(TaggedIsHeapObject(newTarget), &newTargetObject, &newTargetNotObject);
|
||||
|
||||
Bind(&newTargetObject);
|
||||
Branch(IsJSFunction(newTarget), &newTargetFunction, &slowPath);
|
||||
BRANCH(IsJSFunction(newTarget), &newTargetFunction, &slowPath);
|
||||
|
||||
Bind(&newTargetFunction);
|
||||
Label fastGetHClass(env);
|
||||
@ -701,11 +701,11 @@ void LinkedHashTableStubBuilder<LinkedHashTableType, LinkedHashTableObject>::Gen
|
||||
GateRef funcEq = Equal(mapOrSetFunc, newTarget);
|
||||
GateRef newTargetHClass = Load(VariableType::JS_ANY(), newTarget, IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET));
|
||||
GateRef isHClass = IsJSHClass(newTargetHClass);
|
||||
Branch(BoolAnd(funcEq, isHClass), &fastGetHClass, &slowPath);
|
||||
BRANCH(BoolAnd(funcEq, isHClass), &fastGetHClass, &slowPath);
|
||||
|
||||
Bind(&fastGetHClass);
|
||||
Label isUndefinedOrNull(env);
|
||||
Branch(TaggedIsUndefinedOrNull(GetCallArg0(numArgs)), &isUndefinedOrNull, &slowPath);
|
||||
BRANCH(TaggedIsUndefinedOrNull(GetCallArg0(numArgs)), &isUndefinedOrNull, &slowPath);
|
||||
|
||||
Bind(&isUndefinedOrNull);
|
||||
StoreHashTableToNewObject(newTargetHClass, returnValue);
|
||||
|
@ -80,14 +80,14 @@ GateRef BuiltinLowering::TypedFloor(GateRef gate)
|
||||
GateRef para1 = acc_.GetValueIn(gate, 0);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant());
|
||||
|
||||
builder_.Branch(builder_.TaggedIsNumber(para1), &numberBranch, ¬NumberBranch);
|
||||
BRANCH_CIR(builder_.TaggedIsNumber(para1), &numberBranch, ¬NumberBranch);
|
||||
builder_.Bind(&numberBranch);
|
||||
{
|
||||
GateRef value = builder_.GetDoubleOfTNumber(para1);
|
||||
Label IsNan(&builder_);
|
||||
Label NotNan(&builder_);
|
||||
GateRef condition = builder_.DoubleIsNAN(value);
|
||||
builder_.Branch(condition, &IsNan, &NotNan);
|
||||
BRANCH_CIR(condition, &IsNan, &NotNan);
|
||||
builder_.Bind(&NotNan);
|
||||
{
|
||||
GateRef glue = acc_.GetGlueFromArgList();
|
||||
@ -157,7 +157,7 @@ void BuiltinLowering::ReplaceHirWithValue(GateRef hirGate, GateRef value, bool n
|
||||
GateRef exceptionVal = builder_.ExceptionConstant();
|
||||
// compare with trampolines result
|
||||
GateRef equal = builder_.Equal(value, exceptionVal);
|
||||
auto ifBranch = builder_.Branch(state, equal);
|
||||
auto ifBranch = builder_.Branch(state, equal, 1, BranchWeight::DEOPT_WEIGHT, "checkException");
|
||||
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
@ -418,7 +418,7 @@ void BuiltinLowering::LowerNumberConstructor(GateRef gate)
|
||||
Label exit(env);
|
||||
Label isNumber(env);
|
||||
Label notNumber(env);
|
||||
builder_.Branch(builder_.TaggedIsNumber(param), &isNumber, ¬Number);
|
||||
BRANCH_CIR(builder_.TaggedIsNumber(param), &isNumber, ¬Number);
|
||||
builder_.Bind(&isNumber);
|
||||
{
|
||||
result = param;
|
||||
@ -428,15 +428,15 @@ void BuiltinLowering::LowerNumberConstructor(GateRef gate)
|
||||
{
|
||||
Label isString(env);
|
||||
Label notString(env);
|
||||
builder_.Branch(builder_.TaggedIsString(param), &isString, ¬String);
|
||||
BRANCH_CIR(builder_.TaggedIsString(param), &isString, ¬String);
|
||||
builder_.Bind(&isString);
|
||||
{
|
||||
Label nonZeroLength(env);
|
||||
auto length = builder_.GetLengthFromString(param);
|
||||
builder_.Branch(builder_.Equal(length, builder_.Int32(0)), &exit, &nonZeroLength);
|
||||
BRANCH_CIR(builder_.Equal(length, builder_.Int32(0)), &exit, &nonZeroLength);
|
||||
builder_.Bind(&nonZeroLength);
|
||||
Label isInteger(env);
|
||||
builder_.Branch(builder_.IsIntegerString(param), &isInteger, ¬String);
|
||||
BRANCH_CIR(builder_.IsIntegerString(param), &isInteger, ¬String);
|
||||
builder_.Bind(&isInteger);
|
||||
{
|
||||
result = IntToTaggedIntPtr(builder_.GetRawHashFromString(param));
|
||||
|
@ -78,7 +78,9 @@ Gate *Circuit::AllocateGateSpace(size_t numIns)
|
||||
|
||||
bool Circuit::AddComment(GateRef g, const char* str)
|
||||
{
|
||||
ASSERT(debugInfo_ != nullptr);
|
||||
if (debugInfo_ == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (!debugInfo_->IsEnable()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ GateRef CircuitBuilder::LogicAnd(GateRef x, GateRef y)
|
||||
Label isX(env_);
|
||||
Label notX(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), x);
|
||||
Branch(x, &isX, ¬X);
|
||||
BRANCH_CIR2(x, &isX, ¬X);
|
||||
Bind(&isX);
|
||||
{
|
||||
result = y;
|
||||
@ -102,7 +102,7 @@ GateRef CircuitBuilder::LogicOr(GateRef x, GateRef y)
|
||||
Label isX(env_);
|
||||
Label notX(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), x);
|
||||
Branch(x, &isX, ¬X);
|
||||
BRANCH_CIR2(x, &isX, ¬X);
|
||||
Bind(&isX);
|
||||
{
|
||||
Jump(&exit);
|
||||
@ -125,7 +125,7 @@ int CircuitBuilder::NextVariableId()
|
||||
|
||||
void CircuitBuilder::HandleException(GateRef result, Label *success, Label *fail, Label *exit)
|
||||
{
|
||||
Branch(Equal(result, ExceptionConstant()), fail, success);
|
||||
BRANCH_CIR2(Equal(result, ExceptionConstant()), fail, success);
|
||||
Bind(fail);
|
||||
{
|
||||
Jump(exit);
|
||||
@ -134,7 +134,7 @@ void CircuitBuilder::HandleException(GateRef result, Label *success, Label *fail
|
||||
|
||||
void CircuitBuilder::HandleException(GateRef result, Label *success, Label *fail, Label *exit, GateRef exceptionVal)
|
||||
{
|
||||
Branch(Equal(result, exceptionVal), fail, success);
|
||||
BRANCH_CIR2(Equal(result, exceptionVal), fail, success);
|
||||
Bind(fail);
|
||||
{
|
||||
Jump(exit);
|
||||
|
@ -222,11 +222,11 @@ void CircuitBuilder::Jump(Label *label)
|
||||
}
|
||||
|
||||
void CircuitBuilder::Branch(GateRef condition, Label *trueLabel, Label *falseLabel,
|
||||
uint32_t trueWeight, uint32_t falseWeight)
|
||||
uint32_t trueWeight, uint32_t falseWeight, const char* comment)
|
||||
{
|
||||
auto currentLabel = env_->GetCurrentLabel();
|
||||
auto currentControl = currentLabel->GetControl();
|
||||
GateRef ifBranch = Branch(currentControl, condition, trueWeight, falseWeight);
|
||||
GateRef ifBranch = Branch(currentControl, condition, trueWeight, falseWeight, comment);
|
||||
currentLabel->SetControl(ifBranch);
|
||||
GateRef ifTrue = IfTrue(ifBranch);
|
||||
trueLabel->AppendPredecessor(GetCurrentLabel());
|
||||
@ -695,7 +695,7 @@ GateRef CircuitBuilder::IsEcmaObject(GateRef obj)
|
||||
Label heapObj(env_);
|
||||
Label exit(env_);
|
||||
GateRef isHeapObject = TaggedIsHeapObject(obj);
|
||||
Branch(isHeapObject, &heapObj, &exit);
|
||||
BRANCH_CIR2(isHeapObject, &heapObj, &exit);
|
||||
Bind(&heapObj);
|
||||
result = LogicAnd(isHeapObject, TaggedObjectIsEcmaObject(obj));
|
||||
Jump(&exit);
|
||||
@ -720,7 +720,7 @@ GateRef CircuitBuilder::GetObjectFromConstPool(GateRef glue, GateRef hirGate, Ga
|
||||
}
|
||||
auto cacheValue = GetValueFromTaggedArray(constPool, index);
|
||||
DEFVALUE(result, env_, VariableType::JS_ANY(), cacheValue);
|
||||
Branch(BoolOr(TaggedIsHole(*result), TaggedIsNullPtr(*result)), &cacheMiss, &cache);
|
||||
BRANCH_CIR2(BoolOr(TaggedIsHole(*result), TaggedIsNullPtr(*result)), &cacheMiss, &cache);
|
||||
Bind(&cacheMiss);
|
||||
{
|
||||
if (type == ConstPoolType::STRING) {
|
||||
@ -742,7 +742,7 @@ GateRef CircuitBuilder::GetObjectFromConstPool(GateRef glue, GateRef hirGate, Ga
|
||||
{
|
||||
if (type == ConstPoolType::METHOD) {
|
||||
Label isAOTLiteralInfo(env_);
|
||||
Branch(IsAOTLiteralInfo(*result), &isAOTLiteralInfo, &exit);
|
||||
BRANCH_CIR2(IsAOTLiteralInfo(*result), &isAOTLiteralInfo, &exit);
|
||||
Bind(&isAOTLiteralInfo);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(GetMethodFromCache), Gate::InvalidGateRef,
|
||||
@ -751,7 +751,7 @@ GateRef CircuitBuilder::GetObjectFromConstPool(GateRef glue, GateRef hirGate, Ga
|
||||
}
|
||||
} else if (type == ConstPoolType::ARRAY_LITERAL) {
|
||||
Label isAOTLiteralInfo(env_);
|
||||
Branch(IsAOTLiteralInfo(*result), &isAOTLiteralInfo, &exit);
|
||||
BRANCH_CIR2(IsAOTLiteralInfo(*result), &isAOTLiteralInfo, &exit);
|
||||
Bind(&isAOTLiteralInfo);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(GetArrayLiteralFromCache), Gate::InvalidGateRef,
|
||||
@ -760,7 +760,7 @@ GateRef CircuitBuilder::GetObjectFromConstPool(GateRef glue, GateRef hirGate, Ga
|
||||
}
|
||||
} else if (type == ConstPoolType::OBJECT_LITERAL) {
|
||||
Label isAOTLiteralInfo(env_);
|
||||
Branch(IsAOTLiteralInfo(*result), &isAOTLiteralInfo, &exit);
|
||||
BRANCH_CIR2(IsAOTLiteralInfo(*result), &isAOTLiteralInfo, &exit);
|
||||
Bind(&isAOTLiteralInfo);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(GetObjectLiteralFromCache), Gate::InvalidGateRef,
|
||||
|
@ -227,6 +227,21 @@ public:
|
||||
void ClearConstantCache(GateRef gate);
|
||||
GateRef NanValue();
|
||||
GateRef RelocatableData(uint64_t val);
|
||||
|
||||
#define BRANCH_CIR(condition, trueLabel, falseLabel) \
|
||||
{ \
|
||||
std::ostringstream os; \
|
||||
os << __func__ << ": " << #trueLabel << "- " << #falseLabel; \
|
||||
builder_.Branch(condition, trueLabel, falseLabel, 1, 1, os.str().c_str()); \
|
||||
}
|
||||
|
||||
#define BRANCH_CIR2(condition, trueLabel, falseLabel) \
|
||||
{ \
|
||||
std::ostringstream os; \
|
||||
os << __func__ << ": " << #trueLabel << "- " << #falseLabel; \
|
||||
Branch(condition, trueLabel, falseLabel, 1, 1, os.str().c_str()); \
|
||||
}
|
||||
|
||||
GateRef Branch(GateRef state, GateRef condition, uint32_t leftWeight = 1, uint32_t rightWeight = 1,
|
||||
const char* comment = nullptr); // 1: default branch weight
|
||||
GateRef SwitchBranch(GateRef state, GateRef index, int caseCounts);
|
||||
@ -312,7 +327,7 @@ public:
|
||||
inline void Bind(Label *label, bool justSlowPath);
|
||||
void Jump(Label *label);
|
||||
void Branch(GateRef condition, Label *trueLabel, Label *falseLabel,
|
||||
uint32_t trueWeight = 1, uint32_t falseWeight = 1); // 1: default branch weight
|
||||
uint32_t trueWeight = 1, uint32_t falseWeight = 1, const char* comment = nullptr);
|
||||
void Switch(GateRef index, Label *defaultLabel, int64_t *keysValue, Label *keysLabel, int numberOfKeys);
|
||||
void LoopBegin(Label *loopHead);
|
||||
void LoopEnd(Label *loopHead);
|
||||
|
@ -305,7 +305,7 @@ void CopyRestArgsStubBuilder::GenerateCircuit()
|
||||
GateRef args = PtrAdd(argv, IntPtr(NUM_MANDATORY_JSFUNC_ARGS * 8)); // 8: ptr size
|
||||
GateRef actualArgc = Int32Sub(numArgs, Int32(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
// 1. Calculate actual rest num.
|
||||
Branch(Int32UnsignedGreaterThan(actualArgc, startIdx), &numArgsGreater, &numArgsNotGreater);
|
||||
BRANCH(Int32UnsignedGreaterThan(actualArgc, startIdx), &numArgsGreater, &numArgsNotGreater);
|
||||
Bind(&numArgsGreater);
|
||||
{
|
||||
actualRestNum = Int32Sub(actualArgc, startIdx);
|
||||
@ -352,7 +352,7 @@ void GetUnmapedArgsStubBuilder::GenerateCircuit()
|
||||
newBuilder.SetParameters(glue, 0);
|
||||
newBuilder.NewArgumentsList(&argumentsList, &afterArgumentsList, args, startIdx, actualArgc);
|
||||
Bind(&afterArgumentsList);
|
||||
Branch(TaggedIsException(*argumentsList), &exit, &newArgumentsObj);
|
||||
BRANCH(TaggedIsException(*argumentsList), &exit, &newArgumentsObj);
|
||||
Bind(&newArgumentsObj);
|
||||
newBuilder.NewArgumentsObj(&argumentsObj, &exit, *argumentsList, actualArgc);
|
||||
Bind(&exit);
|
||||
@ -622,11 +622,11 @@ void TryLoadICByNameStubBuilder::GenerateCircuit()
|
||||
Label hclassEqualFirstValue(env);
|
||||
Label hclassNotEqualFirstValue(env);
|
||||
Label cachedHandlerNotHole(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
Bind(&receiverIsHeapObject);
|
||||
{
|
||||
GateRef hclass = LoadHClass(receiver);
|
||||
Branch(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
BRANCH(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
&hclassEqualFirstValue,
|
||||
&hclassNotEqualFirstValue);
|
||||
Bind(&hclassEqualFirstValue);
|
||||
@ -636,7 +636,7 @@ void TryLoadICByNameStubBuilder::GenerateCircuit()
|
||||
Bind(&hclassNotEqualFirstValue);
|
||||
{
|
||||
GateRef cachedHandler = CheckPolyHClass(firstValue, hclass);
|
||||
Branch(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
BRANCH(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
Bind(&cachedHandlerNotHole);
|
||||
{
|
||||
Return(LoadICWithHandler(glue, receiver, receiver, cachedHandler, ProfileOperation()));
|
||||
@ -664,22 +664,22 @@ void TryLoadICByValueStubBuilder::GenerateCircuit()
|
||||
Label hclassNotEqualFirstValue(env);
|
||||
Label firstValueEqualKey(env);
|
||||
Label cachedHandlerNotHole(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
Bind(&receiverIsHeapObject);
|
||||
{
|
||||
GateRef hclass = LoadHClass(receiver);
|
||||
Branch(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
BRANCH(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
&hclassEqualFirstValue,
|
||||
&hclassNotEqualFirstValue);
|
||||
Bind(&hclassEqualFirstValue);
|
||||
Return(LoadElement(glue, receiver, key));
|
||||
Bind(&hclassNotEqualFirstValue);
|
||||
{
|
||||
Branch(Int64Equal(firstValue, key), &firstValueEqualKey, &receiverNotHeapObject);
|
||||
BRANCH(Int64Equal(firstValue, key), &firstValueEqualKey, &receiverNotHeapObject);
|
||||
Bind(&firstValueEqualKey);
|
||||
{
|
||||
auto cachedHandler = CheckPolyHClass(secondValue, hclass);
|
||||
Branch(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
BRANCH(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
Bind(&cachedHandlerNotHole);
|
||||
Return(LoadICWithHandler(glue, receiver, receiver, cachedHandler, ProfileOperation()));
|
||||
}
|
||||
@ -702,11 +702,11 @@ void TryStoreICByNameStubBuilder::GenerateCircuit()
|
||||
Label hclassEqualFirstValue(env);
|
||||
Label hclassNotEqualFirstValue(env);
|
||||
Label cachedHandlerNotHole(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
Bind(&receiverIsHeapObject);
|
||||
{
|
||||
GateRef hclass = LoadHClass(receiver);
|
||||
Branch(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
BRANCH(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
&hclassEqualFirstValue,
|
||||
&hclassNotEqualFirstValue);
|
||||
Bind(&hclassEqualFirstValue);
|
||||
@ -716,7 +716,7 @@ void TryStoreICByNameStubBuilder::GenerateCircuit()
|
||||
Bind(&hclassNotEqualFirstValue);
|
||||
{
|
||||
GateRef cachedHandler = CheckPolyHClass(firstValue, hclass);
|
||||
Branch(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
BRANCH(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
Bind(&cachedHandlerNotHole);
|
||||
{
|
||||
Return(StoreICWithHandler(glue, receiver, receiver, value, cachedHandler));
|
||||
@ -742,22 +742,22 @@ void TryStoreICByValueStubBuilder::GenerateCircuit()
|
||||
Label hclassNotEqualFirstValue(env);
|
||||
Label firstValueEqualKey(env);
|
||||
Label cachedHandlerNotHole(env);
|
||||
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
BRANCH(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
Bind(&receiverIsHeapObject);
|
||||
{
|
||||
GateRef hclass = LoadHClass(receiver);
|
||||
Branch(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
BRANCH(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
&hclassEqualFirstValue,
|
||||
&hclassNotEqualFirstValue);
|
||||
Bind(&hclassEqualFirstValue);
|
||||
Return(ICStoreElement(glue, receiver, key, value, secondValue));
|
||||
Bind(&hclassNotEqualFirstValue);
|
||||
{
|
||||
Branch(Int64Equal(firstValue, key), &firstValueEqualKey, &receiverNotHeapObject);
|
||||
BRANCH(Int64Equal(firstValue, key), &firstValueEqualKey, &receiverNotHeapObject);
|
||||
Bind(&firstValueEqualKey);
|
||||
{
|
||||
GateRef cachedHandler = CheckPolyHClass(secondValue, hclass);
|
||||
Branch(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
BRANCH(TaggedIsHole(cachedHandler), &receiverNotHeapObject, &cachedHandlerNotHole);
|
||||
Bind(&cachedHandlerNotHole);
|
||||
Return(StoreICWithHandler(glue, receiver, receiver, value, cachedHandler));
|
||||
}
|
||||
@ -844,11 +844,11 @@ void JsBoundCallInternalStubBuilder::GenerateCircuit()
|
||||
Int64((1LU << MethodLiteral::NumArgsBits::SIZE) - 1));
|
||||
GateRef expectedArgc = Int64Add(expectedNum, Int64(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
GateRef actualArgc = Int64Sub(argc, IntPtr(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
Branch(JudgeAotAndFastCallWithMethod(method, CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL),
|
||||
BRANCH(JudgeAotAndFastCallWithMethod(method, CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL),
|
||||
&methodIsFastCall, ¬FastCall);
|
||||
Bind(&methodIsFastCall);
|
||||
{
|
||||
Branch(Int64LessThanOrEqual(expectedArgc, argc), &fastCall, &fastCallBridge);
|
||||
BRANCH(Int64LessThanOrEqual(expectedArgc, argc), &fastCall, &fastCallBridge);
|
||||
Bind(&fastCall);
|
||||
{
|
||||
result = CallNGCRuntime(glue, RTSTUB_ID(JSFastCallWithArgV),
|
||||
@ -864,7 +864,7 @@ void JsBoundCallInternalStubBuilder::GenerateCircuit()
|
||||
}
|
||||
Bind(¬FastCall);
|
||||
{
|
||||
Branch(Int64LessThanOrEqual(expectedArgc, argc), &slowCall, &slowCallBridge);
|
||||
BRANCH(Int64LessThanOrEqual(expectedArgc, argc), &slowCall, &slowCallBridge);
|
||||
Bind(&slowCall);
|
||||
{
|
||||
result = CallNGCRuntime(glue, RTSTUB_ID(JSCallWithArgV),
|
||||
@ -901,7 +901,7 @@ void JsProxyCallInternalStubBuilder::GenerateCircuit()
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
|
||||
GateRef handler = GetHandlerFromJSProxy(proxy);
|
||||
Branch(TaggedIsNull(handler), &isNull, ¬Null);
|
||||
BRANCH(TaggedIsNull(handler), &isNull, ¬Null);
|
||||
Bind(&isNull);
|
||||
{
|
||||
ThrowTypeAndReturn(glue, GET_MESSAGE_STRING_ID(NonCallable), Exception());
|
||||
@ -919,7 +919,7 @@ void JsProxyCallInternalStubBuilder::GenerateCircuit()
|
||||
GateRef method = CallRuntime(glue, RTSTUB_ID(JSObjectGetMethod), {handler, key});
|
||||
ReturnExceptionIfAbruptCompletion(glue);
|
||||
|
||||
Branch(TaggedIsUndefined(method), &isUndefined, &isNotUndefined);
|
||||
BRANCH(TaggedIsUndefined(method), &isUndefined, &isNotUndefined);
|
||||
Bind(&isUndefined);
|
||||
{
|
||||
Label isHeapObject(env);
|
||||
@ -929,19 +929,19 @@ void JsProxyCallInternalStubBuilder::GenerateCircuit()
|
||||
Label fastCall(env);
|
||||
Label notFastCall(env);
|
||||
Label slowCall(env);
|
||||
Branch(TaggedIsHeapObject(target), &isHeapObject, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(target), &isHeapObject, &slowPath);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
Branch(IsJSFunction(target), &isJsFcuntion, &slowPath);
|
||||
BRANCH(IsJSFunction(target), &isJsFcuntion, &slowPath);
|
||||
Bind(&isJsFcuntion);
|
||||
{
|
||||
Branch(IsClassConstructor(target), &slowPath, ¬CallConstructor);
|
||||
BRANCH(IsClassConstructor(target), &slowPath, ¬CallConstructor);
|
||||
Bind(¬CallConstructor);
|
||||
GateRef meth = GetMethodFromFunction(target);
|
||||
GateRef actualArgc = Int64Sub(argc, IntPtr(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
GateRef actualArgv =
|
||||
PtrAdd(argv, IntPtr(NUM_MANDATORY_JSFUNC_ARGS * JSTaggedValue::TaggedTypeSize()));
|
||||
Branch(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL),
|
||||
BRANCH(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL),
|
||||
&fastCall, ¬FastCall);
|
||||
Bind(&fastCall);
|
||||
{
|
||||
@ -951,7 +951,7 @@ void JsProxyCallInternalStubBuilder::GenerateCircuit()
|
||||
}
|
||||
Bind(¬FastCall);
|
||||
{
|
||||
Branch(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT),
|
||||
BRANCH(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT),
|
||||
&slowCall, &slowPath);
|
||||
Bind(&slowCall);
|
||||
{
|
||||
@ -982,17 +982,17 @@ void JsProxyCallInternalStubBuilder::GenerateCircuit()
|
||||
// 2: this offset
|
||||
GateRef numArgs = Int64(JSPROXY_NUM_ARGS + NUM_MANDATORY_JSFUNC_ARGS);
|
||||
|
||||
Branch(TaggedIsHeapObject(method), &isHeapObject1, &slowPath1);
|
||||
BRANCH(TaggedIsHeapObject(method), &isHeapObject1, &slowPath1);
|
||||
Bind(&isHeapObject1);
|
||||
{
|
||||
Branch(IsJSFunction(method), &isJsFcuntion1, &slowPath1);
|
||||
BRANCH(IsJSFunction(method), &isJsFcuntion1, &slowPath1);
|
||||
Bind(&isJsFcuntion1);
|
||||
{
|
||||
Branch(IsClassConstructor(method), &slowPath1, ¬CallConstructor1);
|
||||
BRANCH(IsClassConstructor(method), &slowPath1, ¬CallConstructor1);
|
||||
Bind(¬CallConstructor1);
|
||||
GateRef meth = GetMethodFromFunction(method);
|
||||
GateRef code = GetAotCodeAddr(meth);
|
||||
Branch(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL),
|
||||
BRANCH(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL),
|
||||
&fastCall1, ¬FastCall1);
|
||||
Bind(&fastCall1);
|
||||
{
|
||||
@ -1002,7 +1002,7 @@ void JsProxyCallInternalStubBuilder::GenerateCircuit()
|
||||
}
|
||||
Bind(¬FastCall1);
|
||||
{
|
||||
Branch(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT),
|
||||
BRANCH(JudgeAotAndFastCallWithMethod(meth, CircuitBuilder::JudgeMethodType::HAS_AOT),
|
||||
&slowCall1, &slowPath1);
|
||||
Bind(&slowCall1);
|
||||
{
|
||||
@ -1054,7 +1054,7 @@ void FastStringEqualStubBuilder::GenerateCircuit()
|
||||
Label leftNotEqualRight(env);
|
||||
Label exit(env);
|
||||
DEFVARIABLE(result, VariableType::BOOL(), False());
|
||||
Branch(Equal(str1, str2), &leftEqualRight, &leftNotEqualRight);
|
||||
BRANCH(Equal(str1, str2), &leftEqualRight, &leftNotEqualRight);
|
||||
Bind(&leftEqualRight);
|
||||
{
|
||||
result = True();
|
||||
|
@ -309,7 +309,7 @@ GateRef CircuitBuilder::FastCallOptimized(GateRef glue, GateRef code, GateRef de
|
||||
ASSERT(hirGate != Circuit::NullGate());
|
||||
filteredHirGate = hirGate;
|
||||
}
|
||||
GateRef result = Call(cs, glue, code, depend, args, filteredHirGate);
|
||||
GateRef result = Call(cs, glue, code, depend, args, filteredHirGate, "fastCallOptimized");
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ GateRef CircuitBuilder::CallOptimized(GateRef glue, GateRef code, GateRef depend
|
||||
ASSERT(hirGate != Circuit::NullGate());
|
||||
filteredHirGate = hirGate;
|
||||
}
|
||||
GateRef result = Call(cs, glue, code, depend, args, filteredHirGate);
|
||||
GateRef result = Call(cs, glue, code, depend, args, filteredHirGate, "callOptimized");
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -474,11 +474,11 @@ GateRef CircuitBuilder::IsStabelArray(GateRef glue, GateRef obj)
|
||||
Label targetIsHeapObject(env_);
|
||||
Label targetIsStableArray(env_);
|
||||
|
||||
Branch(TaggedIsHeapObject(obj), &targetIsHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &targetIsHeapObject, &exit);
|
||||
Bind(&targetIsHeapObject);
|
||||
{
|
||||
GateRef jsHclass = LoadHClass(obj);
|
||||
Branch(IsStableArray(jsHclass), &targetIsStableArray, &exit);
|
||||
BRANCH_CIR2(IsStableArray(jsHclass), &targetIsStableArray, &exit);
|
||||
Bind(&targetIsStableArray);
|
||||
{
|
||||
GateRef guardiansOffset =
|
||||
|
@ -24,35 +24,35 @@ void ICStubBuilder::NamedICAccessor(Variable* cachedHandler, Label *tryICHandler
|
||||
Label receiverNotHeapObject(env);
|
||||
Label tryIC(env);
|
||||
|
||||
Branch(TaggedIsHeapObject(receiver_), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
BRANCH(TaggedIsHeapObject(receiver_), &receiverIsHeapObject, &receiverNotHeapObject);
|
||||
Bind(&receiverIsHeapObject);
|
||||
{
|
||||
Branch(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
Bind(&tryIC);
|
||||
{
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
GateRef firstValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, slotId_);
|
||||
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, ¬HeapObject);
|
||||
BRANCH(TaggedIsHeapObject(firstValue), &isHeapObject, ¬HeapObject);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
GateRef secondValue = GetValueFromTaggedArray(profileTypeInfo_, Int32Add(slotId_, Int32(1)));
|
||||
cachedHandler->WriteVariable(secondValue);
|
||||
Label tryPoly(env);
|
||||
GateRef hclass = LoadHClass(receiver_);
|
||||
Branch(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
BRANCH(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
tryICHandler,
|
||||
&tryPoly);
|
||||
Bind(&tryPoly);
|
||||
{
|
||||
cachedHandler->WriteVariable(CheckPolyHClass(firstValue, hclass));
|
||||
Branch(TaggedIsHole(cachedHandler->ReadVariable()), slowPath_, tryICHandler);
|
||||
BRANCH(TaggedIsHole(cachedHandler->ReadVariable()), slowPath_, tryICHandler);
|
||||
}
|
||||
}
|
||||
Bind(¬HeapObject);
|
||||
{
|
||||
Branch(TaggedIsUndefined(firstValue), slowPath_, tryFastPath_);
|
||||
BRANCH(TaggedIsUndefined(firstValue), slowPath_, tryFastPath_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -60,10 +60,10 @@ void ICStubBuilder::NamedICAccessor(Variable* cachedHandler, Label *tryICHandler
|
||||
{
|
||||
Label tryNumber(env);
|
||||
Label profileNotUndefined(env);
|
||||
Branch(TaggedIsNumber(receiver_), &tryNumber, slowPath_);
|
||||
BRANCH(TaggedIsNumber(receiver_), &tryNumber, slowPath_);
|
||||
Bind(&tryNumber);
|
||||
{
|
||||
Branch(TaggedIsUndefined(profileTypeInfo_), slowPath_, &profileNotUndefined);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo_), slowPath_, &profileNotUndefined);
|
||||
Bind(&profileNotUndefined);
|
||||
{
|
||||
GateRef firstValue = GetValueFromTaggedArray(profileTypeInfo_, slotId_);
|
||||
@ -74,7 +74,7 @@ void ICStubBuilder::NamedICAccessor(Variable* cachedHandler, Label *tryICHandler
|
||||
auto numberFunction = GetGlobalEnvValue(VariableType::JS_ANY(),
|
||||
glueGlobalEnv, GlobalEnv::NUMBER_FUNCTION_INDEX);
|
||||
GateRef hclass = LoadHClass(numberFunction);
|
||||
Branch(BoolAnd(TaggedIsHeapObject(firstValue), Equal(LoadObjectFromWeakRef(firstValue), hclass)),
|
||||
BRANCH(BoolAnd(TaggedIsHeapObject(firstValue), Equal(LoadObjectFromWeakRef(firstValue), hclass)),
|
||||
tryICHandler, slowPath_);
|
||||
}
|
||||
}
|
||||
@ -86,56 +86,56 @@ void ICStubBuilder::ValuedICAccessor(Variable* cachedHandler, Label *tryICHandle
|
||||
auto env = GetEnvironment();
|
||||
Label receiverIsHeapObject(env);
|
||||
|
||||
Branch(TaggedIsHeapObject(receiver_), &receiverIsHeapObject, slowPath_);
|
||||
BRANCH(TaggedIsHeapObject(receiver_), &receiverIsHeapObject, slowPath_);
|
||||
Bind(&receiverIsHeapObject);
|
||||
{
|
||||
Label tryIC(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
Bind(&tryIC);
|
||||
{
|
||||
Label isHeapObject(env);
|
||||
Label notHeapObject(env);
|
||||
GateRef firstValue = GetValueFromTaggedArray(
|
||||
profileTypeInfo_, slotId_);
|
||||
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, ¬HeapObject);
|
||||
BRANCH(TaggedIsHeapObject(firstValue), &isHeapObject, ¬HeapObject);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
Label tryPoly(env);
|
||||
Label tryWithElementPoly(env);
|
||||
GateRef hclass = LoadHClass(receiver_);
|
||||
Branch(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
BRANCH(Equal(LoadObjectFromWeakRef(firstValue), hclass),
|
||||
tryElementIC,
|
||||
&tryPoly);
|
||||
Bind(&tryPoly);
|
||||
{
|
||||
Label firstIsKey(env);
|
||||
Branch(Int64Equal(firstValue, propKey_), &firstIsKey, &tryWithElementPoly);
|
||||
BRANCH(Int64Equal(firstValue, propKey_), &firstIsKey, &tryWithElementPoly);
|
||||
Bind(&firstIsKey);
|
||||
{
|
||||
GateRef handler = CheckPolyHClass(cachedHandler->ReadVariable(), hclass);
|
||||
cachedHandler->WriteVariable(handler);
|
||||
Branch(TaggedIsHole(cachedHandler->ReadVariable()), slowPath_, tryICHandler);
|
||||
BRANCH(TaggedIsHole(cachedHandler->ReadVariable()), slowPath_, tryICHandler);
|
||||
}
|
||||
Bind(&tryWithElementPoly);
|
||||
{
|
||||
Label checkSecond(env);
|
||||
Label checkPoly(env);
|
||||
Branch(TaggedIsWeak(firstValue), slowPath_, &checkSecond);
|
||||
BRANCH(TaggedIsWeak(firstValue), slowPath_, &checkSecond);
|
||||
Bind(&checkSecond);
|
||||
{
|
||||
Branch(TaggedIsHole(cachedHandler->ReadVariable()), &checkPoly, slowPath_);
|
||||
BRANCH(TaggedIsHole(cachedHandler->ReadVariable()), &checkPoly, slowPath_);
|
||||
}
|
||||
Bind(&checkPoly);
|
||||
{
|
||||
cachedHandler->WriteVariable(CheckPolyHClass(firstValue, hclass));
|
||||
Branch(TaggedIsHole(cachedHandler->ReadVariable()), slowPath_, tryElementIC);
|
||||
BRANCH(TaggedIsHole(cachedHandler->ReadVariable()), slowPath_, tryElementIC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Bind(¬HeapObject);
|
||||
{
|
||||
Branch(TaggedIsUndefined(firstValue), slowPath_, tryFastPath_);
|
||||
BRANCH(TaggedIsUndefined(firstValue), slowPath_, tryFastPath_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,7 +154,7 @@ void ICStubBuilder::LoadICByName(
|
||||
{
|
||||
GateRef ret = LoadICWithHandler(glue_, receiver_, receiver_, *cachedHandler, callback);
|
||||
result->WriteVariable(ret);
|
||||
Branch(TaggedIsHole(ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(ret), slowPath_, success_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ void ICStubBuilder::StoreICByName(Variable* result, Label* tryFastPath, Label *s
|
||||
{
|
||||
GateRef ret = StoreICWithHandler(glue_, receiver_, receiver_, value_, *cachedHandler, callback_);
|
||||
result->WriteVariable(ret);
|
||||
Branch(TaggedIsHole(ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(ret), slowPath_, success_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ void ICStubBuilder::LoadICByValue(
|
||||
Bind(&loadElement);
|
||||
{
|
||||
GateRef handlerInfo = NumberGetInt(glue_, *cachedHandler);
|
||||
Branch(IsElement(handlerInfo), &handlerInfoIsElement, &handlerInfoNotElement);
|
||||
BRANCH(IsElement(handlerInfo), &handlerInfoIsElement, &handlerInfoNotElement);
|
||||
Bind(&handlerInfoIsElement);
|
||||
{
|
||||
ret = LoadElement(glue_, receiver_, propKey_);
|
||||
@ -207,7 +207,7 @@ void ICStubBuilder::LoadICByValue(
|
||||
}
|
||||
Bind(&handlerInfoNotElement);
|
||||
{
|
||||
Branch(IsStringElement(handlerInfo), &handlerInfoIsStringElement, &handlerInfoNotStringElement);
|
||||
BRANCH(IsStringElement(handlerInfo), &handlerInfoIsStringElement, &handlerInfoNotStringElement);
|
||||
Bind(&handlerInfoIsStringElement);
|
||||
{
|
||||
ret = LoadStringElement(glue_, receiver_, propKey_);
|
||||
@ -215,7 +215,7 @@ void ICStubBuilder::LoadICByValue(
|
||||
}
|
||||
Bind(&handlerInfoNotStringElement);
|
||||
{
|
||||
Branch(IsTypedArrayElement(handlerInfo), &handlerInfoIsTypedArrayElement, &exit);
|
||||
BRANCH(IsTypedArrayElement(handlerInfo), &handlerInfoIsTypedArrayElement, &exit);
|
||||
Bind(&handlerInfoIsTypedArrayElement);
|
||||
{
|
||||
GateRef hclass = LoadHClass(receiver_);
|
||||
@ -234,7 +234,7 @@ void ICStubBuilder::LoadICByValue(
|
||||
}
|
||||
Bind(&exit);
|
||||
result->WriteVariable(*ret);
|
||||
Branch(TaggedIsHole(*ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(*ret), slowPath_, success_);
|
||||
}
|
||||
|
||||
void ICStubBuilder::StoreICByValue(Variable* result, Label* tryFastPath, Label *slowPath, Label *success)
|
||||
@ -251,13 +251,13 @@ void ICStubBuilder::StoreICByValue(Variable* result, Label* tryFastPath, Label *
|
||||
{
|
||||
GateRef ret = ICStoreElement(glue_, receiver_, propKey_, value_, *cachedHandler);
|
||||
result->WriteVariable(ret);
|
||||
Branch(TaggedIsHole(ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(ret), slowPath_, success_);
|
||||
}
|
||||
Bind(&storeWithHandler);
|
||||
{
|
||||
GateRef ret = StoreICWithHandler(glue_, receiver_, receiver_, value_, *cachedHandler, callback_);
|
||||
result->WriteVariable(ret);
|
||||
Branch(TaggedIsHole(ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(ret), slowPath_, success_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,17 +267,17 @@ void ICStubBuilder::TryLoadGlobalICByName(Variable* result, Label* tryFastPath,
|
||||
Label tryIC(env);
|
||||
|
||||
SetLabels(tryFastPath, slowPath, success);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
Bind(&tryIC);
|
||||
{
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo_, slotId_);
|
||||
Label isHeapObject(env);
|
||||
Branch(TaggedIsHeapObject(handler), &isHeapObject, slowPath_);
|
||||
BRANCH(TaggedIsHeapObject(handler), &isHeapObject, slowPath_);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
GateRef ret = LoadGlobal(handler);
|
||||
result->WriteVariable(ret);
|
||||
Branch(TaggedIsHole(ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(ret), slowPath_, success_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -288,17 +288,17 @@ void ICStubBuilder::TryStoreGlobalICByName(Variable* result, Label* tryFastPath,
|
||||
Label tryIC(env);
|
||||
|
||||
SetLabels(tryFastPath, slowPath, success);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo_), tryFastPath_, &tryIC);
|
||||
Bind(&tryIC);
|
||||
{
|
||||
GateRef handler = GetValueFromTaggedArray(profileTypeInfo_, slotId_);
|
||||
Label isHeapObject(env);
|
||||
Branch(TaggedIsHeapObject(handler), &isHeapObject, slowPath_);
|
||||
BRANCH(TaggedIsHeapObject(handler), &isHeapObject, slowPath_);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
GateRef ret = StoreGlobal(glue_, value_, handler);
|
||||
result->WriteVariable(ret);
|
||||
Branch(TaggedIsHole(ret), slowPath_, success_);
|
||||
BRANCH(TaggedIsHole(ret), slowPath_, success_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -418,11 +418,11 @@ GateRef InterpreterStubBuilder::PushUndefined(GateRef glue, GateRef sp, GateRef
|
||||
Label pushUndefinedBegin(env);
|
||||
Label pushUndefinedAgain(env);
|
||||
Label pushUndefinedEnd(env);
|
||||
Branch(Int32LessThan(*i, num), &pushUndefinedBegin, &pushUndefinedEnd);
|
||||
BRANCH(Int32LessThan(*i, num), &pushUndefinedBegin, &pushUndefinedEnd);
|
||||
LoopBegin(&pushUndefinedBegin);
|
||||
newSp = PushArg(glue, *newSp, Undefined());
|
||||
i = Int32Add(*i, Int32(1)); // 1 : set as high 1 bits
|
||||
Branch(Int32LessThan(*i, num), &pushUndefinedAgain, &pushUndefinedEnd);
|
||||
BRANCH(Int32LessThan(*i, num), &pushUndefinedAgain, &pushUndefinedEnd);
|
||||
Bind(&pushUndefinedAgain);
|
||||
LoopEnd(&pushUndefinedBegin);
|
||||
Bind(&pushUndefinedEnd);
|
||||
@ -441,12 +441,12 @@ GateRef InterpreterStubBuilder::PushRange(GateRef glue, GateRef sp, GateRef arra
|
||||
Label pushArgsBegin(env);
|
||||
Label pushArgsAgain(env);
|
||||
Label pushArgsEnd(env);
|
||||
Branch(Int32GreaterThanOrEqual(*i, startIndex), &pushArgsBegin, &pushArgsEnd);
|
||||
BRANCH(Int32GreaterThanOrEqual(*i, startIndex), &pushArgsBegin, &pushArgsEnd);
|
||||
LoopBegin(&pushArgsBegin);
|
||||
GateRef arg = GetVregValue(array, ZExtInt32ToPtr(*i));
|
||||
newSp = PushArg(glue, *newSp, arg);
|
||||
i = Int32Sub(*i, Int32(1)); // 1 : set as high 1 bits
|
||||
Branch(Int32GreaterThanOrEqual(*i, startIndex), &pushArgsAgain, &pushArgsEnd);
|
||||
BRANCH(Int32GreaterThanOrEqual(*i, startIndex), &pushArgsAgain, &pushArgsEnd);
|
||||
Bind(&pushArgsAgain);
|
||||
LoopEnd(&pushArgsBegin);
|
||||
Bind(&pushArgsEnd);
|
||||
@ -483,7 +483,7 @@ GateRef InterpreterStubBuilder::GetStartIdxAndNumArgs(GateRef sp, GateRef restId
|
||||
IntPtr(AsmInterpretedFrame::GetFpOffset(env->IsArch32Bit())));
|
||||
Label actualEqualDeclared(env);
|
||||
Label actualNotEqualDeclared(env);
|
||||
Branch(Int32UnsignedGreaterThan(ChangeIntPtrToInt32(PtrSub(fp, sp)),
|
||||
BRANCH(Int32UnsignedGreaterThan(ChangeIntPtrToInt32(PtrSub(fp, sp)),
|
||||
Int32Mul(Int32Add(Int32Add(numVregs, copyArgs), *numArgs),
|
||||
Int32(sizeof(JSTaggedType)))),
|
||||
&actualNotEqualDeclared, &actualEqualDeclared);
|
||||
@ -497,7 +497,7 @@ GateRef InterpreterStubBuilder::GetStartIdxAndNumArgs(GateRef sp, GateRef restId
|
||||
Label numArgsGreater(env);
|
||||
Label numArgsNotGreater(env);
|
||||
Label exit(env);
|
||||
Branch(Int32UnsignedGreaterThan(*numArgs, restIdx), &numArgsGreater, &numArgsNotGreater);
|
||||
BRANCH(Int32UnsignedGreaterThan(*numArgs, restIdx), &numArgsGreater, &numArgsNotGreater);
|
||||
Bind(&numArgsGreater);
|
||||
{
|
||||
numArgs = Int32Sub(*numArgs, restIdx);
|
||||
@ -641,7 +641,7 @@ void InterpreterStubBuilder::CheckException(GateRef glue, GateRef sp, GateRef pc
|
||||
auto env = GetEnvironment();
|
||||
Label isException(env);
|
||||
Label notException(env);
|
||||
Branch(TaggedIsException(res), &isException, ¬Exception);
|
||||
BRANCH(TaggedIsException(res), &isException, ¬Exception);
|
||||
Bind(&isException);
|
||||
{
|
||||
DISPATCH_LAST(acc);
|
||||
@ -659,7 +659,7 @@ void InterpreterStubBuilder::CheckPendingException(GateRef glue, GateRef sp, Gat
|
||||
auto env = GetEnvironment();
|
||||
Label isException(env);
|
||||
Label notException(env);
|
||||
Branch(HasPendingException(glue), &isException, ¬Exception);
|
||||
BRANCH(HasPendingException(glue), &isException, ¬Exception);
|
||||
Bind(&isException);
|
||||
{
|
||||
DISPATCH_LAST(acc);
|
||||
@ -677,7 +677,7 @@ void InterpreterStubBuilder::CheckExceptionWithVar(GateRef glue, GateRef sp, Gat
|
||||
auto env = GetEnvironment();
|
||||
Label isException(env);
|
||||
Label notException(env);
|
||||
Branch(TaggedIsException(res), &isException, ¬Exception);
|
||||
BRANCH(TaggedIsException(res), &isException, ¬Exception);
|
||||
Bind(&isException);
|
||||
{
|
||||
DISPATCH_LAST(acc);
|
||||
@ -697,7 +697,7 @@ void InterpreterStubBuilder::CheckExceptionWithJump(GateRef glue, GateRef sp, Ga
|
||||
auto env = GetEnvironment();
|
||||
Label isException(env);
|
||||
Label notException(env);
|
||||
Branch(TaggedIsException(res), &isException, ¬Exception);
|
||||
BRANCH(TaggedIsException(res), &isException, ¬Exception);
|
||||
Bind(&isException);
|
||||
{
|
||||
DISPATCH_LAST(acc);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -129,7 +129,7 @@ GateRef CircuitBuilder::GetDoubleOfTNumber(GateRef x)
|
||||
Label isDouble(env_);
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::FLOAT64(), Double(0));
|
||||
Branch(TaggedIsInt(x), &isInt, &isDouble);
|
||||
BRANCH_CIR2(TaggedIsInt(x), &isInt, &isDouble);
|
||||
Bind(&isInt);
|
||||
{
|
||||
result = ChangeInt32ToFloat64(GetInt32OfTInt(x));
|
||||
@ -160,7 +160,7 @@ GateRef CircuitBuilder::DoubleToInt(GateRef x, Label *exit)
|
||||
exp = Int32Sub(exp, Int32(base::DOUBLE_EXPONENT_BIAS));
|
||||
GateRef bits = Int32(base::INT32_BITS - 1);
|
||||
// exp < 32 - 1
|
||||
Branch(Int32LessThan(exp, bits), exit, &overflow);
|
||||
BRANCH_CIR2(Int32LessThan(exp, bits), exit, &overflow);
|
||||
|
||||
Bind(&overflow);
|
||||
{
|
||||
@ -185,7 +185,7 @@ GateRef CircuitBuilder::DoubleToInt(GateRef glue, GateRef x, size_t typeBits)
|
||||
|
||||
if (env_->IsAmd64()) {
|
||||
// 0x80000000: amd64 overflow return value
|
||||
Branch(Int32Equal(xInt, Int32(0x80000000)), &overflow, &exit);
|
||||
BRANCH_CIR2(Int32Equal(xInt, Int32(0x80000000)), &overflow, &exit);
|
||||
} else {
|
||||
GateRef xInt64 = CastDoubleToInt64(x);
|
||||
// exp = (u64 & DOUBLE_EXPONENT_MASK) >> DOUBLE_SIGNIFICAND_SIZE - DOUBLE_EXPONENT_BIAS
|
||||
@ -194,7 +194,7 @@ GateRef CircuitBuilder::DoubleToInt(GateRef glue, GateRef x, size_t typeBits)
|
||||
exp = Int32Sub(exp, Int32(base::DOUBLE_EXPONENT_BIAS));
|
||||
GateRef bits = Int32(typeBits - 1);
|
||||
// exp < 32 - 1
|
||||
Branch(Int32LessThan(exp, bits), &exit, &overflow);
|
||||
BRANCH_CIR2(Int32LessThan(exp, bits), &exit, &overflow);
|
||||
}
|
||||
Bind(&overflow);
|
||||
{
|
||||
|
@ -1138,7 +1138,7 @@ void CircuitBuilder::SetRawHashcode(GateRef glue, GateRef str, GateRef rawHashco
|
||||
Label exit(env_);
|
||||
|
||||
DEFVALUE(hash, env_, VariableType::INT32(), Int32(0));
|
||||
Branch(isInteger, &integer, ¬Integer);
|
||||
BRANCH_CIR2(isInteger, &integer, ¬Integer);
|
||||
Bind(&integer);
|
||||
{
|
||||
hash = Int32Or(rawHashcode, Int32(EcmaString::IS_INTEGER_MASK));
|
||||
@ -1170,7 +1170,7 @@ GateRef CircuitBuilder::GetHashcodeFromString(GateRef glue, GateRef value)
|
||||
Label exit(env_);
|
||||
DEFVALUE(hashcode, env_, VariableType::INT32(), Int32(0));
|
||||
hashcode = Load(VariableType::INT32(), value, IntPtr(EcmaString::MIX_HASHCODE_OFFSET));
|
||||
Branch(Int32Equal(*hashcode, Int32(0)), &noRawHashcode, &exit);
|
||||
BRANCH_CIR2(Int32Equal(*hashcode, Int32(0)), &noRawHashcode, &exit);
|
||||
Bind(&noRawHashcode);
|
||||
{
|
||||
hashcode = GetInt32OfTInt(
|
||||
@ -1193,12 +1193,12 @@ GateRef CircuitBuilder::TryGetHashcodeFromString(GateRef string)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::INT64(), Int64(-1));
|
||||
GateRef hashCode = ZExtInt32ToInt64(Load(VariableType::INT32(), string, IntPtr(EcmaString::MIX_HASHCODE_OFFSET)));
|
||||
Branch(Int64Equal(hashCode, Int64(0)), &noRawHashcode, &storeHash);
|
||||
BRANCH_CIR2(Int64Equal(hashCode, Int64(0)), &noRawHashcode, &storeHash);
|
||||
Bind(&noRawHashcode);
|
||||
{
|
||||
GateRef length = GetLengthFromString(string);
|
||||
Label lengthNotZero(env_);
|
||||
Branch(Int32Equal(length, Int32(0)), &storeHash, &exit);
|
||||
BRANCH_CIR2(Int32Equal(length, Int32(0)), &storeHash, &exit);
|
||||
}
|
||||
Bind(&storeHash);
|
||||
result = hashCode;
|
||||
@ -1217,7 +1217,7 @@ GateRef CircuitBuilder::GetStringDataFromLineOrConstantString(GateRef str)
|
||||
Label isConstantString(env_);
|
||||
Label isLineString(env_);
|
||||
DEFVALUE(result, env_, VariableType::NATIVE_POINTER(), IntPtr(0));
|
||||
Branch(IsConstantString(str), &isConstantString, &isLineString);
|
||||
BRANCH_CIR2(IsConstantString(str), &isConstantString, &isLineString);
|
||||
Bind(&isConstantString);
|
||||
{
|
||||
GateRef address = ChangeTaggedPointerToInt64(PtrAdd(str, IntPtr(ConstantString::CONSTANT_DATA_OFFSET)));
|
||||
@ -1251,7 +1251,7 @@ void CircuitBuilder::CopyChars(GateRef glue, GateRef dst, GateRef source,
|
||||
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32GreaterThan(*len, Int32(0)), &next, &exit);
|
||||
BRANCH_CIR2(Int32GreaterThan(*len, Int32(0)), &next, &exit);
|
||||
Bind(&next);
|
||||
{
|
||||
len = Int32Sub(*len, Int32(1));
|
||||
@ -1287,7 +1287,7 @@ void CircuitBuilder::CopyUtf8AsUtf16(GateRef glue, GateRef dst, GateRef src,
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32GreaterThan(*len, Int32(0)), &next, &exit);
|
||||
BRANCH_CIR2(Int32GreaterThan(*len, Int32(0)), &next, &exit);
|
||||
Bind(&next);
|
||||
{
|
||||
len = Int32Sub(*len, Int32(1));
|
||||
@ -1329,10 +1329,10 @@ GateRef CircuitBuilder::GetEnumCacheKind(GateRef glue, GateRef enumCache)
|
||||
Label isEmptyArray(env_);
|
||||
Label notEmptyArray(env_);
|
||||
|
||||
Branch(TaggedIsUndefinedOrNull(enumCache), &exit, &enumCacheIsArray);
|
||||
BRANCH_CIR2(TaggedIsUndefinedOrNull(enumCache), &exit, &enumCacheIsArray);
|
||||
Bind(&enumCacheIsArray);
|
||||
GateRef emptyArray = GetEmptyArray(glue);
|
||||
Branch(Int64Equal(enumCache, emptyArray), &isEmptyArray, ¬EmptyArray);
|
||||
BRANCH_CIR2(Int64Equal(enumCache, emptyArray), &isEmptyArray, ¬EmptyArray);
|
||||
Bind(&isEmptyArray);
|
||||
{
|
||||
result = Int32(static_cast<int32_t>(EnumCacheKind::SIMPLE));
|
||||
@ -1366,10 +1366,10 @@ GateRef CircuitBuilder::IsEnumCacheValid(GateRef receiver, GateRef cachedHclass,
|
||||
Label protoNotChanged(env_);
|
||||
|
||||
GateRef hclass = LoadHClass(receiver);
|
||||
Branch(Int64Equal(hclass, cachedHclass), &isSameHclass, &exit);
|
||||
BRANCH_CIR2(Int64Equal(hclass, cachedHclass), &isSameHclass, &exit);
|
||||
Bind(&isSameHclass);
|
||||
Branch(Int32Equal(kind, Int32(static_cast<int32_t>(EnumCacheKind::SIMPLE))),
|
||||
&isSimpleEnumCache, ¬SimpleEnumCache);
|
||||
BRANCH_CIR2(Int32Equal(kind, Int32(static_cast<int32_t>(EnumCacheKind::SIMPLE))),
|
||||
&isSimpleEnumCache, ¬SimpleEnumCache);
|
||||
Bind(&isSimpleEnumCache);
|
||||
{
|
||||
result = True();
|
||||
@ -1377,12 +1377,12 @@ GateRef CircuitBuilder::IsEnumCacheValid(GateRef receiver, GateRef cachedHclass,
|
||||
}
|
||||
Bind(¬SimpleEnumCache);
|
||||
GateRef prototype = GetPrototypeFromHClass(hclass);
|
||||
Branch(IsEcmaObject(prototype), &prototypeIsEcmaObj, &exit);
|
||||
BRANCH_CIR2(IsEcmaObject(prototype), &prototypeIsEcmaObj, &exit);
|
||||
Bind(&prototypeIsEcmaObj);
|
||||
GateRef protoChangeMarker = GetProtoChangeMarkerFromHClass(hclass);
|
||||
Branch(TaggedIsProtoChangeMarker(protoChangeMarker), &isProtoChangeMarker, &exit);
|
||||
BRANCH_CIR2(TaggedIsProtoChangeMarker(protoChangeMarker), &isProtoChangeMarker, &exit);
|
||||
Bind(&isProtoChangeMarker);
|
||||
Branch(GetHasChanged(protoChangeMarker), &exit, &protoNotChanged);
|
||||
BRANCH_CIR2(GetHasChanged(protoChangeMarker), &exit, &protoNotChanged);
|
||||
Bind(&protoNotChanged);
|
||||
{
|
||||
result = True();
|
||||
@ -1409,16 +1409,16 @@ GateRef CircuitBuilder::NeedCheckProperty(GateRef receiver)
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), True());
|
||||
DEFVALUE(current, env_, VariableType::JS_ANY(), receiver);
|
||||
|
||||
Branch(TaggedIsHeapObject(*current), &loopHead, &afterLoop);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(*current), &loopHead, &afterLoop);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(IsJSObject(*current), &isJSObject, &exit);
|
||||
BRANCH_CIR2(IsJSObject(*current), &isJSObject, &exit);
|
||||
Bind(&isJSObject);
|
||||
GateRef hclass = LoadHClass(*current);
|
||||
Branch(HasDeleteProperty(hclass), &exit, &hasNoDeleteProperty);
|
||||
BRANCH_CIR2(HasDeleteProperty(hclass), &exit, &hasNoDeleteProperty);
|
||||
Bind(&hasNoDeleteProperty);
|
||||
current = GetPrototypeFromHClass(hclass);
|
||||
Branch(TaggedIsHeapObject(*current), &loopEnd, &afterLoop);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(*current), &loopEnd, &afterLoop);
|
||||
}
|
||||
Bind(&loopEnd);
|
||||
LoopEnd(&loopHead);
|
||||
@ -1549,7 +1549,7 @@ GateRef CircuitBuilder::ToNumber(GateRef gate, GateRef value, GateRef glue)
|
||||
Label isNumber(env_);
|
||||
Label notNumber(env_);
|
||||
DEFVALUE(result, env_, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsNumber(value), &isNumber, ¬Number);
|
||||
BRANCH_CIR2(TaggedIsNumber(value), &isNumber, ¬Number);
|
||||
Bind(&isNumber);
|
||||
{
|
||||
result = value;
|
||||
|
@ -95,7 +95,7 @@ GateRef CircuitBuilder::IsSpecialSlicedString(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isSlicedStr(env_);
|
||||
Branch(isSlicedString, &isSlicedStr, &exit);
|
||||
BRANCH_CIR2(isSlicedString, &isSlicedStr, &exit);
|
||||
Bind(&isSlicedStr);
|
||||
{
|
||||
GateRef hasBackingStore = LoadConstOffset(VariableType::INT32(), obj, SlicedString::BACKING_STORE_FLAG);
|
||||
@ -115,7 +115,7 @@ GateRef CircuitBuilder::TaggedIsBigInt(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
result = Int32Equal(GetObjectType(LoadHClass(obj)),
|
||||
@ -135,7 +135,7 @@ GateRef CircuitBuilder::TaggedIsString(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
result = TaggedObjectIsString(obj);
|
||||
@ -174,7 +174,7 @@ GateRef CircuitBuilder::TaggedIsShared(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
result = TaggedObjectIsShared(obj);
|
||||
@ -193,7 +193,7 @@ GateRef CircuitBuilder::TaggedIsSymbol(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
GateRef objType = GetObjectType(LoadHClass(obj));
|
||||
@ -213,13 +213,13 @@ GateRef CircuitBuilder::TaggedIsStringOrSymbol(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
result = TaggedObjectIsString(obj);
|
||||
Label isString(env_);
|
||||
Label notString(env_);
|
||||
Branch(*result, &exit, ¬String);
|
||||
BRANCH_CIR2(*result, &exit, ¬String);
|
||||
Bind(¬String);
|
||||
{
|
||||
GateRef objType = GetObjectType(LoadHClass(obj));
|
||||
@ -240,7 +240,7 @@ GateRef CircuitBuilder::TaggedIsProtoChangeMarker(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
GateRef objType = GetObjectType(LoadHClass(obj));
|
||||
@ -322,10 +322,10 @@ GateRef CircuitBuilder::BothAreString(GateRef x, GateRef y)
|
||||
Label bothAreStringType(env_);
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Branch(BoolAnd(TaggedIsHeapObject(x), TaggedIsHeapObject(y)), &bothAreHeapObjet, &exit);
|
||||
BRANCH_CIR2(BoolAnd(TaggedIsHeapObject(x), TaggedIsHeapObject(y)), &bothAreHeapObjet, &exit);
|
||||
Bind(&bothAreHeapObjet);
|
||||
{
|
||||
Branch(TaggedObjectBothAreString(x, y), &bothAreStringType, &exit);
|
||||
BRANCH_CIR2(TaggedObjectBothAreString(x, y), &bothAreStringType, &exit);
|
||||
Bind(&bothAreStringType);
|
||||
{
|
||||
result = True();
|
||||
@ -422,7 +422,7 @@ GateRef CircuitBuilder::TaggedIsJSArray(GateRef obj)
|
||||
Label exit(env_);
|
||||
DEFVALUE(result, env_, VariableType::BOOL(), False());
|
||||
Label isHeapObject(env_);
|
||||
Branch(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
BRANCH_CIR2(TaggedIsHeapObject(obj), &isHeapObject, &exit);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
GateRef objType = GetObjectType(LoadHClass(obj));
|
||||
|
@ -142,7 +142,8 @@ void MCRLowering::LowerConvertHoleAsUndefined(GateRef gate)
|
||||
GateRef receiver = acc_.GetValueIn(gate, 0);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), receiver);
|
||||
|
||||
builder_.Branch(builder_.TaggedIsHole(*result), &returnUndefined, &exit, 1, BranchWeight::DEOPT_WEIGHT);
|
||||
builder_.Branch(builder_.TaggedIsHole(*result), &returnUndefined, &exit, 1, BranchWeight::DEOPT_WEIGHT,
|
||||
"holeCheck");
|
||||
builder_.Bind(&returnUndefined);
|
||||
{
|
||||
result = builder_.UndefineConstant();
|
||||
@ -411,7 +412,8 @@ GateRef MCRLowering::ConvertSpecialHoleIntToTagged(GateRef gate, Label* exit)
|
||||
Label returnTaggedInt(&builder_);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant());
|
||||
|
||||
builder_.Branch(builder_.IsSpecialHole(gate), &returnUndefined, &returnTaggedInt, 1, BranchWeight::DEOPT_WEIGHT);
|
||||
builder_.Branch(builder_.IsSpecialHole(gate), &returnUndefined, &returnTaggedInt, 1, BranchWeight::DEOPT_WEIGHT,
|
||||
"specialHoleCheck");
|
||||
builder_.Bind(&returnUndefined);
|
||||
{
|
||||
result = builder_.UndefineConstant();
|
||||
@ -433,7 +435,8 @@ GateRef MCRLowering::ConvertSpecialHoleDoubleToTagged(GateRef gate, Label* exit)
|
||||
Label returnTaggedDouble(&builder_);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant());
|
||||
|
||||
builder_.Branch(builder_.IsSpecialHole(gate), &returnUndefined, &returnTaggedDouble, 1, BranchWeight::DEOPT_WEIGHT);
|
||||
builder_.Branch(builder_.IsSpecialHole(gate), &returnUndefined, &returnTaggedDouble, 1, BranchWeight::DEOPT_WEIGHT,
|
||||
"specialHoleCheck");
|
||||
builder_.Bind(&returnUndefined);
|
||||
{
|
||||
result = builder_.UndefineConstant();
|
||||
@ -455,7 +458,7 @@ GateRef MCRLowering::ConvertTaggedNumberToBool(GateRef gate, Label *exit)
|
||||
Label isInt(&builder_);
|
||||
Label isDouble(&builder_);
|
||||
Label toInt32(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsInt(gate), &isInt, &isDouble);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(gate), &isInt, &isDouble);
|
||||
builder_.Bind(&isInt);
|
||||
{
|
||||
GateRef intVal = builder_.GetInt64OfTInt(gate);
|
||||
@ -478,7 +481,7 @@ GateRef MCRLowering::ConvertTaggedNumberToInt32(GateRef gate, Label *exit)
|
||||
Label isInt(&builder_);
|
||||
Label isDouble(&builder_);
|
||||
Label toInt32(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsInt(gate), &isInt, &isDouble);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(gate), &isInt, &isDouble);
|
||||
builder_.Bind(&isInt);
|
||||
result = ConvertTaggedIntToInt32(gate);
|
||||
builder_.Jump(exit);
|
||||
@ -494,7 +497,7 @@ GateRef MCRLowering::ConvertTaggedNumberToFloat64(GateRef gate, Label *exit)
|
||||
DEFVALUE(result, (&builder_), VariableType::FLOAT64(), builder_.Double(0));
|
||||
Label isInt(&builder_);
|
||||
Label isDouble(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsInt(gate), &isInt, &isDouble);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(gate), &isInt, &isDouble);
|
||||
builder_.Bind(&isInt);
|
||||
result = ConvertInt32ToFloat64(ConvertTaggedIntToInt32(gate));
|
||||
builder_.Jump(exit);
|
||||
@ -733,7 +736,7 @@ GateRef MCRLowering::ConvertUInt32ToTaggedNumber(GateRef gate, Label *exit)
|
||||
Label notOverFlow(&builder_);
|
||||
GateRef upperBound = builder_.Int32(INT32_MAX);
|
||||
DEFVALUE(taggedVal, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant());
|
||||
builder_.Branch(builder_.Int32UnsignedLessThanOrEqual(gate, upperBound), ¬OverFlow, &isOverFlow);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThanOrEqual(gate, upperBound), ¬OverFlow, &isOverFlow);
|
||||
builder_.Bind(¬OverFlow);
|
||||
taggedVal = builder_.Int32ToTaggedPtr(gate);
|
||||
builder_.Jump(exit);
|
||||
@ -959,7 +962,7 @@ void MCRLowering::InitializeWithSpeicalValue(Label *exit, GateRef object, GateRe
|
||||
builder_.Jump(&begin);
|
||||
builder_.LoopBegin(&begin);
|
||||
{
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(*startOffset, end), &storeValue, exit);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(*startOffset, end), &storeValue, exit);
|
||||
builder_.Bind(&storeValue);
|
||||
{
|
||||
builder_.Store(VariableType::INT64(), glue, object, builder_.ZExtInt32ToPtr(*startOffset), value);
|
||||
@ -984,7 +987,7 @@ void MCRLowering::LowerMigrateFromRawValueToHeapValues(GateRef gate)
|
||||
Label createCOW(&builder_);
|
||||
Label createNormal(&builder_);
|
||||
Label finishElementsInit(&builder_);
|
||||
builder_.Branch(needCOW, &createCOW, &createNormal);
|
||||
BRANCH_CIR(needCOW, &createCOW, &createNormal);
|
||||
builder_.Bind(&createCOW);
|
||||
{
|
||||
newElements = builder_.CallRuntime(glue_, RTSTUB_ID(NewCOWTaggedArray), acc_.GetDep(gate),
|
||||
@ -1010,13 +1013,13 @@ void MCRLowering::LowerMigrateFromRawValueToHeapValues(GateRef gate)
|
||||
Label storeHole(&builder_);
|
||||
Label storeNormalValue(&builder_);
|
||||
Label finishStore(&builder_);
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
builder_.Bind(&storeValue);
|
||||
{
|
||||
Label rawValueIsInt(&builder_);
|
||||
Label rawValueIsNumber(&builder_);
|
||||
GateRef value = builder_.GetValueFromJSArrayWithElementsKind(VariableType::INT64(), elements, *index);
|
||||
builder_.Branch(builder_.IsSpecialHole(value), &storeHole, &storeNormalValue);
|
||||
BRANCH_CIR(builder_.IsSpecialHole(value), &storeHole, &storeNormalValue);
|
||||
builder_.Bind(&storeHole);
|
||||
{
|
||||
builder_.SetValueToTaggedArray(VariableType::JS_ANY(), glue_, *newElements, *index, builder_.Hole());
|
||||
@ -1024,7 +1027,7 @@ void MCRLowering::LowerMigrateFromRawValueToHeapValues(GateRef gate)
|
||||
}
|
||||
builder_.Bind(&storeNormalValue);
|
||||
{
|
||||
builder_.Branch(isIntKind, &rawValueIsInt, &rawValueIsNumber);
|
||||
BRANCH_CIR(isIntKind, &rawValueIsInt, &rawValueIsNumber);
|
||||
builder_.Bind(&rawValueIsInt);
|
||||
{
|
||||
GateRef convertedInt = builder_.ToTaggedIntPtr(value);
|
||||
@ -1071,7 +1074,7 @@ void MCRLowering::LowerMigrateFromHeapValueToRawValue(GateRef gate)
|
||||
Label createCOW(&builder_);
|
||||
Label createNormal(&builder_);
|
||||
Label finishElementsInit(&builder_);
|
||||
builder_.Branch(needCOW, &createCOW, &createNormal);
|
||||
BRANCH_CIR(needCOW, &createCOW, &createNormal);
|
||||
builder_.Bind(&createCOW);
|
||||
{
|
||||
newElements = builder_.CallRuntime(glue_, RTSTUB_ID(NewCOWMutantTaggedArray), acc_.GetDep(gate),
|
||||
@ -1097,13 +1100,13 @@ void MCRLowering::LowerMigrateFromHeapValueToRawValue(GateRef gate)
|
||||
Label storeSpecialHole(&builder_);
|
||||
Label storeNormalValue(&builder_);
|
||||
Label finishStore(&builder_);
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
builder_.Bind(&storeValue);
|
||||
{
|
||||
Label convertToInt(&builder_);
|
||||
Label convertToDouble(&builder_);
|
||||
GateRef value = builder_.GetValueFromTaggedArray(elements, *index);
|
||||
builder_.Branch(builder_.TaggedIsHole(value), &storeSpecialHole, &storeNormalValue);
|
||||
BRANCH_CIR(builder_.TaggedIsHole(value), &storeSpecialHole, &storeNormalValue);
|
||||
builder_.Bind(&storeSpecialHole);
|
||||
{
|
||||
builder_.SetValueToTaggedArray(VariableType::INT64(), glue_, *newElements,
|
||||
@ -1114,7 +1117,7 @@ void MCRLowering::LowerMigrateFromHeapValueToRawValue(GateRef gate)
|
||||
{
|
||||
Label valueIsInt(&builder_);
|
||||
Label valueIsDouble(&builder_);
|
||||
builder_.Branch(isIntKind, &convertToInt, &convertToDouble);
|
||||
BRANCH_CIR(isIntKind, &convertToInt, &convertToDouble);
|
||||
builder_.Bind(&convertToInt);
|
||||
{
|
||||
GateRef convertedInt = builder_.GetInt64OfTInt(value);
|
||||
@ -1123,7 +1126,7 @@ void MCRLowering::LowerMigrateFromHeapValueToRawValue(GateRef gate)
|
||||
}
|
||||
builder_.Bind(&convertToDouble);
|
||||
{
|
||||
builder_.Branch(builder_.TaggedIsInt(value), &valueIsInt, &valueIsDouble);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(value), &valueIsInt, &valueIsDouble);
|
||||
builder_.Bind(&valueIsInt);
|
||||
{
|
||||
GateRef convertedDoubleFromTInt = builder_.CastDoubleToInt64(builder_.GetDoubleOfTInt(value));
|
||||
@ -1176,11 +1179,11 @@ void MCRLowering::LowerMigrateFromHoleIntToHoleNumber(GateRef gate)
|
||||
{
|
||||
Label storeNormalValue(&builder_);
|
||||
Label finishStore(&builder_);
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
builder_.Bind(&storeValue);
|
||||
{
|
||||
GateRef value = builder_.GetValueFromTaggedArray(VariableType::INT64(), elements, *index);
|
||||
builder_.Branch(builder_.IsSpecialHole(value), &finishStore, &storeNormalValue);
|
||||
BRANCH_CIR(builder_.IsSpecialHole(value), &finishStore, &storeNormalValue);
|
||||
builder_.Bind(&storeNormalValue);
|
||||
{
|
||||
GateRef intVal = builder_.TruncInt64ToInt32(value);
|
||||
@ -1224,11 +1227,11 @@ void MCRLowering::LowerMigrateFromHoleNumberToHoleInt(GateRef gate)
|
||||
{
|
||||
Label storeNormalValue(&builder_);
|
||||
Label finishStore(&builder_);
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(*index, length), &storeValue, &afterLoop);
|
||||
builder_.Bind(&storeValue);
|
||||
{
|
||||
GateRef value = builder_.GetValueFromTaggedArray(VariableType::INT64(), elements, *index);
|
||||
builder_.Branch(builder_.IsSpecialHole(value), &finishStore, &storeNormalValue);
|
||||
BRANCH_CIR(builder_.IsSpecialHole(value), &finishStore, &storeNormalValue);
|
||||
builder_.Bind(&storeNormalValue);
|
||||
{
|
||||
GateRef doubleVal = builder_.CastInt64ToFloat64(value);
|
||||
|
@ -186,5 +186,4 @@ void NativeInlineLowering::TryInlineMathBinaryBuiltin(GateRef gate, size_t argc,
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
} // namespace panda::ecmascript
|
||||
|
@ -74,11 +74,11 @@ GateRef NewObjectStubBuilder::NewJSArrayWithSize(GateRef hclass, GateRef size)
|
||||
Label notEmptyArray(env);
|
||||
Label initObj(env);
|
||||
GateRef isElementsKindEnabled = CallRuntime(glue_, RTSTUB_ID(IsElementsKindSwitchOn), {});
|
||||
Branch(TaggedIsTrue(isElementsKindEnabled), &enabledElementsKind, &initObj);
|
||||
BRANCH(TaggedIsTrue(isElementsKindEnabled), &enabledElementsKind, &initObj);
|
||||
Bind(&enabledElementsKind);
|
||||
{
|
||||
// For new Array(Len), the elementsKind should be Hole
|
||||
Branch(Equal(TruncInt64ToInt32(size), Int32(0)), &initObj, ¬EmptyArray);
|
||||
BRANCH(Equal(TruncInt64ToInt32(size), Int32(0)), &initObj, ¬EmptyArray);
|
||||
Bind(¬EmptyArray);
|
||||
{
|
||||
GateRef holeKindArrayClass = GetGlobalConstantValue(VariableType::JS_ANY(), glue_,
|
||||
@ -112,7 +112,7 @@ void NewObjectStubBuilder::NewJSObject(Variable *result, Label *exit, GateRef hc
|
||||
DEFVARIABLE(initValue, VariableType::JS_ANY(), Undefined());
|
||||
Label isTS(env);
|
||||
Label initialize(env);
|
||||
Branch(IsTSHClass(hclass), &isTS, &initialize);
|
||||
BRANCH(IsTSHClass(hclass), &isTS, &initialize);
|
||||
Bind(&isTS);
|
||||
{
|
||||
// The object which created by AOT speculative hclass, should be initialized as hole, means does not exist,
|
||||
@ -162,7 +162,7 @@ void NewObjectStubBuilder::NewTaggedArrayChecked(Variable *result, GateRef len,
|
||||
auto env = GetEnvironment();
|
||||
Label overflow(env);
|
||||
Label notOverflow(env);
|
||||
Branch(Int32UnsignedGreaterThan(len, Int32(INT32_MAX)), &overflow, ¬Overflow);
|
||||
BRANCH(Int32UnsignedGreaterThan(len, Int32(INT32_MAX)), &overflow, ¬Overflow);
|
||||
Bind(&overflow);
|
||||
{
|
||||
GateRef taggedId = Int32(GET_MESSAGE_STRING_ID(LenGreaterThanMax));
|
||||
@ -197,7 +197,7 @@ void NewObjectStubBuilder::NewMutantTaggedArrayChecked(Variable *result, GateRef
|
||||
AllocateInYoung(result, &afterAllocate);
|
||||
Bind(&afterAllocate);
|
||||
Label noException(env);
|
||||
Branch(TaggedIsException(result->ReadVariable()), exit, &noException);
|
||||
BRANCH(TaggedIsException(result->ReadVariable()), exit, &noException);
|
||||
Bind(&noException);
|
||||
{
|
||||
auto hclass = GetGlobalConstantValue(
|
||||
@ -222,7 +222,7 @@ GateRef NewObjectStubBuilder::NewTaggedArray(GateRef glue, GateRef len)
|
||||
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
SetGlue(glue);
|
||||
Branch(Int32Equal(len, Int32(0)), &isEmpty, ¬Empty);
|
||||
BRANCH(Int32Equal(len, Int32(0)), &isEmpty, ¬Empty);
|
||||
Bind(&isEmpty);
|
||||
{
|
||||
result = GetGlobalConstantValue(
|
||||
@ -233,7 +233,7 @@ GateRef NewObjectStubBuilder::NewTaggedArray(GateRef glue, GateRef len)
|
||||
{
|
||||
Label next(env);
|
||||
Label slowPath(env);
|
||||
Branch(Int32LessThan(len, Int32(MAX_TAGGED_ARRAY_LENGTH)), &next, &slowPath);
|
||||
BRANCH(Int32LessThan(len, Int32(MAX_TAGGED_ARRAY_LENGTH)), &next, &slowPath);
|
||||
Bind(&next);
|
||||
{
|
||||
NewTaggedArrayChecked(&result, len, &exit);
|
||||
@ -262,7 +262,7 @@ GateRef NewObjectStubBuilder::NewMutantTaggedArray(GateRef glue, GateRef len)
|
||||
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
SetGlue(glue);
|
||||
Branch(Int32Equal(len, Int32(0)), &isEmpty, ¬Empty);
|
||||
BRANCH(Int32Equal(len, Int32(0)), &isEmpty, ¬Empty);
|
||||
Bind(&isEmpty);
|
||||
{
|
||||
result = GetGlobalConstantValue(
|
||||
@ -273,7 +273,7 @@ GateRef NewObjectStubBuilder::NewMutantTaggedArray(GateRef glue, GateRef len)
|
||||
{
|
||||
Label next(env);
|
||||
Label slowPath(env);
|
||||
Branch(Int32LessThan(len, Int32(MAX_TAGGED_ARRAY_LENGTH)), &next, &slowPath);
|
||||
BRANCH(Int32LessThan(len, Int32(MAX_TAGGED_ARRAY_LENGTH)), &next, &slowPath);
|
||||
Bind(&next);
|
||||
{
|
||||
NewMutantTaggedArrayChecked(&result, len, &exit);
|
||||
@ -305,7 +305,7 @@ GateRef NewObjectStubBuilder::ExtendArray(GateRef glue, GateRef elements, GateRe
|
||||
DEFVARIABLE(index, VariableType::INT32(), Int32(0));
|
||||
DEFVARIABLE(res, VariableType::JS_ANY(), Hole());
|
||||
DEFVARIABLE(array, VariableType::JS_ANY(), Undefined());
|
||||
Branch(IsMutantTaggedArray(elements),
|
||||
BRANCH(IsMutantTaggedArray(elements),
|
||||
&newMutantArray, &newNormalArray);
|
||||
Bind(&newNormalArray);
|
||||
{
|
||||
@ -332,10 +332,10 @@ GateRef NewObjectStubBuilder::ExtendArray(GateRef glue, GateRef elements, GateRe
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, oldL), &storeValue, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*index, oldL), &storeValue, &afterLoop);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
Branch(IsMutantTaggedArray(elements),
|
||||
BRANCH(IsMutantTaggedArray(elements),
|
||||
&storeToMutantArray, &storeToNormalArray);
|
||||
Bind(&storeToNormalArray);
|
||||
{
|
||||
@ -370,10 +370,10 @@ GateRef NewObjectStubBuilder::ExtendArray(GateRef glue, GateRef elements, GateRe
|
||||
Label finishStoreHole(env);
|
||||
LoopBegin(&loopHead1);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, newLen), &storeValue1, &afterLoop1);
|
||||
BRANCH(Int32UnsignedLessThan(*index, newLen), &storeValue1, &afterLoop1);
|
||||
Bind(&storeValue1);
|
||||
{
|
||||
Branch(IsMutantTaggedArray(elements),
|
||||
BRANCH(IsMutantTaggedArray(elements),
|
||||
&storeMutantHole, &storeNormalHole);
|
||||
Bind(&storeNormalHole);
|
||||
{
|
||||
@ -417,7 +417,7 @@ GateRef NewObjectStubBuilder::CopyArray(GateRef glue, GateRef elements, GateRef
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
Label emptyArray(env);
|
||||
Label notEmptyArray(env);
|
||||
Branch(Int32Equal(newLen, Int32(0)), &emptyArray, ¬EmptyArray);
|
||||
BRANCH(Int32Equal(newLen, Int32(0)), &emptyArray, ¬EmptyArray);
|
||||
Bind(&emptyArray);
|
||||
result = GetEmptyArray(glue);
|
||||
Jump(&exit);
|
||||
@ -425,7 +425,7 @@ GateRef NewObjectStubBuilder::CopyArray(GateRef glue, GateRef elements, GateRef
|
||||
{
|
||||
Label extendArray(env);
|
||||
Label notExtendArray(env);
|
||||
Branch(Int32GreaterThan(newLen, oldLen), &extendArray, ¬ExtendArray);
|
||||
BRANCH(Int32GreaterThan(newLen, oldLen), &extendArray, ¬ExtendArray);
|
||||
Bind(&extendArray);
|
||||
{
|
||||
result = ExtendArray(glue, elements, newLen);
|
||||
@ -438,7 +438,7 @@ GateRef NewObjectStubBuilder::CopyArray(GateRef glue, GateRef elements, GateRef
|
||||
Label isNotMutantTaggedArray(env);
|
||||
Label afterInitializeElements(env);
|
||||
GateRef checkIsMutantTaggedArray = IsMutantTaggedArray(*array);
|
||||
Branch(checkIsMutantTaggedArray, &isMutantTaggedArray, &isNotMutantTaggedArray);
|
||||
BRANCH(checkIsMutantTaggedArray, &isMutantTaggedArray, &isNotMutantTaggedArray);
|
||||
Bind(&isMutantTaggedArray);
|
||||
{
|
||||
array = newBuilder.NewMutantTaggedArray(glue, newLen);
|
||||
@ -460,13 +460,13 @@ GateRef NewObjectStubBuilder::CopyArray(GateRef glue, GateRef elements, GateRef
|
||||
Jump(&loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*index, newLen), &storeValue, &afterLoop);
|
||||
BRANCH(Int32UnsignedLessThan(*index, newLen), &storeValue, &afterLoop);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
Label storeToTaggedArray(env);
|
||||
Label storeToMutantTaggedArray(env);
|
||||
Label finishStore(env);
|
||||
Branch(checkIsMutantTaggedArray, &storeToMutantTaggedArray, &storeToTaggedArray);
|
||||
BRANCH(checkIsMutantTaggedArray, &storeToMutantTaggedArray, &storeToTaggedArray);
|
||||
Bind(&storeToMutantTaggedArray);
|
||||
{
|
||||
GateRef value = GetValueFromMutantTaggedArray(elements, *index);
|
||||
@ -539,7 +539,7 @@ GateRef NewObjectStubBuilder::LoadHClassFromMethod(GateRef glue, GateRef method)
|
||||
static_cast<int64_t>(FunctionKind::ASYNC_GENERATOR_FUNCTION) };
|
||||
GateRef glueGlobalEnvOffset = IntPtr(JSThread::GlueData::GetGlueGlobalEnvOffset(env->Is32Bit()));
|
||||
GateRef glueGlobalEnv = Load(VariableType::NATIVE_POINTER(), glue, glueGlobalEnvOffset);
|
||||
Branch(Int32LessThanOrEqual(kind, Int32(static_cast<int32_t>(FunctionKind::ARROW_FUNCTION))),
|
||||
BRANCH(Int32LessThanOrEqual(kind, Int32(static_cast<int32_t>(FunctionKind::ARROW_FUNCTION))),
|
||||
&isNormal, ¬Normal);
|
||||
Bind(&isNormal);
|
||||
{
|
||||
@ -558,7 +558,7 @@ GateRef NewObjectStubBuilder::LoadHClassFromMethod(GateRef glue, GateRef method)
|
||||
}
|
||||
Bind(¬Normal);
|
||||
{
|
||||
Branch(Int32LessThanOrEqual(kind, Int32(static_cast<int32_t>(FunctionKind::ASYNC_FUNCTION))),
|
||||
BRANCH(Int32LessThanOrEqual(kind, Int32(static_cast<int32_t>(FunctionKind::ASYNC_FUNCTION))),
|
||||
&isAsync, ¬Async);
|
||||
Bind(&isAsync);
|
||||
{
|
||||
@ -610,11 +610,11 @@ GateRef NewObjectStubBuilder::NewJSFunction(GateRef glue, GateRef constpool, Gat
|
||||
auto val = GetValueFromTaggedArray(constpool, index);
|
||||
Label isHeapObject(env);
|
||||
Label afterAOTLiteral(env);
|
||||
Branch(TaggedIsHeapObject(val), &isHeapObject, &afterAOTLiteral);
|
||||
BRANCH(TaggedIsHeapObject(val), &isHeapObject, &afterAOTLiteral);
|
||||
{
|
||||
Bind(&isHeapObject);
|
||||
Label isAOTLiteral(env);
|
||||
Branch(IsAOTLiteralInfo(val), &isAOTLiteral, &afterAOTLiteral);
|
||||
BRANCH(IsAOTLiteralInfo(val), &isAOTLiteral, &afterAOTLiteral);
|
||||
{
|
||||
Bind(&isAOTLiteral);
|
||||
ihc = GetIhcFromAOTLiteralInfo(val);
|
||||
@ -632,7 +632,7 @@ GateRef NewObjectStubBuilder::NewJSFunction(GateRef glue, GateRef constpool, Gat
|
||||
SetMethodToFunction(glue, *result, method);
|
||||
|
||||
Label ihcNotUndefined(env);
|
||||
Branch(TaggedIsUndefined(*ihc), &exit, &ihcNotUndefined);
|
||||
BRANCH(TaggedIsUndefined(*ihc), &exit, &ihcNotUndefined);
|
||||
Bind(&ihcNotUndefined);
|
||||
{
|
||||
CallRuntime(glue, RTSTUB_ID(AOTEnableProtoChangeMarker), { *result, *ihc});
|
||||
@ -653,7 +653,7 @@ void NewObjectStubBuilder::NewJSFunction(GateRef glue, GateRef jsFunc, GateRef i
|
||||
GateRef constPool = GetConstPoolFromFunction(jsFunc);
|
||||
GateRef module = GetModuleFromFunction(jsFunc);
|
||||
result->WriteVariable(NewJSFunction(glue, constPool, module, index));
|
||||
Branch(HasPendingException(glue), &hasException, ¬Exception);
|
||||
BRANCH(HasPendingException(glue), &hasException, ¬Exception);
|
||||
Bind(&hasException);
|
||||
{
|
||||
Jump(failed);
|
||||
@ -690,12 +690,12 @@ void NewObjectStubBuilder::InitializeJSFunction(GateRef glue, GateRef func, Gate
|
||||
SetWorkNodePointerToFunction(glue, func, NullPtr());
|
||||
SetMethodToFunction(glue, func, Undefined());
|
||||
|
||||
Branch(HasPrototype(kind), &hasProto, ¬Proto);
|
||||
BRANCH(HasPrototype(kind), &hasProto, ¬Proto);
|
||||
Bind(&hasProto);
|
||||
{
|
||||
auto funcprotoAccessor = GetGlobalConstantValue(VariableType::JS_POINTER(), glue,
|
||||
ConstantIndex::FUNCTION_PROTOTYPE_ACCESSOR);
|
||||
Branch(IsBaseKind(kind), &isBase, ¬Base);
|
||||
BRANCH(IsBaseKind(kind), &isBase, ¬Base);
|
||||
Bind(&isBase);
|
||||
{
|
||||
SetPropertyInlinedProps(glue, func, hclass, funcprotoAccessor,
|
||||
@ -708,7 +708,7 @@ void NewObjectStubBuilder::InitializeJSFunction(GateRef glue, GateRef func, Gate
|
||||
ConstantIndex::FUNCTION_LENGTH_ACCESSOR);
|
||||
SetPropertyInlinedProps(glue, func, hclass, funcAccessor,
|
||||
Int32(JSFunction::LENGTH_INLINE_PROPERTY_INDEX));
|
||||
Branch(IsGeneratorKind(kind), &isGenerator, &exit);
|
||||
BRANCH(IsGeneratorKind(kind), &isGenerator, &exit);
|
||||
Bind(&isGenerator);
|
||||
{
|
||||
thisObj = CallRuntime(glue, RTSTUB_ID(InitializeGeneratorFunction), {kind});
|
||||
@ -718,7 +718,7 @@ void NewObjectStubBuilder::InitializeJSFunction(GateRef glue, GateRef func, Gate
|
||||
}
|
||||
Bind(¬Base);
|
||||
{
|
||||
Branch(IsClassConstructorKind(kind), &exit, ¬ClassConstructor);
|
||||
BRANCH(IsClassConstructorKind(kind), &exit, ¬ClassConstructor);
|
||||
Bind(¬ClassConstructor);
|
||||
{
|
||||
CallRuntime(glue, RTSTUB_ID(FunctionDefineOwnProperty), {func, funcprotoAccessor, kind});
|
||||
@ -728,7 +728,7 @@ void NewObjectStubBuilder::InitializeJSFunction(GateRef glue, GateRef func, Gate
|
||||
}
|
||||
Bind(¬Proto);
|
||||
{
|
||||
Branch(HasAccessor(kind), &hasAccess, &exit);
|
||||
BRANCH(HasAccessor(kind), &hasAccess, &exit);
|
||||
Bind(&hasAccess);
|
||||
{
|
||||
auto funcAccessor = GetGlobalConstantValue(VariableType::JS_POINTER(), glue,
|
||||
@ -761,7 +761,7 @@ GateRef NewObjectStubBuilder::EnumerateObjectProperties(GateRef glue, GateRef ob
|
||||
Label empty(env);
|
||||
Label tryGetEnumCache(env);
|
||||
Label cacheHit(env);
|
||||
Branch(TaggedIsString(obj), &isString, &isNotString);
|
||||
BRANCH(TaggedIsString(obj), &isString, &isNotString);
|
||||
Bind(&isString);
|
||||
{
|
||||
object = CallRuntime(glue, RTSTUB_ID(PrimitiveStringCreate), { obj });;
|
||||
@ -773,10 +773,10 @@ GateRef NewObjectStubBuilder::EnumerateObjectProperties(GateRef glue, GateRef ob
|
||||
Jump(&afterObjectTransform);
|
||||
}
|
||||
Bind(&afterObjectTransform);
|
||||
Branch(TaggedIsUndefinedOrNull(*object), &empty, &tryGetEnumCache);
|
||||
BRANCH(TaggedIsUndefinedOrNull(*object), &empty, &tryGetEnumCache);
|
||||
Bind(&tryGetEnumCache);
|
||||
GateRef enumCache = TryGetEnumCache(glue, *object);
|
||||
Branch(TaggedIsUndefined(enumCache), &slowpath, &cacheHit);
|
||||
BRANCH(TaggedIsUndefined(enumCache), &slowpath, &cacheHit);
|
||||
Bind(&cacheHit);
|
||||
{
|
||||
GateRef hclass = LoadHClass(*object);
|
||||
@ -818,13 +818,13 @@ void NewObjectStubBuilder::NewArgumentsList(Variable *result, Label *exit,
|
||||
Label setArgumentsBegin(env);
|
||||
Label setArgumentsAgain(env);
|
||||
Label setArgumentsEnd(env);
|
||||
Branch(Int32UnsignedLessThan(*i, numArgs), &setArgumentsBegin, &setArgumentsEnd);
|
||||
BRANCH(Int32UnsignedLessThan(*i, numArgs), &setArgumentsBegin, &setArgumentsEnd);
|
||||
LoopBegin(&setArgumentsBegin);
|
||||
GateRef idx = ZExtInt32ToPtr(Int32Add(startIdx, *i));
|
||||
GateRef argument = Load(VariableType::JS_ANY(), sp, PtrMul(IntPtr(sizeof(JSTaggedType)), idx));
|
||||
SetValueToTaggedArray(VariableType::JS_ANY(), glue_, result->ReadVariable(), *i, argument);
|
||||
i = Int32Add(*i, Int32(1));
|
||||
Branch(Int32UnsignedLessThan(*i, numArgs), &setArgumentsAgain, &setArgumentsEnd);
|
||||
BRANCH(Int32UnsignedLessThan(*i, numArgs), &setArgumentsAgain, &setArgumentsEnd);
|
||||
Bind(&setArgumentsAgain);
|
||||
LoopEnd(&setArgumentsBegin);
|
||||
Bind(&setArgumentsEnd);
|
||||
@ -844,7 +844,7 @@ void NewObjectStubBuilder::NewArgumentsObj(Variable *result, Label *exit,
|
||||
NewJSObject(result, &afterNewObject, argumentsClass);
|
||||
Bind(&afterNewObject);
|
||||
Label setArgumentsObjProperties(env);
|
||||
Branch(TaggedIsException(result->ReadVariable()), exit, &setArgumentsObjProperties);
|
||||
BRANCH(TaggedIsException(result->ReadVariable()), exit, &setArgumentsObjProperties);
|
||||
Bind(&setArgumentsObjProperties);
|
||||
SetPropertyInlinedProps(glue_, result->ReadVariable(), argumentsClass, IntToTaggedInt(numArgs),
|
||||
Int32(JSArguments::LENGTH_INLINE_PROPERTY_INDEX));
|
||||
@ -928,7 +928,7 @@ void NewObjectStubBuilder::AllocateInYoungPrologue(Variable *result, Label *call
|
||||
#ifdef ECMASCRIPT_SUPPORT_HEAPSAMPLING
|
||||
auto isStartHeapSamplingOffset = JSThread::GlueData::GetIsStartHeapSamplingOffset(env->Is32Bit());
|
||||
auto isStartHeapSampling = Load(VariableType::JS_ANY(), glue_, IntPtr(isStartHeapSamplingOffset));
|
||||
Branch(TaggedIsTrue(isStartHeapSampling), callRuntime, &next);
|
||||
BRANCH(TaggedIsTrue(isStartHeapSampling), callRuntime, &next);
|
||||
Bind(&next);
|
||||
#endif
|
||||
auto topOffset = JSThread::GlueData::GetNewSpaceAllocationTopAddressOffset(env->Is32Bit());
|
||||
@ -938,7 +938,7 @@ void NewObjectStubBuilder::AllocateInYoungPrologue(Variable *result, Label *call
|
||||
auto top = Load(VariableType::JS_POINTER(), topAddress, IntPtr(0));
|
||||
auto end = Load(VariableType::JS_POINTER(), endAddress, IntPtr(0));
|
||||
auto newTop = PtrAdd(top, size_);
|
||||
Branch(IntPtrGreaterThan(newTop, end), callRuntime, &success);
|
||||
BRANCH(IntPtrGreaterThan(newTop, end), callRuntime, &success);
|
||||
Bind(&success);
|
||||
{
|
||||
Store(VariableType::NATIVE_POINTER(), glue_, topAddress, IntPtr(0), newTop);
|
||||
@ -977,7 +977,7 @@ void NewObjectStubBuilder::AllocateInYoung(Variable *result, Label *error, Label
|
||||
ret = CallRuntime(glue_, RTSTUB_ID(AllocateInYoung), {
|
||||
IntToTaggedInt(size_) });
|
||||
result->WriteVariable(*ret);
|
||||
Branch(TaggedIsException(*ret), error, noError);
|
||||
BRANCH(TaggedIsException(*ret), error, noError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1023,7 +1023,7 @@ void NewObjectStubBuilder::InitializeWithSpeicalValue(Label *exit, GateRef objec
|
||||
Jump(&begin);
|
||||
LoopBegin(&begin);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*startOffset, end), &storeValue, exit);
|
||||
BRANCH(Int32UnsignedLessThan(*startOffset, end), &storeValue, exit);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
Store(VariableType::INT64(), glue_, object, ZExtInt32ToPtr(*startOffset), value);
|
||||
@ -1127,12 +1127,12 @@ GateRef NewObjectStubBuilder::FastNewThisObject(GateRef glue, GateRef ctor)
|
||||
DEFVARIABLE(thisObj, VariableType::JS_ANY(), Undefined());
|
||||
auto protoOrHclass = Load(VariableType::JS_ANY(), ctor,
|
||||
IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET));
|
||||
Branch(TaggedIsHeapObject(protoOrHclass), &isHeapObject, &callRuntime);
|
||||
BRANCH(TaggedIsHeapObject(protoOrHclass), &isHeapObject, &callRuntime);
|
||||
Bind(&isHeapObject);
|
||||
Branch(IsJSHClass(protoOrHclass), &checkJSObject, &callRuntime);
|
||||
BRANCH(IsJSHClass(protoOrHclass), &checkJSObject, &callRuntime);
|
||||
Bind(&checkJSObject);
|
||||
auto objectType = GetObjectType(protoOrHclass);
|
||||
Branch(Int32Equal(objectType, Int32(static_cast<int32_t>(JSType::JS_OBJECT))),
|
||||
BRANCH(Int32Equal(objectType, Int32(static_cast<int32_t>(JSType::JS_OBJECT))),
|
||||
&newObject, &callRuntime);
|
||||
Bind(&newObject);
|
||||
{
|
||||
@ -1166,7 +1166,7 @@ GateRef NewObjectStubBuilder::FastSuperAllocateThis(GateRef glue, GateRef superC
|
||||
|
||||
DEFVARIABLE(thisObj, VariableType::JS_ANY(), Undefined());
|
||||
DEFVARIABLE(protoOrHclass, VariableType::JS_ANY(), Undefined());
|
||||
Branch(IsBase(newTarget), &newTargetIsBase, &newTargetNotBase);
|
||||
BRANCH(IsBase(newTarget), &newTargetIsBase, &newTargetNotBase);
|
||||
Bind(&newTargetIsBase);
|
||||
{
|
||||
protoOrHclass = Load(VariableType::JS_ANY(), superCtor,
|
||||
@ -1180,12 +1180,12 @@ GateRef NewObjectStubBuilder::FastSuperAllocateThis(GateRef glue, GateRef superC
|
||||
Jump(&checkHeapObject);
|
||||
}
|
||||
Bind(&checkHeapObject);
|
||||
Branch(TaggedIsHeapObject(*protoOrHclass), &isHeapObject, &callRuntime);
|
||||
BRANCH(TaggedIsHeapObject(*protoOrHclass), &isHeapObject, &callRuntime);
|
||||
Bind(&isHeapObject);
|
||||
Branch(IsJSHClass(*protoOrHclass), &checkJSObject, &callRuntime);
|
||||
BRANCH(IsJSHClass(*protoOrHclass), &checkJSObject, &callRuntime);
|
||||
Bind(&checkJSObject);
|
||||
auto objectType = GetObjectType(*protoOrHclass);
|
||||
Branch(Int32Equal(objectType, Int32(static_cast<int32_t>(JSType::JS_OBJECT))),
|
||||
BRANCH(Int32Equal(objectType, Int32(static_cast<int32_t>(JSType::JS_OBJECT))),
|
||||
&newObject, &callRuntime);
|
||||
Bind(&newObject);
|
||||
{
|
||||
@ -1218,14 +1218,14 @@ GateRef NewObjectStubBuilder::NewThisObjectChecked(GateRef glue, GateRef ctor)
|
||||
|
||||
DEFVARIABLE(thisObj, VariableType::JS_ANY(), Undefined());
|
||||
|
||||
Branch(TaggedIsHeapObject(ctor), &ctorIsHeapObject, &slowPath);
|
||||
BRANCH(TaggedIsHeapObject(ctor), &ctorIsHeapObject, &slowPath);
|
||||
Bind(&ctorIsHeapObject);
|
||||
Branch(IsJSFunction(ctor), &ctorIsJSFunction, &slowPath);
|
||||
BRANCH(IsJSFunction(ctor), &ctorIsJSFunction, &slowPath);
|
||||
Bind(&ctorIsJSFunction);
|
||||
Branch(IsConstructor(ctor), &fastPath, &slowPath);
|
||||
BRANCH(IsConstructor(ctor), &fastPath, &slowPath);
|
||||
Bind(&fastPath);
|
||||
{
|
||||
Branch(IsBase(ctor), &ctorIsBase, &exit);
|
||||
BRANCH(IsBase(ctor), &ctorIsBase, &exit);
|
||||
Bind(&ctorIsBase);
|
||||
{
|
||||
thisObj = FastNewThisObject(glue, ctor);
|
||||
@ -1255,7 +1255,7 @@ GateRef NewObjectStubBuilder::LoadTrackInfo(GateRef glue, GateRef jsFunc, GateRe
|
||||
Label uninitialized(env);
|
||||
Label fastpath(env);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsHeapObject(slotValue), &fastpath, &uninitialized);
|
||||
BRANCH(TaggedIsHeapObject(slotValue), &fastpath, &uninitialized);
|
||||
Bind(&fastpath);
|
||||
{
|
||||
ret = slotValue;
|
||||
@ -1296,7 +1296,7 @@ GateRef NewObjectStubBuilder::LoadArrayHClassSlowPath(
|
||||
auto hcIndexInfos = LoadHCIndexInfosFromConstPool(jsFunc);
|
||||
auto indexInfosLength = GetLengthOfTaggedArray(hcIndexInfos);
|
||||
Label aotLoad(env);
|
||||
Branch(Int32Equal(indexInfosLength, Int32(0)), &originLoad, &aotLoad);
|
||||
BRANCH(Int32Equal(indexInfosLength, Int32(0)), &originLoad, &aotLoad);
|
||||
Bind(&aotLoad);
|
||||
{
|
||||
auto pfAddr = LoadPfHeaderFromConstPool(jsFunc);
|
||||
@ -1386,7 +1386,7 @@ GateRef NewObjectStubBuilder::CreateEmptyArray(
|
||||
Label slowpath(env);
|
||||
Label mayFastpath(env);
|
||||
Label createArray(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &slowpath, &mayFastpath);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &slowpath, &mayFastpath);
|
||||
Bind(&mayFastpath);
|
||||
{
|
||||
trackInfo = LoadTrackInfo(glue, jsFunc, pc, profileTypeInfo, slotId, Circuit::NullGate(), callback);
|
||||
@ -1426,7 +1426,7 @@ GateRef NewObjectStubBuilder::CreateArrayWithBuffer(GateRef glue,
|
||||
Label slowpath(env);
|
||||
Label mayFastpath(env);
|
||||
Label createArray(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &slowpath, &mayFastpath);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &slowpath, &mayFastpath);
|
||||
Bind(&mayFastpath);
|
||||
{
|
||||
trackInfo = LoadTrackInfo(glue, jsFunc, pc, profileTypeInfo, slotId, obj, callback);
|
||||
|
@ -236,13 +236,14 @@ GateRef NTypeHCRLowering::NewTaggedArray(size_t length, GateRef glue)
|
||||
GateRef NTypeHCRLowering::LowerCallRuntime(GateRef glue, GateRef hirGate, int index, const std::vector<GateRef> &args,
|
||||
bool useLabel)
|
||||
{
|
||||
const std::string name = RuntimeStubCSigns::GetRTName(index);
|
||||
if (useLabel) {
|
||||
GateRef result = builder_.CallRuntime(glue, index, Gate::InvalidGateRef, args, hirGate);
|
||||
GateRef result = builder_.CallRuntime(glue, index, Gate::InvalidGateRef, args, hirGate, name.c_str());
|
||||
return result;
|
||||
} else {
|
||||
const CallSignature *cs = RuntimeStubCSigns::Get(RTSTUB_ID(CallRuntime));
|
||||
GateRef target = builder_.IntPtr(index);
|
||||
GateRef result = builder_.Call(cs, glue, target, dependEntry_, args, hirGate);
|
||||
GateRef result = builder_.Call(cs, glue, target, dependEntry_, args, hirGate, name.c_str());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -264,7 +265,7 @@ void NTypeHCRLowering::LowerStoreModuleVar(GateRef gate, GateRef glue)
|
||||
|
||||
Label dataIsUndefined(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsUndefined(data), &dataIsUndefined, &exit);
|
||||
BRANCH_CIR(builder_.TaggedIsUndefined(data), &dataIsUndefined, &exit);
|
||||
builder_.Bind(&dataIsUndefined);
|
||||
{
|
||||
GateRef size = builder_.GetLengthOfTaggedArray(localExportEntries);
|
||||
@ -293,7 +294,7 @@ void NTypeHCRLowering::LowerLdLocalModuleVar(GateRef gate)
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), builder_.Hole());
|
||||
Label dataIsNotUndefined(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsUndefined(dictionary), &exit, &dataIsNotUndefined);
|
||||
BRANCH_CIR(builder_.TaggedIsUndefined(dictionary), &exit, &dataIsNotUndefined);
|
||||
builder_.Bind(&dataIsNotUndefined);
|
||||
{
|
||||
GateRef dataOffset = builder_.Int32(TaggedArray::DATA_OFFSET);
|
||||
@ -309,7 +310,7 @@ void NTypeHCRLowering::LowerLdLocalModuleVar(GateRef gate)
|
||||
void NTypeHCRLowering::ReplaceGateWithPendingException(GateRef gate, GateRef state, GateRef depend, GateRef value)
|
||||
{
|
||||
auto condition = builder_.HasPendingException(glue_);
|
||||
GateRef ifBranch = builder_.Branch(state, condition);
|
||||
GateRef ifBranch = builder_.Branch(state, condition, 1, BranchWeight::DEOPT_WEIGHT, "checkException");
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
GateRef eDepend = builder_.DependRelay(ifTrue, depend);
|
||||
|
@ -488,7 +488,7 @@ void NumberSpeculativeLowering::VisitBooleanJump(GateRef gate)
|
||||
std::swap(trueWeight, falseWeight);
|
||||
condition = builder_.BoolNot(condition);
|
||||
}
|
||||
GateRef ifBranch = builder_.Branch(acc_.GetState(gate), condition, trueWeight, falseWeight);
|
||||
GateRef ifBranch = builder_.Branch(acc_.GetState(gate), condition, trueWeight, falseWeight, "booleanJump");
|
||||
acc_.ReplaceGate(gate, ifBranch, acc_.GetDep(gate), Circuit::NullGate());
|
||||
}
|
||||
|
||||
@ -1018,7 +1018,7 @@ void NumberSpeculativeLowering::VisitLoadPropertyOnProto(GateRef gate)
|
||||
builder_.LoopBegin(&loopHead);
|
||||
builder_.DeoptCheck(builder_.TaggedIsNotNull(*current), frameState, DeoptType::INCONSISTENTHCLASS7);
|
||||
auto curHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), *current, TaggedObject::HCLASS_OFFSET);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
current = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
|
@ -29,7 +29,7 @@ GateRef OperationsStubBuilder::Equal(GateRef glue, GateRef left, GateRef right,
|
||||
Label notHole(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
result = FastEqual(glue, left, right, callback);
|
||||
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*result), &isHole, ¬Hole);
|
||||
Bind(&isHole);
|
||||
{
|
||||
// slow path
|
||||
@ -40,7 +40,7 @@ GateRef OperationsStubBuilder::Equal(GateRef glue, GateRef left, GateRef right,
|
||||
{
|
||||
Label resultIsTrue(env);
|
||||
Label resultNotTrue(env);
|
||||
Branch(TaggedIsTrue(*result), &resultIsTrue, &resultNotTrue);
|
||||
BRANCH(TaggedIsTrue(*result), &resultIsTrue, &resultNotTrue);
|
||||
Bind(&resultIsTrue);
|
||||
{
|
||||
callback.ProfileBranch(true);
|
||||
@ -69,7 +69,7 @@ GateRef OperationsStubBuilder::NotEqual(GateRef glue, GateRef left, GateRef righ
|
||||
result = FastEqual(glue, left, right, callback);
|
||||
Label isHole(env);
|
||||
Label notHole(env);
|
||||
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
||||
BRANCH(TaggedIsHole(*result), &isHole, ¬Hole);
|
||||
Bind(&isHole);
|
||||
{
|
||||
// slow path
|
||||
@ -80,7 +80,7 @@ GateRef OperationsStubBuilder::NotEqual(GateRef glue, GateRef left, GateRef righ
|
||||
{
|
||||
Label resultIsTrue(env);
|
||||
Label resultNotTrue(env);
|
||||
Branch(TaggedIsTrue(*result), &resultIsTrue, &resultNotTrue);
|
||||
BRANCH(TaggedIsTrue(*result), &resultIsTrue, &resultNotTrue);
|
||||
Bind(&resultIsTrue);
|
||||
{
|
||||
result = TaggedFalse();
|
||||
@ -109,7 +109,7 @@ GateRef OperationsStubBuilder::StrictEqual(GateRef glue, GateRef left, GateRef r
|
||||
Label strictEqual(env);
|
||||
Label notStrictEqual(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), TaggedTrue());
|
||||
Branch(FastStrictEqual(glue, left, right, callback), &strictEqual, ¬StrictEqual);
|
||||
BRANCH(FastStrictEqual(glue, left, right, callback), &strictEqual, ¬StrictEqual);
|
||||
Bind(&strictEqual);
|
||||
{
|
||||
callback.ProfileBranch(true);
|
||||
@ -136,7 +136,7 @@ GateRef OperationsStubBuilder::StrictNotEqual(GateRef glue, GateRef left, GateRe
|
||||
Label strictEqual(env);
|
||||
Label notStrictEqual(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), TaggedTrue());
|
||||
Branch(FastStrictEqual(glue, left, right, callback), &strictEqual, ¬StrictEqual);
|
||||
BRANCH(FastStrictEqual(glue, left, right, callback), &strictEqual, ¬StrictEqual);
|
||||
Bind(&strictEqual);
|
||||
{
|
||||
result = TaggedFalse();
|
||||
@ -167,27 +167,27 @@ GateRef OperationsStubBuilder::Less(GateRef glue, GateRef left, GateRef right, P
|
||||
Label slowPath(env);
|
||||
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
GateRef intLeft = TaggedGetInt(left);
|
||||
GateRef intRight = TaggedGetInt(right);
|
||||
Branch(Int32LessThan(intLeft, intRight), &leftLessRight, &leftNotLessRight);
|
||||
BRANCH(Int32LessThan(intLeft, intRight), &leftLessRight, &leftNotLessRight);
|
||||
}
|
||||
}
|
||||
Bind(&leftOrRightNotInt);
|
||||
{
|
||||
Label leftIsNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
// fast path
|
||||
@ -200,7 +200,7 @@ GateRef OperationsStubBuilder::Less(GateRef glue, GateRef left, GateRef right, P
|
||||
Label exit2(env);
|
||||
Label rightIsInt1(env);
|
||||
Label rightNotInt1(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
Bind(&leftIsInt1);
|
||||
{
|
||||
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
||||
@ -214,7 +214,7 @@ GateRef OperationsStubBuilder::Less(GateRef glue, GateRef left, GateRef right, P
|
||||
}
|
||||
Bind(&exit1);
|
||||
{
|
||||
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
}
|
||||
Bind(&rightIsInt1);
|
||||
{
|
||||
@ -232,7 +232,7 @@ GateRef OperationsStubBuilder::Less(GateRef glue, GateRef left, GateRef right, P
|
||||
}
|
||||
Bind(&exit2);
|
||||
{
|
||||
Branch(DoubleLessThan(*doubleLeft, *doubleRight), &leftLessRight, &leftNotLessRight);
|
||||
BRANCH(DoubleLessThan(*doubleLeft, *doubleRight), &leftLessRight, &leftNotLessRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -274,27 +274,27 @@ GateRef OperationsStubBuilder::LessEq(GateRef glue, GateRef left, GateRef right,
|
||||
Label slowPath(env);
|
||||
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
GateRef intLeft = TaggedGetInt(left);
|
||||
GateRef intRight = TaggedGetInt(right);
|
||||
Branch(Int32LessThanOrEqual(intLeft, intRight), &leftLessEqRight, &leftNotLessEqRight);
|
||||
BRANCH(Int32LessThanOrEqual(intLeft, intRight), &leftLessEqRight, &leftNotLessEqRight);
|
||||
}
|
||||
}
|
||||
Bind(&leftOrRightNotInt);
|
||||
{
|
||||
Label leftIsNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
// fast path
|
||||
@ -307,7 +307,7 @@ GateRef OperationsStubBuilder::LessEq(GateRef glue, GateRef left, GateRef right,
|
||||
Label exit2(env);
|
||||
Label rightIsInt1(env);
|
||||
Label rightNotInt1(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
Bind(&leftIsInt1);
|
||||
{
|
||||
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
||||
@ -321,7 +321,7 @@ GateRef OperationsStubBuilder::LessEq(GateRef glue, GateRef left, GateRef right,
|
||||
}
|
||||
Bind(&exit1);
|
||||
{
|
||||
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
}
|
||||
Bind(&rightIsInt1);
|
||||
{
|
||||
@ -339,7 +339,7 @@ GateRef OperationsStubBuilder::LessEq(GateRef glue, GateRef left, GateRef right,
|
||||
}
|
||||
Bind(&exit2);
|
||||
{
|
||||
Branch(DoubleLessThanOrEqual(*doubleLeft, *doubleRight), &leftLessEqRight, &leftNotLessEqRight);
|
||||
BRANCH(DoubleLessThanOrEqual(*doubleLeft, *doubleRight), &leftLessEqRight, &leftNotLessEqRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -380,27 +380,27 @@ GateRef OperationsStubBuilder::Greater(GateRef glue, GateRef left, GateRef right
|
||||
Label leftNotGreaterRight(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
GateRef intLeft = TaggedGetInt(left);
|
||||
GateRef intRight = TaggedGetInt(right);
|
||||
Branch(Int32GreaterThan(intLeft, intRight), &leftGreaterRight, &leftNotGreaterRight);
|
||||
BRANCH(Int32GreaterThan(intLeft, intRight), &leftGreaterRight, &leftNotGreaterRight);
|
||||
}
|
||||
}
|
||||
Bind(&leftOrRightNotInt);
|
||||
{
|
||||
Label leftIsNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
// fast path
|
||||
@ -413,7 +413,7 @@ GateRef OperationsStubBuilder::Greater(GateRef glue, GateRef left, GateRef right
|
||||
Label exit2(env);
|
||||
Label rightIsInt1(env);
|
||||
Label rightNotInt1(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
Bind(&leftIsInt1);
|
||||
{
|
||||
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
||||
@ -427,7 +427,7 @@ GateRef OperationsStubBuilder::Greater(GateRef glue, GateRef left, GateRef right
|
||||
}
|
||||
Bind(&exit1);
|
||||
{
|
||||
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
}
|
||||
Bind(&rightIsInt1);
|
||||
{
|
||||
@ -445,7 +445,7 @@ GateRef OperationsStubBuilder::Greater(GateRef glue, GateRef left, GateRef right
|
||||
}
|
||||
Bind(&exit2);
|
||||
{
|
||||
Branch(DoubleGreaterThan(*doubleLeft, *doubleRight), &leftGreaterRight, &leftNotGreaterRight);
|
||||
BRANCH(DoubleGreaterThan(*doubleLeft, *doubleRight), &leftGreaterRight, &leftNotGreaterRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -486,27 +486,27 @@ GateRef OperationsStubBuilder::GreaterEq(GateRef glue, GateRef left, GateRef rig
|
||||
Label leftNotGreaterEQRight(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
GateRef intLeft = TaggedGetInt(left);
|
||||
GateRef intRight = TaggedGetInt(right);
|
||||
Branch(Int32GreaterThanOrEqual(intLeft, intRight), &leftGreaterEqRight, &leftNotGreaterEQRight);
|
||||
BRANCH(Int32GreaterThanOrEqual(intLeft, intRight), &leftGreaterEqRight, &leftNotGreaterEQRight);
|
||||
}
|
||||
}
|
||||
Bind(&leftOrRightNotInt);
|
||||
{
|
||||
Label leftIsNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
// fast path
|
||||
@ -519,7 +519,7 @@ GateRef OperationsStubBuilder::GreaterEq(GateRef glue, GateRef left, GateRef rig
|
||||
Label exit2(env);
|
||||
Label rightIsInt1(env);
|
||||
Label rightNotInt1(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
||||
Bind(&leftIsInt1);
|
||||
{
|
||||
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
||||
@ -533,7 +533,7 @@ GateRef OperationsStubBuilder::GreaterEq(GateRef glue, GateRef left, GateRef rig
|
||||
}
|
||||
Bind(&exit1);
|
||||
{
|
||||
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
||||
}
|
||||
Bind(&rightIsInt1);
|
||||
{
|
||||
@ -551,7 +551,7 @@ GateRef OperationsStubBuilder::GreaterEq(GateRef glue, GateRef left, GateRef rig
|
||||
}
|
||||
Bind(&exit2);
|
||||
{
|
||||
Branch(DoubleGreaterThanOrEqual(*doubleLeft, *doubleRight),
|
||||
BRANCH(DoubleGreaterThanOrEqual(*doubleLeft, *doubleRight),
|
||||
&leftGreaterEqRight, &leftNotGreaterEQRight);
|
||||
}
|
||||
}
|
||||
@ -589,7 +589,7 @@ GateRef OperationsStubBuilder::Add(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label exit(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), FastAdd(glue, left, right, callback));
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
Bind(&slowPath);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::AnyType()));
|
||||
@ -610,7 +610,7 @@ GateRef OperationsStubBuilder::Sub(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label exit(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), FastSub(glue, left, right, callback));
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
Bind(&slowPath);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::AnyType()));
|
||||
@ -631,7 +631,7 @@ GateRef OperationsStubBuilder::Mul(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label exit(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), FastMul(glue, left, right, callback));
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
Bind(&slowPath);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::AnyType()));
|
||||
@ -652,7 +652,7 @@ GateRef OperationsStubBuilder::Div(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label exit(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), FastDiv(left, right, callback));
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
Bind(&slowPath);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::AnyType()));
|
||||
@ -673,7 +673,7 @@ GateRef OperationsStubBuilder::Mod(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label exit(env);
|
||||
Label slowPath(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), FastMod(glue, left, right, callback));
|
||||
Branch(TaggedIsHole(*result), &slowPath, &exit);
|
||||
BRANCH(TaggedIsHole(*result), &slowPath, &exit);
|
||||
Bind(&slowPath);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::AnyType()));
|
||||
@ -700,21 +700,21 @@ GateRef OperationsStubBuilder::Shl(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label calculate(env);
|
||||
Label leftIsNumber(env);
|
||||
Label leftNotNumberOrRightNotNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
Label leftIsInt(env);
|
||||
Label leftIsDouble(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -735,7 +735,7 @@ GateRef OperationsStubBuilder::Shl(GateRef glue, GateRef left, GateRef right, Pr
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::NumberType()));
|
||||
@ -793,21 +793,21 @@ GateRef OperationsStubBuilder::Shr(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label notOverflow(env);
|
||||
Label leftIsNumber(env);
|
||||
Label leftNotNumberOrRightNotNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
Label leftIsInt(env);
|
||||
Label leftIsDouble(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
curType = Int32(PGOSampleType::IntType());
|
||||
@ -828,7 +828,7 @@ GateRef OperationsStubBuilder::Shr(GateRef glue, GateRef left, GateRef right, Pr
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
curType = Int32(PGOSampleType::NumberType());
|
||||
@ -861,7 +861,7 @@ GateRef OperationsStubBuilder::Shr(GateRef glue, GateRef left, GateRef right, Pr
|
||||
GateRef shift = Int32And(*opNumber1, Int32(0x1f));
|
||||
GateRef val = Int32LSR(*opNumber0, shift);
|
||||
auto condition = Int32UnsignedGreaterThan(val, Int32(INT32_MAX));
|
||||
Branch(condition, &overflow, ¬Overflow);
|
||||
BRANCH(condition, &overflow, ¬Overflow);
|
||||
Bind(&overflow);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntOverFlowType()));
|
||||
@ -895,21 +895,21 @@ GateRef OperationsStubBuilder::Ashr(GateRef glue, GateRef left, GateRef right, P
|
||||
Label calculate(env);
|
||||
Label leftIsNumber(env);
|
||||
Label leftNotNumberOrRightNotNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
Label leftIsInt(env);
|
||||
Label leftIsDouble(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -930,7 +930,7 @@ GateRef OperationsStubBuilder::Ashr(GateRef glue, GateRef left, GateRef right, P
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::NumberType()));
|
||||
@ -985,21 +985,21 @@ GateRef OperationsStubBuilder::And(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label calculate(env);
|
||||
Label leftIsNumber(env);
|
||||
Label leftNotNumberOrRightNotNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
Label leftIsInt(env);
|
||||
Label leftIsDouble(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -1020,7 +1020,7 @@ GateRef OperationsStubBuilder::And(GateRef glue, GateRef left, GateRef right, Pr
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::NumberType()));
|
||||
@ -1074,21 +1074,21 @@ GateRef OperationsStubBuilder::Or(GateRef glue, GateRef left, GateRef right, Pro
|
||||
Label calculate(env);
|
||||
Label leftIsNumber(env);
|
||||
Label leftNotNumberOrRightNotNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
Label leftIsInt(env);
|
||||
Label leftIsDouble(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -1109,7 +1109,7 @@ GateRef OperationsStubBuilder::Or(GateRef glue, GateRef left, GateRef right, Pro
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::NumberType()));
|
||||
@ -1163,21 +1163,21 @@ GateRef OperationsStubBuilder::Xor(GateRef glue, GateRef left, GateRef right, Pr
|
||||
Label calculate(env);
|
||||
Label leftIsNumber(env);
|
||||
Label leftNotNumberOrRightNotNumber(env);
|
||||
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&leftIsNumber);
|
||||
{
|
||||
Label rightIsNumber(env);
|
||||
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
BRANCH(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
||||
Bind(&rightIsNumber);
|
||||
{
|
||||
Label leftIsInt(env);
|
||||
Label leftIsDouble(env);
|
||||
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
BRANCH(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
||||
Bind(&leftIsInt);
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -1198,7 +1198,7 @@ GateRef OperationsStubBuilder::Xor(GateRef glue, GateRef left, GateRef right, Pr
|
||||
{
|
||||
Label rightIsInt(env);
|
||||
Label rightIsDouble(env);
|
||||
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
BRANCH(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
||||
Bind(&rightIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::NumberType()));
|
||||
@ -1249,12 +1249,12 @@ GateRef OperationsStubBuilder::Inc(GateRef glue, GateRef value, ProfileOperation
|
||||
Label valueIsInt(env);
|
||||
Label valueNotInt(env);
|
||||
Label slowPath(env);
|
||||
Branch(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
||||
BRANCH(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
||||
Bind(&valueIsInt);
|
||||
{
|
||||
GateRef valueInt = GetInt32OfTInt(value);
|
||||
Label valueNoOverflow(env);
|
||||
Branch(Int32Equal(valueInt, Int32(INT32_MAX)), &valueNotInt, &valueNoOverflow);
|
||||
BRANCH(Int32Equal(valueInt, Int32(INT32_MAX)), &valueNotInt, &valueNoOverflow);
|
||||
Bind(&valueNoOverflow);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -1265,7 +1265,7 @@ GateRef OperationsStubBuilder::Inc(GateRef glue, GateRef value, ProfileOperation
|
||||
Bind(&valueNotInt);
|
||||
{
|
||||
Label valueIsDouble(env);
|
||||
Branch(TaggedIsDouble(value), &valueIsDouble, &slowPath);
|
||||
BRANCH(TaggedIsDouble(value), &valueIsDouble, &slowPath);
|
||||
Bind(&valueIsDouble);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::DoubleType()));
|
||||
@ -1297,12 +1297,12 @@ GateRef OperationsStubBuilder::Dec(GateRef glue, GateRef value, ProfileOperation
|
||||
Label valueIsInt(env);
|
||||
Label valueNotInt(env);
|
||||
Label slowPath(env);
|
||||
Branch(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
||||
BRANCH(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
||||
Bind(&valueIsInt);
|
||||
{
|
||||
GateRef valueInt = GetInt32OfTInt(value);
|
||||
Label valueNoOverflow(env);
|
||||
Branch(Int32Equal(valueInt, Int32(INT32_MIN)), &valueNotInt, &valueNoOverflow);
|
||||
BRANCH(Int32Equal(valueInt, Int32(INT32_MIN)), &valueNotInt, &valueNoOverflow);
|
||||
Bind(&valueNoOverflow);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -1313,7 +1313,7 @@ GateRef OperationsStubBuilder::Dec(GateRef glue, GateRef value, ProfileOperation
|
||||
Bind(&valueNotInt);
|
||||
{
|
||||
Label valueIsDouble(env);
|
||||
Branch(TaggedIsDouble(value), &valueIsDouble, &slowPath);
|
||||
BRANCH(TaggedIsDouble(value), &valueIsDouble, &slowPath);
|
||||
Bind(&valueIsDouble);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::DoubleType()));
|
||||
@ -1345,13 +1345,13 @@ GateRef OperationsStubBuilder::Neg(GateRef glue, GateRef value, ProfileOperation
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Label valueIsInt(env);
|
||||
Label valueNotInt(env);
|
||||
Branch(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
||||
BRANCH(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
||||
Bind(&valueIsInt);
|
||||
{
|
||||
GateRef valueInt = GetInt32OfTInt(value);
|
||||
Label valueIsZero(env);
|
||||
Label valueNotZero(env);
|
||||
Branch(Int32Equal(valueInt, Int32(0)), &valueIsZero, &valueNotZero);
|
||||
BRANCH(Int32Equal(valueInt, Int32(0)), &valueIsZero, &valueNotZero);
|
||||
Bind(&valueIsZero);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntOverFlowType()));
|
||||
@ -1362,7 +1362,7 @@ GateRef OperationsStubBuilder::Neg(GateRef glue, GateRef value, ProfileOperation
|
||||
{
|
||||
Label valueIsInt32Min(env);
|
||||
Label valueNotInt32Min(env);
|
||||
Branch(Int32Equal(valueInt, Int32(INT32_MIN)), &valueIsInt32Min, &valueNotInt32Min);
|
||||
BRANCH(Int32Equal(valueInt, Int32(INT32_MIN)), &valueIsInt32Min, &valueNotInt32Min);
|
||||
Bind(&valueIsInt32Min);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntOverFlowType()));
|
||||
@ -1381,7 +1381,7 @@ GateRef OperationsStubBuilder::Neg(GateRef glue, GateRef value, ProfileOperation
|
||||
{
|
||||
Label valueIsDouble(env);
|
||||
Label valueNotDouble(env);
|
||||
Branch(TaggedIsDouble(value), &valueIsDouble, &valueNotDouble);
|
||||
BRANCH(TaggedIsDouble(value), &valueIsDouble, &valueNotDouble);
|
||||
Bind(&valueIsDouble);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::DoubleType()));
|
||||
@ -1413,7 +1413,7 @@ GateRef OperationsStubBuilder::Not(GateRef glue, GateRef value, ProfileOperation
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Label numberIsInt(env);
|
||||
Label numberNotInt(env);
|
||||
Branch(TaggedIsInt(value), &numberIsInt, &numberNotInt);
|
||||
BRANCH(TaggedIsInt(value), &numberIsInt, &numberNotInt);
|
||||
Bind(&numberIsInt);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::IntType()));
|
||||
@ -1425,7 +1425,7 @@ GateRef OperationsStubBuilder::Not(GateRef glue, GateRef value, ProfileOperation
|
||||
{
|
||||
Label numberIsDouble(env);
|
||||
Label numberNotDouble(env);
|
||||
Branch(TaggedIsDouble(value), &numberIsDouble, &numberNotDouble);
|
||||
BRANCH(TaggedIsDouble(value), &numberIsDouble, &numberNotDouble);
|
||||
Bind(&numberIsDouble);
|
||||
{
|
||||
callback.ProfileOpType(Int32(PGOSampleType::DoubleType()));
|
||||
|
@ -236,7 +236,7 @@ void PostSchedule::LoweringHeapAllocAndPrepareScheduleGate(GateRef gate,
|
||||
GateRef newTop = builder_.PtrAdd(top, size);
|
||||
GateRef condition = builder_.Int64GreaterThan(newTop, end);
|
||||
Label *currentLabel = env.GetCurrentLabel();
|
||||
builder_.Branch(condition, &callRuntime, &success);
|
||||
BRANCH_CIR(condition, &callRuntime, &success);
|
||||
{
|
||||
GateRef ifBranch = currentLabel->GetControl();
|
||||
PrepareToScheduleNewGate(ifBranch, currentBBGates);
|
||||
@ -429,7 +429,7 @@ void PostSchedule::LoweringStoreUnknownBarrierAndPrepareScheduleGate(GateRef gat
|
||||
Label exit(&builder_);
|
||||
Label isHeapObject(&builder_);
|
||||
Label *currentLabel = env.GetCurrentLabel();
|
||||
builder_.Branch(condition, &isHeapObject, &exit);
|
||||
BRANCH_CIR(condition, &isHeapObject, &exit);
|
||||
{
|
||||
GateRef ifBranch = currentLabel->GetControl();
|
||||
PrepareToScheduleNewGate(ifBranch, currentBBGates);
|
||||
|
@ -74,7 +74,7 @@ void ProfilerStubBuilder::TryDump(GateRef glue, GateRef func, GateRef profileTyp
|
||||
Label updatePeriodCounter(env);
|
||||
Label exit(env);
|
||||
|
||||
Branch(IsProfileTypeInfoDumped(profileTypeInfo), &exit, &updatePeriodCounter);
|
||||
BRANCH(IsProfileTypeInfoDumped(profileTypeInfo), &exit, &updatePeriodCounter);
|
||||
Bind(&updatePeriodCounter);
|
||||
{
|
||||
SetDumpPeriodIndex(glue, profileTypeInfo);
|
||||
@ -92,7 +92,7 @@ void ProfilerStubBuilder::TryPreDump(GateRef glue, GateRef func, GateRef profile
|
||||
env->SubCfgEntry(&subEntry);
|
||||
Label exit(env);
|
||||
Label profiler(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
Bind(&profiler);
|
||||
{
|
||||
TryPreDumpInner(glue, func, profileTypeInfo);
|
||||
@ -111,7 +111,7 @@ void ProfilerStubBuilder::ProfileOpType(
|
||||
|
||||
Label exit(env);
|
||||
Label profiler(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
Bind(&profiler);
|
||||
{
|
||||
Label icSlotValid(env);
|
||||
@ -121,24 +121,24 @@ void ProfilerStubBuilder::ProfileOpType(
|
||||
|
||||
GateRef slotId = GetSlotID(pc, format);
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
DEFVARIABLE(curType, VariableType::INT32(), type);
|
||||
DEFVARIABLE(curCount, VariableType::INT32(), Int32(0));
|
||||
Branch(TaggedIsInt(slotValue), &compareLabel, &uninitialize);
|
||||
BRANCH(TaggedIsInt(slotValue), &compareLabel, &uninitialize);
|
||||
Bind(&compareLabel);
|
||||
{
|
||||
GateRef oldSlotValue = TaggedGetInt(slotValue);
|
||||
GateRef oldType = Int32And(oldSlotValue, Int32(PGOSampleType::AnyType()));
|
||||
curType = Int32Or(oldType, type);
|
||||
curCount = Int32And(oldSlotValue, Int32(0xfffffc00)); // 0xfffffc00: count bits
|
||||
Branch(Int32Equal(oldType, *curType), &exit, &updateSlot);
|
||||
BRANCH(Int32Equal(oldType, *curType), &exit, &updateSlot);
|
||||
}
|
||||
Bind(&uninitialize);
|
||||
{
|
||||
// Slot maybe overflow.
|
||||
Branch(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
BRANCH(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
}
|
||||
Bind(&updateSlot);
|
||||
{
|
||||
@ -161,7 +161,7 @@ void ProfilerStubBuilder::ProfileDefineClass(
|
||||
|
||||
Label exit(env);
|
||||
Label profiler(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
Bind(&profiler);
|
||||
{
|
||||
Label icSlotValid(env);
|
||||
@ -169,10 +169,10 @@ void ProfilerStubBuilder::ProfileDefineClass(
|
||||
|
||||
GateRef slotId = GetSlotID(pc, format);
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
BRANCH(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
Bind(&updateSlot);
|
||||
auto weakCtor = env->GetBuilder()->CreateWeakRef(constructor);
|
||||
SetValueToTaggedArray(VariableType::JS_ANY(), glue, profileTypeInfo, slotId, weakCtor);
|
||||
@ -192,7 +192,7 @@ void ProfilerStubBuilder::ProfileCreateObject(
|
||||
Label exit(env);
|
||||
|
||||
Label profiler(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
Bind(&profiler);
|
||||
{
|
||||
Label icSlotValid(env);
|
||||
@ -203,23 +203,23 @@ void ProfilerStubBuilder::ProfileCreateObject(
|
||||
|
||||
GateRef slotId = GetSlotID(pc, format);
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
auto hclass = LoadHClass(newObj);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsHeapObject(slotValue), &isHeapObject, &uninitialized);
|
||||
BRANCH(TaggedIsHeapObject(slotValue), &isHeapObject, &uninitialized);
|
||||
Bind(&isHeapObject);
|
||||
{
|
||||
Branch(TaggedIsWeak(slotValue), &isWeak, &updateSlot);
|
||||
BRANCH(TaggedIsWeak(slotValue), &isWeak, &updateSlot);
|
||||
}
|
||||
Bind(&isWeak);
|
||||
{
|
||||
auto cachedHClass = LoadObjectFromWeakRef(slotValue);
|
||||
Branch(Equal(cachedHClass, hclass), &exit, &updateSlot);
|
||||
BRANCH(Equal(cachedHClass, hclass), &exit, &updateSlot);
|
||||
}
|
||||
Bind(&uninitialized);
|
||||
{
|
||||
Branch(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
BRANCH(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
}
|
||||
Bind(&updateSlot);
|
||||
{
|
||||
@ -245,14 +245,14 @@ void ProfilerStubBuilder::ProfileCall(
|
||||
Label fastpath(env);
|
||||
|
||||
Label targetIsFunction(env);
|
||||
Branch(IsJSFunction(target), &targetIsFunction, &exit);
|
||||
BRANCH(IsJSFunction(target), &targetIsFunction, &exit);
|
||||
Bind(&targetIsFunction);
|
||||
{
|
||||
GateRef targetProfileInfo = GetProfileTypeInfo(target);
|
||||
Label targetNonHotness(env);
|
||||
Label IsCurrentHotness(env);
|
||||
Label currentIsHotness(env);
|
||||
Branch(TaggedIsUndefined(targetProfileInfo), &targetNonHotness, &IsCurrentHotness);
|
||||
BRANCH(TaggedIsUndefined(targetProfileInfo), &targetNonHotness, &IsCurrentHotness);
|
||||
Bind(&targetNonHotness);
|
||||
{
|
||||
CallRuntime(glue, RTSTUB_ID(UpdateHotnessCounterWithProf), { target });
|
||||
@ -260,7 +260,7 @@ void ProfilerStubBuilder::ProfileCall(
|
||||
}
|
||||
Bind(&IsCurrentHotness);
|
||||
{
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, ¤tIsHotness);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, ¤tIsHotness);
|
||||
}
|
||||
Bind(¤tIsHotness);
|
||||
{
|
||||
@ -271,22 +271,22 @@ void ProfilerStubBuilder::ProfileCall(
|
||||
|
||||
GateRef slotId = GetSlotID(pc, format);
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsInt(slotValue), &isInt, &uninitialized);
|
||||
BRANCH(TaggedIsInt(slotValue), &isInt, &uninitialized);
|
||||
Bind(&isInt);
|
||||
{
|
||||
Label change(env);
|
||||
Label resetSlot(env);
|
||||
GateRef oldSlotValue = TaggedGetInt(slotValue);
|
||||
GateRef methodId = env->GetBuilder()->GetMethodId(target);
|
||||
Branch(Int32Equal(oldSlotValue, TruncInt64ToInt32(methodId)), &exit, &change);
|
||||
BRANCH(Int32Equal(oldSlotValue, TruncInt64ToInt32(methodId)), &exit, &change);
|
||||
Bind(&change);
|
||||
{
|
||||
GateRef polyCallCheck = Int32Equal(oldSlotValue, Int32(base::PGO_POLY_INLINE_REP));
|
||||
GateRef emptyCallCheck = Int32Equal(oldSlotValue, Int32(0));
|
||||
Branch(BoolOr(polyCallCheck, emptyCallCheck), &exit, &resetSlot);
|
||||
BRANCH(BoolOr(polyCallCheck, emptyCallCheck), &exit, &resetSlot);
|
||||
}
|
||||
Bind(&resetSlot);
|
||||
{
|
||||
@ -298,7 +298,7 @@ void ProfilerStubBuilder::ProfileCall(
|
||||
}
|
||||
Bind(&uninitialized);
|
||||
{
|
||||
Branch(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
BRANCH(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
}
|
||||
Bind(&updateSlot);
|
||||
{
|
||||
@ -323,7 +323,7 @@ GateRef ProfilerStubBuilder::TryGetBuiltinFunctionId(GateRef target)
|
||||
Label exit(env);
|
||||
|
||||
DEFVARIABLE(functionId, VariableType::INT32(), Int32(PGO_BUILTINS_STUB_ID(NONE)));
|
||||
Branch(IsJSFunction(target), &targetIsFunction, &exit);
|
||||
BRANCH(IsJSFunction(target), &targetIsFunction, &exit);
|
||||
Bind(&targetIsFunction);
|
||||
{
|
||||
auto builtinsId = env->GetBuilder()->GetBuiltinsId(target);
|
||||
@ -346,7 +346,7 @@ void ProfilerStubBuilder::ProfileNativeCall(
|
||||
Label exit(env);
|
||||
Label currentIsHot(env);
|
||||
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, ¤tIsHot);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, ¤tIsHot);
|
||||
Bind(¤tIsHot);
|
||||
{
|
||||
Label icSlotValid(env);
|
||||
@ -357,17 +357,17 @@ void ProfilerStubBuilder::ProfileNativeCall(
|
||||
|
||||
GateRef slotId = GetSlotID(pc, format);
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsInt(slotValue), &updateSlot, &initSlot);
|
||||
BRANCH(TaggedIsInt(slotValue), &updateSlot, &initSlot);
|
||||
Bind(&updateSlot);
|
||||
GateRef oldId = TaggedGetInt(slotValue);
|
||||
Branch(Int32Equal(oldId, Int32(PGO_BUILTINS_STUB_ID(NONE))), &exit, &sameValueCheck);
|
||||
BRANCH(Int32Equal(oldId, Int32(PGO_BUILTINS_STUB_ID(NONE))), &exit, &sameValueCheck);
|
||||
Bind(&sameValueCheck);
|
||||
{
|
||||
GateRef newId = TryGetBuiltinFunctionId(target);
|
||||
Branch(Int32Equal(oldId, newId), &exit, &invalidate);
|
||||
BRANCH(Int32Equal(oldId, newId), &exit, &invalidate);
|
||||
}
|
||||
Bind(&invalidate);
|
||||
{
|
||||
@ -411,17 +411,17 @@ GateRef ProfilerStubBuilder::UpdateTrackTypeInPropAttr(GateRef attr, GateRef val
|
||||
|
||||
Label exit(env);
|
||||
Label judgeValue(env);
|
||||
Branch(Equal(oldTrackType, Int32(static_cast<int32_t>(TrackType::TAGGED))), &exit, &judgeValue);
|
||||
BRANCH(Equal(oldTrackType, Int32(static_cast<int32_t>(TrackType::TAGGED))), &exit, &judgeValue);
|
||||
Bind(&judgeValue);
|
||||
{
|
||||
newTrackType = TaggedToTrackType(value);
|
||||
Label update(env);
|
||||
Label merge(env);
|
||||
Branch(Int32Equal(*newTrackType, Int32(static_cast<int32_t>(TrackType::TAGGED))), &update, &merge);
|
||||
BRANCH(Int32Equal(*newTrackType, Int32(static_cast<int32_t>(TrackType::TAGGED))), &update, &merge);
|
||||
Bind(&merge);
|
||||
{
|
||||
newTrackType = Int32Or(oldTrackType, *newTrackType);
|
||||
Branch(Int32Equal(oldTrackType, *newTrackType), &exit, &update);
|
||||
BRANCH(Int32Equal(oldTrackType, *newTrackType), &exit, &update);
|
||||
}
|
||||
Bind(&update);
|
||||
{
|
||||
@ -454,10 +454,10 @@ void ProfilerStubBuilder::UpdatePropAttrIC(
|
||||
GateRef propAttr = GetPropAttrFromLayoutInfo(layout, attrIndex);
|
||||
GateRef attr = GetInt32OfTInt(propAttr);
|
||||
GateRef newAttr = UpdateTrackTypeInPropAttr(attr, value, callback);
|
||||
Branch(IsJSShared(receiver), &exit, &handleUnShared);
|
||||
BRANCH(IsJSShared(receiver), &exit, &handleUnShared);
|
||||
Bind(&handleUnShared);
|
||||
{
|
||||
Branch(Equal(attr, newAttr), &exit, &updateLayout);
|
||||
BRANCH(Equal(attr, newAttr), &exit, &updateLayout);
|
||||
Bind(&updateLayout);
|
||||
{
|
||||
SetPropAttrToLayoutInfo(glue, layout, attrIndex, newAttr);
|
||||
@ -481,10 +481,10 @@ void ProfilerStubBuilder::UpdatePropAttrWithValue(GateRef glue, GateRef jsType,
|
||||
Label exit(env);
|
||||
Label updateLayout(env);
|
||||
Label notSharedType(env);
|
||||
Branch(IsJSSharedType(jsType), &exit, ¬SharedType);
|
||||
BRANCH(IsJSSharedType(jsType), &exit, ¬SharedType);
|
||||
Bind(¬SharedType);
|
||||
GateRef newAttr = UpdateTrackTypeInPropAttr(attr, value, callback);
|
||||
Branch(Equal(attr, newAttr), &exit, &updateLayout);
|
||||
BRANCH(Equal(attr, newAttr), &exit, &updateLayout);
|
||||
Bind(&updateLayout);
|
||||
{
|
||||
SetPropAttrToLayoutInfo(glue, layout, attrIndex, newAttr);
|
||||
@ -504,7 +504,7 @@ GateRef ProfilerStubBuilder::TaggedToTrackType(GateRef value)
|
||||
Label exit(env);
|
||||
Label isInt(env);
|
||||
Label notInt(env);
|
||||
Branch(TaggedIsInt(value), &isInt, ¬Int);
|
||||
BRANCH(TaggedIsInt(value), &isInt, ¬Int);
|
||||
Bind(&isInt);
|
||||
{
|
||||
newTrackType = Int32(static_cast<int32_t>(TrackType::INT));
|
||||
@ -514,7 +514,7 @@ GateRef ProfilerStubBuilder::TaggedToTrackType(GateRef value)
|
||||
{
|
||||
Label isObject(env);
|
||||
Label isDouble(env);
|
||||
Branch(TaggedIsObject(value), &isObject, &isDouble);
|
||||
BRANCH(TaggedIsObject(value), &isObject, &isDouble);
|
||||
Bind(&isObject);
|
||||
{
|
||||
newTrackType = Int32(static_cast<int32_t>(TrackType::TAGGED));
|
||||
@ -552,19 +552,19 @@ void ProfilerStubBuilder::ProfileBranch(GateRef glue, GateRef pc, GateRef func,
|
||||
DEFVARIABLE(newTrue, VariableType::INT32(), isTrue ? Int32(1) : Int32(0));
|
||||
DEFVARIABLE(newFalse, VariableType::INT32(), isTrue ? Int32(0) : Int32(1));
|
||||
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
Bind(&profiler);
|
||||
{
|
||||
GateRef slotId = ZExtInt8ToInt32(Load(VariableType::INT8(), pc, IntPtr(1)));
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsHole(slotValue), &exit, &hasSlot); // ishole -- isundefined
|
||||
BRANCH(TaggedIsHole(slotValue), &exit, &hasSlot); // ishole -- isundefined
|
||||
Bind(&hasSlot);
|
||||
{
|
||||
Label uninitialized(env);
|
||||
Branch(TaggedIsInt(slotValue), &compareLabel, &uninitialized);
|
||||
BRANCH(TaggedIsInt(slotValue), &compareLabel, &uninitialized);
|
||||
Bind(&compareLabel);
|
||||
{
|
||||
GateRef oldSlotValue = TaggedGetInt(slotValue);
|
||||
@ -574,7 +574,7 @@ void ProfilerStubBuilder::ProfileBranch(GateRef glue, GateRef pc, GateRef func,
|
||||
oldPrama = Int32And(oldSlotValue, Int32(PGOSampleType::AnyType()));
|
||||
auto condition = BoolAnd(Int32LessThan(oldTrue, Int32(PGOSampleType::WEIGHT_MASK)),
|
||||
Int32LessThan(oldFalse, Int32(PGOSampleType::WEIGHT_MASK)));
|
||||
Branch(condition, &needUpdate, &exit); // 2000: limit
|
||||
BRANCH(condition, &needUpdate, &exit); // 2000: limit
|
||||
Bind(&needUpdate);
|
||||
{
|
||||
newTrue = Int32Add(*newTrue, oldTrue);
|
||||
@ -584,7 +584,7 @@ void ProfilerStubBuilder::ProfileBranch(GateRef glue, GateRef pc, GateRef func,
|
||||
}
|
||||
Bind(&uninitialized);
|
||||
{
|
||||
Branch(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
BRANCH(TaggedIsUndefined(slotValue), &updateSlot, &exit);
|
||||
}
|
||||
Bind(&updateSlot);
|
||||
{
|
||||
@ -596,12 +596,12 @@ void ProfilerStubBuilder::ProfileBranch(GateRef glue, GateRef pc, GateRef func,
|
||||
auto totalCount = Int32Add(*newTrue, *newFalse);
|
||||
auto mask = Int32(0x1FF);
|
||||
Label updateFinal(env);
|
||||
Branch(Int32Equal(Int32And(totalCount, mask), Int32(0)), &preProfile, &updateFinal);
|
||||
BRANCH(Int32Equal(Int32And(totalCount, mask), Int32(0)), &preProfile, &updateFinal);
|
||||
Bind(&updateFinal);
|
||||
{
|
||||
auto isFinal = BoolOr(Int32Equal(*newTrue, Int32(PGOSampleType::WEIGHT_MASK)),
|
||||
Int32Equal(*newFalse, Int32(PGOSampleType::WEIGHT_MASK)));
|
||||
Branch(isFinal, &preProfile, &exit);
|
||||
BRANCH(isFinal, &preProfile, &exit);
|
||||
}
|
||||
}
|
||||
Bind(&preProfile);
|
||||
@ -624,7 +624,7 @@ void ProfilerStubBuilder::TryPreDumpInner(GateRef glue, GateRef func, GateRef pr
|
||||
Label isInPredumpWorkList(env);
|
||||
Label addPredumpWorkList(env);
|
||||
Label exit(env);
|
||||
Branch(IsProfileTypeInfoPreDumped(profileTypeInfo), &exit, &setPreDumpPeriodIndex);
|
||||
BRANCH(IsProfileTypeInfoPreDumped(profileTypeInfo), &exit, &setPreDumpPeriodIndex);
|
||||
Bind(&setPreDumpPeriodIndex);
|
||||
{
|
||||
SetPreDumpPeriodIndex(glue, profileTypeInfo);
|
||||
@ -661,7 +661,7 @@ GateRef ProfilerStubBuilder::GetIterationFunctionId(GateRef glue, GateRef iterat
|
||||
GateRef glueGlobalEnvOffset = IntPtr(JSThread::GlueData::GetGlueGlobalEnvOffset(env->Is32Bit()));
|
||||
GateRef glueGlobalEnv = Load(VariableType::NATIVE_POINTER(), glue, glueGlobalEnvOffset);
|
||||
maybeFunc = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::ARRAY_PROTO_VALUES_FUNCTION_INDEX);
|
||||
Branch(Int64Equal(iterator, *maybeFunc), &isArrayProtoValues, ¬ArrayProtoValues);
|
||||
BRANCH(Int64Equal(iterator, *maybeFunc), &isArrayProtoValues, ¬ArrayProtoValues);
|
||||
Bind(&isArrayProtoValues);
|
||||
{
|
||||
functionId = Int32(PGO_BUILTINS_STUB_ID(ARRAY_PROTO_ITERATOR));
|
||||
@ -669,7 +669,7 @@ GateRef ProfilerStubBuilder::GetIterationFunctionId(GateRef glue, GateRef iterat
|
||||
}
|
||||
Bind(¬ArrayProtoValues);
|
||||
maybeFunc = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::SET_PROTO_VALUES_FUNCTION_INDEX);
|
||||
Branch(Int64Equal(iterator, *maybeFunc), &isSetProtoValues, ¬SetProtoValues);
|
||||
BRANCH(Int64Equal(iterator, *maybeFunc), &isSetProtoValues, ¬SetProtoValues);
|
||||
Bind(&isSetProtoValues);
|
||||
{
|
||||
functionId = Int32(PGO_BUILTINS_STUB_ID(SET_PROTO_ITERATOR));
|
||||
@ -677,7 +677,7 @@ GateRef ProfilerStubBuilder::GetIterationFunctionId(GateRef glue, GateRef iterat
|
||||
}
|
||||
Bind(¬SetProtoValues);
|
||||
maybeFunc = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::MAP_PROTO_ENTRIES_FUNCTION_INDEX);
|
||||
Branch(Int64Equal(iterator, *maybeFunc), &isMapProtoEntries, ¬MapProtoEntries);
|
||||
BRANCH(Int64Equal(iterator, *maybeFunc), &isMapProtoEntries, ¬MapProtoEntries);
|
||||
Bind(&isMapProtoEntries);
|
||||
{
|
||||
functionId = Int32(PGO_BUILTINS_STUB_ID(MAP_PROTO_ITERATOR));
|
||||
@ -685,7 +685,7 @@ GateRef ProfilerStubBuilder::GetIterationFunctionId(GateRef glue, GateRef iterat
|
||||
}
|
||||
Bind(¬MapProtoEntries);
|
||||
maybeFunc = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::STRING_PROTO_ITER_FUNCTION_INDEX);
|
||||
Branch(Int64Equal(iterator, *maybeFunc), &isStringProtoIter, ¬StringProtoIter);
|
||||
BRANCH(Int64Equal(iterator, *maybeFunc), &isStringProtoIter, ¬StringProtoIter);
|
||||
Bind(&isStringProtoIter);
|
||||
{
|
||||
functionId = Int32(PGO_BUILTINS_STUB_ID(STRING_PROTO_ITERATOR));
|
||||
@ -694,7 +694,7 @@ GateRef ProfilerStubBuilder::GetIterationFunctionId(GateRef glue, GateRef iterat
|
||||
Bind(¬StringProtoIter);
|
||||
maybeFunc = GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv,
|
||||
GlobalEnv::TYPED_ARRAY_PROTO_VALUES_FUNCTION_INDEX);
|
||||
Branch(Int64Equal(iterator, *maybeFunc), &isTypedArrayProtoValues, &exit);
|
||||
BRANCH(Int64Equal(iterator, *maybeFunc), &isTypedArrayProtoValues, &exit);
|
||||
Bind(&isTypedArrayProtoValues);
|
||||
{
|
||||
functionId = Int32(PGO_BUILTINS_STUB_ID(TYPED_ARRAY_PROTO_ITERATOR));
|
||||
@ -715,7 +715,7 @@ void ProfilerStubBuilder::ProfileGetIterator(
|
||||
|
||||
Label exit(env);
|
||||
Label profiler(env);
|
||||
Branch(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
BRANCH(TaggedIsUndefined(profileTypeInfo), &exit, &profiler);
|
||||
Bind(&profiler);
|
||||
{
|
||||
Label icSlotValid(env);
|
||||
@ -726,18 +726,18 @@ void ProfilerStubBuilder::ProfileGetIterator(
|
||||
|
||||
GateRef slotId = GetSlotID(pc, format);
|
||||
GateRef length = GetLengthOfTaggedArray(profileTypeInfo);
|
||||
Branch(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
BRANCH(Int32LessThan(slotId, length), &icSlotValid, &exit);
|
||||
Bind(&icSlotValid);
|
||||
GateRef slotValue = GetValueFromTaggedArray(profileTypeInfo, slotId);
|
||||
Branch(TaggedIsInt(slotValue), &updateSlot, &initSlot);
|
||||
BRANCH(TaggedIsInt(slotValue), &updateSlot, &initSlot);
|
||||
Bind(&updateSlot);
|
||||
GateRef oldIterKind = TaggedGetInt(slotValue);
|
||||
Branch(Int32Equal(oldIterKind, Int32(PGO_BUILTINS_STUB_ID(NONE))),
|
||||
BRANCH(Int32Equal(oldIterKind, Int32(PGO_BUILTINS_STUB_ID(NONE))),
|
||||
&exit, &sameValueCheck);
|
||||
Bind(&sameValueCheck);
|
||||
{
|
||||
GateRef newIterKind = GetIterationFunctionId(glue, iterator);
|
||||
Branch(Int32Equal(oldIterKind, newIterKind), &exit, &invalidate);
|
||||
BRANCH(Int32Equal(oldIterKind, newIterKind), &exit, &invalidate);
|
||||
}
|
||||
Bind(&invalidate);
|
||||
{
|
||||
@ -853,7 +853,7 @@ GateRef ProfilerStubBuilder::IsHotForJitCompiling(GateRef profileTypeInfo)
|
||||
GateRef hotnessThreshold = GetJitHotnessThreshold(profileTypeInfo);
|
||||
GateRef hotnessCnt = GetJitHotnessCnt(profileTypeInfo);
|
||||
Label greaterThreshold(env);
|
||||
Branch(Int32GreaterThan(hotnessCnt, hotnessThreshold), &greaterThreshold, &exit);
|
||||
BRANCH(Int32GreaterThan(hotnessCnt, hotnessThreshold), &greaterThreshold, &exit);
|
||||
Bind(&greaterThreshold);
|
||||
result = True();
|
||||
Jump(&exit);
|
||||
@ -875,14 +875,14 @@ void ProfilerStubBuilder::TryJitCompile(GateRef glue, GateRef func, GateRef prof
|
||||
Label equalThreshold(env);
|
||||
Label notEqualThreshold(env);
|
||||
Label incCnt(env);
|
||||
Branch(Int32Equal(hotnessCnt, hotnessThreshold), &equalThreshold, ¬EqualThreshold);
|
||||
BRANCH(Int32Equal(hotnessCnt, hotnessThreshold), &equalThreshold, ¬EqualThreshold);
|
||||
Bind(&equalThreshold);
|
||||
{
|
||||
CallRuntime(glue, RTSTUB_ID(JitCompile), { func });
|
||||
Jump(&incCnt);
|
||||
}
|
||||
Bind(¬EqualThreshold);
|
||||
Branch(Int32LessThan(hotnessCnt, hotnessThreshold), &incCnt, &exit);
|
||||
BRANCH(Int32LessThan(hotnessCnt, hotnessThreshold), &incCnt, &exit);
|
||||
Bind(&incCnt);
|
||||
{
|
||||
GateRef newCnt = Int16Add(hotnessCnt, Int16(1));
|
||||
|
@ -136,7 +136,7 @@ void SlowPathLowering::ReplaceHirWithPendingException(GateRef hirGate,
|
||||
GateRef state, GateRef depend, GateRef value)
|
||||
{
|
||||
auto condition = builder_.HasPendingException(glue_);
|
||||
GateRef ifBranch = builder_.Branch(state, condition);
|
||||
GateRef ifBranch = builder_.Branch(state, condition, 1, BranchWeight::DEOPT_WEIGHT, "checkException");
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
GateRef eDepend = builder_.DependRelay(ifTrue, depend);
|
||||
@ -170,7 +170,7 @@ void SlowPathLowering::ReplaceHirWithValue(GateRef hirGate, GateRef value, bool
|
||||
GateRef exceptionVal = builder_.ExceptionConstant();
|
||||
// compare with trampolines result
|
||||
GateRef equal = builder_.Equal(value, exceptionVal);
|
||||
auto ifBranch = builder_.Branch(state, equal);
|
||||
auto ifBranch = builder_.Branch(state, equal, 1, BranchWeight::DEOPT_WEIGHT, "checkException");
|
||||
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
@ -195,7 +195,7 @@ void SlowPathLowering::ReplaceHirToThrowCall(GateRef hirGate, GateRef value)
|
||||
auto condition = builder_.HasPendingException(glue_);
|
||||
GateRef state = builder_.GetState();
|
||||
GateRef depend = builder_.GetDepend();
|
||||
GateRef ifBranch = builder_.Branch(state, condition);
|
||||
GateRef ifBranch = builder_.Branch(state, condition, BranchWeight::DEOPT_WEIGHT, 1, "checkException");
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
GateRef eDepend = builder_.DependRelay(ifTrue, depend);
|
||||
@ -1109,9 +1109,9 @@ void SlowPathLowering::LowerThrowIfNotObject(GateRef gate)
|
||||
Label isEcmaObject(&builder_);
|
||||
Label notEcmaObject(&builder_);
|
||||
Label isHeapObject(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(value), &isHeapObject, ¬EcmaObject);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(value), &isHeapObject, ¬EcmaObject);
|
||||
builder_.Bind(&isHeapObject);
|
||||
builder_.Branch(builder_.TaggedObjectIsEcmaObject(value), &isEcmaObject, ¬EcmaObject);
|
||||
BRANCH_CIR(builder_.TaggedObjectIsEcmaObject(value), &isEcmaObject, ¬EcmaObject);
|
||||
builder_.Bind(&isEcmaObject);
|
||||
{
|
||||
builder_.Jump(&successExit);
|
||||
@ -1135,7 +1135,7 @@ void SlowPathLowering::LowerThrowUndefinedIfHole(GateRef gate)
|
||||
Label exceptionExit(&builder_);
|
||||
Label isHole(&builder_);
|
||||
Label notHole(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHole(hole), &isHole, ¬Hole);
|
||||
BRANCH_CIR(builder_.TaggedIsHole(hole), &isHole, ¬Hole);
|
||||
builder_.Bind(¬Hole);
|
||||
{
|
||||
builder_.Jump(&successExit);
|
||||
@ -1160,7 +1160,7 @@ void SlowPathLowering::LowerThrowUndefinedIfHoleWithName(GateRef gate)
|
||||
Label exceptionExit(&builder_);
|
||||
Label isHole(&builder_);
|
||||
Label notHole(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHole(hole), &isHole, ¬Hole);
|
||||
BRANCH_CIR(builder_.TaggedIsHole(hole), &isHole, ¬Hole);
|
||||
builder_.Bind(¬Hole);
|
||||
{
|
||||
builder_.Jump(&successExit);
|
||||
@ -1368,7 +1368,7 @@ void SlowPathLowering::LowerToNumber(GateRef gate)
|
||||
Label checkResult(&builder_);
|
||||
GateRef value = acc_.GetValueIn(gate, 0);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), value);
|
||||
builder_.Branch(builder_.TaggedIsNumber(value), &checkResult, ¬Number);
|
||||
BRANCH_CIR(builder_.TaggedIsNumber(value), &checkResult, ¬Number);
|
||||
builder_.Bind(¬Number);
|
||||
{
|
||||
result = LowerCallRuntime(gate, RTSTUB_ID(ToNumber), { value }, true);
|
||||
@ -1458,7 +1458,7 @@ void SlowPathLowering::LowerDelObjProp(GateRef gate)
|
||||
Label exceptionExit(&builder_);
|
||||
GateRef newGate = builder_.CallStub(glue_, gate, CommonStubCSigns::DeleteObjectProperty,
|
||||
{ glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) });
|
||||
builder_.Branch(builder_.IsSpecial(newGate, JSTaggedValue::VALUE_EXCEPTION),
|
||||
BRANCH_CIR(builder_.IsSpecial(newGate, JSTaggedValue::VALUE_EXCEPTION),
|
||||
&exceptionExit, &successExit);
|
||||
CREATE_DOUBLE_EXIT(successExit, exceptionExit)
|
||||
acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, newGate);
|
||||
@ -1629,7 +1629,7 @@ void SlowPathLowering::LowerToNumeric(GateRef gate)
|
||||
Label checkResult(&builder_);
|
||||
GateRef value = acc_.GetValueIn(gate, 0);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), value);
|
||||
builder_.Branch(builder_.TaggedIsNumeric(value), &checkResult, ¬Number);
|
||||
BRANCH_CIR(builder_.TaggedIsNumeric(value), &checkResult, ¬Number);
|
||||
builder_.Bind(¬Number);
|
||||
{
|
||||
result = LowerCallRuntime(gate, RTSTUB_ID(ToNumeric), { value }, true);
|
||||
@ -1751,7 +1751,7 @@ void SlowPathLowering::LowerNewObjRange(GateRef gate)
|
||||
|
||||
GateRef ctor = acc_.GetValueIn(gate, 0);
|
||||
GateRef thisObj = builder_.CallStub(glue_, gate, CommonStubCSigns::NewThisObjectChecked, { glue_, ctor });
|
||||
builder_.Branch(builder_.TaggedIsHole(thisObj), &slowPath, &fastPath);
|
||||
BRANCH_CIR(builder_.TaggedIsHole(thisObj), &slowPath, &fastPath);
|
||||
builder_.Bind(&fastPath);
|
||||
{
|
||||
const int extra = 4; // 4: add glue, argc, new-target and this
|
||||
@ -1793,20 +1793,20 @@ void SlowPathLowering::LowerConditionJump(GateRef gate, bool isEqualJump)
|
||||
GateRef value = acc_.GetValueIn(gate, 0);
|
||||
// GET_ACC().IsFalse()
|
||||
GateRef condition = builder_.IsSpecial(value, JSTaggedValue::VALUE_FALSE);
|
||||
GateRef ifBranch = builder_.Branch(acc_.GetState(gate), condition);
|
||||
GateRef ifBranch = builder_.Branch(acc_.GetState(gate), condition, 1, 1, "checkFalse");
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
trueState.emplace_back(isEqualJump ? ifTrue : ifFalse);
|
||||
|
||||
// (GET_ACC().IsInt() && GET_ACC().GetInt())
|
||||
std::vector<GateRef> intFalseState;
|
||||
ifBranch = isEqualJump ? builder_.Branch(ifFalse, builder_.TaggedIsInt(value))
|
||||
: builder_.Branch(ifTrue, builder_.TaggedIsInt(value));
|
||||
ifBranch = isEqualJump ? builder_.Branch(ifFalse, builder_.TaggedIsInt(value), 1, 1, "checkInt")
|
||||
: builder_.Branch(ifTrue, builder_.TaggedIsInt(value), 1, 1, "checkInt");
|
||||
GateRef isInt = builder_.IfTrue(ifBranch);
|
||||
GateRef notInt = builder_.IfFalse(ifBranch);
|
||||
intFalseState.emplace_back(notInt);
|
||||
condition = builder_.Equal(builder_.TaggedGetInt(value), builder_.Int32(0));
|
||||
ifBranch = builder_.Branch(isInt, condition);
|
||||
ifBranch = builder_.Branch(isInt, condition, 1, 1, "checkZero");
|
||||
GateRef isZero = builder_.IfTrue(ifBranch);
|
||||
GateRef notZero = builder_.IfFalse(ifBranch);
|
||||
trueState.emplace_back(isEqualJump ? isZero : notZero);
|
||||
@ -1815,12 +1815,12 @@ void SlowPathLowering::LowerConditionJump(GateRef gate, bool isEqualJump)
|
||||
|
||||
// (GET_ACC().IsDouble() && GET_ACC().GetDouble() == 0)
|
||||
std::vector<GateRef> doubleFalseState;
|
||||
ifBranch = builder_.Branch(mergeIntState, builder_.TaggedIsDouble(value));
|
||||
ifBranch = builder_.Branch(mergeIntState, builder_.TaggedIsDouble(value), 1, 1, "checkDouble");
|
||||
GateRef isDouble = builder_.IfTrue(ifBranch);
|
||||
GateRef notDouble = builder_.IfFalse(ifBranch);
|
||||
doubleFalseState.emplace_back(notDouble);
|
||||
condition = builder_.Equal(builder_.GetDoubleOfTDouble(value), builder_.Double(0));
|
||||
ifBranch = builder_.Branch(isDouble, condition);
|
||||
ifBranch = builder_.Branch(isDouble, condition, 1, 1, "checkZero");
|
||||
GateRef isDoubleZero = builder_.IfTrue(ifBranch);
|
||||
GateRef notDoubleZero = builder_.IfFalse(ifBranch);
|
||||
trueState.emplace_back(isEqualJump ? isDoubleZero : notDoubleZero);
|
||||
@ -1865,15 +1865,15 @@ void SlowPathLowering::LowerGetNextPropName(GateRef gate)
|
||||
|
||||
GateRef index = builder_.GetIndexFromForInIterator(iter);
|
||||
GateRef length = builder_.GetLengthFromForInIterator(iter);
|
||||
builder_.Branch(builder_.Int32GreaterThanOrEqual(index, length), &exit, ¬Finish);
|
||||
BRANCH_CIR(builder_.Int32GreaterThanOrEqual(index, length), &exit, ¬Finish);
|
||||
builder_.Bind(¬Finish);
|
||||
GateRef keys = builder_.GetKeysFromForInIterator(iter);
|
||||
GateRef receiver = builder_.GetObjectFromForInIterator(iter);
|
||||
GateRef cachedHclass = builder_.GetCachedHclassFromForInIterator(iter);
|
||||
GateRef kind = builder_.GetEnumCacheKind(glue_, keys);
|
||||
builder_.Branch(builder_.IsEnumCacheValid(receiver, cachedHclass, kind), &fastGetKey, ¬EnumCacheValid);
|
||||
BRANCH_CIR(builder_.IsEnumCacheValid(receiver, cachedHclass, kind), &fastGetKey, ¬EnumCacheValid);
|
||||
builder_.Bind(¬EnumCacheValid);
|
||||
builder_.Branch(builder_.NeedCheckProperty(receiver), &slowpath, &fastGetKey);
|
||||
BRANCH_CIR(builder_.NeedCheckProperty(receiver), &slowpath, &fastGetKey);
|
||||
builder_.Bind(&fastGetKey);
|
||||
{
|
||||
result = builder_.GetValueFromTaggedArray(keys, index);
|
||||
@ -2073,7 +2073,7 @@ void SlowPathLowering::LowerStOwnByValueWithNameSet(GateRef gate)
|
||||
Label exceptionExit(&builder_);
|
||||
GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByValueWithNameSet,
|
||||
{ glue_, receiver, propKey, accValue });
|
||||
builder_.Branch(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION),
|
||||
BRANCH_CIR(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION),
|
||||
&exceptionExit, &successExit);
|
||||
CREATE_DOUBLE_EXIT(successExit, exceptionExit)
|
||||
acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate());
|
||||
@ -2094,7 +2094,7 @@ void SlowPathLowering::LowerStOwnByNameWithNameSet(GateRef gate)
|
||||
Label exceptionExit(&builder_);
|
||||
GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByNameWithNameSet,
|
||||
{ glue_, receiver, propKey, accValue });
|
||||
builder_.Branch(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION),
|
||||
BRANCH_CIR(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION),
|
||||
&exceptionExit, &successExit);
|
||||
CREATE_DOUBLE_EXIT(successExit, exceptionExit)
|
||||
acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate());
|
||||
@ -2308,11 +2308,11 @@ void SlowPathLowering::LowerLdLexVar(GateRef gate)
|
||||
DEFVALUE(i, (&builder_), VariableType::INT32(), builder_.Int32(0));
|
||||
Label loopHead(&builder_);
|
||||
Label loopEnd(&builder_);
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopHead, &exit);
|
||||
BRANCH_CIR(builder_.Int32LessThan(*i, level), &loopHead, &exit);
|
||||
builder_.LoopBegin(&loopHead);
|
||||
currentEnv = builder_.GetValueFromTaggedArray(*currentEnv, index);
|
||||
i = builder_.Int32Add(*i, builder_.Int32(1));
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopEnd, &exit);
|
||||
BRANCH_CIR(builder_.Int32LessThan(*i, level), &loopEnd, &exit);
|
||||
builder_.Bind(&loopEnd);
|
||||
builder_.LoopEnd(&loopHead);
|
||||
}
|
||||
@ -2342,11 +2342,11 @@ void SlowPathLowering::LowerStLexVar(GateRef gate)
|
||||
DEFVALUE(i, (&builder_), VariableType::INT32(), builder_.Int32(0));
|
||||
Label loopHead(&builder_);
|
||||
Label loopEnd(&builder_);
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopHead, &exit);
|
||||
BRANCH_CIR(builder_.Int32LessThan(*i, level), &loopHead, &exit);
|
||||
builder_.LoopBegin(&loopHead);
|
||||
currentEnv = builder_.GetValueFromTaggedArray(*currentEnv, index);
|
||||
i = builder_.Int32Add(*i, builder_.Int32(1));
|
||||
builder_.Branch(builder_.Int32LessThan(*i, level), &loopEnd, &exit);
|
||||
BRANCH_CIR(builder_.Int32LessThan(*i, level), &loopEnd, &exit);
|
||||
builder_.Bind(&loopEnd);
|
||||
builder_.LoopEnd(&loopHead);
|
||||
}
|
||||
@ -2377,7 +2377,7 @@ void SlowPathLowering::LowerDefineClassWithBuffer(GateRef gate)
|
||||
builder_.ToTaggedInt(methodId), builder_.ToTaggedInt(literalId), module,
|
||||
builder_.ToTaggedInt(length)};
|
||||
result = LowerCallRuntime(gate, RTSTUB_ID(CreateClassWithBuffer), args, true);
|
||||
builder_.Branch(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION), &isException, &isNotException);
|
||||
BRANCH_CIR(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION), &isException, &isNotException);
|
||||
CREATE_DOUBLE_EXIT(isNotException, isException)
|
||||
acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, result);
|
||||
}
|
||||
@ -2437,7 +2437,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
Label defaultLabel(&builder_);
|
||||
GateRef gConstBooleanStr = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
builder_.GetGlobalConstantOffset(ConstantIndex::BOOLEAN_STRING_INDEX));
|
||||
builder_.Branch(builder_.TaggedIsTrue(obj), &objIsTrue, &objNotTrue);
|
||||
BRANCH_CIR(builder_.TaggedIsTrue(obj), &objIsTrue, &objNotTrue);
|
||||
builder_.Bind(&objIsTrue);
|
||||
{
|
||||
result = gConstBooleanStr;
|
||||
@ -2447,7 +2447,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsFalse(&builder_);
|
||||
Label objNotFalse(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsFalse(obj), &objIsFalse, &objNotFalse);
|
||||
BRANCH_CIR(builder_.TaggedIsFalse(obj), &objIsFalse, &objNotFalse);
|
||||
builder_.Bind(&objIsFalse);
|
||||
{
|
||||
result = gConstBooleanStr;
|
||||
@ -2457,7 +2457,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsNull(&builder_);
|
||||
Label objNotNull(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsNull(obj), &objIsNull, &objNotNull);
|
||||
BRANCH_CIR(builder_.TaggedIsNull(obj), &objIsNull, &objNotNull);
|
||||
builder_.Bind(&objIsNull);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2468,7 +2468,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsUndefined(&builder_);
|
||||
Label objNotUndefined(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsUndefined(obj), &objIsUndefined, &objNotUndefined);
|
||||
BRANCH_CIR(builder_.TaggedIsUndefined(obj), &objIsUndefined, &objNotUndefined);
|
||||
builder_.Bind(&objIsUndefined);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2484,12 +2484,12 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsHeapObject(&builder_);
|
||||
Label objNotHeapObject(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(obj), &objIsHeapObject, &objNotHeapObject);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(obj), &objIsHeapObject, &objNotHeapObject);
|
||||
builder_.Bind(&objIsHeapObject);
|
||||
{
|
||||
Label objIsString(&builder_);
|
||||
Label objNotString(&builder_);
|
||||
builder_.Branch(builder_.TaggedObjectIsString(obj), &objIsString, &objNotString);
|
||||
BRANCH_CIR(builder_.TaggedObjectIsString(obj), &objIsString, &objNotString);
|
||||
builder_.Bind(&objIsString);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2500,7 +2500,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsSymbol(&builder_);
|
||||
Label objNotSymbol(&builder_);
|
||||
builder_.Branch(builder_.IsJsType(obj, JSType::SYMBOL), &objIsSymbol, &objNotSymbol);
|
||||
BRANCH_CIR(builder_.IsJsType(obj, JSType::SYMBOL), &objIsSymbol, &objNotSymbol);
|
||||
builder_.Bind(&objIsSymbol);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2511,7 +2511,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsCallable(&builder_);
|
||||
Label objNotCallable(&builder_);
|
||||
builder_.Branch(builder_.IsCallable(obj), &objIsCallable, &objNotCallable);
|
||||
BRANCH_CIR(builder_.IsCallable(obj), &objIsCallable, &objNotCallable);
|
||||
builder_.Bind(&objIsCallable);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2522,7 +2522,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsBigInt(&builder_);
|
||||
Label objNotBigInt(&builder_);
|
||||
builder_.Branch(builder_.IsJsType(obj, JSType::BIGINT), &objIsBigInt, &objNotBigInt);
|
||||
BRANCH_CIR(builder_.IsJsType(obj, JSType::BIGINT), &objIsBigInt, &objNotBigInt);
|
||||
builder_.Bind(&objIsBigInt);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2543,7 +2543,7 @@ void SlowPathLowering::LowerTypeof(GateRef gate)
|
||||
{
|
||||
Label objIsNum(&builder_);
|
||||
Label objNotNum(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsNumber(obj), &objIsNum, &objNotNum);
|
||||
BRANCH_CIR(builder_.TaggedIsNumber(obj), &objIsNum, &objNotNum);
|
||||
builder_.Bind(&objIsNum);
|
||||
{
|
||||
result = builder_.Load(VariableType::JS_POINTER(), gConstAddr,
|
||||
@ -2603,7 +2603,7 @@ void SlowPathLowering::LowerResumeGenerator(GateRef gate)
|
||||
Label notAsyncGeneratorObj(&builder_);
|
||||
Label exit(&builder_);
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant());
|
||||
builder_.Branch(builder_.TaggedIsAsyncGeneratorObject(obj), &isAsyncGeneratorObj, ¬AsyncGeneratorObj);
|
||||
BRANCH_CIR(builder_.TaggedIsAsyncGeneratorObject(obj), &isAsyncGeneratorObj, ¬AsyncGeneratorObj);
|
||||
builder_.Bind(&isAsyncGeneratorObj);
|
||||
{
|
||||
GateRef resumeResultOffset = builder_.IntPtr(JSAsyncGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET);
|
||||
@ -2629,7 +2629,7 @@ void SlowPathLowering::LowerGetResumeMode(GateRef gate)
|
||||
Label notAsyncGeneratorObj(&builder_);
|
||||
Label exit(&builder_);
|
||||
GateRef obj = acc_.GetValueIn(gate, 0);
|
||||
builder_.Branch(builder_.TaggedIsAsyncGeneratorObject(obj), &isAsyncGeneratorObj, ¬AsyncGeneratorObj);
|
||||
BRANCH_CIR(builder_.TaggedIsAsyncGeneratorObject(obj), &isAsyncGeneratorObj, ¬AsyncGeneratorObj);
|
||||
builder_.Bind(&isAsyncGeneratorObj);
|
||||
{
|
||||
GateRef bitFieldOffset = builder_.IntPtr(JSAsyncGeneratorObject::BIT_FIELD_OFFSET);
|
||||
@ -2675,7 +2675,7 @@ void SlowPathLowering::LowerDefineMethod(GateRef gate)
|
||||
Label exceptionExit(&builder_);
|
||||
GateRef result = LowerCallRuntime(gate, RTSTUB_ID(DefineMethod),
|
||||
{method, homeObject, builder_.ToTaggedInt(length), env}, true);
|
||||
builder_.Branch(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION),
|
||||
BRANCH_CIR(builder_.IsSpecial(result, JSTaggedValue::VALUE_EXCEPTION),
|
||||
&exceptionExit, &successExit);
|
||||
CREATE_DOUBLE_EXIT(successExit, exceptionExit)
|
||||
acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, result);
|
||||
@ -2942,35 +2942,35 @@ void SlowPathLowering::LowerFastCall(GateRef gate, GateRef glue, GateRef func, G
|
||||
Label slowPath(&builder_);
|
||||
Label notCallConstructor(&builder_);
|
||||
Label isCallConstructor(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(func), &isHeapObject, &slowPath);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(func), &isHeapObject, &slowPath);
|
||||
builder_.Bind(&isHeapObject);
|
||||
{
|
||||
builder_.Branch(builder_.IsJSFunction(func), &isJsFcuntion, &slowPath);
|
||||
BRANCH_CIR(builder_.IsJSFunction(func), &isJsFcuntion, &slowPath);
|
||||
builder_.Bind(&isJsFcuntion);
|
||||
{
|
||||
if (!isNew) {
|
||||
builder_.Branch(builder_.IsClassConstructor(func), &slowPath, ¬CallConstructor);
|
||||
BRANCH_CIR(builder_.IsClassConstructor(func), &slowPath, ¬CallConstructor);
|
||||
builder_.Bind(¬CallConstructor);
|
||||
} else {
|
||||
builder_.Branch(builder_.IsClassConstructor(func), &isCallConstructor, &slowPath);
|
||||
BRANCH_CIR(builder_.IsClassConstructor(func), &isCallConstructor, &slowPath);
|
||||
builder_.Bind(&isCallConstructor);
|
||||
}
|
||||
GateRef method = builder_.GetMethodFromFunction(func);
|
||||
if (!isNew) {
|
||||
builder_.Branch(builder_.JudgeAotAndFastCallWithMethod(method,
|
||||
BRANCH_CIR(builder_.JudgeAotAndFastCallWithMethod(method,
|
||||
CircuitBuilder::JudgeMethodType::HAS_AOT_FASTCALL), &fastCall, ¬FastCall);
|
||||
builder_.Bind(&fastCall);
|
||||
{
|
||||
GateRef expectedArgc = builder_.Int64Add(builder_.GetExpectedNumOfArgs(method),
|
||||
builder_.Int64(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
builder_.Branch(builder_.Int64LessThanOrEqual(expectedArgc, argc), &call, &callBridge);
|
||||
BRANCH_CIR(builder_.Int64LessThanOrEqual(expectedArgc, argc), &call, &callBridge);
|
||||
builder_.Bind(&call);
|
||||
{
|
||||
builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true);
|
||||
GateRef code = builder_.GetCodeAddr(method);
|
||||
auto depend = builder_.GetDepend();
|
||||
const CallSignature *cs = RuntimeStubCSigns::GetOptimizedFastCallSign();
|
||||
result->WriteVariable(builder_.Call(cs, glue, code, depend, argsFastCall, gate));
|
||||
result->WriteVariable(builder_.Call(cs, glue, code, depend, argsFastCall, gate, "callFastAOT"));
|
||||
builder_.EndCallTimer(glue_, gate, {glue_, func}, true);
|
||||
builder_.Jump(exit);
|
||||
}
|
||||
@ -2980,27 +2980,27 @@ void SlowPathLowering::LowerFastCall(GateRef gate, GateRef glue, GateRef func, G
|
||||
const CallSignature *cs = RuntimeStubCSigns::Get(RTSTUB_ID(OptimizedFastCallAndPushUndefined));
|
||||
GateRef target = builder_.IntPtr(RTSTUB_ID(OptimizedFastCallAndPushUndefined));
|
||||
auto depend = builder_.GetDepend();
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate));
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate, "callFastBridge"));
|
||||
builder_.EndCallTimer(glue_, gate, {glue_, func}, true);
|
||||
builder_.Jump(exit);
|
||||
}
|
||||
}
|
||||
builder_.Bind(¬FastCall);
|
||||
}
|
||||
builder_.Branch(builder_.JudgeAotAndFastCallWithMethod(method, CircuitBuilder::JudgeMethodType::HAS_AOT),
|
||||
BRANCH_CIR(builder_.JudgeAotAndFastCallWithMethod(method, CircuitBuilder::JudgeMethodType::HAS_AOT),
|
||||
&slowCall, &slowPath);
|
||||
builder_.Bind(&slowCall);
|
||||
{
|
||||
GateRef expectedArgc = builder_.Int64Add(builder_.GetExpectedNumOfArgs(method),
|
||||
builder_.Int64(NUM_MANDATORY_JSFUNC_ARGS));
|
||||
builder_.Branch(builder_.Int64LessThanOrEqual(expectedArgc, argc), &call1, &callBridge1);
|
||||
BRANCH_CIR(builder_.Int64LessThanOrEqual(expectedArgc, argc), &call1, &callBridge1);
|
||||
builder_.Bind(&call1);
|
||||
{
|
||||
builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true);
|
||||
GateRef code = builder_.GetCodeAddr(method);
|
||||
auto depend = builder_.GetDepend();
|
||||
const CallSignature *cs = RuntimeStubCSigns::GetOptimizedCallSign();
|
||||
result->WriteVariable(builder_.Call(cs, glue, code, depend, args, gate));
|
||||
result->WriteVariable(builder_.Call(cs, glue, code, depend, args, gate, "callAOT"));
|
||||
builder_.EndCallTimer(glue_, gate, {glue_, func}, true);
|
||||
builder_.Jump(exit);
|
||||
}
|
||||
@ -3010,7 +3010,7 @@ void SlowPathLowering::LowerFastCall(GateRef gate, GateRef glue, GateRef func, G
|
||||
const CallSignature *cs = RuntimeStubCSigns::Get(RTSTUB_ID(OptimizedCallAndPushUndefined));
|
||||
GateRef target = builder_.IntPtr(RTSTUB_ID(OptimizedCallAndPushUndefined));
|
||||
auto depend = builder_.GetDepend();
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate));
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate, "callBridge"));
|
||||
builder_.EndCallTimer(glue_, gate, {glue_, func}, true);
|
||||
builder_.Jump(exit);
|
||||
}
|
||||
@ -3024,7 +3024,7 @@ void SlowPathLowering::LowerFastCall(GateRef gate, GateRef glue, GateRef func, G
|
||||
const CallSignature *cs = RuntimeStubCSigns::Get(RTSTUB_ID(JSCallNew));
|
||||
GateRef target = builder_.IntPtr(RTSTUB_ID(JSCallNew));
|
||||
auto depend = builder_.GetDepend();
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate));
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate, "slowNew"));
|
||||
builder_.EndCallTimer(glue_, gate, {glue_, func}, true);
|
||||
builder_.Jump(exit);
|
||||
} else {
|
||||
@ -3032,7 +3032,7 @@ void SlowPathLowering::LowerFastCall(GateRef gate, GateRef glue, GateRef func, G
|
||||
const CallSignature *cs = RuntimeStubCSigns::Get(RTSTUB_ID(JSCall));
|
||||
GateRef target = builder_.IntPtr(RTSTUB_ID(JSCall));
|
||||
auto depend = builder_.GetDepend();
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate));
|
||||
result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate, "jscall"));
|
||||
builder_.EndCallTimer(glue_, gate, {glue_, func}, true);
|
||||
builder_.Jump(exit);
|
||||
}
|
||||
@ -3053,7 +3053,7 @@ void SlowPathLowering::LowerTypedCall(GateRef gate)
|
||||
GateRef state = builder_.GetState();
|
||||
auto depend = builder_.GetDepend();
|
||||
const CallSignature *cs = RuntimeStubCSigns::GetOptimizedCallSign();
|
||||
GateRef result = builder_.Call(cs, glue_, code, depend, args, gate);
|
||||
GateRef result = builder_.Call(cs, glue_, code, depend, args, gate, "callAOT");
|
||||
ReplaceHirWithPendingException(gate, state, result, result);
|
||||
}
|
||||
|
||||
@ -3071,7 +3071,7 @@ void SlowPathLowering::LowerTypedFastCall(GateRef gate)
|
||||
GateRef state = builder_.GetState();
|
||||
auto depend = builder_.GetDepend();
|
||||
const CallSignature *cs = RuntimeStubCSigns::GetOptimizedFastCallSign();
|
||||
GateRef result = builder_.Call(cs, glue_, code, depend, args, gate);
|
||||
GateRef result = builder_.Call(cs, glue_, code, depend, args, gate, "callFastAOT");
|
||||
ReplaceHirWithPendingException(gate, state, result, result);
|
||||
}
|
||||
|
||||
@ -3088,7 +3088,7 @@ void SlowPathLowering::LowerCheckSafePointAndStackOver(GateRef gate)
|
||||
builder_.IntPtr(JSThread::GlueData::GetInterruptVectorOffset(builder_.GetCompilationConfig()->Is32Bit())));
|
||||
GateRef spValue = builder_.ReadSp();
|
||||
builder_.Branch(builder_.Int8Equal(interruptsFlag, builder_.Int8(VmThreadControl::VM_NEED_SUSPENSION)),
|
||||
&slowPath, &checkStackOver, BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT);
|
||||
&slowPath, &checkStackOver, BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT, "checkSafePoint");
|
||||
builder_.Bind(&slowPath);
|
||||
{
|
||||
LowerCallRuntime(glue_, RTSTUB_ID(CheckSafePoint), {}, true);
|
||||
@ -3097,7 +3097,7 @@ void SlowPathLowering::LowerCheckSafePointAndStackOver(GateRef gate)
|
||||
builder_.Bind(&checkStackOver);
|
||||
{
|
||||
builder_.Branch(builder_.Int64LessThanOrEqual(spValue, stackLimit), &stackOverflow, &dispatch,
|
||||
BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT);
|
||||
BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT, "checkStackOverflow");
|
||||
builder_.Bind(&stackOverflow);
|
||||
{
|
||||
GateRef res = LowerCallRuntime(glue_, RTSTUB_ID(ThrowStackOverflowException), {}, true);
|
||||
|
@ -1394,7 +1394,7 @@ inline GateRef StubBuilder::IsJSObjectType(GateRef obj, JSType jsType)
|
||||
Label heapObj(env);
|
||||
Label exit(env);
|
||||
GateRef isHeapObject = TaggedIsHeapObject(obj);
|
||||
Branch(isHeapObject, &heapObj, &exit);
|
||||
BRANCH(isHeapObject, &heapObj, &exit);
|
||||
Bind(&heapObj);
|
||||
GateRef objectType = GetObjectType(LoadHClass(obj));
|
||||
result = env_->GetBuilder()->LogicAnd(isHeapObject, Int32Equal(objectType, Int32(static_cast<int32_t>(jsType))));
|
||||
@ -2123,7 +2123,7 @@ inline void StubBuilder::CheckUpdateSharedType(bool isDicMode, Variable *result,
|
||||
{
|
||||
auto *env = GetEnvironment();
|
||||
Label isSharedObj(env);
|
||||
Branch(IsJSSharedType(jsType), &isSharedObj, executeSetProp);
|
||||
BRANCH(IsJSSharedType(jsType), &isSharedObj, executeSetProp);
|
||||
Bind(&isSharedObj);
|
||||
{
|
||||
Label typeMismatch(env);
|
||||
@ -2621,7 +2621,7 @@ inline GateRef StubBuilder::GetMethodFromJSFunction(GateRef object)
|
||||
Label funcIsJSFunctionBase(env);
|
||||
Label funcIsJSProxy(env);
|
||||
Label getMethod(env);
|
||||
Branch(IsJSFunctionBase(object), &funcIsJSFunctionBase, &funcIsJSProxy);
|
||||
BRANCH(IsJSFunctionBase(object), &funcIsJSFunctionBase, &funcIsJSProxy);
|
||||
Bind(&funcIsJSFunctionBase);
|
||||
{
|
||||
methodOffset = IntPtr(JSFunctionBase::METHOD_OFFSET);
|
||||
@ -3049,7 +3049,7 @@ inline void StubBuilder::CheckDetectorName(GateRef glue, GateRef key, Label *fal
|
||||
VariableType::INT64(), glueGlobalEnv, GlobalEnv::LAST_DETECTOR_SYMBOL_INDEX);
|
||||
GateRef isDetectorName = BoolAnd(Int64UnsignedLessThanOrEqual(firstDetectorName, keyAddr),
|
||||
Int64UnsignedLessThanOrEqual(keyAddr, lastDetectorName));
|
||||
Branch(isDetectorName, slow, fallthrough);
|
||||
BRANCH(isDetectorName, slow, fallthrough);
|
||||
}
|
||||
|
||||
inline GateRef StubBuilder::LoadPfHeaderFromConstPool(GateRef jsFunc)
|
||||
@ -3091,16 +3091,16 @@ inline GateRef StubBuilder::LoadHCIndexFromConstPool(
|
||||
Label afterLoop(env);
|
||||
Label matchSuccess(env);
|
||||
Label afterUpdate(env);
|
||||
Branch(Int32LessThan(*i, cachedLength), &loopHead, miss);
|
||||
BRANCH(Int32LessThan(*i, cachedLength), &loopHead, miss);
|
||||
LoopBegin(&loopHead);
|
||||
bcOffset = GetInt32OfTInt(GetValueFromTaggedArray(cachedArray, *i));
|
||||
Branch(Int32Equal(*bcOffset, traceId), &matchSuccess, &afterUpdate);
|
||||
BRANCH(Int32Equal(*bcOffset, traceId), &matchSuccess, &afterUpdate);
|
||||
Bind(&matchSuccess);
|
||||
constantIndex = GetInt32OfTInt(GetValueFromTaggedArray(cachedArray, Int32Add(*i, Int32(1))));
|
||||
Jump(&afterLoop);
|
||||
Bind(&afterUpdate);
|
||||
i = Int32Add(*i, Int32(2)); // 2 : skip traceId and constantIndex
|
||||
Branch(Int32LessThan(*i, cachedLength), &loopEnd, miss);
|
||||
BRANCH(Int32LessThan(*i, cachedLength), &loopEnd, miss);
|
||||
Bind(&loopEnd);
|
||||
LoopEnd(&loopHead);
|
||||
Bind(&afterLoop);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -135,7 +135,14 @@ public:
|
||||
GateRef Return();
|
||||
void Bind(Label *label);
|
||||
void Jump(Label *label);
|
||||
void Branch(GateRef condition, Label *trueLabel, Label *falseLabel);
|
||||
|
||||
#define BRANCH(condition, trueLabel, falseLabel) \
|
||||
{ \
|
||||
std::ostringstream os; \
|
||||
os << __func__ << ": " << #trueLabel << "- " << #falseLabel; \
|
||||
Branch(condition, trueLabel, falseLabel, os.str().c_str()); \
|
||||
}
|
||||
void Branch(GateRef condition, Label *trueLabel, Label *falseLabel, const char* comment = nullptr);
|
||||
void Switch(GateRef index, Label *defaultLabel, int64_t *keysValue, Label *keysLabel, int numberOfKeys);
|
||||
void LoopBegin(Label *loopHead);
|
||||
void LoopEnd(Label *loopHead);
|
||||
|
@ -30,7 +30,7 @@ GateRef TypedArrayStubBuilder::IsDetachedBuffer(GateRef buffer)
|
||||
Label isByteArray(env);
|
||||
Label notByteArray(env);
|
||||
DEFVARIABLE(result, VariableType::BOOL(), False());
|
||||
Branch(IsByteArray(buffer), &isByteArray, ¬ByteArray);
|
||||
BRANCH(IsByteArray(buffer), &isByteArray, ¬ByteArray);
|
||||
Bind(&isByteArray);
|
||||
{
|
||||
Jump(&exit);
|
||||
@ -38,7 +38,7 @@ GateRef TypedArrayStubBuilder::IsDetachedBuffer(GateRef buffer)
|
||||
Bind(¬ByteArray);
|
||||
{
|
||||
GateRef dataSlot = GetArrayBufferData(buffer);
|
||||
Branch(TaggedIsNull(dataSlot), &isNull, &exit);
|
||||
BRANCH(TaggedIsNull(dataSlot), &isNull, &exit);
|
||||
Bind(&isNull);
|
||||
{
|
||||
result = True();
|
||||
@ -61,7 +61,7 @@ GateRef TypedArrayStubBuilder::GetDataPointFromBuffer(GateRef arrBuf)
|
||||
Label isByteArray(env);
|
||||
Label notByteArray(env);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), arrBuf);
|
||||
Branch(IsByteArray(arrBuf), &isByteArray, ¬ByteArray);
|
||||
BRANCH(IsByteArray(arrBuf), &isByteArray, ¬ByteArray);
|
||||
Bind(&isByteArray);
|
||||
{
|
||||
result = PtrAdd(*result, IntPtr(ByteArray::DATA_OFFSET));
|
||||
@ -88,11 +88,11 @@ GateRef TypedArrayStubBuilder::CheckTypedArrayIndexInRange(GateRef array, GateRe
|
||||
Label exit(env);
|
||||
Label indexIsvalid(env);
|
||||
Label indexNotLessZero(env);
|
||||
Branch(Int64LessThan(index, Int64(0)), &exit, &indexNotLessZero);
|
||||
BRANCH(Int64LessThan(index, Int64(0)), &exit, &indexNotLessZero);
|
||||
Bind(&indexNotLessZero);
|
||||
{
|
||||
GateRef arrLen = GetArrayLength(array);
|
||||
Branch(Int64GreaterThanOrEqual(index, ZExtInt32ToInt64(arrLen)), &exit, &indexIsvalid);
|
||||
BRANCH(Int64GreaterThanOrEqual(index, ZExtInt32ToInt64(arrLen)), &exit, &indexIsvalid);
|
||||
Bind(&indexIsvalid);
|
||||
{
|
||||
result = True();
|
||||
@ -116,16 +116,16 @@ GateRef TypedArrayStubBuilder::LoadTypedArrayElement(GateRef glue, GateRef array
|
||||
Label indexIsvalid(env);
|
||||
Label slowPath(env);
|
||||
GateRef buffer = GetViewedArrayBuffer(array);
|
||||
Branch(IsDetachedBuffer(buffer), &exit, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), &exit, ¬Detached);
|
||||
Bind(¬Detached);
|
||||
{
|
||||
GateRef index = TryToElementsIndex(glue, key);
|
||||
Branch(CheckTypedArrayIndexInRange(array, index), &indexIsvalid, &exit);
|
||||
BRANCH(CheckTypedArrayIndexInRange(array, index), &indexIsvalid, &exit);
|
||||
Bind(&indexIsvalid);
|
||||
{
|
||||
GateRef offset = GetByteOffset(array);
|
||||
result = GetValueFromBuffer(buffer, TruncInt64ToInt32(index), offset, jsType);
|
||||
Branch(TaggedIsNumber(*result), &exit, &slowPath);
|
||||
BRANCH(TaggedIsNumber(*result), &exit, &slowPath);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
@ -151,10 +151,10 @@ GateRef TypedArrayStubBuilder::StoreTypedArrayElement(GateRef glue, GateRef arra
|
||||
Label notDetached(env);
|
||||
Label indexIsvalid(env);
|
||||
GateRef buffer = GetViewedArrayBuffer(array);
|
||||
Branch(IsDetachedBuffer(buffer), &exit, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), &exit, ¬Detached);
|
||||
Bind(¬Detached);
|
||||
{
|
||||
Branch(CheckTypedArrayIndexInRange(array, index), &indexIsvalid, &exit);
|
||||
BRANCH(CheckTypedArrayIndexInRange(array, index), &indexIsvalid, &exit);
|
||||
Bind(&indexIsvalid);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(SetTypeArrayPropertyByIndex),
|
||||
@ -181,7 +181,7 @@ GateRef TypedArrayStubBuilder::FastGetPropertyByIndex(GateRef glue, GateRef arra
|
||||
Label indexIsvalid(env);
|
||||
|
||||
GateRef buffer = GetViewedArrayBuffer(array);
|
||||
Branch(IsDetachedBuffer(buffer), &isDetached, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), &isDetached, ¬Detached);
|
||||
Bind(&isDetached);
|
||||
{
|
||||
Jump(&slowPath);
|
||||
@ -189,12 +189,12 @@ GateRef TypedArrayStubBuilder::FastGetPropertyByIndex(GateRef glue, GateRef arra
|
||||
Bind(¬Detached);
|
||||
{
|
||||
GateRef arrLen = GetArrayLength(array);
|
||||
Branch(Int32GreaterThanOrEqual(index, arrLen), &exit, &indexIsvalid);
|
||||
BRANCH(Int32GreaterThanOrEqual(index, arrLen), &exit, &indexIsvalid);
|
||||
Bind(&indexIsvalid);
|
||||
{
|
||||
GateRef offset = GetByteOffset(array);
|
||||
result = GetValueFromBuffer(buffer, index, offset, jsType);
|
||||
Branch(TaggedIsNumber(*result), &exit, &slowPath);
|
||||
BRANCH(TaggedIsNumber(*result), &exit, &slowPath);
|
||||
}
|
||||
}
|
||||
Bind(&slowPath);
|
||||
@ -225,7 +225,7 @@ GateRef TypedArrayStubBuilder::FastCopyElementToArray(GateRef glue, GateRef type
|
||||
Label endLoop(env);
|
||||
|
||||
GateRef buffer = GetViewedArrayBuffer(typedArray);
|
||||
Branch(IsDetachedBuffer(buffer), &isDetached, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), &isDetached, ¬Detached);
|
||||
Bind(&isDetached);
|
||||
{
|
||||
result = False();
|
||||
@ -241,7 +241,7 @@ GateRef TypedArrayStubBuilder::FastCopyElementToArray(GateRef glue, GateRef type
|
||||
Jump(&begin);
|
||||
LoopBegin(&begin);
|
||||
{
|
||||
Branch(Int32UnsignedLessThan(*start, arrLen), &storeValue, &exit);
|
||||
BRANCH(Int32UnsignedLessThan(*start, arrLen), &storeValue, &exit);
|
||||
Bind(&storeValue);
|
||||
{
|
||||
GateRef value = GetValueFromBuffer(buffer, *start, offset, jsType);
|
||||
@ -290,7 +290,7 @@ GateRef TypedArrayStubBuilder::GetValueFromBuffer(GateRef buffer, GateRef index,
|
||||
static_cast<int64_t>(JSType::JS_UINT32_ARRAY), static_cast<int64_t>(JSType::JS_FLOAT32_ARRAY),
|
||||
static_cast<int64_t>(JSType::JS_FLOAT64_ARRAY) };
|
||||
|
||||
Branch(Int32LessThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_UINT8_CLAMPED_ARRAY))),
|
||||
BRANCH(Int32LessThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_UINT8_CLAMPED_ARRAY))),
|
||||
&isInt8, ¬Int8);
|
||||
Bind(&isInt8);
|
||||
{
|
||||
@ -326,7 +326,7 @@ GateRef TypedArrayStubBuilder::GetValueFromBuffer(GateRef buffer, GateRef index,
|
||||
|
||||
Bind(¬Int8);
|
||||
{
|
||||
Branch(Int32LessThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_INT32_ARRAY))),
|
||||
BRANCH(Int32LessThanOrEqual(jsType, Int32(static_cast<int32_t>(JSType::JS_INT32_ARRAY))),
|
||||
&isInt16, ¬Int16);
|
||||
Bind(&isInt16);
|
||||
{
|
||||
@ -372,7 +372,7 @@ GateRef TypedArrayStubBuilder::GetValueFromBuffer(GateRef buffer, GateRef index,
|
||||
GateRef re = Load(VariableType::INT32(), block, byteIndex);
|
||||
|
||||
auto condition = Int32UnsignedGreaterThan(re, Int32(INT32_MAX));
|
||||
Branch(condition, &overflow, ¬Overflow);
|
||||
BRANCH(condition, &overflow, ¬Overflow);
|
||||
Bind(&overflow);
|
||||
{
|
||||
result = DoubleToTaggedDoublePtr(ChangeUInt32ToFloat64(re));
|
||||
@ -425,29 +425,29 @@ void TypedArrayStubBuilder::SubArray(GateRef glue, GateRef thisValue, GateRef nu
|
||||
DEFVARIABLE(endIndex, VariableType::INT32(), Int32(0));
|
||||
DEFVARIABLE(newLength, VariableType::INT32(), Int32(0));
|
||||
|
||||
Branch(IsEcmaObject(thisValue), &ecmaObj, slowPath);
|
||||
BRANCH(IsEcmaObject(thisValue), &ecmaObj, slowPath);
|
||||
Bind(&ecmaObj);
|
||||
Branch(IsTypedArray(thisValue), &typedArray, slowPath);
|
||||
BRANCH(IsTypedArray(thisValue), &typedArray, slowPath);
|
||||
Bind(&typedArray);
|
||||
|
||||
GateRef objHclass = LoadHClass(thisValue);
|
||||
Label defaultConstructor(env);
|
||||
Branch(HasConstructorByHClass(objHclass), slowPath, &defaultConstructor);
|
||||
BRANCH(HasConstructorByHClass(objHclass), slowPath, &defaultConstructor);
|
||||
Bind(&defaultConstructor);
|
||||
GateRef arrayLen = GetArrayLength(thisValue);
|
||||
GateRef buffer = GetViewedArrayBuffer(thisValue);
|
||||
Label offHeap(env);
|
||||
Branch(BoolOr(IsJSObjectType(buffer, JSType::JS_ARRAY_BUFFER),
|
||||
BRANCH(BoolOr(IsJSObjectType(buffer, JSType::JS_ARRAY_BUFFER),
|
||||
IsJSObjectType(buffer, JSType::JS_SHARED_ARRAY_BUFFER)), &offHeap, slowPath);
|
||||
Bind(&offHeap);
|
||||
Label notDetached(env);
|
||||
Branch(IsDetachedBuffer(buffer), slowPath, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), slowPath, ¬Detached);
|
||||
Bind(¬Detached);
|
||||
|
||||
Label intIndex(env);
|
||||
GateRef relativeBegin = GetCallArg0(numArgs);
|
||||
GateRef end = GetCallArg1(numArgs);
|
||||
Branch(TaggedIsInt(relativeBegin), &intIndex, slowPath);
|
||||
BRANCH(TaggedIsInt(relativeBegin), &intIndex, slowPath);
|
||||
Bind(&intIndex);
|
||||
GateRef relativeBeginInt = GetInt32OfTInt(relativeBegin);
|
||||
beginIndex = CalArrayRelativePos(relativeBeginInt, arrayLen);
|
||||
@ -456,7 +456,7 @@ void TypedArrayStubBuilder::SubArray(GateRef glue, GateRef thisValue, GateRef nu
|
||||
Label defEnd(env);
|
||||
Label calNewLength(env);
|
||||
Label newArray(env);
|
||||
Branch(TaggedIsUndefined(end), &undefEnd, &defEnd);
|
||||
BRANCH(TaggedIsUndefined(end), &undefEnd, &defEnd);
|
||||
Bind(&undefEnd);
|
||||
{
|
||||
endIndex = arrayLen;
|
||||
@ -465,7 +465,7 @@ void TypedArrayStubBuilder::SubArray(GateRef glue, GateRef thisValue, GateRef nu
|
||||
Bind(&defEnd);
|
||||
{
|
||||
Label intEnd(env);
|
||||
Branch(TaggedIsInt(end), &intEnd, slowPath);
|
||||
BRANCH(TaggedIsInt(end), &intEnd, slowPath);
|
||||
Bind(&intEnd);
|
||||
{
|
||||
GateRef endVal = GetInt32OfTInt(end);
|
||||
@ -477,7 +477,7 @@ void TypedArrayStubBuilder::SubArray(GateRef glue, GateRef thisValue, GateRef nu
|
||||
{
|
||||
GateRef diffLen = Int32Sub(*endIndex, *beginIndex);
|
||||
Label diffLargeZero(env);
|
||||
Branch(Int32GreaterThan(diffLen, Int32(0)), &diffLargeZero, &newArray);
|
||||
BRANCH(Int32GreaterThan(diffLen, Int32(0)), &diffLargeZero, &newArray);
|
||||
Bind(&diffLargeZero);
|
||||
{
|
||||
newLength = diffLen;
|
||||
@ -486,7 +486,7 @@ void TypedArrayStubBuilder::SubArray(GateRef glue, GateRef thisValue, GateRef nu
|
||||
}
|
||||
Bind(&newArray);
|
||||
GateRef oldByteLength = Load(VariableType::INT32(), thisValue, IntPtr(JSTypedArray::BYTE_LENGTH_OFFSET));
|
||||
Branch(Int32Equal(arrayLen, Int32(0)), slowPath, &isNotZero);
|
||||
BRANCH(Int32Equal(arrayLen, Int32(0)), slowPath, &isNotZero);
|
||||
Bind(&isNotZero);
|
||||
GateRef elementSize = Int32Div(oldByteLength, arrayLen);
|
||||
NewObjectStubBuilder newBuilder(this);
|
||||
@ -502,12 +502,12 @@ void TypedArrayStubBuilder::GetByteLength([[maybe_unused]] GateRef glue, GateRef
|
||||
Label typedArray(env);
|
||||
Label Detached(env);
|
||||
Label notDetached(env);
|
||||
Branch(IsEcmaObject(thisValue), &ecmaObj, slowPath);
|
||||
BRANCH(IsEcmaObject(thisValue), &ecmaObj, slowPath);
|
||||
Bind(&ecmaObj);
|
||||
Branch(IsTypedArray(thisValue), &typedArray, slowPath);
|
||||
BRANCH(IsTypedArray(thisValue), &typedArray, slowPath);
|
||||
Bind(&typedArray);
|
||||
GateRef buffer = GetViewedArrayBuffer(thisValue);
|
||||
Branch(IsDetachedBuffer(buffer), &Detached, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), &Detached, ¬Detached);
|
||||
Bind(&Detached);
|
||||
{
|
||||
*result = IntToTaggedPtr(Int32(0));
|
||||
@ -528,12 +528,12 @@ void TypedArrayStubBuilder::GetByteOffset([[maybe_unused]] GateRef glue, GateRef
|
||||
Label typedArray(env);
|
||||
Label Detached(env);
|
||||
Label notDetached(env);
|
||||
Branch(IsEcmaObject(thisValue), &ecmaObj, slowPath);
|
||||
BRANCH(IsEcmaObject(thisValue), &ecmaObj, slowPath);
|
||||
Bind(&ecmaObj);
|
||||
Branch(IsTypedArray(thisValue), &typedArray, slowPath);
|
||||
BRANCH(IsTypedArray(thisValue), &typedArray, slowPath);
|
||||
Bind(&typedArray);
|
||||
GateRef buffer = GetViewedArrayBuffer(thisValue);
|
||||
Branch(IsDetachedBuffer(buffer), &Detached, ¬Detached);
|
||||
BRANCH(IsDetachedBuffer(buffer), &Detached, ¬Detached);
|
||||
Bind(&Detached);
|
||||
{
|
||||
*result = IntToTaggedPtr(Int32(0));
|
||||
|
@ -562,7 +562,7 @@ void TypedBytecodeLowering::LowerTypedLdObjByName(GateRef gate)
|
||||
for (size_t i = 0; i < typeCount; ++i) {
|
||||
auto expected = builder_.GetHClassGateFromIndex(gate, tacc.GetExpectedHClassIndex(i));
|
||||
if (i != typeCount - 1) {
|
||||
builder_.Branch(builder_.Equal(receiverHC, expected), &loaders[i], &fails[i]);
|
||||
BRANCH_CIR(builder_.Equal(receiverHC, expected), &loaders[i], &fails[i]);
|
||||
builder_.Bind(&loaders[i]);
|
||||
} else {
|
||||
// Deopt if fails at last hclass compare
|
||||
@ -590,7 +590,7 @@ void TypedBytecodeLowering::LowerTypedLdObjByName(GateRef gate)
|
||||
builder_.LoopBegin(&loopHead);
|
||||
builder_.DeoptCheck(builder_.TaggedIsNotNull(*current), frameState, DeoptType::INCONSISTENTHCLASS2);
|
||||
auto curHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), *current, TaggedObject::HCLASS_OFFSET);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
current = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
@ -676,7 +676,7 @@ void TypedBytecodeLowering::LowerTypedStObjByName(GateRef gate)
|
||||
for (size_t i = 0; i < typeCount; ++i) {
|
||||
auto expected = builder_.GetHClassGateFromIndex(gate, tacc.GetExpectedHClassIndex(i));
|
||||
if (i != typeCount - 1) {
|
||||
builder_.Branch(builder_.Equal(receiverHC, expected),
|
||||
BRANCH_CIR(builder_.Equal(receiverHC, expected),
|
||||
&loaders[i], &fails[i]);
|
||||
builder_.Bind(&loaders[i]);
|
||||
} else {
|
||||
@ -698,7 +698,7 @@ void TypedBytecodeLowering::LowerTypedStObjByName(GateRef gate)
|
||||
builder_.DeoptCheck(builder_.TaggedIsNotNull(*current), frameState, DeoptType::INCONSISTENTHCLASS4);
|
||||
auto curHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), *current,
|
||||
TaggedObject::HCLASS_OFFSET);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
current = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
@ -715,7 +715,7 @@ void TypedBytecodeLowering::LowerTypedStObjByName(GateRef gate)
|
||||
auto newHolderHC = builder_.GetHClassGateFromIndex(gate, tacc.GetAccessInfo(i).HClassIndex());
|
||||
builder_.StoreConstOffset(VariableType::JS_ANY(), newHolderHC, JSHClass::PROTOTYPE_OFFSET, prototype);
|
||||
builder_.Branch(builder_.IsProtoTypeHClass(receiverHC), &isProto, ¬Proto,
|
||||
BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT);
|
||||
BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT, "isProtoTypeHClass");
|
||||
builder_.Bind(&isProto);
|
||||
auto propKey = builder_.LoadObjectFromConstPool(argAcc_.GetFrameArgsIn(gate, FrameArgIdx::CONST_POOL),
|
||||
tacc.GetKey());
|
||||
@ -734,7 +734,7 @@ void TypedBytecodeLowering::LowerTypedStObjByName(GateRef gate)
|
||||
auto index = builder_.Int32(tacc.GetAccessInfo(i).Plr().GetOffset());
|
||||
Label needExtend(&builder_);
|
||||
Label notExtend(&builder_);
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(index, capacity), ¬Extend, &needExtend);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(index, capacity), ¬Extend, &needExtend);
|
||||
builder_.Bind(¬Extend);
|
||||
{
|
||||
BuildNamedPropertyAccess(gate, tacc.GetReceiver(), tacc.GetReceiver(),
|
||||
|
@ -419,12 +419,12 @@ void TypedHCRLowering::LowerFlattenTreeStringCheck(GateRef gate, GateRef glue)
|
||||
Label isTreeString(&builder_);
|
||||
Label exit(&builder_);
|
||||
|
||||
builder_.Branch(builder_.IsTreeString(str), &isTreeString, &exit);
|
||||
BRANCH_CIR(builder_.IsTreeString(str), &isTreeString, &exit);
|
||||
builder_.Bind(&isTreeString);
|
||||
{
|
||||
Label isFlat(&builder_);
|
||||
Label needFlat(&builder_);
|
||||
builder_.Branch(builder_.TreeStringIsFlat(str), &isFlat, &needFlat);
|
||||
BRANCH_CIR(builder_.TreeStringIsFlat(str), &isFlat, &needFlat);
|
||||
builder_.Bind(&isFlat);
|
||||
{
|
||||
result = builder_.GetFirstFromTreeString(str);
|
||||
@ -599,13 +599,14 @@ void TypedHCRLowering::LowerIndexCheck(GateRef gate)
|
||||
GateRef TypedHCRLowering::LowerCallRuntime(GateRef glue, GateRef hirGate, int index, const std::vector<GateRef> &args,
|
||||
bool useLabel)
|
||||
{
|
||||
const std::string name = RuntimeStubCSigns::GetRTName(index);
|
||||
if (useLabel) {
|
||||
GateRef result = builder_.CallRuntime(glue, index, Gate::InvalidGateRef, args, hirGate);
|
||||
GateRef result = builder_.CallRuntime(glue, index, Gate::InvalidGateRef, args, hirGate, name.c_str());
|
||||
return result;
|
||||
} else {
|
||||
const CallSignature *cs = RuntimeStubCSigns::Get(RTSTUB_ID(CallRuntime));
|
||||
GateRef target = builder_.IntPtr(index);
|
||||
GateRef result = builder_.Call(cs, glue, target, dependEntry_, args, hirGate);
|
||||
GateRef result = builder_.Call(cs, glue, target, dependEntry_, args, hirGate, name.c_str());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -631,7 +632,7 @@ void TypedHCRLowering::LowerPrimitiveToNumber(GateRef dst, GateRef src, GateType
|
||||
Label exit(&builder_);
|
||||
Label isTrue(&builder_);
|
||||
Label isFalse(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsTrue(src), &isTrue, &isFalse);
|
||||
BRANCH_CIR(builder_.TaggedIsTrue(src), &isTrue, &isFalse);
|
||||
builder_.Bind(&isTrue);
|
||||
{
|
||||
result = IntToTaggedIntPtr(builder_.Int32(1));
|
||||
@ -695,7 +696,7 @@ void TypedHCRLowering::LowerCallGetter(GateRef gate, GateRef glue)
|
||||
Label notInternalAccessor(&builder_);
|
||||
Label callGetter(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
BRANCH_CIR(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
{
|
||||
builder_.Bind(&isInternalAccessor);
|
||||
{
|
||||
@ -706,7 +707,7 @@ void TypedHCRLowering::LowerCallGetter(GateRef gate, GateRef glue)
|
||||
builder_.Bind(¬InternalAccessor);
|
||||
{
|
||||
GateRef getter = builder_.LoadConstOffset(VariableType::JS_ANY(), accessor, AccessorData::GETTER_OFFSET);
|
||||
builder_.Branch(builder_.IsSpecial(getter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callGetter);
|
||||
BRANCH_CIR(builder_.IsSpecial(getter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callGetter);
|
||||
builder_.Bind(&callGetter);
|
||||
{
|
||||
result = CallAccessor(glue, gate, getter, receiver, AccessorMode::GETTER);
|
||||
@ -785,7 +786,7 @@ void TypedHCRLowering::LowerCallSetter(GateRef gate, GateRef glue)
|
||||
Label notInternalAccessor(&builder_);
|
||||
Label callSetter(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
BRANCH_CIR(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
{
|
||||
builder_.Bind(&isInternalAccessor);
|
||||
{
|
||||
@ -796,7 +797,7 @@ void TypedHCRLowering::LowerCallSetter(GateRef gate, GateRef glue)
|
||||
builder_.Bind(¬InternalAccessor);
|
||||
{
|
||||
GateRef setter = builder_.LoadConstOffset(VariableType::JS_ANY(), accessor, AccessorData::SETTER_OFFSET);
|
||||
builder_.Branch(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
BRANCH_CIR(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
builder_.Bind(&callSetter);
|
||||
{
|
||||
CallAccessor(glue, gate, setter, receiver, AccessorMode::SETTER, value);
|
||||
@ -935,7 +936,7 @@ void TypedHCRLowering::LowerCowArrayCheck(GateRef gate, GateRef glue)
|
||||
GateRef receiver = acc_.GetValueIn(gate, 0);
|
||||
Label notCOWArray(&builder_);
|
||||
Label isCOWArray(&builder_);
|
||||
builder_.Branch(builder_.IsJsCOWArray(receiver), &isCOWArray, ¬COWArray);
|
||||
BRANCH_CIR(builder_.IsJsCOWArray(receiver), &isCOWArray, ¬COWArray);
|
||||
builder_.Bind(&isCOWArray);
|
||||
{
|
||||
LowerCallRuntime(glue, gate, RTSTUB_ID(CheckAndCopyArray), {receiver}, true);
|
||||
@ -1054,7 +1055,7 @@ GateRef TypedHCRLowering::BuildTypedArrayLoadElement(GateRef receiver, GateRef o
|
||||
DEFVALUE(result, (&builder_), type, builder_.Double(0));
|
||||
|
||||
GateRef isOnHeap = builder_.IsOnHeap(builder_.LoadHClass(receiver));
|
||||
builder_.Branch(isOnHeap, isByteArray, isArrayBuffer);
|
||||
BRANCH_CIR(isOnHeap, isByteArray, isArrayBuffer);
|
||||
builder_.Bind(isByteArray);
|
||||
{
|
||||
data = builder_.PtrAdd(byteArrayOrArrayBuffer, builder_.IntPtr(ByteArray::DATA_OFFSET));
|
||||
@ -1233,7 +1234,7 @@ void TypedHCRLowering::BuildTypedArrayStoreElement(GateRef receiver, GateRef off
|
||||
JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET);
|
||||
GateRef isOnHeap = builder_.IsOnHeap(builder_.LoadHClass(receiver));
|
||||
DEFVALUE(data, (&builder_), VariableType::JS_ANY(), builder_.Undefined());
|
||||
builder_.Branch(isOnHeap, isByteArray, isArrayBuffer);
|
||||
BRANCH_CIR(isOnHeap, isByteArray, isArrayBuffer);
|
||||
builder_.Bind(isByteArray);
|
||||
{
|
||||
data = builder_.PtrAdd(byteArrayOrArrayBuffer, builder_.IntPtr(ByteArray::DATA_OFFSET));
|
||||
@ -1271,7 +1272,7 @@ void TypedHCRLowering::LowerUInt8ClampedArrayStoreElement(GateRef gate)
|
||||
Label isOverFlow(&builder_);
|
||||
Label notOverFlow(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.Int32GreaterThan(value, topValue), &isOverFlow, ¬OverFlow);
|
||||
BRANCH_CIR(builder_.Int32GreaterThan(value, topValue), &isOverFlow, ¬OverFlow);
|
||||
builder_.Bind(&isOverFlow);
|
||||
{
|
||||
result = topValue;
|
||||
@ -1280,7 +1281,7 @@ void TypedHCRLowering::LowerUInt8ClampedArrayStoreElement(GateRef gate)
|
||||
builder_.Bind(¬OverFlow);
|
||||
{
|
||||
Label isUnderSpill(&builder_);
|
||||
builder_.Branch(builder_.Int32LessThan(value, bottomValue), &isUnderSpill, &exit);
|
||||
BRANCH_CIR(builder_.Int32LessThan(value, bottomValue), &isUnderSpill, &exit);
|
||||
builder_.Bind(&isUnderSpill);
|
||||
{
|
||||
result = bottomValue;
|
||||
@ -1513,7 +1514,7 @@ void TypedHCRLowering::LowerTypedNewAllocateThis(GateRef gate, GateRef glue)
|
||||
Label exit(&builder_);
|
||||
|
||||
GateRef isBase = builder_.IsBase(ctor);
|
||||
builder_.Branch(isBase, &allocate, &exit);
|
||||
BRANCH_CIR(isBase, &allocate, &exit);
|
||||
builder_.Bind(&allocate);
|
||||
{
|
||||
thisObj = builder_.CallStub(glue, gate, CommonStubCSigns::NewJSObject, { glue, ctor });
|
||||
@ -1534,7 +1535,7 @@ void TypedHCRLowering::LowerTypedSuperAllocateThis(GateRef gate, GateRef glue)
|
||||
Label exit(&builder_);
|
||||
|
||||
GateRef isBase = builder_.IsBase(superCtor);
|
||||
builder_.Branch(isBase, &allocate, &exit);
|
||||
BRANCH_CIR(isBase, &allocate, &exit);
|
||||
builder_.Bind(&allocate);
|
||||
{
|
||||
thisObj = builder_.CallStub(glue, gate, CommonStubCSigns::NewJSObject, { glue, newTarget });
|
||||
@ -1611,7 +1612,7 @@ void TypedHCRLowering::ReplaceHirWithPendingException(GateRef hirGate, GateRef g
|
||||
GateRef value)
|
||||
{
|
||||
auto condition = builder_.HasPendingException(glue);
|
||||
GateRef ifBranch = builder_.Branch(state, condition);
|
||||
GateRef ifBranch = builder_.Branch(state, condition, 1, BranchWeight::DEOPT_WEIGHT, "checkException");
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
GateRef eDepend = builder_.DependRelay(ifTrue, depend);
|
||||
@ -1638,7 +1639,7 @@ void TypedHCRLowering::LowerLookupHolder(GateRef gate)
|
||||
|
||||
builder_.LoopBegin(&loopHead);
|
||||
auto curHC = builder_.LoadHClass(*holder);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &exit, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &exit, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
holder = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
@ -1723,7 +1724,7 @@ void TypedHCRLowering::LowerStringEqual(GateRef gate, GateRef glue)
|
||||
DEFVALUE(result, (&builder_), VariableType::BOOL(), builder_.False());
|
||||
Label lenEqual(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.Equal(leftLength, rightLength), &lenEqual, &exit);
|
||||
BRANCH_CIR(builder_.Equal(leftLength, rightLength), &lenEqual, &exit);
|
||||
builder_.Bind(&lenEqual);
|
||||
{
|
||||
result = builder_.CallStub(glue, gate, CommonStubCSigns::FastStringEqual, { glue, left, right });
|
||||
@ -1766,7 +1767,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
DEFVALUE(newLeft, (&builder_), VariableType::JS_POINTER(), builder_.Undefined());
|
||||
DEFVALUE(result, (&builder_), VariableType::JS_POINTER(), builder_.Undefined());
|
||||
|
||||
builder_.Branch(builder_.Equal(leftLength, builder_.Int32(0)), &leftEmpty, &leftNotEmpty);
|
||||
BRANCH_CIR(builder_.Equal(leftLength, builder_.Int32(0)), &leftEmpty, &leftNotEmpty);
|
||||
builder_.Bind(&leftEmpty);
|
||||
{
|
||||
result = right;
|
||||
@ -1776,7 +1777,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
{
|
||||
Label rightEmpty(&builder_);
|
||||
Label rightNotEmpty(&builder_);
|
||||
builder_.Branch(builder_.Equal(rightLength, builder_.Int32(0)), &rightEmpty, &rightNotEmpty);
|
||||
BRANCH_CIR(builder_.Equal(rightLength, builder_.Int32(0)), &rightEmpty, &rightNotEmpty);
|
||||
builder_.Bind(&rightEmpty);
|
||||
{
|
||||
result = left;
|
||||
@ -1785,11 +1786,11 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
builder_.Bind(&rightNotEmpty);
|
||||
{
|
||||
Label stringConcatOpt(&builder_);
|
||||
builder_.Branch(builder_.Int32LessThan(newLength,
|
||||
BRANCH_CIR(builder_.Int32LessThan(newLength,
|
||||
builder_.Int32(SlicedString::MIN_SLICED_ECMASTRING_LENGTH)), &slowPath, &stringConcatOpt);
|
||||
builder_.Bind(&stringConcatOpt);
|
||||
{
|
||||
builder_.Branch(builder_.IsSpecialSlicedString(left), &isNotFirstConcat, &isFirstConcat);
|
||||
BRANCH_CIR(builder_.IsSpecialSlicedString(left), &isNotFirstConcat, &isFirstConcat);
|
||||
builder_.Bind(&isFirstConcat);
|
||||
{
|
||||
Label fastPath(&builder_);
|
||||
@ -1797,16 +1798,16 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
Label canBeCompress(&builder_);
|
||||
Label canNotBeCompress(&builder_);
|
||||
Label newSlicedStr(&builder_);
|
||||
builder_.Branch(builder_.Int32LessThan(builder_.Int32(LineEcmaString::MAX_LENGTH),
|
||||
BRANCH_CIR(builder_.Int32LessThan(builder_.Int32(LineEcmaString::MAX_LENGTH),
|
||||
backStoreLength), &slowPath, &fastPath);
|
||||
builder_.Bind(&fastPath);
|
||||
{
|
||||
builder_.Branch(builder_.CanBeConcat(left, right, isValidFirstOpt),
|
||||
BRANCH_CIR(builder_.CanBeConcat(left, right, isValidFirstOpt),
|
||||
&canBeConcat, &slowPath);
|
||||
builder_.Bind(&canBeConcat);
|
||||
{
|
||||
lineString = AllocateLineString(glue, backStoreLength, canBeCompressed);
|
||||
builder_.Branch(canBeCompressed, &canBeCompress, &canNotBeCompress);
|
||||
BRANCH_CIR(canBeCompressed, &canBeCompress, &canNotBeCompress);
|
||||
builder_.Bind(&canBeCompress);
|
||||
{
|
||||
GateRef leftSource = builder_.GetStringDataFromLineOrConstantString(left);
|
||||
@ -1834,7 +1835,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
GateRef rightDst = builder_.TaggedPointerToInt64(builder_.PtrAdd(leftDst,
|
||||
builder_.PtrMul(builder_.ZExtInt32ToPtr(leftLength),
|
||||
builder_.IntPtr(sizeof(uint16_t)))));
|
||||
builder_.Branch(leftIsUtf8, &leftIsUtf8L, &leftIsUtf16L);
|
||||
BRANCH_CIR(leftIsUtf8, &leftIsUtf8L, &leftIsUtf16L);
|
||||
builder_.Bind(&leftIsUtf8L);
|
||||
{
|
||||
// left is utf8, right string must utf16
|
||||
@ -1847,7 +1848,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
{
|
||||
builder_.CopyChars(glue, leftDst, leftSource, leftLength,
|
||||
builder_.IntPtr(sizeof(uint16_t)), VariableType::INT16());
|
||||
builder_.Branch(rightIsUtf8, &rightIsUtf8L, &rightIsUtf16L);
|
||||
BRANCH_CIR(rightIsUtf8, &rightIsUtf8L, &rightIsUtf16L);
|
||||
builder_.Bind(&rightIsUtf8L);
|
||||
builder_.CopyUtf8AsUtf16(glue, rightDst, rightSource, rightLength);
|
||||
builder_.Jump(&newSlicedStr);
|
||||
@ -1867,7 +1868,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
builder_.Bind(&isNotFirstConcat);
|
||||
{
|
||||
Label fastPath(&builder_);
|
||||
builder_.Branch(builder_.CanBackStore(right, isValidOpt), &fastPath, &slowPath);
|
||||
BRANCH_CIR(builder_.CanBackStore(right, isValidOpt), &fastPath, &slowPath);
|
||||
builder_.Bind(&fastPath);
|
||||
{
|
||||
// left string length means current length,
|
||||
@ -1877,8 +1878,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
GateRef maxLength = builder_.GetLengthFromString(*lineString);
|
||||
Label needsRealloc(&builder_);
|
||||
Label backingStore(&builder_);
|
||||
builder_.Branch(builder_.Int32LessThan(maxLength, newLength),
|
||||
&needsRealloc, &backingStore);
|
||||
BRANCH_CIR(builder_.Int32LessThan(maxLength, newLength), &needsRealloc, &backingStore);
|
||||
builder_.Bind(&needsRealloc);
|
||||
{
|
||||
Label newLineStr(&builder_);
|
||||
@ -1886,11 +1886,11 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
Label canNotBeCompress(&builder_);
|
||||
// The new backing store will have a length of min(2*length, LineEcmaString::MAX_LENGTH).
|
||||
GateRef newBackStoreLength = builder_.Int32Mul(newLength, builder_.Int32(2));
|
||||
builder_.Branch(builder_.Int32LessThan(newBackStoreLength,
|
||||
BRANCH_CIR(builder_.Int32LessThan(newBackStoreLength,
|
||||
builder_.Int32(LineEcmaString::MAX_LENGTH)), &newLineStr, &slowPath);
|
||||
builder_.Bind(&newLineStr);
|
||||
{
|
||||
builder_.Branch(canBeCompressed, &canBeCompress, &canNotBeCompress);
|
||||
BRANCH_CIR(canBeCompressed, &canBeCompress, &canNotBeCompress);
|
||||
builder_.Bind(&canBeCompress);
|
||||
{
|
||||
GateRef newBackingStore = AllocateLineString(glue, newBackStoreLength,
|
||||
@ -1951,7 +1951,7 @@ void TypedHCRLowering::LowerStringAdd(GateRef gate, GateRef glue)
|
||||
{
|
||||
Label canBeCompress(&builder_);
|
||||
Label canNotBeCompress(&builder_);
|
||||
builder_.Branch(canBeCompressed, &canBeCompress, &canNotBeCompress);
|
||||
BRANCH_CIR(canBeCompressed, &canBeCompress, &canNotBeCompress);
|
||||
builder_.Bind(&canBeCompress);
|
||||
{
|
||||
GateRef len = builder_.Int32LSL(newLength,
|
||||
@ -2022,7 +2022,7 @@ GateRef TypedHCRLowering::AllocateLineString(GateRef glue, GateRef length, GateR
|
||||
|
||||
GateRef len = builder_.Int32LSL(length, builder_.Int32(EcmaString::STRING_LENGTH_SHIFT_COUNT));
|
||||
|
||||
builder_.Branch(canBeCompressed, &isUtf8, &isUtf16);
|
||||
BRANCH_CIR(canBeCompressed, &isUtf8, &isUtf16);
|
||||
builder_.Bind(&isUtf8);
|
||||
{
|
||||
size = builder_.AlignUp(builder_.ComputeSizeUtf8(builder_.ZExtInt32ToPtr(length)),
|
||||
@ -2064,7 +2064,7 @@ GateRef TypedHCRLowering::AllocateSlicedString(GateRef glue, GateRef flatString,
|
||||
|
||||
GateRef len = builder_.Int32LSL(length, builder_.Int32(EcmaString::STRING_LENGTH_SHIFT_COUNT));
|
||||
|
||||
builder_.Branch(canBeCompressed, &isUtf8, &isUtf16);
|
||||
BRANCH_CIR(canBeCompressed, &isUtf8, &isUtf16);
|
||||
builder_.Bind(&isUtf8);
|
||||
{
|
||||
mixLength = builder_.Int32Or(len, builder_.Int32(EcmaString::STRING_COMPRESSED));
|
||||
@ -2191,12 +2191,12 @@ void TypedHCRLowering::LowerArrayConstructorCheck(GateRef gate, GateRef glue)
|
||||
Label exit(&builder_);
|
||||
DEFVALUE(check, (&builder_), VariableType::BOOL(), builder_.True());
|
||||
check = builder_.TaggedIsHeapObject(newTarget);
|
||||
builder_.Branch(*check, &isHeapObject, &exit);
|
||||
BRANCH_CIR(*check, &isHeapObject, &exit);
|
||||
builder_.Bind(&isHeapObject);
|
||||
{
|
||||
Label isJSFunction(&builder_);
|
||||
check = builder_.IsJSFunction(newTarget);
|
||||
builder_.Branch(*check, &isJSFunction, &exit);
|
||||
BRANCH_CIR(*check, &isJSFunction, &exit);
|
||||
builder_.Bind(&isJSFunction);
|
||||
{
|
||||
Label getHclass(&builder_);
|
||||
@ -2206,7 +2206,7 @@ void TypedHCRLowering::LowerArrayConstructorCheck(GateRef gate, GateRef glue)
|
||||
GateRef arrayFunc =
|
||||
builder_.GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::ARRAY_FUNCTION_INDEX);
|
||||
check = builder_.Equal(arrayFunc, newTarget);
|
||||
builder_.Branch(*check, &getHclass, &exit);
|
||||
BRANCH_CIR(*check, &getHclass, &exit);
|
||||
builder_.Bind(&getHclass);
|
||||
{
|
||||
GateRef intialHClass = builder_.Load(VariableType::JS_ANY(), newTarget,
|
||||
@ -2239,19 +2239,19 @@ void TypedHCRLowering::LowerArrayConstructor(GateRef gate, GateRef glue)
|
||||
DEFVALUE(arrayLength, (&builder_), VariableType::INT64(), builder_.Int64(0));
|
||||
Label argIsNumber(&builder_);
|
||||
Label arrayCreate(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsNumber(arg0), &argIsNumber, &slowPath);
|
||||
BRANCH_CIR(builder_.TaggedIsNumber(arg0), &argIsNumber, &slowPath);
|
||||
builder_.Bind(&argIsNumber);
|
||||
{
|
||||
Label argIsInt(&builder_);
|
||||
Label argIsDouble(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsInt(arg0), &argIsInt, &argIsDouble);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(arg0), &argIsInt, &argIsDouble);
|
||||
builder_.Bind(&argIsInt);
|
||||
{
|
||||
Label validIntLength(&builder_);
|
||||
GateRef intLen = builder_.GetInt64OfTInt(arg0);
|
||||
GateRef isGEZero = builder_.Int64GreaterThanOrEqual(intLen, builder_.Int64(0));
|
||||
GateRef isLEMaxLen = builder_.Int64LessThanOrEqual(intLen, builder_.Int64(JSArray::MAX_ARRAY_INDEX));
|
||||
builder_.Branch(builder_.BoolAnd(isGEZero, isLEMaxLen), &validIntLength, &slowPath);
|
||||
BRANCH_CIR(builder_.BoolAnd(isGEZero, isLEMaxLen), &validIntLength, &slowPath);
|
||||
builder_.Bind(&validIntLength);
|
||||
{
|
||||
arrayLength = intLen;
|
||||
@ -2268,7 +2268,7 @@ void TypedHCRLowering::LowerArrayConstructor(GateRef gate, GateRef glue)
|
||||
GateRef doubleEqual = builder_.DoubleEqual(doubleLength, intToDouble);
|
||||
GateRef doubleLEMaxLen =
|
||||
builder_.DoubleLessThanOrEqual(doubleLength, builder_.Double(JSArray::MAX_ARRAY_INDEX));
|
||||
builder_.Branch(builder_.BoolAnd(doubleEqual, doubleLEMaxLen), &validDoubleLength, &slowPath);
|
||||
BRANCH_CIR(builder_.BoolAnd(doubleEqual, doubleLEMaxLen), &validDoubleLength, &slowPath);
|
||||
builder_.Bind(&validDoubleLength);
|
||||
{
|
||||
arrayLength = builder_.SExtInt32ToInt64(doubleToInt);
|
||||
@ -2279,7 +2279,7 @@ void TypedHCRLowering::LowerArrayConstructor(GateRef gate, GateRef glue)
|
||||
builder_.Bind(&arrayCreate);
|
||||
{
|
||||
Label lengthValid(&builder_);
|
||||
builder_.Branch(
|
||||
BRANCH_CIR(
|
||||
builder_.Int64GreaterThan(*arrayLength, builder_.Int64(JSObject::MAX_GAP)), &slowPath, &lengthValid);
|
||||
builder_.Bind(&lengthValid);
|
||||
{
|
||||
@ -2336,12 +2336,12 @@ void TypedHCRLowering::LowerObjectConstructorCheck(GateRef gate, GateRef glue)
|
||||
Label exit(&builder_);
|
||||
DEFVALUE(check, (&builder_), VariableType::BOOL(), builder_.True());
|
||||
check = builder_.TaggedIsHeapObject(newTarget);
|
||||
builder_.Branch(*check, &isHeapObject, &exit);
|
||||
BRANCH_CIR(*check, &isHeapObject, &exit);
|
||||
builder_.Bind(&isHeapObject);
|
||||
{
|
||||
Label isJSFunction(&builder_);
|
||||
check = builder_.IsJSFunction(newTarget);
|
||||
builder_.Branch(*check, &isJSFunction, &exit);
|
||||
BRANCH_CIR(*check, &isJSFunction, &exit);
|
||||
builder_.Bind(&isJSFunction);
|
||||
{
|
||||
Label getHclass(&builder_);
|
||||
@ -2351,7 +2351,7 @@ void TypedHCRLowering::LowerObjectConstructorCheck(GateRef gate, GateRef glue)
|
||||
GateRef targetFunc =
|
||||
builder_.GetGlobalEnvValue(VariableType::JS_ANY(), glueGlobalEnv, GlobalEnv::OBJECT_FUNCTION_INDEX);
|
||||
check = builder_.Equal(targetFunc, newTarget);
|
||||
builder_.Branch(*check, &getHclass, &exit);
|
||||
BRANCH_CIR(*check, &getHclass, &exit);
|
||||
builder_.Bind(&getHclass);
|
||||
{
|
||||
GateRef intialHClass = builder_.Load(VariableType::JS_ANY(), newTarget,
|
||||
@ -2380,12 +2380,12 @@ void TypedHCRLowering::LowerObjectConstructor(GateRef gate, GateRef glue)
|
||||
|
||||
Label isHeapObj(&builder_);
|
||||
Label notHeapObj(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(value), &isHeapObj, ¬HeapObj);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(value), &isHeapObj, ¬HeapObj);
|
||||
builder_.Bind(&isHeapObj);
|
||||
{
|
||||
Label isEcmaObj(&builder_);
|
||||
Label notEcmaObj(&builder_);
|
||||
builder_.Branch(builder_.TaggedObjectIsEcmaObject(value), &isEcmaObj, ¬EcmaObj);
|
||||
BRANCH_CIR(builder_.TaggedObjectIsEcmaObject(value), &isEcmaObj, ¬EcmaObj);
|
||||
builder_.Bind(&isEcmaObj);
|
||||
{
|
||||
res = value;
|
||||
@ -2395,7 +2395,7 @@ void TypedHCRLowering::LowerObjectConstructor(GateRef gate, GateRef glue)
|
||||
{
|
||||
Label isSymbol(&builder_);
|
||||
Label notSymbol(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsSymbol(value), &isSymbol, ¬Symbol);
|
||||
BRANCH_CIR(builder_.TaggedIsSymbol(value), &isSymbol, ¬Symbol);
|
||||
builder_.Bind(&isSymbol);
|
||||
{
|
||||
res = NewJSPrimitiveRef(PrimitiveType::PRIMITIVE_SYMBOL, glue, value);
|
||||
@ -2404,7 +2404,7 @@ void TypedHCRLowering::LowerObjectConstructor(GateRef gate, GateRef glue)
|
||||
builder_.Bind(¬Symbol);
|
||||
{
|
||||
Label isBigInt(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsBigInt(value), &isBigInt, &slowPath);
|
||||
BRANCH_CIR(builder_.TaggedIsBigInt(value), &isBigInt, &slowPath);
|
||||
builder_.Bind(&isBigInt);
|
||||
{
|
||||
res = NewJSPrimitiveRef(PrimitiveType::PRIMITIVE_BIGINT, glue, value);
|
||||
@ -2417,7 +2417,7 @@ void TypedHCRLowering::LowerObjectConstructor(GateRef gate, GateRef glue)
|
||||
{
|
||||
Label isNumber(&builder_);
|
||||
Label notNumber(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsNumber(value), &isNumber, ¬Number);
|
||||
BRANCH_CIR(builder_.TaggedIsNumber(value), &isNumber, ¬Number);
|
||||
builder_.Bind(&isNumber);
|
||||
{
|
||||
res = NewJSPrimitiveRef(PrimitiveType::PRIMITIVE_NUMBER, glue, value);
|
||||
@ -2426,7 +2426,7 @@ void TypedHCRLowering::LowerObjectConstructor(GateRef gate, GateRef glue)
|
||||
builder_.Bind(¬Number);
|
||||
{
|
||||
Label isBoolean(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsBoolean(value), &isBoolean, &slowPath);
|
||||
BRANCH_CIR(builder_.TaggedIsBoolean(value), &isBoolean, &slowPath);
|
||||
builder_.Bind(&isBoolean);
|
||||
{
|
||||
res = NewJSPrimitiveRef(PrimitiveType::PRIMITIVE_BOOLEAN, glue, value);
|
||||
@ -2489,7 +2489,7 @@ void TypedHCRLowering::ReplaceGateWithPendingException(GateRef glue, GateRef gat
|
||||
GateRef value)
|
||||
{
|
||||
auto condition = builder_.HasPendingException(glue);
|
||||
GateRef ifBranch = builder_.Branch(state, condition);
|
||||
GateRef ifBranch = builder_.Branch(state, condition, 1, BranchWeight::DEOPT_WEIGHT, "checkException");
|
||||
GateRef ifTrue = builder_.IfTrue(ifBranch);
|
||||
GateRef ifFalse = builder_.IfFalse(ifBranch);
|
||||
GateRef eDepend = builder_.DependRelay(ifTrue, depend);
|
||||
@ -2535,9 +2535,9 @@ void TypedHCRLowering::LowerOrdinaryHasInstance(GateRef gate, GateRef glue)
|
||||
Label objIsHeapObject(&builder_);
|
||||
Label objIsEcmaObject(&builder_);
|
||||
Label objNotEcmaObject(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(obj), &objIsHeapObject, &objNotEcmaObject);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(obj), &objIsHeapObject, &objNotEcmaObject);
|
||||
builder_.Bind(&objIsHeapObject);
|
||||
builder_.Branch(builder_.TaggedObjectIsEcmaObject(obj), &objIsEcmaObject, &objNotEcmaObject);
|
||||
BRANCH_CIR(builder_.TaggedObjectIsEcmaObject(obj), &objIsEcmaObject, &objNotEcmaObject);
|
||||
builder_.Bind(&objNotEcmaObject);
|
||||
{
|
||||
result = builder_.TaggedFalse();
|
||||
@ -2551,21 +2551,21 @@ void TypedHCRLowering::LowerOrdinaryHasInstance(GateRef gate, GateRef glue)
|
||||
Label gotCtorPrototype(&builder_);
|
||||
Label isHeapObject(&builder_);
|
||||
DEFVALUE(constructorPrototype, (&builder_), VariableType::JS_ANY(), builder_.Undefined());
|
||||
builder_.Branch(builder_.IsJSFunction(target), &ctorIsJSFunction, &getCtorProtoSlowPath);
|
||||
BRANCH_CIR(builder_.IsJSFunction(target), &ctorIsJSFunction, &getCtorProtoSlowPath);
|
||||
builder_.Bind(&ctorIsJSFunction);
|
||||
{
|
||||
Label getCtorProtoFastPath(&builder_);
|
||||
GateRef ctorProtoOrHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), target,
|
||||
JSFunction::PROTO_OR_DYNCLASS_OFFSET);
|
||||
|
||||
builder_.Branch(builder_.TaggedIsHole(ctorProtoOrHC), &getCtorProtoSlowPath, &getCtorProtoFastPath);
|
||||
BRANCH_CIR(builder_.TaggedIsHole(ctorProtoOrHC), &getCtorProtoSlowPath, &getCtorProtoFastPath);
|
||||
builder_.Bind(&getCtorProtoFastPath);
|
||||
{
|
||||
Label isHClass(&builder_);
|
||||
Label isPrototype(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(ctorProtoOrHC), &isHeapObject, &getCtorProtoSlowPath);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(ctorProtoOrHC), &isHeapObject, &getCtorProtoSlowPath);
|
||||
builder_.Bind(&isHeapObject);
|
||||
builder_.Branch(builder_.IsJSHClass(ctorProtoOrHC), &isHClass, &isPrototype);
|
||||
BRANCH_CIR(builder_.IsJSHClass(ctorProtoOrHC), &isHClass, &isPrototype);
|
||||
builder_.Bind(&isHClass);
|
||||
{
|
||||
constructorPrototype = builder_.LoadConstOffset(VariableType::JS_POINTER(), ctorProtoOrHC,
|
||||
@ -2600,12 +2600,12 @@ void TypedHCRLowering::LowerOrdinaryHasInstance(GateRef gate, GateRef glue)
|
||||
Label shouldReturn(&builder_);
|
||||
Label shouldContinue(&builder_);
|
||||
|
||||
builder_.Branch(builder_.TaggedIsNull(*object), &afterLoop, &loopHead);
|
||||
BRANCH_CIR(builder_.TaggedIsNull(*object), &afterLoop, &loopHead);
|
||||
builder_.LoopBegin(&loopHead);
|
||||
{
|
||||
GateRef isEqual = builder_.Equal(*object, *constructorPrototype);
|
||||
|
||||
builder_.Branch(isEqual, &strictEqual1, ¬StrictEqual1);
|
||||
BRANCH_CIR(isEqual, &strictEqual1, ¬StrictEqual1);
|
||||
builder_.Bind(&strictEqual1);
|
||||
{
|
||||
result = builder_.TaggedTrue();
|
||||
@ -2617,9 +2617,9 @@ void TypedHCRLowering::LowerOrdinaryHasInstance(GateRef gate, GateRef glue)
|
||||
Label objectIsEcmaObject(&builder_);
|
||||
Label objectNotEcmaObject(&builder_);
|
||||
|
||||
builder_.Branch(builder_.TaggedIsHeapObject(*object), &objectIsHeapObject, &objectNotEcmaObject);
|
||||
BRANCH_CIR(builder_.TaggedIsHeapObject(*object), &objectIsHeapObject, &objectNotEcmaObject);
|
||||
builder_.Bind(&objectIsHeapObject);
|
||||
builder_.Branch(builder_.TaggedObjectIsEcmaObject(*object), &objectIsEcmaObject, &objectNotEcmaObject);
|
||||
BRANCH_CIR(builder_.TaggedObjectIsEcmaObject(*object), &objectIsEcmaObject, &objectNotEcmaObject);
|
||||
builder_.Bind(&objectNotEcmaObject);
|
||||
{
|
||||
GateRef taggedId = builder_.Int32(GET_MESSAGE_STRING_ID(CanNotGetNotEcmaObject));
|
||||
@ -2632,7 +2632,7 @@ void TypedHCRLowering::LowerOrdinaryHasInstance(GateRef gate, GateRef glue)
|
||||
{
|
||||
Label objectIsJsProxy(&builder_);
|
||||
Label objectNotIsJsProxy(&builder_);
|
||||
builder_.Branch(builder_.IsJsProxy(*object), &objectIsJsProxy, &objectNotIsJsProxy);
|
||||
BRANCH_CIR(builder_.IsJsProxy(*object), &objectIsJsProxy, &objectNotIsJsProxy);
|
||||
builder_.Bind(&objectIsJsProxy);
|
||||
{
|
||||
object = builder_.CallRuntime(glue, RTSTUB_ID(CallGetPrototype), Gate::InvalidGateRef,
|
||||
@ -2648,7 +2648,7 @@ void TypedHCRLowering::LowerOrdinaryHasInstance(GateRef gate, GateRef glue)
|
||||
}
|
||||
}
|
||||
builder_.Bind(&shouldContinue);
|
||||
builder_.Branch(builder_.TaggedIsNull(*object), &afterLoop, &loopEnd);
|
||||
BRANCH_CIR(builder_.TaggedIsNull(*object), &afterLoop, &loopEnd);
|
||||
}
|
||||
builder_.Bind(&loopEnd);
|
||||
builder_.LoopEnd(&loopHead);
|
||||
@ -2705,7 +2705,7 @@ void TypedHCRLowering::LowerMonoLoadPropertyOnProto(GateRef gate)
|
||||
builder_.LoopBegin(&loopHead);
|
||||
builder_.DeoptCheck(builder_.TaggedIsNotNull(*current), frameState, DeoptType::INCONSISTENTHCLASS8);
|
||||
auto curHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), *current, TaggedObject::HCLASS_OFFSET);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
current = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
@ -2745,7 +2745,7 @@ void TypedHCRLowering::LowerMonoCallGetterOnProto(GateRef gate, GateRef glue)
|
||||
builder_.LoopBegin(&loopHead);
|
||||
builder_.DeoptCheck(builder_.TaggedIsNotNull(*current), frameState, DeoptType::INCONSISTENTHCLASS9);
|
||||
auto curHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), *current, TaggedObject::HCLASS_OFFSET);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
current = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
@ -2761,7 +2761,7 @@ void TypedHCRLowering::LowerMonoCallGetterOnProto(GateRef gate, GateRef glue)
|
||||
Label notInternalAccessor(&builder_);
|
||||
Label callGetter(&builder_);
|
||||
Label exit(&builder_);
|
||||
builder_.Branch(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
BRANCH_CIR(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
{
|
||||
builder_.Bind(&isInternalAccessor);
|
||||
{
|
||||
@ -2772,7 +2772,7 @@ void TypedHCRLowering::LowerMonoCallGetterOnProto(GateRef gate, GateRef glue)
|
||||
builder_.Bind(¬InternalAccessor);
|
||||
{
|
||||
GateRef getter = builder_.LoadConstOffset(VariableType::JS_ANY(), accessor, AccessorData::GETTER_OFFSET);
|
||||
builder_.Branch(builder_.IsSpecial(getter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callGetter);
|
||||
BRANCH_CIR(builder_.IsSpecial(getter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callGetter);
|
||||
builder_.Bind(&callGetter);
|
||||
{
|
||||
result = CallAccessor(glue, gate, getter, receiver, AccessorMode::GETTER);
|
||||
@ -2836,7 +2836,7 @@ void TypedHCRLowering::LowerMonoStorePropertyLookUpProto(GateRef gate, GateRef g
|
||||
builder_.DeoptCheck(builder_.TaggedIsNotNull(*current), frameState, DeoptType::INCONSISTENTHCLASS10);
|
||||
auto curHC = builder_.LoadConstOffset(VariableType::JS_POINTER(), *current,
|
||||
TaggedObject::HCLASS_OFFSET);
|
||||
builder_.Branch(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
BRANCH_CIR(builder_.Equal(curHC, holderHC), &loadHolder, &lookUpProto);
|
||||
|
||||
builder_.Bind(&lookUpProto);
|
||||
current = builder_.LoadConstOffset(VariableType::JS_ANY(), curHC, JSHClass::PROTOTYPE_OFFSET);
|
||||
@ -2851,7 +2851,7 @@ void TypedHCRLowering::LowerMonoStorePropertyLookUpProto(GateRef gate, GateRef g
|
||||
Label isInternalAccessor(&builder_);
|
||||
Label notInternalAccessor(&builder_);
|
||||
Label callSetter(&builder_);
|
||||
builder_.Branch(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
BRANCH_CIR(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
{
|
||||
builder_.Bind(&isInternalAccessor);
|
||||
{
|
||||
@ -2863,7 +2863,7 @@ void TypedHCRLowering::LowerMonoStorePropertyLookUpProto(GateRef gate, GateRef g
|
||||
{
|
||||
GateRef setter =
|
||||
builder_.LoadConstOffset(VariableType::JS_ANY(), accessor, AccessorData::SETTER_OFFSET);
|
||||
builder_.Branch(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
BRANCH_CIR(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
builder_.Bind(&callSetter);
|
||||
{
|
||||
CallAccessor(glue, gate, setter, receiver, AccessorMode::SETTER, value);
|
||||
@ -2896,7 +2896,7 @@ void TypedHCRLowering::LowerMonoStoreProperty(GateRef gate, GateRef glue)
|
||||
auto newHolderHC = builder_.LoadHClassFromConstpool(constPool, acc_.GetConstantValue(hclassIndex));
|
||||
builder_.StoreConstOffset(VariableType::JS_ANY(), newHolderHC, JSHClass::PROTOTYPE_OFFSET, prototype);
|
||||
builder_.Branch(builder_.IsProtoTypeHClass(receiverHC), &isProto, ¬Proto,
|
||||
BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT);
|
||||
BranchWeight::ONE_WEIGHT, BranchWeight::DEOPT_WEIGHT, "isProtoTypeHClass");
|
||||
builder_.Bind(&isProto);
|
||||
builder_.CallRuntime(glue, RTSTUB_ID(UpdateAOTHClass), Gate::InvalidGateRef,
|
||||
{ receiverHC, newHolderHC, key }, gate);
|
||||
@ -2911,7 +2911,7 @@ void TypedHCRLowering::LowerMonoStoreProperty(GateRef gate, GateRef glue)
|
||||
auto index = builder_.Int32(plr.GetOffset());
|
||||
Label needExtend(&builder_);
|
||||
Label notExtend(&builder_);
|
||||
builder_.Branch(builder_.Int32UnsignedLessThan(index, capacity), ¬Extend, &needExtend);
|
||||
BRANCH_CIR(builder_.Int32UnsignedLessThan(index, capacity), ¬Extend, &needExtend);
|
||||
builder_.Bind(¬Extend);
|
||||
{
|
||||
if (!plr.IsAccessor()) {
|
||||
@ -2922,7 +2922,7 @@ void TypedHCRLowering::LowerMonoStoreProperty(GateRef gate, GateRef glue)
|
||||
Label isInternalAccessor(&builder_);
|
||||
Label notInternalAccessor(&builder_);
|
||||
Label callSetter(&builder_);
|
||||
builder_.Branch(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
BRANCH_CIR(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
{
|
||||
builder_.Bind(&isInternalAccessor);
|
||||
{
|
||||
@ -2934,7 +2934,7 @@ void TypedHCRLowering::LowerMonoStoreProperty(GateRef gate, GateRef glue)
|
||||
{
|
||||
GateRef setter =
|
||||
builder_.LoadConstOffset(VariableType::JS_ANY(), accessor, AccessorData::SETTER_OFFSET);
|
||||
builder_.Branch(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
BRANCH_CIR(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
builder_.Bind(&callSetter);
|
||||
{
|
||||
CallAccessor(glue, gate, setter, receiver, AccessorMode::SETTER, value);
|
||||
@ -2962,7 +2962,7 @@ void TypedHCRLowering::LowerMonoStoreProperty(GateRef gate, GateRef glue)
|
||||
Label isInternalAccessor(&builder_);
|
||||
Label notInternalAccessor(&builder_);
|
||||
Label callSetter(&builder_);
|
||||
builder_.Branch(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
BRANCH_CIR(builder_.IsAccessorInternal(accessor), &isInternalAccessor, ¬InternalAccessor);
|
||||
{
|
||||
builder_.Bind(&isInternalAccessor);
|
||||
{
|
||||
@ -2974,7 +2974,7 @@ void TypedHCRLowering::LowerMonoStoreProperty(GateRef gate, GateRef glue)
|
||||
{
|
||||
GateRef setter =
|
||||
builder_.LoadConstOffset(VariableType::JS_ANY(), accessor, AccessorData::SETTER_OFFSET);
|
||||
builder_.Branch(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
BRANCH_CIR(builder_.IsSpecial(setter, JSTaggedValue::VALUE_UNDEFINED), &exit, &callSetter);
|
||||
builder_.Bind(&callSetter);
|
||||
{
|
||||
CallAccessor(glue, gate, setter, receiver, AccessorMode::SETTER, value);
|
||||
@ -3043,7 +3043,7 @@ void TypedHCRLowering::LowerTypedCreateObjWithBuffer(GateRef gate, GateRef glue)
|
||||
GateRef hclass = builder_.LoadConstOffset(VariableType::JS_POINTER(), oldObj, JSObject::HCLASS_OFFSET);
|
||||
GateRef emptyArray = builder_.GetGlobalConstantValue(ConstantIndex::EMPTY_ARRAY_OBJECT_INDEX);
|
||||
GateRef objectSize = builder_.GetObjectSizeFromHClass(hclass);
|
||||
builder_.Branch(builder_.Equal(objectSize, objSize), &equal, ¬Equal);
|
||||
BRANCH_CIR(builder_.Equal(objectSize, objSize), &equal, ¬Equal);
|
||||
builder_.Bind(&equal);
|
||||
{
|
||||
builder_.StartAllocate();
|
||||
@ -3088,7 +3088,7 @@ void TypedHCRLowering::LowerStringFromSingleCharCode(GateRef gate, GateRef glue)
|
||||
Label canNotBeCompress(&builder_);
|
||||
GateRef codePointTag = acc_.GetValueIn(gate);
|
||||
GateRef codePointValue = builder_.ToNumber(gate, codePointTag, glue);
|
||||
builder_.Branch(builder_.HasPendingException(glue), &isPendingException, &noPendingException);
|
||||
BRANCH_CIR(builder_.HasPendingException(glue), &isPendingException, &noPendingException);
|
||||
builder_.Bind(&isPendingException);
|
||||
{
|
||||
res = builder_.ExceptionConstant();
|
||||
@ -3096,7 +3096,7 @@ void TypedHCRLowering::LowerStringFromSingleCharCode(GateRef gate, GateRef glue)
|
||||
}
|
||||
builder_.Bind(&noPendingException);
|
||||
{
|
||||
builder_.Branch(builder_.TaggedIsInt(codePointValue), &isInt, ¬Int);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(codePointValue), &isInt, ¬Int);
|
||||
builder_.Bind(&isInt);
|
||||
{
|
||||
value = builder_.TruncInt32ToInt16(builder_.GetInt32OfTInt(codePointValue));
|
||||
@ -3109,8 +3109,7 @@ void TypedHCRLowering::LowerStringFromSingleCharCode(GateRef gate, GateRef glue)
|
||||
builder_.Jump(&newObj);
|
||||
}
|
||||
builder_.Bind(&newObj);
|
||||
builder_.Branch(builder_.IsASCIICharacter(builder_.ZExtInt16ToInt32(*value)), &canBeCompress,
|
||||
&canNotBeCompress);
|
||||
BRANCH_CIR(builder_.IsASCIICharacter(builder_.ZExtInt16ToInt32(*value)), &canBeCompress, &canNotBeCompress);
|
||||
NewObjectStubBuilder newBuilder(&env);
|
||||
newBuilder.SetParameters(glue, 0);
|
||||
builder_.Bind(&canBeCompress);
|
||||
@ -3159,18 +3158,18 @@ void TypedHCRLowering::LowerMigrateArrayWithKind(GateRef gate)
|
||||
builder_.BoolAnd(oldKindIsNum, newKindIsHoleNum));
|
||||
GateRef sameKinds = builder_.Int32Equal(oldKind, newKind);
|
||||
GateRef noNeedMigration = builder_.BoolOr(sameKinds, isTransitToHoleKind);
|
||||
builder_.Branch(noNeedMigration, &exit, &doMigration);
|
||||
BRANCH_CIR(noNeedMigration, &exit, &doMigration);
|
||||
builder_.Bind(&doMigration);
|
||||
|
||||
GateRef needCOW = builder_.IsJsCOWArray(object);
|
||||
builder_.Branch(builder_.ElementsKindIsIntOrHoleInt(oldKind), &migrateFromInt, &migrateOtherKinds);
|
||||
BRANCH_CIR(builder_.ElementsKindIsIntOrHoleInt(oldKind), &migrateFromInt, &migrateOtherKinds);
|
||||
builder_.Bind(&migrateFromInt);
|
||||
{
|
||||
Label migrateToHeapValuesFromInt(&builder_);
|
||||
Label migrateToRawValuesFromInt(&builder_);
|
||||
Label migrateToNumbersFromInt(&builder_);
|
||||
builder_.Branch(builder_.ElementsKindIsHeapKind(newKind),
|
||||
&migrateToHeapValuesFromInt, &migrateToRawValuesFromInt);
|
||||
BRANCH_CIR(builder_.ElementsKindIsHeapKind(newKind),
|
||||
&migrateToHeapValuesFromInt, &migrateToRawValuesFromInt);
|
||||
builder_.Bind(&migrateToHeapValuesFromInt);
|
||||
{
|
||||
newElements = builder_.MigrateFromRawValueToHeapValues(object, needCOW, builder_.True());
|
||||
@ -3179,7 +3178,7 @@ void TypedHCRLowering::LowerMigrateArrayWithKind(GateRef gate)
|
||||
}
|
||||
builder_.Bind(&migrateToRawValuesFromInt);
|
||||
{
|
||||
builder_.Branch(builder_.ElementsKindIsNumOrHoleNum(newKind), &migrateToNumbersFromInt, &exit);
|
||||
BRANCH_CIR(builder_.ElementsKindIsNumOrHoleNum(newKind), &migrateToNumbersFromInt, &exit);
|
||||
builder_.Bind(&migrateToNumbersFromInt);
|
||||
{
|
||||
builder_.MigrateFromHoleIntToHoleNumber(object);
|
||||
@ -3194,15 +3193,15 @@ void TypedHCRLowering::LowerMigrateArrayWithKind(GateRef gate)
|
||||
Label migrateToRawValuesFromNum(&builder_);
|
||||
Label migrateToIntFromNum(&builder_);
|
||||
Label migrateToRawValueFromTagged(&builder_);
|
||||
builder_.Branch(builder_.ElementsKindIsNumOrHoleNum(oldKind), &migrateFromNumber, &migrateToRawValueFromTagged);
|
||||
BRANCH_CIR(builder_.ElementsKindIsNumOrHoleNum(oldKind), &migrateFromNumber, &migrateToRawValueFromTagged);
|
||||
builder_.Bind(&migrateFromNumber);
|
||||
{
|
||||
builder_.Branch(builder_.ElementsKindIsHeapKind(newKind),
|
||||
&migrateToHeapValuesFromNum, &migrateToRawValuesFromNum);
|
||||
BRANCH_CIR(builder_.ElementsKindIsHeapKind(newKind),
|
||||
&migrateToHeapValuesFromNum, &migrateToRawValuesFromNum);
|
||||
builder_.Bind(&migrateToHeapValuesFromNum);
|
||||
{
|
||||
Label migrateToTaggedFromNum(&builder_);
|
||||
builder_.Branch(builder_.ElementsKindIsHeapKind(newKind), &migrateToTaggedFromNum, &exit);
|
||||
BRANCH_CIR(builder_.ElementsKindIsHeapKind(newKind), &migrateToTaggedFromNum, &exit);
|
||||
builder_.Bind(&migrateToTaggedFromNum);
|
||||
{
|
||||
newElements = builder_.MigrateFromRawValueToHeapValues(object, needCOW, builder_.False());
|
||||
@ -3212,7 +3211,7 @@ void TypedHCRLowering::LowerMigrateArrayWithKind(GateRef gate)
|
||||
}
|
||||
builder_.Bind(&migrateToRawValuesFromNum);
|
||||
{
|
||||
builder_.Branch(builder_.ElementsKindIsIntOrHoleInt(newKind), &migrateToIntFromNum, &exit);
|
||||
BRANCH_CIR(builder_.ElementsKindIsIntOrHoleInt(newKind), &migrateToIntFromNum, &exit);
|
||||
builder_.Bind(&migrateToIntFromNum);
|
||||
{
|
||||
builder_.MigrateFromHoleNumberToHoleInt(object);
|
||||
@ -3224,8 +3223,8 @@ void TypedHCRLowering::LowerMigrateArrayWithKind(GateRef gate)
|
||||
{
|
||||
Label migrateToIntFromTagged(&builder_);
|
||||
Label migrateToOthersFromTagged(&builder_);
|
||||
builder_.Branch(builder_.ElementsKindIsIntOrHoleInt(newKind),
|
||||
&migrateToIntFromTagged, &migrateToOthersFromTagged);
|
||||
BRANCH_CIR(builder_.ElementsKindIsIntOrHoleInt(newKind),
|
||||
&migrateToIntFromTagged, &migrateToOthersFromTagged);
|
||||
builder_.Bind(&migrateToIntFromTagged);
|
||||
{
|
||||
newElements = builder_.MigrateFromHeapValueToRawValue(object, needCOW, builder_.True());
|
||||
@ -3235,7 +3234,7 @@ void TypedHCRLowering::LowerMigrateArrayWithKind(GateRef gate)
|
||||
builder_.Bind(&migrateToOthersFromTagged);
|
||||
{
|
||||
Label migrateToNumFromTagged(&builder_);
|
||||
builder_.Branch(builder_.ElementsKindIsNumOrHoleNum(newKind), &migrateToNumFromTagged, &exit);
|
||||
BRANCH_CIR(builder_.ElementsKindIsNumOrHoleNum(newKind), &migrateToNumFromTagged, &exit);
|
||||
builder_.Bind(&migrateToNumFromTagged);
|
||||
{
|
||||
newElements = builder_.MigrateFromHeapValueToRawValue(object, needCOW, builder_.False());
|
||||
|
@ -103,7 +103,7 @@ void TypedNativeInlineLowering::LowerMathPow(GateRef gate)
|
||||
GateRef tempIsNan = builder_.BoolAnd(baseIsOne, builder_.DoubleIsINF(exp));
|
||||
GateRef resultIsNan = builder_.BoolOr(builder_.DoubleIsNAN(exp), tempIsNan);
|
||||
|
||||
builder_.Branch(resultIsNan, &exit, ¬Nan);
|
||||
BRANCH_CIR(resultIsNan, &exit, ¬Nan);
|
||||
builder_.Bind(¬Nan);
|
||||
{
|
||||
GateRef glue = acc_.GetGlueFromArgList();
|
||||
@ -138,7 +138,7 @@ void TypedNativeInlineLowering::LowerGeneralUnaryMath(GateRef gate, RuntimeStubC
|
||||
check = builder_.BoolOr(gt, lt);
|
||||
}
|
||||
|
||||
builder_.Branch(check, &exit, &checkNotPassed);
|
||||
BRANCH_CIR(check, &exit, &checkNotPassed);
|
||||
builder_.Bind(&checkNotPassed);
|
||||
{
|
||||
GateRef glue = acc_.GetGlueFromArgList();
|
||||
@ -165,14 +165,14 @@ void TypedNativeInlineLowering::LowerMathAtan2(GateRef gate)
|
||||
auto yIsNan = builder_.DoubleIsNAN(y);
|
||||
auto xIsNan = builder_.DoubleIsNAN(x);
|
||||
auto checkNaN = builder_.BoolOr(yIsNan, xIsNan);
|
||||
builder_.Branch(checkNaN, &exit, &label1);
|
||||
BRANCH_CIR(checkNaN, &exit, &label1);
|
||||
builder_.Bind(&label1);
|
||||
{
|
||||
Label label4(&builder_);
|
||||
auto yIsZero = builder_.DoubleEqual(y, builder_.Double(0.));
|
||||
auto xIsMoreZero = builder_.DoubleGreaterThan(x, builder_.Double(0.));
|
||||
auto check = builder_.BoolAnd(yIsZero, xIsMoreZero);
|
||||
builder_.Branch(check, &label4, &label2);
|
||||
BRANCH_CIR(check, &label4, &label2);
|
||||
builder_.Bind(&label4);
|
||||
{
|
||||
result = y;
|
||||
@ -183,13 +183,13 @@ void TypedNativeInlineLowering::LowerMathAtan2(GateRef gate)
|
||||
{
|
||||
Label label5(&builder_);
|
||||
auto xIsPositiveInf = builder_.DoubleEqual(x, builder_.Double(std::numeric_limits<double>::infinity()));
|
||||
builder_.Branch(xIsPositiveInf, &label5, &label3);
|
||||
BRANCH_CIR(xIsPositiveInf, &label5, &label3);
|
||||
builder_.Bind(&label5);
|
||||
{
|
||||
Label label6(&builder_);
|
||||
Label label7(&builder_);
|
||||
auto yPositiveCheck = builder_.DoubleGreaterThanOrEqual(y, builder_.Double(0.));
|
||||
builder_.Branch(yPositiveCheck, &label6, &label7);
|
||||
BRANCH_CIR(yPositiveCheck, &label6, &label7);
|
||||
builder_.Bind(&label6);
|
||||
{
|
||||
result = builder_.Double(0.0);
|
||||
@ -231,11 +231,11 @@ void TypedNativeInlineLowering::LowerAbs(GateRef gate)
|
||||
Label isIntMin(&builder_);
|
||||
Label isResultInt(&builder_);
|
||||
Label intExit(&builder_);
|
||||
builder_.Branch(builder_.TaggedIsInt(param), &isInt, ¬Int);
|
||||
BRANCH_CIR(builder_.TaggedIsInt(param), &isInt, ¬Int);
|
||||
builder_.Bind(&isInt);
|
||||
{
|
||||
auto value = builder_.GetInt32OfTInt(param);
|
||||
builder_.Branch(builder_.Equal(value, builder_.Int32(INT32_MIN)), &isIntMin, &isResultInt);
|
||||
BRANCH_CIR(builder_.Equal(value, builder_.Int32(INT32_MIN)), &isIntMin, &isResultInt);
|
||||
builder_.Bind(&isResultInt);
|
||||
{
|
||||
auto temp = builder_.Int32ASR(value, builder_.Int32(JSTaggedValue::INT_SIGN_BIT_OFFSET));
|
||||
|
Loading…
Reference in New Issue
Block a user