2022-02-19 02:09:52 +00:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "interpreter_stub-inl.h"
|
|
|
|
|
|
|
|
|
|
#include "ecmascript/base/number_helper.h"
|
|
|
|
|
#include "ecmascript/compiler/llvm_ir_builder.h"
|
2022-03-01 08:31:08 +00:00
|
|
|
|
#include "ecmascript/compiler/variable_type.h"
|
2022-03-16 10:12:15 +00:00
|
|
|
|
#include "ecmascript/global_env_constants.h"
|
2022-02-19 02:09:52 +00:00
|
|
|
|
#include "ecmascript/ic/profile_type_info.h"
|
2022-03-11 08:08:16 +00:00
|
|
|
|
#include "ecmascript/interpreter/interpreter.h"
|
2022-02-19 02:09:52 +00:00
|
|
|
|
#include "ecmascript/js_array.h"
|
2022-03-16 10:12:15 +00:00
|
|
|
|
#include "ecmascript/js_function.h"
|
2022-02-19 02:09:52 +00:00
|
|
|
|
#include "ecmascript/js_generator_object.h"
|
|
|
|
|
#include "ecmascript/message_string.h"
|
|
|
|
|
#include "ecmascript/tagged_hash_table-inl.h"
|
2022-03-16 10:12:15 +00:00
|
|
|
|
#include "stub-inl.h"
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
namespace panda::ecmascript::kungfu {
|
2022-03-04 03:45:28 +00:00
|
|
|
|
#if ECMASCRIPT_ENABLE_ASM_INTERPRETER_LOG
|
2022-02-19 02:09:52 +00:00
|
|
|
|
#define DECLARE_ASM_HANDLER(name) \
|
|
|
|
|
void name##Stub::GenerateCircuit(const CompilationConfig *cfg) \
|
|
|
|
|
{ \
|
|
|
|
|
Stub::GenerateCircuit(cfg); \
|
|
|
|
|
GateRef glue = PtrArgument(0); \
|
|
|
|
|
GateRef pc = PtrArgument(1); \
|
|
|
|
|
GateRef sp = PtrArgument(2); /* 2 : 3rd parameter is value */ \
|
|
|
|
|
GateRef constpool = TaggedPointerArgument(3); /* 3 : 4th parameter is value */ \
|
|
|
|
|
GateRef profileTypeInfo = TaggedPointerArgument(4); /* 4 : 5th parameter is value */ \
|
|
|
|
|
GateRef acc = TaggedArgument(5); /* 5: 6th parameter is value */ \
|
|
|
|
|
GateRef hotnessCounter = Int32Argument(6); /* 6 : 7th parameter is value */ \
|
2022-03-04 03:45:28 +00:00
|
|
|
|
DebugPrint(glue, { GetInt32Constant(GET_MESSAGE_STRING_ID(name)) }); \
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GenerateCircuitImpl(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter); \
|
|
|
|
|
} \
|
|
|
|
|
void name##Stub::GenerateCircuitImpl(GateRef glue, GateRef pc, GateRef sp, \
|
|
|
|
|
GateRef constpool, GateRef profileTypeInfo, \
|
|
|
|
|
GateRef acc, GateRef hotnessCounter)
|
2022-03-04 03:45:28 +00:00
|
|
|
|
#else
|
|
|
|
|
#define DECLARE_ASM_HANDLER(name) \
|
|
|
|
|
void name##Stub::GenerateCircuit(const CompilationConfig *cfg) \
|
|
|
|
|
{ \
|
|
|
|
|
Stub::GenerateCircuit(cfg); \
|
|
|
|
|
GateRef glue = PtrArgument(0); \
|
|
|
|
|
GateRef pc = PtrArgument(1); \
|
|
|
|
|
GateRef sp = PtrArgument(2); /* 2 : 3rd parameter is value */ \
|
|
|
|
|
GateRef constpool = TaggedPointerArgument(3); /* 3 : 4th parameter is value */ \
|
|
|
|
|
GateRef profileTypeInfo = TaggedPointerArgument(4); /* 4 : 5th parameter is value */ \
|
|
|
|
|
GateRef acc = TaggedArgument(5); /* 5: 6th parameter is value */ \
|
|
|
|
|
GateRef hotnessCounter = Int32Argument(6); /* 6 : 7th parameter is value */ \
|
|
|
|
|
GenerateCircuitImpl(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter); \
|
|
|
|
|
} \
|
|
|
|
|
void name##Stub::GenerateCircuitImpl(GateRef glue, GateRef pc, GateRef sp, \
|
|
|
|
|
GateRef constpool, GateRef profileTypeInfo, \
|
|
|
|
|
GateRef acc, GateRef hotnessCounter)
|
|
|
|
|
#endif
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
#define DISPATCH(format) \
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter, \
|
|
|
|
|
GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::format)))
|
|
|
|
|
|
|
|
|
|
#define DISPATCH_WITH_ACC(format) \
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, profileTypeInfo, *varAcc, hotnessCounter, \
|
|
|
|
|
GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::format)))
|
|
|
|
|
|
|
|
|
|
#define DISPATCH_LAST() \
|
|
|
|
|
DispatchLast(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter) \
|
|
|
|
|
|
2022-03-12 10:47:21 +00:00
|
|
|
|
#define DISPATCH_LAST_WITH_ACC() \
|
|
|
|
|
DispatchLast(glue, pc, sp, constpool, profileTypeInfo, *varAcc, hotnessCounter) \
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
2022-02-25 07:43:36 +00:00
|
|
|
|
#define UPDATE_HOTNESS(_sp) \
|
|
|
|
|
varHotnessCounter = Int32Add(offset, *varHotnessCounter); \
|
|
|
|
|
Branch(Int32LessThan(*varHotnessCounter, GetInt32Constant(0)), &slowPath, &dispatch); \
|
|
|
|
|
Bind(&slowPath); \
|
|
|
|
|
{ \
|
|
|
|
|
varProfileTypeInfo = CallRuntimeTrampoline(glue, \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(UpdateHotnessCounter)), {}); \
|
2022-02-25 07:43:36 +00:00
|
|
|
|
varHotnessCounter = GetInt32Constant(EcmaInterpreter::METHOD_HOTNESS_THRESHOLD); \
|
|
|
|
|
Jump(&dispatch); \
|
|
|
|
|
} \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
Bind(&dispatch);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdNanPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(GetDoubleConstant(base::NAN_VALUE));
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdInfinityPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(GetDoubleConstant(base::POSITIVE_INFINITY));
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 03:59:11 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdGlobalThisPref)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
varAcc = GetGlobalObject(glue);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdUndefinedPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = GetUndefinedConstant();
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdNullPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = GetNullConstant();
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 03:59:11 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdSymbolPref)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
varAcc = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(GetSymbolFunction)), {});
|
2022-02-25 03:59:11 +00:00
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdGlobalPref)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
varAcc = GetGlobalObject(glue);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdTruePref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = ChangeInt64ToTagged(GetInt64Constant(JSTaggedValue::VALUE_TRUE));
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdFalsePref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = ChangeInt64ToTagged(GetInt64Constant(JSTaggedValue::VALUE_FALSE));
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowDynPref)
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowDyn)), { acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleTypeOfDynPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-03-14 03:50:02 +00:00
|
|
|
|
varAcc = FastTypeOf(glue, acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdLexEnvDynPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef state = GetFrame(sp);
|
|
|
|
|
varAcc = GetEnvFromFrame(state);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandlePopLexEnvDynPref)
|
|
|
|
|
{
|
|
|
|
|
GateRef state = GetFrame(sp);
|
|
|
|
|
GateRef currentLexEnv = GetEnvFromFrame(state);
|
|
|
|
|
GateRef parentLexEnv = GetParentEnv(currentLexEnv);
|
|
|
|
|
SetEnvToFrame(glue, state, parentLexEnv);
|
|
|
|
|
DISPATCH(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 03:59:11 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetUnmappedArgsPref)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetUnmapedArgs)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{});
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCopyRestArgsPrefImm16)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef restIdx = ZExtInt16ToInt32(ReadInst16_1(pc));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CopyRestArgs)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ IntBuildTaggedTypeWithNoGC(restIdx) });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateArrayWithBufferPrefImm16)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef imm = ZExtInt16ToInt32(ReadInst16_1(pc));
|
|
|
|
|
GateRef result = GetObjectFromConstPool(constpool, imm);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(CreateArrayWithBuffer)), { result });
|
2022-02-25 03:59:11 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateObjectWithBufferPrefImm16)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef imm = ZExtInt16ToInt32(ReadInst16_1(pc));
|
|
|
|
|
GateRef result = GetObjectFromConstPool(constpool, imm);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(CreateObjectWithBuffer)), { result });
|
2022-02-25 03:59:11 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateObjectWithExcludedKeysPrefImm16V8V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef numKeys = ReadInst16_1(pc);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
|
|
|
|
GateRef firstArgRegIdx = ZExtInt8ToInt16(ReadInst8_4(pc));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CreateObjectWithExcludedKeys)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ Int16BuildTaggedTypeWithNoGC(numKeys), obj, Int16BuildTaggedTypeWithNoGC(firstArgRegIdx) });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateObjectHavingMethodPrefImm16)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef imm = ZExtInt16ToInt32(ReadInst16_1(pc));
|
|
|
|
|
GateRef result = GetObjectFromConstPool(constpool, imm);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CreateObjectHavingMethod)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ result, acc, constpool }); // acc is env
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowIfSuperNotCorrectCallPrefImm16)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef imm = ReadInst16_1(pc);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowIfSuperNotCorrectCall)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ Int16BuildTaggedTypeWithNoGC(imm), acc }); // acc is thisValue
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH(PREF_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleNewLexEnvDynPrefImm16)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef numVars = ReadInst16_1(pc);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(NewLexicalEnvDyn)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ Int16BuildTaggedTypeWithNoGC(numVars) });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
SetEnvToFrame(glue, GetFrame(sp), res);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleNewObjDynRangePrefImm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef numArgs = ReadInst16_1(pc);
|
|
|
|
|
GateRef firstArgRegIdx = ZExtInt8ToInt16(ReadInst8_3(pc));
|
|
|
|
|
GateRef firstArgOffset = GetInt16Constant(2);
|
|
|
|
|
GateRef func = GetVregValue(sp, ZExtInt16ToPtr(firstArgRegIdx));
|
|
|
|
|
GateRef newTarget = GetVregValue(sp, IntPtrAdd(ZExtInt16ToPtr(firstArgRegIdx), GetIntPtrConstant(1)));
|
|
|
|
|
GateRef firstArgIdx = Int16Add(firstArgRegIdx, firstArgOffset);
|
|
|
|
|
GateRef length = Int16Sub(numArgs, firstArgOffset);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(NewObjDynRange)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ func, newTarget, Int16BuildTaggedTypeWithNoGC(firstArgIdx), Int16BuildTaggedTypeWithNoGC(length) });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineFuncDynPrefId16Imm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef methodId = ReadInst16_1(pc);
|
|
|
|
|
GateRef length = ReadInst16_3(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
DEFVARIABLE(result, VariableType::JS_POINTER(),
|
|
|
|
|
GetObjectFromConstPool(constpool, ZExtInt16ToInt32(methodId)));
|
|
|
|
|
Label isResolved(env);
|
|
|
|
|
Label notResolved(env);
|
|
|
|
|
Label defaultLabel(env);
|
|
|
|
|
Branch(FunctionIsResolved(*result), &isResolved, ¬Resolved);
|
|
|
|
|
Bind(&isResolved);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(DefinefuncDyn)), { *result });
|
2022-02-25 03:59:11 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
SetConstantPoolToFunction(glue, *result, constpool);
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Resolved);
|
|
|
|
|
{
|
|
|
|
|
SetResolvedToFunction(glue, *result, GetBooleanConstant(true));
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
Bind(&defaultLabel);
|
|
|
|
|
{
|
|
|
|
|
GateRef hClass = LoadHClass(*result);
|
|
|
|
|
SetPropertyInlinedProps(glue, *result, hClass, Int16BuildTaggedWithNoGC(length),
|
|
|
|
|
GetInt32Constant(JSFunction::LENGTH_INLINE_PROPERTY_INDEX), VariableType::INT64());
|
|
|
|
|
GateRef envHandle = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
SetLexicalEnvToFunction(glue, *result, envHandle);
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID16_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineNCFuncDynPrefId16Imm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef methodId = ReadInst16_1(pc);
|
|
|
|
|
GateRef length = ReadInst16_3(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
DEFVARIABLE(result, VariableType::JS_POINTER(),
|
|
|
|
|
GetObjectFromConstPool(constpool, ZExtInt16ToInt32(methodId)));
|
|
|
|
|
Label isResolved(env);
|
|
|
|
|
Label notResolved(env);
|
|
|
|
|
Label defaultLabel(env);
|
|
|
|
|
Branch(FunctionIsResolved(*result), &isResolved, ¬Resolved);
|
|
|
|
|
Bind(&isResolved);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(DefineNCFuncDyn)), { *result });
|
2022-02-25 03:59:11 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
SetConstantPoolToFunction(glue, *result, constpool);
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Resolved);
|
|
|
|
|
{
|
|
|
|
|
SetResolvedToFunction(glue, *result, GetBooleanConstant(true));
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
Bind(&defaultLabel);
|
|
|
|
|
{
|
|
|
|
|
GateRef hClass = LoadHClass(*result);
|
|
|
|
|
SetPropertyInlinedProps(glue, *result, hClass, Int16BuildTaggedWithNoGC(length),
|
|
|
|
|
GetInt32Constant(JSFunction::LENGTH_INLINE_PROPERTY_INDEX), VariableType::INT64());
|
|
|
|
|
GateRef env = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
SetLexicalEnvToFunction(glue, *result, env);
|
|
|
|
|
SetHomeObjectToFunction(glue, *result, acc);
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID16_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineGeneratorFuncPrefId16Imm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef methodId = ReadInst16_1(pc);
|
|
|
|
|
GateRef length = ReadInst16_3(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
DEFVARIABLE(result, VariableType::JS_POINTER(),
|
|
|
|
|
GetObjectFromConstPool(constpool, ZExtInt16ToInt32(methodId)));
|
|
|
|
|
Label isResolved(env);
|
|
|
|
|
Label notResolved(env);
|
|
|
|
|
Label defaultLabel(env);
|
|
|
|
|
Branch(FunctionIsResolved(*result), &isResolved, ¬Resolved);
|
|
|
|
|
Bind(&isResolved);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(DefineGeneratorFunc)), { *result });
|
2022-02-25 03:59:11 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
SetConstantPoolToFunction(glue, *result, constpool);
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Resolved);
|
|
|
|
|
{
|
|
|
|
|
SetResolvedToFunction(glue, *result, GetBooleanConstant(true));
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
Bind(&defaultLabel);
|
|
|
|
|
{
|
|
|
|
|
GateRef hClass = LoadHClass(*result);
|
|
|
|
|
SetPropertyInlinedProps(glue, *result, hClass, Int16BuildTaggedWithNoGC(length),
|
|
|
|
|
GetInt32Constant(JSFunction::LENGTH_INLINE_PROPERTY_INDEX), VariableType::INT64());
|
|
|
|
|
GateRef env = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
SetLexicalEnvToFunction(glue, *result, env);
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID16_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineAsyncFuncPrefId16Imm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef methodId = ReadInst16_1(pc);
|
|
|
|
|
GateRef length = ReadInst16_3(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
DEFVARIABLE(result, VariableType::JS_POINTER(),
|
|
|
|
|
GetObjectFromConstPool(constpool, ZExtInt16ToInt32(methodId)));
|
|
|
|
|
Label isResolved(env);
|
|
|
|
|
Label notResolved(env);
|
|
|
|
|
Label defaultLabel(env);
|
|
|
|
|
Branch(FunctionIsResolved(*result), &isResolved, ¬Resolved);
|
|
|
|
|
Bind(&isResolved);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(DefineAsyncFunc)), { *result });
|
2022-02-25 03:59:11 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
SetConstantPoolToFunction(glue, *result, constpool);
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Resolved);
|
|
|
|
|
{
|
|
|
|
|
SetResolvedToFunction(glue, *result, GetBooleanConstant(true));
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
Bind(&defaultLabel);
|
|
|
|
|
{
|
|
|
|
|
GateRef hClass = LoadHClass(*result);
|
|
|
|
|
SetPropertyInlinedProps(glue, *result, hClass, Int16BuildTaggedWithNoGC(length),
|
|
|
|
|
GetInt32Constant(JSFunction::LENGTH_INLINE_PROPERTY_INDEX), VariableType::INT64());
|
|
|
|
|
GateRef env = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
SetLexicalEnvToFunction(glue, *result, env);
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID16_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineMethodPrefId16Imm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef methodId = ReadInst16_1(pc);
|
|
|
|
|
GateRef length = ReadInst16_3(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
DEFVARIABLE(result, VariableType::JS_POINTER(),
|
|
|
|
|
GetObjectFromConstPool(constpool, ZExtInt16ToInt32(methodId)));
|
|
|
|
|
Label isResolved(env);
|
|
|
|
|
Label notResolved(env);
|
|
|
|
|
Label defaultLabel(env);
|
|
|
|
|
Branch(FunctionIsResolved(*result), &isResolved, ¬Resolved);
|
|
|
|
|
Bind(&isResolved);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(DefineMethod)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ *result, acc }); // acc is homeObject
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
SetConstantPoolToFunction(glue, *result, constpool);
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Resolved);
|
|
|
|
|
{
|
|
|
|
|
SetHomeObjectToFunction(glue, *result, acc);
|
|
|
|
|
SetResolvedToFunction(glue, *result, GetBooleanConstant(true));
|
|
|
|
|
Jump(&defaultLabel);
|
|
|
|
|
}
|
|
|
|
|
Bind(&defaultLabel);
|
|
|
|
|
{
|
|
|
|
|
GateRef hClass = LoadHClass(*result);
|
|
|
|
|
SetPropertyInlinedProps(glue, *result, hClass, Int16BuildTaggedWithNoGC(length),
|
|
|
|
|
GetInt32Constant(JSFunction::LENGTH_INLINE_PROPERTY_INDEX), VariableType::INT64());
|
|
|
|
|
GateRef env = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
SetLexicalEnvToFunction(glue, *result, env);
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID16_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallSpreadDynPrefV8V8V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef func = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_2(pc)));
|
|
|
|
|
GateRef array = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CallSpreadDyn)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ func, obj, array });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAsyncFunctionResolvePrefV8V8V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef asyncFuncObj = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(AsyncFunctionResolveOrReject)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ asyncFuncObj, value, TaggedTrue() });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAsyncFunctionRejectPrefV8V8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef asyncFuncObj = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(AsyncFunctionResolveOrReject)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ asyncFuncObj, value, TaggedFalse() });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH(PREF_V8_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineGetterSetterByValuePrefV8V8V8V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef prop = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_2(pc)));
|
|
|
|
|
GateRef getter = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
|
|
|
|
GateRef setter = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_4(pc)));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(DefineGetterSetterByValue)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ obj, prop, getter, setter, acc }); // acc is flag
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleSuperCallPrefImm16V8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef range = ReadInst16_1(pc);
|
|
|
|
|
GateRef v0 = ZExtInt8ToInt16(ReadInst8_3(pc));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 03:59:11 +00:00
|
|
|
|
// acc is thisFunc
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SuperCall)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ acc, Int16BuildTaggedTypeWithNoGC(v0), Int16BuildTaggedTypeWithNoGC(range) });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetPropIteratorPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
auto env = GetEnvironment();
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetPropIterator)), { *varAcc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAsyncFunctionEnterPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
auto env = GetEnvironment();
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(AsyncFunctionEnter)), {});
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdHolePref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = GetHoleConstant();
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 03:59:11 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateEmptyObjectPref)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(CreateEmptyObject)), {});
|
2022-02-25 03:59:11 +00:00
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateEmptyArrayPref)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(CreateEmptyArray)), {});
|
2022-02-25 03:59:11 +00:00
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetIteratorPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
auto env = GetEnvironment();
|
2022-03-16 10:12:15 +00:00
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isGeneratorObj(env);
|
|
|
|
|
Label notGeneratorObj(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsGeneratorObject(*varAcc), &isGeneratorObj, ¬GeneratorObj);
|
|
|
|
|
Bind(&isGeneratorObj);
|
|
|
|
|
{
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬GeneratorObj);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetIterator)), { *varAcc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowThrowNotExistsPref)
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowThrowNotExists)), {});
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowPatternNonCoerciblePref)
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowPatternNonCoercible)), {});
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdHomeObjectPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef thisFunc = GetFunctionFromFrame(GetFrame(sp));
|
|
|
|
|
varAcc = GetHomeObjectFromJSFunction(thisFunc);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowDeleteSuperPropertyPref)
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowDeleteSuperProperty)), {});
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDebuggerPref)
|
|
|
|
|
{
|
|
|
|
|
DISPATCH(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleMul2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetHoleConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// fast path
|
|
|
|
|
result = FastMul(left, acc);
|
|
|
|
|
Label isHole(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
|
|
|
|
Bind(&isHole);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(Mul2Dyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDiv2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetHoleConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// fast path
|
|
|
|
|
result = FastDiv(left, acc);
|
|
|
|
|
Label isHole(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
|
|
|
|
Bind(&isHole);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(Div2Dyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleMod2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetHoleConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// fast path
|
|
|
|
|
result = FastMod(glue, left, acc);
|
|
|
|
|
Label isHole(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
|
|
|
|
Bind(&isHole);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(Mod2Dyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleEqDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
// fast path
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetHoleConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
result = FastEqual(left, acc);
|
|
|
|
|
Label isHole(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
|
|
|
|
Bind(&isHole);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(EqDyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleNotEqDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
// fast path
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetHoleConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
result = FastEqual(left, acc);
|
|
|
|
|
Label isHole(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsHole(*result), &isHole, ¬Hole);
|
|
|
|
|
Bind(&isHole);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(NotEqDyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
Label resultIsTrue(env);
|
|
|
|
|
Label resultNotTrue(env);
|
|
|
|
|
Branch(TaggedIsTrue(*result), &resultIsTrue, &resultNotTrue);
|
|
|
|
|
Bind(&resultIsTrue);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&resultNotTrue);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLessDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef right = acc;
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftOrRightNotInt(env);
|
|
|
|
|
Label leftLessRight(env);
|
|
|
|
|
Label leftNotLessRight(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef intLeft = TaggedGetInt(left);
|
|
|
|
|
GateRef intRight = TaggedGetInt(right);
|
|
|
|
|
Branch(Int32LessThan(intLeft, intRight), &leftLessRight, &leftNotLessRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftOrRightNotInt);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
// fast path
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(doubleLeft, VariableType::FLOAT64(), GetDoubleConstant(0));
|
|
|
|
|
DEFVARIABLE(doubleRight, VariableType::FLOAT64(), GetDoubleConstant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label leftIsInt1(env);
|
|
|
|
|
Label leftNotInt1(env);
|
|
|
|
|
Label exit1(env);
|
|
|
|
|
Label exit2(env);
|
|
|
|
|
Label rightIsInt1(env);
|
|
|
|
|
Label rightNotInt1(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
|
|
|
|
Bind(&leftIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = TaggedCastToDouble(left);
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit1);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = ChangeInt32ToFloat64(TaggedGetInt(right));
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = TaggedCastToDouble(right);
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit2);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleLessThan(*doubleLeft, *doubleRight), &leftLessRight, &leftNotLessRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftLessRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotLessRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LessDyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLessEqDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef right = acc;
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftOrRightNotInt(env);
|
|
|
|
|
Label leftLessEqRight(env);
|
|
|
|
|
Label leftNotLessEqRight(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef intLeft = TaggedGetInt(left);
|
|
|
|
|
GateRef intRight = TaggedGetInt(right);
|
|
|
|
|
Branch(Int32LessThanOrEqual(intLeft, intRight), &leftLessEqRight, &leftNotLessEqRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftOrRightNotInt);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
// fast path
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(doubleLeft, VariableType::FLOAT64(), GetDoubleConstant(0));
|
|
|
|
|
DEFVARIABLE(doubleRight, VariableType::FLOAT64(), GetDoubleConstant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label leftIsInt1(env);
|
|
|
|
|
Label leftNotInt1(env);
|
|
|
|
|
Label exit1(env);
|
|
|
|
|
Label exit2(env);
|
|
|
|
|
Label rightIsInt1(env);
|
|
|
|
|
Label rightNotInt1(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
|
|
|
|
Bind(&leftIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = TaggedCastToDouble(left);
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit1);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = ChangeInt32ToFloat64(TaggedGetInt(right));
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = TaggedCastToDouble(right);
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit2);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleLessThanOrEqual(*doubleLeft, *doubleRight), &leftLessEqRight, &leftNotLessEqRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftLessEqRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotLessEqRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LessEqDyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleGreaterDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef right = acc;
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftOrRightNotInt(env);
|
|
|
|
|
Label leftGreaterRight(env);
|
|
|
|
|
Label leftNotGreaterRight(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef intLeft = TaggedGetInt(left);
|
|
|
|
|
GateRef intRight = TaggedGetInt(right);
|
|
|
|
|
Branch(Int32GreaterThan(intLeft, intRight), &leftGreaterRight, &leftNotGreaterRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftOrRightNotInt);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
// fast path
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(doubleLeft, VariableType::FLOAT64(), GetDoubleConstant(0));
|
|
|
|
|
DEFVARIABLE(doubleRight, VariableType::FLOAT64(), GetDoubleConstant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label leftIsInt1(env);
|
|
|
|
|
Label leftNotInt1(env);
|
|
|
|
|
Label exit1(env);
|
|
|
|
|
Label exit2(env);
|
|
|
|
|
Label rightIsInt1(env);
|
|
|
|
|
Label rightNotInt1(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
|
|
|
|
Bind(&leftIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = TaggedCastToDouble(left);
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit1);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = ChangeInt32ToFloat64(TaggedGetInt(right));
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = TaggedCastToDouble(right);
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit2);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleGreaterThan(*doubleLeft, *doubleRight), &leftGreaterRight, &leftNotGreaterRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftGreaterRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotGreaterRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GreaterDyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleGreaterEqDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef right = acc;
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftOrRightNotInt(env);
|
|
|
|
|
Label leftGreaterEqRight(env);
|
|
|
|
|
Label leftNotGreaterEQRight(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &leftOrRightNotInt);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef intLeft = TaggedGetInt(left);
|
|
|
|
|
GateRef intRight = TaggedGetInt(right);
|
|
|
|
|
Branch(Int32GreaterThanOrEqual(intLeft, intRight), &leftGreaterEqRight, &leftNotGreaterEQRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftOrRightNotInt);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &slowPath);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &slowPath);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
// fast path
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(doubleLeft, VariableType::FLOAT64(), GetDoubleConstant(0));
|
|
|
|
|
DEFVARIABLE(doubleRight, VariableType::FLOAT64(), GetDoubleConstant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label leftIsInt1(env);
|
|
|
|
|
Label leftNotInt1(env);
|
|
|
|
|
Label exit1(env);
|
|
|
|
|
Label exit2(env);
|
|
|
|
|
Label rightIsInt1(env);
|
|
|
|
|
Label rightNotInt1(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt1, &leftNotInt1);
|
|
|
|
|
Bind(&leftIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = ChangeInt32ToFloat64(TaggedGetInt(left));
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleLeft = TaggedCastToDouble(left);
|
|
|
|
|
Jump(&exit1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit1);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt1, &rightNotInt1);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = ChangeInt32ToFloat64(TaggedGetInt(right));
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightNotInt1);
|
|
|
|
|
{
|
|
|
|
|
doubleRight = TaggedCastToDouble(right);
|
|
|
|
|
Jump(&exit2);
|
|
|
|
|
}
|
|
|
|
|
Bind(&exit2);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleGreaterThanOrEqual(*doubleLeft, *doubleRight),
|
|
|
|
|
&leftGreaterEqRight, &leftNotGreaterEQRight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftGreaterEqRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftNotGreaterEQRight);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GreaterEqDyn)), { left, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(AsmInterpreterEntry)
|
|
|
|
|
{
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(SingleStepDebugging)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varPc, VariableType::POINTER(), pc);
|
|
|
|
|
DEFVARIABLE(varSp, VariableType::POINTER(), sp);
|
|
|
|
|
DEFVARIABLE(varConstpool, VariableType::JS_POINTER(), constpool);
|
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
2022-03-02 02:21:05 +00:00
|
|
|
|
GateRef tmpFrame = GetFrame(*varSp);
|
|
|
|
|
SetPcToFrame(glue, tmpFrame, *varPc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
varPc = TaggedCastToIntPtr(CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(JumpToCInterpreter)), {
|
2022-03-02 02:21:05 +00:00
|
|
|
|
constpool, profileTypeInfo, acc, IntBuildTaggedTypeWithNoGC(hotnessCounter)
|
2022-02-25 07:43:36 +00:00
|
|
|
|
}));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label shouldReturn(env);
|
|
|
|
|
Label shouldContinue(env);
|
|
|
|
|
|
2022-02-24 07:53:56 +00:00
|
|
|
|
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &shouldReturn, &shouldContinue);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Bind(&shouldReturn);
|
|
|
|
|
{
|
|
|
|
|
Return();
|
|
|
|
|
}
|
|
|
|
|
Bind(&shouldContinue);
|
|
|
|
|
{
|
|
|
|
|
varSp = GetCurrentSpFrame(glue);
|
|
|
|
|
GateRef frame = GetFrame(*varSp);
|
|
|
|
|
varAcc = GetAccFromFrame(frame);
|
|
|
|
|
|
|
|
|
|
GateRef function = GetFunctionFromFrame(frame);
|
|
|
|
|
varProfileTypeInfo = GetProfileTypeInfoFromFunction(function);
|
|
|
|
|
varConstpool = GetConstpoolFromFunction(function);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varHotnessCounter = Load(VariableType::INT32(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET));
|
|
|
|
|
}
|
|
|
|
|
Dispatch(glue, *varPc, *varSp, *varConstpool, *varProfileTypeInfo, *varAcc,
|
|
|
|
|
*varHotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 07:18:47 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleOverflow)
|
|
|
|
|
{
|
|
|
|
|
FatalPrint(glue, { GetInt32Constant(GET_MESSAGE_STRING_ID(OPCODE_OVERFLOW)) });
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdaDynV8)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef vsrc = ReadInst8_0(pc);
|
|
|
|
|
varAcc = GetVregValue(sp, ZExtInt8ToPtr(vsrc));
|
|
|
|
|
DISPATCH_WITH_ACC(V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStaDynV8)
|
|
|
|
|
{
|
|
|
|
|
GateRef vdst = ReadInst8_0(pc);
|
|
|
|
|
SetVregValue(glue, sp, ZExtInt8ToPtr(vdst), acc);
|
|
|
|
|
DISPATCH(V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJmpImm8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned8_0(pc);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJmpImm16)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned16_0(pc);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJmpImm32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned32_0(pc);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdLexVarDynPrefImm4Imm4)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef level = ZExtInt8ToInt32(ReadInst4_2(pc));
|
|
|
|
|
GateRef slot = ZExtInt8ToInt32(ReadInst4_3(pc));
|
|
|
|
|
GateRef state = GetFrame(sp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(currentEnv, VariableType::JS_ANY(), GetEnvFromFrame(state));
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label loopHead(env);
|
|
|
|
|
Label loopEnd(env);
|
|
|
|
|
Label afterLoop(env);
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopHead, &afterLoop);
|
|
|
|
|
LoopBegin(&loopHead);
|
|
|
|
|
currentEnv = GetParentEnv(*currentEnv);
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1));
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
|
|
|
|
Bind(&loopEnd);
|
|
|
|
|
LoopEnd(&loopHead);
|
|
|
|
|
Bind(&afterLoop);
|
|
|
|
|
GateRef variable = GetPropertiesFromLexicalEnv(*currentEnv, slot);
|
|
|
|
|
varAcc = variable;
|
|
|
|
|
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM4_IMM4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdLexVarDynPrefImm8Imm8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef level = ZExtInt8ToInt32(ReadInst8_1(pc));
|
|
|
|
|
GateRef slot = ZExtInt8ToInt32(ReadInst8_2(pc));
|
|
|
|
|
|
|
|
|
|
GateRef state = GetFrame(sp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(currentEnv, VariableType::JS_ANY(), GetEnvFromFrame(state));
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label loopHead(env);
|
|
|
|
|
Label loopEnd(env);
|
|
|
|
|
Label afterLoop(env);
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopHead, &afterLoop);
|
|
|
|
|
LoopBegin(&loopHead);
|
|
|
|
|
currentEnv = GetParentEnv(*currentEnv);
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1));
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
|
|
|
|
Bind(&loopEnd);
|
|
|
|
|
LoopEnd(&loopHead);
|
|
|
|
|
Bind(&afterLoop);
|
|
|
|
|
GateRef variable = GetPropertiesFromLexicalEnv(*currentEnv, slot);
|
|
|
|
|
varAcc = variable;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM8_IMM8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdLexVarDynPrefImm16Imm16)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef level = ZExtInt16ToInt32(ReadInst16_1(pc));
|
|
|
|
|
GateRef slot = ZExtInt16ToInt32(ReadInst16_3(pc));
|
|
|
|
|
|
|
|
|
|
GateRef state = GetFrame(sp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(currentEnv, VariableType::JS_ANY(), GetEnvFromFrame(state));
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label loopHead(env);
|
|
|
|
|
Label loopEnd(env);
|
|
|
|
|
Label afterLoop(env);
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopHead, &afterLoop);
|
|
|
|
|
LoopBegin(&loopHead);
|
|
|
|
|
currentEnv = GetParentEnv(*currentEnv);
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1));
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
|
|
|
|
Bind(&loopEnd);
|
|
|
|
|
LoopEnd(&loopHead);
|
|
|
|
|
Bind(&afterLoop);
|
|
|
|
|
GateRef variable = GetPropertiesFromLexicalEnv(*currentEnv, slot);
|
|
|
|
|
varAcc = variable;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_IMM16_IMM16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStLexVarDynPrefImm4Imm4V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef level = ZExtInt8ToInt32(ReadInst4_2(pc));
|
|
|
|
|
GateRef slot = ZExtInt8ToInt32(ReadInst4_3(pc));
|
|
|
|
|
GateRef v0 = ReadInst8_2(pc);
|
|
|
|
|
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef state = GetFrame(sp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(currentEnv, VariableType::JS_ANY(), GetEnvFromFrame(state));
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label loopHead(env);
|
|
|
|
|
Label loopEnd(env);
|
|
|
|
|
Label afterLoop(env);
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopHead, &afterLoop);
|
|
|
|
|
LoopBegin(&loopHead);
|
|
|
|
|
currentEnv = GetParentEnv(*currentEnv);
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1));
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
|
|
|
|
Bind(&loopEnd);
|
|
|
|
|
LoopEnd(&loopHead);
|
|
|
|
|
Bind(&afterLoop);
|
|
|
|
|
SetPropertiesToLexicalEnv(glue, *currentEnv, slot, value);
|
|
|
|
|
DISPATCH(PREF_IMM4_IMM4_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStLexVarDynPrefImm8Imm8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef level = ZExtInt8ToInt32(ReadInst8_1(pc));
|
|
|
|
|
GateRef slot = ZExtInt8ToInt32(ReadInst8_2(pc));
|
|
|
|
|
GateRef v0 = ReadInst8_3(pc);
|
|
|
|
|
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef state = GetFrame(sp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(currentEnv, VariableType::JS_ANY(), GetEnvFromFrame(state));
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label loopHead(env);
|
|
|
|
|
Label loopEnd(env);
|
|
|
|
|
Label afterLoop(env);
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopHead, &afterLoop);
|
|
|
|
|
LoopBegin(&loopHead);
|
|
|
|
|
currentEnv = GetParentEnv(*currentEnv);
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1));
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
|
|
|
|
Bind(&loopEnd);
|
|
|
|
|
LoopEnd(&loopHead);
|
|
|
|
|
Bind(&afterLoop);
|
|
|
|
|
SetPropertiesToLexicalEnv(glue, *currentEnv, slot, value);
|
|
|
|
|
DISPATCH(PREF_IMM8_IMM8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStLexVarDynPrefImm16Imm16V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef level = ZExtInt16ToInt32(ReadInst16_1(pc));
|
|
|
|
|
GateRef slot = ZExtInt16ToInt32(ReadInst16_3(pc));
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef state = GetFrame(sp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(currentEnv, VariableType::JS_ANY(), GetEnvFromFrame(state));
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label loopHead(env);
|
|
|
|
|
Label loopEnd(env);
|
|
|
|
|
Label afterLoop(env);
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopHead, &afterLoop);
|
|
|
|
|
LoopBegin(&loopHead);
|
|
|
|
|
currentEnv = GetParentEnv(*currentEnv);
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1));
|
|
|
|
|
Branch(Int32LessThan(*i, level), &loopEnd, &afterLoop);
|
|
|
|
|
Bind(&loopEnd);
|
|
|
|
|
LoopEnd(&loopHead);
|
|
|
|
|
Bind(&afterLoop);
|
|
|
|
|
SetPropertiesToLexicalEnv(glue, *currentEnv, slot, value);
|
|
|
|
|
DISPATCH(PREF_IMM16_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleIncDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
Label valueIsInt(env);
|
|
|
|
|
Label valueNotInt(env);
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
|
|
|
|
Bind(&valueIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueInt = TaggedCastToInt32(value);
|
|
|
|
|
Label valueNoOverflow(env);
|
2022-03-08 13:16:27 +00:00
|
|
|
|
Branch(Int32Equal(valueInt, GetInt32Constant(INT32_MAX)), &valueNotInt, &valueNoOverflow);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Bind(&valueNoOverflow);
|
|
|
|
|
{
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(Int32Add(valueInt, GetInt32Constant(1)));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotInt);
|
2022-03-08 13:16:27 +00:00
|
|
|
|
if (!env->IsAmd64()) {
|
|
|
|
|
Label valueIsDouble(env);
|
|
|
|
|
Label valueNotDouble(env);
|
|
|
|
|
Branch(TaggedIsDouble(value), &valueIsDouble, &valueNotDouble);
|
|
|
|
|
Bind(&valueIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueDouble = TaggedCastToDouble(value);
|
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(DoubleAdd(valueDouble, GetDoubleConstant(1.0)));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(IncDyn)), { value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDecDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
Label valueIsInt(env);
|
|
|
|
|
Label valueNotInt(env);
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
|
|
|
|
Bind(&valueIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueInt = TaggedCastToInt32(value);
|
|
|
|
|
Label valueNoOverflow(env);
|
2022-03-08 13:16:27 +00:00
|
|
|
|
Branch(Int32Equal(valueInt, GetInt32Constant(INT32_MIN)), &valueNotInt, &valueNoOverflow);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Bind(&valueNoOverflow);
|
|
|
|
|
{
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(Int32Sub(valueInt, GetInt32Constant(1)));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotInt);
|
2022-03-08 13:16:27 +00:00
|
|
|
|
if (!env->IsAmd64()) {
|
|
|
|
|
Label valueIsDouble(env);
|
|
|
|
|
Label valueNotDouble(env);
|
|
|
|
|
Branch(TaggedIsDouble(value), &valueIsDouble, &valueNotDouble);
|
|
|
|
|
Bind(&valueIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueDouble = TaggedCastToDouble(value);
|
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(DoubleSub(valueDouble, GetDoubleConstant(1.0)));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(DecDyn)), { value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleExpDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef base = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ExpDyn)),
|
2022-03-01 01:38:27 +00:00
|
|
|
|
{ base, acc }); // acc is exponent
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleIsInDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef prop = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(IsInDyn)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ prop, acc }); // acc is obj
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleInstanceOfDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(InstanceOfDyn)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ obj, acc }); // acc is target
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStrictNotEqDynPrefV8)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(FastStrictNotEqual)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ left, acc }); // acc is right
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStrictEqDynPrefV8)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(FastStrictEqual)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ left, acc }); // acc is right
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleResumeGeneratorPrefV8)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef vs = ReadInst8_1(pc);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(vs));
|
|
|
|
|
GateRef resumeResultOffset = GetIntPtrConstant(JSGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varAcc = Load(VariableType::JS_ANY(), obj, resumeResultOffset);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetResumeModePrefV8)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef vs = ReadInst8_1(pc);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(vs));
|
|
|
|
|
varAcc = ChangeInt64ToTagged(ZExtInt32ToInt64(GetGeneratorObjectResumeMode(obj)));
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateGeneratorObjPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef genFunc = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CreateGeneratorObj)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ genFunc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowConstAssignmentPrefV8)
|
|
|
|
|
{
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowConstAssignment)), { value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetTemplateObjectPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef literal = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetTemplateObject)), { literal });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetNextPropNamePrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef iter = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetNextPropName)), { iter });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowIfNotObjectPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
Label isEcmaObject(env);
|
|
|
|
|
Label notEcmaObject(env);
|
|
|
|
|
Branch(IsEcmaObject(value), &isEcmaObject, ¬EcmaObject);
|
|
|
|
|
Bind(&isEcmaObject);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬EcmaObject);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowIfNotObject)), {});
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleIterNextPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef iter = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(IterNext)), { iter });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCloseIteratorPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef iter = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CloseIterator)), { iter });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCopyModulePrefV8)
|
|
|
|
|
{
|
|
|
|
|
DISPATCH(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleSuperCallSpreadPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef array = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SuperCallSpread)),
|
2022-03-02 02:21:05 +00:00
|
|
|
|
{ acc, array }); // acc is thisFunc, sp for newTarget
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDelObjPropPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef prop = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(DelObjProp)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ obj, prop });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleNewObjSpreadDynPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef func = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef newTarget = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(NewObjSpreadDyn)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ func, newTarget, acc }); // acc is array
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateIterResultObjPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef flag = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CreateIterResultObj)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ value, flag });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAsyncFunctionAwaitUncaughtPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef asyncFuncObj = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(AsyncFunctionAwaitUncaught)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ asyncFuncObj, value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleThrowUndefinedIfHolePrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef hole = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
Label isHole(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(hole), &isHole, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isHole);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// assert obj.IsString()
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ThrowUndefinedIfHole)), { obj });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCopyDataPropertiesPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef dst = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef src = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CopyDataProperties)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ dst, src });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStArraySpreadPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef dst = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef index = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StArraySpread)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ dst, index, acc }); // acc is res
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetIteratorNextPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef method = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetIteratorNext)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ obj, method });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleSetObjectWithProtoPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef proto = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef obj = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetObjectWithProto)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ proto, obj });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdObjByValuePrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
|
|
|
|
Label receiverIsHeapObject(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label accDispatch(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &slowPath);
|
|
|
|
|
Bind(&receiverIsHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label tryIC(env);
|
|
|
|
|
Label tryFastPath(env);
|
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &tryFastPath, &tryIC);
|
|
|
|
|
Bind(&tryIC);
|
|
|
|
|
{
|
|
|
|
|
Label isHeapObject(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef firstValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label loadElement(env);
|
|
|
|
|
Label tryPoly(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Int32Add(slotId, GetInt32Constant(1)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef hclass = LoadHClass(receiver);
|
|
|
|
|
Branch(Int64Equal(TaggedCastToWeakReferentUnChecked(firstValue), hclass),
|
|
|
|
|
&loadElement, &tryPoly);
|
|
|
|
|
Bind(&loadElement);
|
|
|
|
|
{
|
|
|
|
|
GateRef result = LoadElement(receiver, propKey);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&tryPoly);
|
|
|
|
|
{
|
|
|
|
|
Label firstIsKey(env);
|
|
|
|
|
Branch(Int64Equal(firstValue, propKey), &firstIsKey, &slowPath);
|
|
|
|
|
Bind(&firstIsKey);
|
|
|
|
|
Label loadWithHandler(env);
|
|
|
|
|
cachedHandler = CheckPolyHClass(secondValue, hclass);
|
|
|
|
|
Branch(TaggedIsHole(*cachedHandler), &slowPath, &loadWithHandler);
|
|
|
|
|
Bind(&loadWithHandler);
|
|
|
|
|
GateRef result = LoadICWithHandler(glue, receiver, receiver, *cachedHandler);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&tryFastPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *getPropertyByValue = CommonStubCSigns::Get(CommonStubCSigns::GetPropertyByValue);
|
|
|
|
|
GateRef result = CallRuntime(getPropertyByValue, glue,
|
|
|
|
|
GetInt64Constant(CommonStubCSigns::GetPropertyByValue),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ glue, receiver, propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LoadICByValue)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ profileTypeInfo, receiver, propKey, IntBuildTaggedTypeWithNoGC(slotId) });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStObjByValuePrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
|
|
|
|
// slotId = READ_INST_8_0()
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
|
|
|
|
Label receiverIsHeapObject(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &slowPath);
|
|
|
|
|
Bind(&receiverIsHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label tryIC(env);
|
|
|
|
|
Label tryFastPath(env);
|
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &tryFastPath, &tryIC);
|
|
|
|
|
Bind(&tryIC);
|
|
|
|
|
{
|
|
|
|
|
Label isHeapObject(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef firstValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label storeElement(env);
|
|
|
|
|
Label tryPoly(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Int32Add(slotId, GetInt32Constant(1)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef hclass = LoadHClass(receiver);
|
|
|
|
|
Branch(Int64Equal(TaggedCastToWeakReferentUnChecked(firstValue), hclass),
|
|
|
|
|
&storeElement, &tryPoly);
|
|
|
|
|
Bind(&storeElement);
|
|
|
|
|
{
|
|
|
|
|
// acc is value
|
|
|
|
|
GateRef result = ICStoreElement(glue, receiver, propKey, acc, secondValue);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&tryPoly);
|
|
|
|
|
{
|
|
|
|
|
Label firstIsKey(env);
|
|
|
|
|
Branch(Int64Equal(firstValue, propKey), &firstIsKey, &slowPath);
|
|
|
|
|
Bind(&firstIsKey);
|
|
|
|
|
Label loadWithHandler(env);
|
|
|
|
|
cachedHandler = CheckPolyHClass(secondValue, hclass);
|
|
|
|
|
Branch(TaggedIsHole(*cachedHandler), &slowPath, &loadWithHandler);
|
|
|
|
|
Bind(&loadWithHandler);
|
|
|
|
|
GateRef result = StoreICWithHandler(glue, receiver, receiver, acc, *cachedHandler); // acc is value
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&tryFastPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *setPropertyByValue = CommonStubCSigns::Get(CommonStubCSigns::SetPropertyByValue);
|
|
|
|
|
GateRef result = CallRuntime(setPropertyByValue, glue,
|
|
|
|
|
GetInt64Constant(CommonStubCSigns::SetPropertyByValue),
|
|
|
|
|
{ glue, receiver, propKey, acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StoreICByValue)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ profileTypeInfo, receiver, propKey, acc, IntBuildTaggedTypeWithNoGC(slotId) }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStOwnByValuePrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
Label notClassConstructor(env);
|
|
|
|
|
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
|
|
|
|
Bind(¬ClassConstructor);
|
|
|
|
|
Label notClassPrototype(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
|
|
|
|
Bind(¬ClassPrototype);
|
|
|
|
|
{
|
|
|
|
|
// fast path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *setPropertyByValue = CommonStubCSigns::Get(CommonStubCSigns::SetPropertyByValue);
|
|
|
|
|
GateRef result = CallRuntime(setPropertyByValue, glue, GetInt64Constant(CommonStubCSigns::SetPropertyByValue),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ glue, receiver, propKey, acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StOwnByValue)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ receiver, propKey, acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdSuperByValuePrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LdSuperByValue)),
|
2022-03-02 02:21:05 +00:00
|
|
|
|
{ receiver, propKey }); // sp for thisFunc
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStSuperByValuePrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_2(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
2022-02-25 07:43:36 +00:00
|
|
|
|
// acc is value, sp for thisFunc
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StSuperByValue)),
|
2022-03-02 02:21:05 +00:00
|
|
|
|
{ receiver, propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdSuperByNamePrefId32V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetObjectFromConstPool(constpool, stringId);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LdSuperByValue)),
|
2022-03-02 02:21:05 +00:00
|
|
|
|
{ receiver, propKey }); // sp for thisFunc
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStSuperByNamePrefId32V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_5(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef propKey = GetObjectFromConstPool(constpool, stringId);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StSuperByValue)),
|
2022-03-02 02:21:05 +00:00
|
|
|
|
{ receiver, propKey, acc }); // sp for thisFunc
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdObjByIndexPrefV8Imm32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef index = ReadInst32_2(pc);
|
|
|
|
|
Label fastPath(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label accDispatch(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
|
|
|
|
Bind(&fastPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *getPropertyByIndex = CommonStubCSigns::Get(CommonStubCSigns::GetPropertyByIndex);
|
|
|
|
|
GateRef result = CallRuntime(getPropertyByIndex, glue, GetInt64Constant(CommonStubCSigns::GetPropertyByIndex),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ glue, receiver, index });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LdObjByIndex)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ receiver, IntBuildTaggedTypeWithNoGC(index), TaggedFalse(), GetUndefinedConstant() });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8_IMM32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStObjByIndexPrefV8Imm32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef index = ReadInst32_2(pc);
|
|
|
|
|
Label fastPath(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
|
|
|
|
Bind(&fastPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *setPropertyByIndex = CommonStubCSigns::Get(CommonStubCSigns::SetPropertyByIndex);
|
|
|
|
|
GateRef result = CallRuntime(setPropertyByIndex, glue, GetInt64Constant(CommonStubCSigns::SetPropertyByIndex),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ glue, receiver, index, acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StObjByIndex)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ receiver, IntBuildTaggedTypeWithNoGC(index), acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH(PREF_V8_IMM32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStOwnByIndexPrefV8Imm32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef index = ReadInst32_2(pc);
|
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
Label notClassConstructor(env);
|
|
|
|
|
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
|
|
|
|
Bind(¬ClassConstructor);
|
|
|
|
|
Label notClassPrototype(env);
|
|
|
|
|
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
|
|
|
|
Bind(¬ClassPrototype);
|
|
|
|
|
{
|
|
|
|
|
// fast path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *setPropertyByIndex = CommonStubCSigns::Get(CommonStubCSigns::SetPropertyByIndex);
|
|
|
|
|
GateRef result = CallRuntime(setPropertyByIndex, glue, GetInt64Constant(CommonStubCSigns::SetPropertyByIndex),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ glue, receiver, index, acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label notHole(env);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StOwnByIndex)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ receiver, IntBuildTaggedTypeWithNoGC(index), acc }); // acc is value
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH(PREF_V8_IMM32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStConstToGlobalRecordPrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StGlobalRecord)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ propKey, *varAcc, TaggedTrue() });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStLetToGlobalRecordPrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StGlobalRecord)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ propKey, *varAcc, TaggedFalse() });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStClassToGlobalRecordPrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StGlobalRecord)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ propKey, *varAcc, TaggedFalse() });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleNegDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef vsrc = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(vsrc));
|
|
|
|
|
|
|
|
|
|
Label valueIsInt(env);
|
|
|
|
|
Label valueNotInt(env);
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(value), &valueIsInt, &valueNotInt);
|
|
|
|
|
Bind(&valueIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueInt = TaggedCastToInt32(value);
|
|
|
|
|
Label valueIsZero(env);
|
|
|
|
|
Label valueNotZero(env);
|
|
|
|
|
Branch(Int32Equal(valueInt, GetInt32Constant(0)), &valueIsZero, &valueNotZero);
|
|
|
|
|
Bind(&valueIsZero);
|
|
|
|
|
{
|
|
|
|
|
// Format::PREF_V8: size = 3
|
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(GetDoubleConstant(-0.0));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotZero);
|
|
|
|
|
{
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(Int32Sub(GetInt32Constant(0), valueInt));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotInt);
|
|
|
|
|
{
|
|
|
|
|
Label valueIsDouble(env);
|
|
|
|
|
Label valueNotDouble(env);
|
|
|
|
|
Branch(TaggedIsDouble(value), &valueIsDouble, &valueNotDouble);
|
|
|
|
|
Bind(&valueIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueDouble = TaggedCastToDouble(value);
|
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(DoubleSub(GetDoubleConstant(0), valueDouble));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Bind(&valueNotDouble);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(NegDyn)), { value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleNotDynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef vsrc = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(vsrc));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(number, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label numberIsInt(env);
|
|
|
|
|
Label numberNotInt(env);
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Branch(TaggedIsInt(value), &numberIsInt, &numberNotInt);
|
|
|
|
|
Bind(&numberIsInt);
|
|
|
|
|
{
|
|
|
|
|
number = TaggedCastToInt32(value);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(Int32Not(*number));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&numberNotInt);
|
|
|
|
|
{
|
|
|
|
|
Label numberIsDouble(env);
|
|
|
|
|
Label numberNotDouble(env);
|
|
|
|
|
Branch(TaggedIsDouble(value), &numberIsDouble, &numberNotDouble);
|
|
|
|
|
Bind(&numberIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef valueDouble = TaggedCastToDouble(value);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
number = DoubleToInt(glue, valueDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(Int32Not(*number));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&numberNotDouble);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(NotDyn)), { value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(result), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAnd2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(opNumber0, VariableType::INT32(), GetInt32Constant(0));
|
|
|
|
|
DEFVARIABLE(opNumber1, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Label leftNotNumberOrRightNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// slow path
|
|
|
|
|
Bind(&leftNotNumberOrRightNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ChangeTwoInt32AndToJSTaggedValue)), { left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
{
|
|
|
|
|
GateRef ret = Int32And(*opNumber0, *opNumber1);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(ret);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleOr2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(opNumber0, VariableType::INT32(), GetInt32Constant(0));
|
|
|
|
|
DEFVARIABLE(opNumber1, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Label leftNotNumberOrRightNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// slow path
|
|
|
|
|
Bind(&leftNotNumberOrRightNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ChangeTwoInt32OrToJSTaggedValue)), { left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
{
|
|
|
|
|
GateRef ret = Int32Or(*opNumber0, *opNumber1);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(ret);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleXOr2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(opNumber0, VariableType::INT32(), GetInt32Constant(0));
|
|
|
|
|
DEFVARIABLE(opNumber1, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Label leftNotNumberOrRightNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// slow path
|
|
|
|
|
Bind(&leftNotNumberOrRightNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ChangeTwoInt32XorToJSTaggedValue)), { left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
{
|
|
|
|
|
GateRef ret = Int32Xor(*opNumber0, *opNumber1);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(ret);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAshr2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(opNumber0, VariableType::INT32(), GetInt32Constant(0));
|
|
|
|
|
DEFVARIABLE(opNumber1, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label accDispatch(env);
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Label doShr(env);
|
|
|
|
|
Label overflow(env);
|
|
|
|
|
Label notOverflow(env);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Label leftNotNumberOrRightNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Jump(&doShr);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Jump(&doShr);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Jump(&doShr);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Jump(&doShr);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// slow path
|
|
|
|
|
Bind(&leftNotNumberOrRightNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ChangeTwoUint32AndToJSTaggedValue)), { left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Jump(&accDispatch);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-21 02:09:13 +00:00
|
|
|
|
Bind(&doShr);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
{
|
|
|
|
|
GateRef shift = Int32And(*opNumber1, GetInt32Constant(0x1f));
|
|
|
|
|
GateRef ret = UInt32LSR(*opNumber0, shift);
|
2022-03-21 02:09:13 +00:00
|
|
|
|
auto condition = UInt32GreaterThan(ret, GetInt32Constant(INT32_MAX));
|
|
|
|
|
Branch(condition, &overflow, ¬Overflow);
|
|
|
|
|
Bind(&overflow);
|
|
|
|
|
{
|
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(ChangeUInt32ToFloat64(ret));
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Overflow);
|
|
|
|
|
{
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(ret);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
{
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleShr2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(opNumber0, VariableType::INT32(), GetInt32Constant(0));
|
|
|
|
|
DEFVARIABLE(opNumber1, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Label leftNotNumberOrRightNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// slow path
|
|
|
|
|
Bind(&leftNotNumberOrRightNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ChangeUintAndIntShrToJSTaggedValue)), { left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
{
|
|
|
|
|
GateRef shift = Int32And(*opNumber1, GetInt32Constant(0x1f));
|
|
|
|
|
GateRef ret = UInt32LSR(*opNumber0, shift);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(ret);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleShl2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(opNumber0, VariableType::INT32(), GetInt32Constant(0));
|
|
|
|
|
DEFVARIABLE(opNumber1, VariableType::INT32(), GetInt32Constant(0));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label accDispatch(env);
|
|
|
|
|
Label leftIsNumber(env);
|
|
|
|
|
Label leftNotNumberOrRightNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(left), &leftIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&leftIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(right), &rightIsNumber, &leftNotNumberOrRightNotNumber);
|
|
|
|
|
Bind(&rightIsNumber);
|
|
|
|
|
{
|
|
|
|
|
Label leftIsInt(env);
|
|
|
|
|
Label leftIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(left), &leftIsInt, &leftIsDouble);
|
|
|
|
|
Bind(&leftIsInt);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
opNumber0 = TaggedCastToInt32(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&leftIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Label rightIsInt(env);
|
|
|
|
|
Label rightIsDouble(env);
|
|
|
|
|
Branch(TaggedIsInt(right), &rightIsInt, &rightIsDouble);
|
|
|
|
|
Bind(&rightIsInt);
|
|
|
|
|
{
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
opNumber1 = TaggedCastToInt32(right);
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&rightIsDouble);
|
|
|
|
|
{
|
|
|
|
|
GateRef rightDouble = TaggedCastToDouble(right);
|
|
|
|
|
GateRef leftDouble = TaggedCastToDouble(left);
|
2022-03-07 06:42:40 +00:00
|
|
|
|
opNumber0 = DoubleToInt(glue, leftDouble);
|
|
|
|
|
opNumber1 = DoubleToInt(glue, rightDouble);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// slow path
|
|
|
|
|
Bind(&leftNotNumberOrRightNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ChangeUintAndIntShlToJSTaggedValue)), { left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label IsException(env);
|
|
|
|
|
Label NotException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &IsException, &NotException);
|
|
|
|
|
Bind(&IsException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&NotException);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
{
|
|
|
|
|
GateRef shift = Int32And(*opNumber1, GetInt32Constant(0x1f));
|
|
|
|
|
GateRef ret = Int32LSL(*opNumber0, shift);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(ret);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleDefineClassWithBufferPrefId16Imm16Imm16V8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef methodId = ReadInst16_1(pc);
|
|
|
|
|
GateRef literalId = ReadInst16_3(pc);
|
|
|
|
|
GateRef length = ReadInst16_5(pc);
|
|
|
|
|
GateRef v0 = ReadInst8_7(pc);
|
|
|
|
|
GateRef v1 = ReadInst8_8(pc);
|
|
|
|
|
|
|
|
|
|
GateRef classTemplate = GetObjectFromConstPool(constpool, ZExtInt16ToInt32(methodId));
|
|
|
|
|
GateRef literalBuffer = GetObjectFromConstPool(constpool, ZExtInt16ToInt32(literalId));
|
|
|
|
|
GateRef lexicalEnv = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef proto = GetVregValue(sp, ZExtInt8ToPtr(v1));
|
|
|
|
|
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(res, VariableType::JS_ANY(), GetUndefinedConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label isResolved(env);
|
|
|
|
|
Label isNotResolved(env);
|
|
|
|
|
Label afterCheckResolved(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(FunctionIsResolved(classTemplate), &isResolved, &isNotResolved);
|
|
|
|
|
Bind(&isResolved);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CloneClassFromTemplate)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ classTemplate, proto, lexicalEnv, constpool });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&afterCheckResolved);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isNotResolved);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ResolveClass)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ classTemplate, literalBuffer, proto, lexicalEnv, constpool });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&afterCheckResolved);
|
|
|
|
|
}
|
|
|
|
|
Bind(&afterCheckResolved);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label isNotException(env);
|
|
|
|
|
Branch(TaggedIsException(*res), &isException, &isNotException);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&isNotException);
|
|
|
|
|
GateRef newLexicalEnv = GetVregValue(sp, ZExtInt8ToPtr(v0)); // slow runtime may gc
|
|
|
|
|
SetLexicalEnvToFunction(glue, *res, newLexicalEnv);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetClassConstructorLength)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ *res, Int16BuildTaggedTypeWithNoGC(length) });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = *res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID16_IMM16_IMM16_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdObjByNamePrefId32V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_5(pc)));
|
|
|
|
|
Label receiverIsHeapObject(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &slowPath);
|
|
|
|
|
Bind(&receiverIsHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label tryIC(env);
|
|
|
|
|
Label tryFastPath(env);
|
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &tryFastPath, &tryIC);
|
|
|
|
|
Bind(&tryIC);
|
|
|
|
|
{
|
|
|
|
|
Label isHeapObject(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef firstValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label tryPoly(env);
|
|
|
|
|
Label loadWithHandler(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Int32Add(slotId, GetInt32Constant(1)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef hclass = LoadHClass(receiver);
|
|
|
|
|
Branch(Int64Equal(TaggedCastToWeakReferentUnChecked(firstValue), hclass),
|
|
|
|
|
&loadWithHandler, &tryPoly);
|
|
|
|
|
|
|
|
|
|
Bind(&tryPoly);
|
|
|
|
|
{
|
|
|
|
|
cachedHandler = CheckPolyHClass(firstValue, hclass);
|
|
|
|
|
Branch(TaggedIsHole(*cachedHandler), &slowPath, &loadWithHandler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&loadWithHandler);
|
|
|
|
|
{
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
|
|
|
|
|
GateRef result = LoadICWithHandler(glue, receiver, receiver, *cachedHandler);
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&tryFastPath);
|
|
|
|
|
{
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *getPropertyByName = CommonStubCSigns::Get(CommonStubCSigns::GetPropertyByName);
|
|
|
|
|
GateRef result = CallRuntime(getPropertyByName, glue,
|
|
|
|
|
GetInt64Constant(CommonStubCSigns::GetPropertyByName), {
|
2022-02-19 02:09:52 +00:00
|
|
|
|
glue, receiver, propKey
|
|
|
|
|
});
|
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label noException(env);
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LoadICByName)), {
|
2022-02-25 07:43:36 +00:00
|
|
|
|
profileTypeInfo, receiver, propKey, IntBuildTaggedTypeWithNoGC(slotId)
|
2022-02-19 02:09:52 +00:00
|
|
|
|
});
|
|
|
|
|
Branch(TaggedIsException(result), &isException, &noException);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&noException);
|
|
|
|
|
varAcc = result;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStObjByNamePrefId32V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_5(pc)));
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::INT64(), GetHoleConstant(VariableType::INT64()));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label checkResult(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
|
|
|
|
|
Label receiverIsHeapObject(env);
|
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &receiverIsHeapObject, &slowPath);
|
|
|
|
|
Bind(&receiverIsHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label tryIC(env);
|
|
|
|
|
Label tryFastPath(env);
|
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &tryFastPath, &tryIC);
|
|
|
|
|
Bind(&tryIC);
|
|
|
|
|
{
|
|
|
|
|
Label isHeapObject(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef firstValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(firstValue), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Label tryPoly(env);
|
|
|
|
|
Label storeWithHandler(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef secondValue = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Int32Add(slotId, GetInt32Constant(1)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(cachedHandler, VariableType::JS_ANY(), secondValue);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef hclass = LoadHClass(receiver);
|
|
|
|
|
Branch(Int64Equal(TaggedCastToWeakReferentUnChecked(firstValue), hclass),
|
|
|
|
|
&storeWithHandler, &tryPoly);
|
|
|
|
|
Bind(&tryPoly);
|
|
|
|
|
{
|
|
|
|
|
cachedHandler = CheckPolyHClass(firstValue, hclass);
|
|
|
|
|
Branch(TaggedIsHole(*cachedHandler), &slowPath, &storeWithHandler);
|
|
|
|
|
}
|
|
|
|
|
Bind(&storeWithHandler);
|
|
|
|
|
{
|
|
|
|
|
result = StoreICWithHandler(glue, receiver, receiver, acc, *cachedHandler);
|
|
|
|
|
Branch(TaggedIsHole(*result), &slowPath, &checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&tryFastPath);
|
|
|
|
|
{
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *setPropertyByName = CommonStubCSigns::Get(CommonStubCSigns::SetPropertyByName);
|
|
|
|
|
result = CallRuntime(setPropertyByName, glue, GetInt64Constant(CommonStubCSigns::SetPropertyByName), {
|
2022-02-19 02:09:52 +00:00
|
|
|
|
glue, receiver, propKey, acc
|
|
|
|
|
});
|
|
|
|
|
Branch(TaggedIsHole(*result), &slowPath, &checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = ChangeTaggedPointerToInt64(CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StoreICByName)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ profileTypeInfo, receiver, propKey, acc, IntBuildTaggedTypeWithNoGC(slotId) }));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&checkResult);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStOwnByValueWithNameSetPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef propKey = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_2(pc)));
|
|
|
|
|
|
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label notClassConstructor(env);
|
|
|
|
|
Label notClassPrototype(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Label isException1(env);
|
|
|
|
|
Label notException1(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHeapObject(receiver), &isHeapObject, &slowPath);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
|
|
|
|
Bind(¬ClassConstructor);
|
|
|
|
|
{
|
|
|
|
|
Branch(IsClassPrototype(receiver), &slowPath, ¬ClassPrototype);
|
|
|
|
|
Bind(¬ClassPrototype);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
const CallSignature *setPropertyByValue = CommonStubCSigns::Get(CommonStubCSigns::SetPropertyByValue);
|
|
|
|
|
GateRef res = CallRuntime(setPropertyByValue, glue,
|
|
|
|
|
GetInt64Constant(CommonStubCSigns::SetPropertyByValue),
|
|
|
|
|
{ glue, receiver, propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHole(res), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DispatchLast(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetFunctionNameNoPrefix)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ acc, propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(StOwnByValueWithNameSet)), { receiver, propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(res), &isException1, ¬Exception1);
|
|
|
|
|
Bind(&isException1);
|
|
|
|
|
{
|
|
|
|
|
DispatchLast(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception1);
|
|
|
|
|
DISPATCH(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStOwnByNamePrefId32V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_5(pc)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::INT64(), GetHoleConstant(VariableType::INT64()));
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label checkResult(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
|
|
|
|
|
Label isJSObject(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Branch(IsJSObject(receiver), &isJSObject, &slowPath);
|
|
|
|
|
Bind(&isJSObject);
|
|
|
|
|
{
|
|
|
|
|
Label notClassConstructor(env);
|
|
|
|
|
Branch(IsClassConstructor(receiver), &slowPath, ¬ClassConstructor);
|
|
|
|
|
Bind(¬ClassConstructor);
|
|
|
|
|
{
|
|
|
|
|
Label fastPath(env);
|
|
|
|
|
Branch(IsClassPrototype(receiver), &slowPath, &fastPath);
|
|
|
|
|
Bind(&fastPath);
|
|
|
|
|
{
|
|
|
|
|
result = SetPropertyByNameWithOwn(glue, receiver, propKey, acc);
|
|
|
|
|
Branch(TaggedIsHole(*result), &slowPath, &checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = ChangeTaggedPointerToInt64(CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StOwnByName)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ receiver, propKey, acc }));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&checkResult);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStOwnByNameWithNameSetPrefId32V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_5(pc)));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef propKey = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isJSObject(env);
|
|
|
|
|
Label notJSObject(env);
|
|
|
|
|
Label notClassConstructor(env);
|
|
|
|
|
Label notClassPrototype(env);
|
|
|
|
|
Label notHole(env);
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Label isException1(env);
|
|
|
|
|
Label notException1(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(IsJSObject(receiver), &isJSObject, ¬JSObject);
|
|
|
|
|
Bind(&isJSObject);
|
|
|
|
|
{
|
|
|
|
|
Branch(IsClassConstructor(receiver), ¬JSObject, ¬ClassConstructor);
|
|
|
|
|
Bind(¬ClassConstructor);
|
|
|
|
|
{
|
|
|
|
|
Branch(IsClassPrototype(receiver), ¬JSObject, ¬ClassPrototype);
|
|
|
|
|
Bind(¬ClassPrototype);
|
|
|
|
|
{
|
|
|
|
|
GateRef res = SetPropertyByNameWithOwn(glue, receiver, propKey, acc);
|
|
|
|
|
Branch(TaggedIsHole(res), ¬JSObject, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DispatchLast(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetFunctionNameNoPrefix)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ acc, propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(¬JSObject);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StOwnByNameWithNameSet)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ receiver, propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsException(res), &isException1, ¬Exception1);
|
|
|
|
|
Bind(&isException1);
|
|
|
|
|
{
|
|
|
|
|
DispatchLast(glue, pc, sp, constpool, profileTypeInfo, acc, hotnessCounter);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception1);
|
|
|
|
|
DISPATCH(PREF_ID32_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdFunctionPref)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
varAcc = GetFunctionFromFrame(GetFrame(sp));
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleMovV4V4)
|
|
|
|
|
{
|
|
|
|
|
GateRef vdst = ZExtInt8ToPtr(ReadInst4_0(pc));
|
|
|
|
|
GateRef vsrc = ZExtInt8ToPtr(ReadInst4_1(pc));
|
|
|
|
|
GateRef value = GetVregValue(sp, vsrc);
|
|
|
|
|
SetVregValue(glue, sp, vdst, value);
|
|
|
|
|
DISPATCH(V4_V4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleMovDynV8V8)
|
|
|
|
|
{
|
|
|
|
|
GateRef vdst = ZExtInt8ToPtr(ReadInst8_0(pc));
|
|
|
|
|
GateRef vsrc = ZExtInt8ToPtr(ReadInst8_1(pc));
|
|
|
|
|
GateRef value = GetVregValue(sp, vsrc);
|
|
|
|
|
SetVregValue(glue, sp, vdst, value);
|
|
|
|
|
DISPATCH(V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleMovDynV16V16)
|
|
|
|
|
{
|
|
|
|
|
GateRef vdst = ZExtInt16ToPtr(ReadInst16_0(pc));
|
|
|
|
|
GateRef vsrc = ZExtInt16ToPtr(ReadInst16_2(pc));
|
|
|
|
|
GateRef value = GetVregValue(sp, vsrc);
|
|
|
|
|
SetVregValue(glue, sp, vdst, value);
|
|
|
|
|
DISPATCH(V16_V16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdaStrId32)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_0(pc);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varAcc = GetValueFromTaggedArray(VariableType::JS_ANY(), constpool, stringId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_WITH_ACC(ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdaiDynImm32)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef imm = ReadInst32_0(pc);
|
|
|
|
|
varAcc = IntBuildTaggedWithNoGC(imm);
|
|
|
|
|
DISPATCH_WITH_ACC(IMM32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleFldaiDynImm64)
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef imm = CastInt64ToFloat64(ReadInst64_0(pc));
|
|
|
|
|
varAcc = DoubleBuildTaggedWithNoGC(imm);
|
|
|
|
|
DISPATCH_WITH_ACC(IMM64);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJeqzImm8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_ANY(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned8_0(pc);
|
|
|
|
|
Label accEqualFalse(env);
|
|
|
|
|
Label accNotEqualFalse(env);
|
|
|
|
|
Label accIsInt(env);
|
|
|
|
|
Label accNotInt(env);
|
|
|
|
|
Label accEqualZero(env);
|
|
|
|
|
Label accIsDouble(env);
|
|
|
|
|
Label last(env);
|
|
|
|
|
Branch(Int64Equal(ChangeTaggedPointerToInt64(acc), TaggedFalse()), &accEqualFalse, &accNotEqualFalse);
|
|
|
|
|
Bind(&accNotEqualFalse);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(acc), &accIsInt, &accNotInt);
|
|
|
|
|
Bind(&accIsInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(Int32Equal(TaggedGetInt(acc), GetInt32Constant(0)), &accEqualFalse, &accNotInt);
|
|
|
|
|
}
|
|
|
|
|
Bind(&accNotInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsDouble(acc), &accIsDouble, &last);
|
|
|
|
|
Bind(&accIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleEqual(TaggedCastToDouble(acc), GetDoubleConstant(0)), &accEqualFalse, &last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accEqualFalse);
|
|
|
|
|
{
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
Bind(&last);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter,
|
|
|
|
|
GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::PREF_NONE)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJeqzImm16)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_ANY(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned16_0(pc);
|
|
|
|
|
Label accEqualFalse(env);
|
|
|
|
|
Label accNotEqualFalse(env);
|
|
|
|
|
Label accIsInt(env);
|
|
|
|
|
Label accNotInt(env);
|
|
|
|
|
Label accEqualZero(env);
|
|
|
|
|
Label accIsDouble(env);
|
|
|
|
|
Label last(env);
|
|
|
|
|
Branch(Int64Equal(ChangeTaggedPointerToInt64(acc), TaggedFalse()), &accEqualFalse, &accNotEqualFalse);
|
|
|
|
|
Bind(&accNotEqualFalse);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(acc), &accIsInt, &accNotInt);
|
|
|
|
|
Bind(&accIsInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(Int32Equal(TaggedGetInt(acc), GetInt32Constant(0)), &accEqualFalse, &accNotInt);
|
|
|
|
|
}
|
|
|
|
|
Bind(&accNotInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsDouble(acc), &accIsDouble, &last);
|
|
|
|
|
Bind(&accIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleEqual(TaggedCastToDouble(acc), GetDoubleConstant(0)), &accEqualFalse, &last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accEqualFalse);
|
|
|
|
|
{
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
Bind(&last);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter,
|
|
|
|
|
GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::IMM16)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJnezImm8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_ANY(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned8_0(pc);
|
|
|
|
|
Label accEqualTrue(env);
|
|
|
|
|
Label accNotEqualTrue(env);
|
|
|
|
|
Label accIsInt(env);
|
|
|
|
|
Label accNotInt(env);
|
|
|
|
|
Label accEqualZero(env);
|
|
|
|
|
Label accIsDouble(env);
|
|
|
|
|
Label last(env);
|
|
|
|
|
Branch(Int64Equal(ChangeTaggedPointerToInt64(acc), TaggedTrue()), &accEqualTrue, &accNotEqualTrue);
|
|
|
|
|
Bind(&accNotEqualTrue);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(acc), &accIsInt, &accNotInt);
|
|
|
|
|
Bind(&accIsInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(Int32Equal(TaggedGetInt(acc), GetInt32Constant(0)), &accNotInt, &accEqualTrue);
|
|
|
|
|
}
|
|
|
|
|
Bind(&accNotInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsDouble(acc), &accIsDouble, &last);
|
|
|
|
|
Bind(&accIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleEqual(TaggedCastToDouble(acc), GetDoubleConstant(0)), &last, &accEqualTrue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accEqualTrue);
|
|
|
|
|
{
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
Bind(&last);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter,
|
|
|
|
|
GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::PREF_NONE)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleJnezImm16)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_ANY(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef offset = ReadInstSigned16_0(pc);
|
|
|
|
|
Label accEqualTrue(env);
|
|
|
|
|
Label accNotEqualTrue(env);
|
|
|
|
|
Label accIsInt(env);
|
|
|
|
|
Label accNotInt(env);
|
|
|
|
|
Label accEqualZero(env);
|
|
|
|
|
Label accIsDouble(env);
|
|
|
|
|
Label last(env);
|
|
|
|
|
Branch(Int64Equal(ChangeTaggedPointerToInt64(acc), TaggedTrue()), &accEqualTrue, &accNotEqualTrue);
|
|
|
|
|
Bind(&accNotEqualTrue);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsInt(acc), &accIsInt, &accNotInt);
|
|
|
|
|
Bind(&accIsInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(Int32Equal(TaggedGetInt(acc), GetInt32Constant(0)), &accNotInt, &accEqualTrue);
|
|
|
|
|
}
|
|
|
|
|
Bind(&accNotInt);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsDouble(acc), &accIsDouble, &last);
|
|
|
|
|
Bind(&accIsDouble);
|
|
|
|
|
{
|
|
|
|
|
Branch(DoubleEqual(TaggedCastToDouble(acc), GetDoubleConstant(0)), &last, &accEqualTrue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&accEqualTrue);
|
|
|
|
|
{
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
UPDATE_HOTNESS(sp);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter, SExtInt32ToPtr(offset));
|
|
|
|
|
}
|
|
|
|
|
Bind(&last);
|
|
|
|
|
Dispatch(glue, pc, sp, constpool, *varProfileTypeInfo, acc, *varHotnessCounter,
|
|
|
|
|
GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::IMM16)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleReturnDyn)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varPc, VariableType::POINTER(), pc);
|
|
|
|
|
DEFVARIABLE(varSp, VariableType::POINTER(), sp);
|
|
|
|
|
DEFVARIABLE(varConstpool, VariableType::JS_POINTER(), constpool);
|
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label pcEqualNullptr(env);
|
|
|
|
|
Label pcNotEqualNullptr(env);
|
|
|
|
|
Label updateHotness(env);
|
|
|
|
|
Label tryContinue(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
|
|
|
|
|
GateRef frame = GetFrame(*varSp);
|
|
|
|
|
Branch(TaggedIsUndefined(*varProfileTypeInfo), &updateHotness, &tryContinue);
|
|
|
|
|
Bind(&updateHotness);
|
|
|
|
|
{
|
|
|
|
|
GateRef function = GetFunctionFromFrame(frame);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef fistPC = Load(VariableType::POINTER(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::GetBytecodeArrayOffset(env->IsArch32Bit())));
|
|
|
|
|
GateRef offset = Int32Not(TruncPtrToInt32(IntPtrSub(*varPc, fistPC)));
|
|
|
|
|
UPDATE_HOTNESS(*varSp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
Store(VariableType::INT32(), glue, method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET), *varHotnessCounter);
|
|
|
|
|
Jump(&tryContinue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&tryContinue);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varSp = Load(VariableType::POINTER(), frame,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(InterpretedFrame::GetBaseOffset(env->IsArch32Bit())));
|
|
|
|
|
GateRef prevState = GetFrame(*varSp);
|
|
|
|
|
varPc = GetPcFromFrame(prevState);
|
|
|
|
|
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &pcEqualNullptr, &pcNotEqualNullptr);
|
|
|
|
|
Bind(&pcEqualNullptr);
|
|
|
|
|
{
|
|
|
|
|
SetAccToFrame(glue, frame, acc);
|
|
|
|
|
Return();
|
|
|
|
|
}
|
|
|
|
|
Bind(&pcNotEqualNullptr);
|
|
|
|
|
{
|
|
|
|
|
SetCurrentSpFrame(glue, *varSp);
|
|
|
|
|
GateRef function = GetFunctionFromFrame(prevState);
|
|
|
|
|
varConstpool = GetConstpoolFromFunction(function);
|
|
|
|
|
varProfileTypeInfo = GetProfileTypeInfoFromFunction(function);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varHotnessCounter = Load(VariableType::INT32(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET));
|
|
|
|
|
Dispatch(glue, *varPc, *varSp, *varConstpool, *varProfileTypeInfo, acc,
|
|
|
|
|
*varHotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleReturnUndefinedPref)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varPc, VariableType::POINTER(), pc);
|
|
|
|
|
DEFVARIABLE(varSp, VariableType::POINTER(), sp);
|
|
|
|
|
DEFVARIABLE(varConstpool, VariableType::JS_POINTER(), constpool);
|
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label pcEqualNullptr(env);
|
|
|
|
|
Label pcNotEqualNullptr(env);
|
|
|
|
|
Label updateHotness(env);
|
|
|
|
|
Label tryContinue(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
|
|
|
|
|
GateRef frame = GetFrame(*varSp);
|
|
|
|
|
Branch(TaggedIsUndefined(*varProfileTypeInfo), &updateHotness, &tryContinue);
|
|
|
|
|
Bind(&updateHotness);
|
|
|
|
|
{
|
|
|
|
|
GateRef function = GetFunctionFromFrame(frame);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef fistPC = Load(VariableType::POINTER(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::GetBytecodeArrayOffset(env->IsArch32Bit())));
|
|
|
|
|
GateRef offset = Int32Not(TruncPtrToInt32(IntPtrSub(*varPc, fistPC)));
|
|
|
|
|
UPDATE_HOTNESS(*varSp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
Store(VariableType::INT32(), glue, method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET), *varHotnessCounter);
|
|
|
|
|
Jump(&tryContinue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&tryContinue);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varSp = Load(VariableType::POINTER(), frame,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(InterpretedFrame::GetBaseOffset(env->IsArch32Bit())));
|
|
|
|
|
GateRef prevState = GetFrame(*varSp);
|
|
|
|
|
varPc = GetPcFromFrame(prevState);
|
|
|
|
|
varAcc = GetUndefinedConstant();
|
|
|
|
|
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &pcEqualNullptr, &pcNotEqualNullptr);
|
|
|
|
|
Bind(&pcEqualNullptr);
|
|
|
|
|
{
|
|
|
|
|
SetAccToFrame(glue, frame, *varAcc);
|
|
|
|
|
Return();
|
|
|
|
|
}
|
|
|
|
|
Bind(&pcNotEqualNullptr);
|
|
|
|
|
{
|
|
|
|
|
SetCurrentSpFrame(glue, *varSp);
|
|
|
|
|
GateRef function = GetFunctionFromFrame(prevState);
|
|
|
|
|
varConstpool = GetConstpoolFromFunction(function);
|
|
|
|
|
varProfileTypeInfo = GetProfileTypeInfoFromFunction(function);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varHotnessCounter = Load(VariableType::INT32(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET));
|
|
|
|
|
Dispatch(glue, *varPc, *varSp, *varConstpool, *varProfileTypeInfo, *varAcc,
|
|
|
|
|
*varHotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleSuspendGeneratorPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varPc, VariableType::POINTER(), pc);
|
|
|
|
|
DEFVARIABLE(varSp, VariableType::POINTER(), sp);
|
|
|
|
|
DEFVARIABLE(varConstpool, VariableType::JS_POINTER(), constpool);
|
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label pcEqualNullptr(env);
|
|
|
|
|
Label pcNotEqualNullptr(env);
|
|
|
|
|
Label updateHotness(env);
|
|
|
|
|
Label tryContinue(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
|
|
|
|
|
GateRef genObj = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_1(pc)));
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_2(pc)));
|
|
|
|
|
GateRef frame = GetFrame(*varSp);
|
|
|
|
|
SetPcToFrame(glue, frame, pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SuspendGenerator)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ genObj, value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DispatchLast(glue, *varPc, *varSp, *varConstpool, *varProfileTypeInfo, *varAcc, *varHotnessCounter);
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
varAcc = res;
|
|
|
|
|
Branch(TaggedIsUndefined(*varProfileTypeInfo), &updateHotness, &tryContinue);
|
|
|
|
|
Bind(&updateHotness);
|
|
|
|
|
{
|
|
|
|
|
GateRef function = GetFunctionFromFrame(frame);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef fistPC = Load(VariableType::POINTER(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::GetBytecodeArrayOffset(env->IsArch32Bit())));
|
|
|
|
|
GateRef offset = Int32Not(TruncPtrToInt32(IntPtrSub(*varPc, fistPC)));
|
|
|
|
|
UPDATE_HOTNESS(*varSp);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
Store(VariableType::INT32(), glue, method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET), *varHotnessCounter);
|
|
|
|
|
Jump(&tryContinue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&tryContinue);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varSp = Load(VariableType::POINTER(), frame,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(InterpretedFrame::GetBaseOffset(env->IsArch32Bit())));
|
|
|
|
|
GateRef prevState = GetFrame(*varSp);
|
|
|
|
|
varPc = GetPcFromFrame(prevState);
|
|
|
|
|
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &pcEqualNullptr, &pcNotEqualNullptr);
|
|
|
|
|
Bind(&pcEqualNullptr);
|
|
|
|
|
{
|
|
|
|
|
SetAccToFrame(glue, frame, acc);
|
|
|
|
|
Return();
|
|
|
|
|
}
|
|
|
|
|
Bind(&pcNotEqualNullptr);
|
|
|
|
|
{
|
|
|
|
|
SetCurrentSpFrame(glue, *varSp);
|
|
|
|
|
GateRef function = GetFunctionFromFrame(prevState);
|
|
|
|
|
varConstpool = GetConstpoolFromFunction(function);
|
|
|
|
|
varProfileTypeInfo = GetProfileTypeInfoFromFunction(function);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varHotnessCounter = Load(VariableType::INT32(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET));
|
|
|
|
|
Dispatch(glue, *varPc, *varSp, *varConstpool, *varProfileTypeInfo, acc,
|
|
|
|
|
*varHotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(ExceptionHandler)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varPc, VariableType::POINTER(), pc);
|
|
|
|
|
DEFVARIABLE(varSp, VariableType::POINTER(), sp);
|
|
|
|
|
DEFVARIABLE(varConstpool, VariableType::JS_POINTER(), constpool);
|
|
|
|
|
DEFVARIABLE(varProfileTypeInfo, VariableType::JS_POINTER(), profileTypeInfo);
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
DEFVARIABLE(varHotnessCounter, VariableType::INT32(), hotnessCounter);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label pcIsInvalid(env);
|
|
|
|
|
Label pcNotInvalid(env);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef exception = Load(VariableType::JS_ANY(), glue, GetIntPtrConstant(0));
|
2022-03-16 10:12:15 +00:00
|
|
|
|
varPc = TaggedCastToIntPtr(CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(UpFrame)), {}));
|
2022-02-24 07:53:56 +00:00
|
|
|
|
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &pcIsInvalid, &pcNotInvalid);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Bind(&pcIsInvalid);
|
|
|
|
|
{
|
|
|
|
|
Return();
|
|
|
|
|
}
|
|
|
|
|
Bind(&pcNotInvalid);
|
|
|
|
|
{
|
|
|
|
|
varSp = GetCurrentSpFrame(glue);
|
|
|
|
|
varAcc = exception;
|
|
|
|
|
// clear exception
|
2022-03-01 08:31:08 +00:00
|
|
|
|
Store(VariableType::INT64(), glue, glue, GetIntPtrConstant(0), GetHoleConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef function = GetFunctionFromFrame(GetFrame(*varSp));
|
|
|
|
|
varConstpool = GetConstpoolFromFunction(function);
|
|
|
|
|
varProfileTypeInfo = GetProfileTypeInfoFromFunction(function);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef method = Load(VariableType::POINTER(), function,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSFunctionBase::METHOD_OFFSET));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varHotnessCounter = Load(VariableType::INT32(), method,
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET));
|
|
|
|
|
Dispatch(glue, *varPc, *varSp, *varConstpool, *varProfileTypeInfo, *varAcc,
|
|
|
|
|
*varHotnessCounter, GetIntPtrConstant(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-30 08:01:33 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleGetModuleNamespacePrefId32)
|
2022-02-19 02:09:52 +00:00
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef prop = GetObjectFromConstPool(constpool, stringId);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef moduleRef = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(GetModuleNamespace)), { prop });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = moduleRef;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStModuleVarPrefId32)
|
|
|
|
|
{
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef prop = GetObjectFromConstPool(constpool, stringId);
|
|
|
|
|
GateRef value = acc;
|
|
|
|
|
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StModuleVar)), { prop, value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-30 08:01:33 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdModuleVarPrefId32Imm8)
|
2022-02-19 02:09:52 +00:00
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
2022-01-30 08:01:33 +00:00
|
|
|
|
GateRef flag = ReadInst8_5(pc);
|
|
|
|
|
GateRef key = GetObjectFromConstPool(constpool, stringId);
|
2022-03-11 08:08:16 +00:00
|
|
|
|
GateRef innerFlag = ZExtInt8ToInt32(flag);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef moduleVar = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LdModuleVar)),
|
2022-03-11 08:08:16 +00:00
|
|
|
|
{ key, IntBuildTaggedTypeWithNoGC(innerFlag) });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
varAcc = moduleVar;
|
2022-01-30 08:01:33 +00:00
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32_IMM8);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleTryLdGlobalByNamePrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef prop = GetObjectFromConstPool(constpool, stringId);
|
|
|
|
|
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label icAvailable(env);
|
|
|
|
|
Label icNotAvailable(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &icNotAvailable, &icAvailable);
|
|
|
|
|
Bind(&icAvailable);
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(icResult, VariableType::JS_ANY(), GetUndefinedConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label ldMiss(env);
|
|
|
|
|
Label icResultCheck(env);
|
|
|
|
|
Branch(TaggedIsHeapObject(handler), &isHeapObject, &ldMiss);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
icResult = LoadGlobal(handler);
|
|
|
|
|
Branch(TaggedIsHole(*icResult), &ldMiss, &icResultCheck);
|
|
|
|
|
}
|
|
|
|
|
Bind(&ldMiss);
|
|
|
|
|
{
|
|
|
|
|
GateRef globalObject = GetGlobalObject(glue);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
icResult = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LoadMiss)), {
|
2022-02-25 07:43:36 +00:00
|
|
|
|
profileTypeInfo, globalObject, prop, IntBuildTaggedTypeWithNoGC(slotId),
|
|
|
|
|
IntBuildTaggedTypeWithNoGC(GetInt32Constant(static_cast<int>(ICKind::NamedGlobalLoadIC)))
|
2022-02-19 02:09:52 +00:00
|
|
|
|
});
|
|
|
|
|
Jump(&icResultCheck);
|
|
|
|
|
}
|
|
|
|
|
Bind(&icResultCheck);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label isNotException(env);
|
|
|
|
|
Branch(TaggedIsException(*icResult), &isException, &isNotException);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&isNotException);
|
|
|
|
|
varAcc = *icResult;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&icNotAvailable);
|
|
|
|
|
{
|
|
|
|
|
// order: 1. global record 2. global object
|
|
|
|
|
// if we find a way to get global record, we can inline LdGlobalRecord directly
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef recordResult = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LdGlobalRecord)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ prop });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isFound(env);
|
|
|
|
|
Label isNotFound(env);
|
|
|
|
|
Branch(TaggedIsUndefined(recordResult), &isNotFound, &isFound);
|
|
|
|
|
Bind(&isNotFound);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef globalResult = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(GetGlobalOwnProperty)), { prop });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isFoundInGlobal(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Branch(TaggedIsHole(globalResult), &slowPath, &isFoundInGlobal);
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef slowResult = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(TryLdGlobalByName)), { prop });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label isNotException(env);
|
|
|
|
|
Branch(TaggedIsException(slowResult), &isException, &isNotException);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(&isNotException);
|
|
|
|
|
varAcc = slowResult;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isFoundInGlobal);
|
|
|
|
|
{
|
|
|
|
|
varAcc = globalResult;
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&isFound);
|
|
|
|
|
{
|
2022-03-01 08:31:08 +00:00
|
|
|
|
varAcc = Load(VariableType::JS_ANY(), recordResult, GetIntPtrConstant(PropertyBox::VALUE_OFFSET));
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleTryStGlobalByNamePrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef propKey = GetObjectFromConstPool(constpool, stringId);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetUndefinedConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label checkResult(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
|
|
|
|
|
Label icAvailable(env);
|
|
|
|
|
Label icNotAvailable(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &icNotAvailable, &icAvailable);
|
|
|
|
|
Bind(&icAvailable);
|
|
|
|
|
{
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label stMiss(env);
|
|
|
|
|
Branch(TaggedIsHeapObject(handler), &isHeapObject, &stMiss);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
result = StoreGlobal(glue, acc, handler);
|
|
|
|
|
Branch(TaggedIsHole(*result), &stMiss, &checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&stMiss);
|
|
|
|
|
{
|
|
|
|
|
GateRef globalObject = GetGlobalObject(glue);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StoreMiss)), {
|
2022-02-25 07:43:36 +00:00
|
|
|
|
profileTypeInfo, globalObject, propKey, acc, IntBuildTaggedTypeWithNoGC(slotId),
|
|
|
|
|
IntBuildTaggedTypeWithNoGC(GetInt32Constant(static_cast<int>(ICKind::NamedGlobalStoreIC)))
|
2022-02-19 02:09:52 +00:00
|
|
|
|
});
|
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&icNotAvailable);
|
|
|
|
|
// order: 1. global record 2. global object
|
|
|
|
|
// if we find a way to get global record, we can inline LdGlobalRecord directly
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef recordInfo = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LdGlobalRecord)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isFound(env);
|
|
|
|
|
Label isNotFound(env);
|
|
|
|
|
Branch(TaggedIsUndefined(recordInfo), &isNotFound, &isFound);
|
|
|
|
|
Bind(&isFound);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(TryUpdateGlobalRecord)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isNotFound);
|
|
|
|
|
{
|
|
|
|
|
Label foundInGlobal(env);
|
|
|
|
|
Label notFoundInGlobal(env);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef globalResult = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(GetGlobalOwnProperty)), { propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHole(globalResult), ¬FoundInGlobal, &foundInGlobal);
|
|
|
|
|
Bind(¬FoundInGlobal);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ThrowReferenceError)), { propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(&foundInGlobal);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(StGlobalVar)), { propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&checkResult);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleLdGlobalVarPrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef propKey = GetObjectFromConstPool(constpool, stringId);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetUndefinedConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label checkResult(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
GateRef globalObject = GetGlobalObject(glue);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label icAvailable(env);
|
|
|
|
|
Label icNotAvailable(env);
|
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &icNotAvailable, &icAvailable);
|
|
|
|
|
Bind(&icAvailable);
|
|
|
|
|
{
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label ldMiss(env);
|
|
|
|
|
Branch(TaggedIsHeapObject(handler), &isHeapObject, &ldMiss);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
result = LoadGlobal(handler);
|
|
|
|
|
Branch(TaggedIsHole(*result), &ldMiss, &checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&ldMiss);
|
|
|
|
|
{
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(LoadMiss)), {
|
2022-02-25 07:43:36 +00:00
|
|
|
|
profileTypeInfo, globalObject, propKey, IntBuildTaggedTypeWithNoGC(slotId),
|
|
|
|
|
IntBuildTaggedTypeWithNoGC(GetInt32Constant(static_cast<int>(ICKind::NamedGlobalLoadIC)))
|
2022-02-19 02:09:52 +00:00
|
|
|
|
});
|
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&icNotAvailable);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(GetGlobalOwnProperty)), { propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsHole(*result), &slowPath, &dispatch);
|
|
|
|
|
Bind(&slowPath);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(LdGlobalVar)), { globalObject, propKey });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&checkResult);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
varAcc = *result;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleStGlobalVarPrefId32)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef propKey = GetObjectFromConstPool(constpool, stringId);
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(result, VariableType::JS_ANY(), GetUndefinedConstant());
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label checkResult(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
|
|
|
|
|
Label icAvailable(env);
|
|
|
|
|
Label icNotAvailable(env);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Branch(TaggedIsUndefined(profileTypeInfo), &icNotAvailable, &icAvailable);
|
|
|
|
|
Bind(&icAvailable);
|
|
|
|
|
{
|
|
|
|
|
GateRef slotId = ZExtInt8ToInt32(ReadInst8_0(pc));
|
2022-03-01 08:31:08 +00:00
|
|
|
|
GateRef handler = GetValueFromTaggedArray(VariableType::JS_ANY(), profileTypeInfo, slotId);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isHeapObject(env);
|
|
|
|
|
Label stMiss(env);
|
|
|
|
|
Branch(TaggedIsHeapObject(handler), &isHeapObject, &stMiss);
|
|
|
|
|
Bind(&isHeapObject);
|
|
|
|
|
{
|
|
|
|
|
result = StoreGlobal(glue, acc, handler);
|
|
|
|
|
Branch(TaggedIsHole(*result), &stMiss, &checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&stMiss);
|
|
|
|
|
{
|
|
|
|
|
GateRef globalObject = GetGlobalObject(glue);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(StoreMiss)), {
|
2022-02-25 07:43:36 +00:00
|
|
|
|
profileTypeInfo, globalObject, propKey, acc, IntBuildTaggedTypeWithNoGC(slotId),
|
|
|
|
|
IntBuildTaggedTypeWithNoGC(GetInt32Constant(static_cast<int>(ICKind::NamedGlobalStoreIC)))
|
2022-02-19 02:09:52 +00:00
|
|
|
|
});
|
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&icNotAvailable);
|
|
|
|
|
{
|
2022-02-25 07:43:36 +00:00
|
|
|
|
result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(StGlobalVar)), { propKey, acc });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Jump(&checkResult);
|
|
|
|
|
}
|
|
|
|
|
Bind(&checkResult);
|
|
|
|
|
{
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Branch(TaggedIsException(*result), &isException, &dispatch);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH(PREF_ID32);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 03:59:11 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleCreateRegExpWithLiteralPrefId32Imm8)
|
|
|
|
|
{
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
GateRef stringId = ReadInst32_1(pc);
|
|
|
|
|
GateRef pattern = GetObjectFromConstPool(constpool, stringId);
|
|
|
|
|
GateRef flags = ReadInst8_5(pc);
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CreateRegExpWithLiteral)),
|
2022-02-25 03:59:11 +00:00
|
|
|
|
{ pattern, Int8BuildTaggedTypeWithNoGC(flags) });
|
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
|
|
|
|
DISPATCH_LAST();
|
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_ID32_IMM8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-19 02:09:52 +00:00
|
|
|
|
DECLARE_ASM_HANDLER(HandleIsTruePref)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label objNotTrue(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isTrue(env);
|
|
|
|
|
Label isFalse(env);
|
|
|
|
|
|
|
|
|
|
Branch(TaggedIsTrue(*varAcc), &isTrue, &objNotTrue);
|
|
|
|
|
Bind(&objNotTrue);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsFalse(*varAcc), &isFalse, &slowPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&slowPath);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ToBoolean)), { *varAcc });
|
2022-02-25 07:43:36 +00:00
|
|
|
|
Branch(TaggedIsTrue(result), &isTrue, &isFalse);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Bind(&isTrue);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isFalse);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleIsFalsePref)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
Label objNotTrue(env);
|
|
|
|
|
Label dispatch(env);
|
|
|
|
|
Label slowPath(env);
|
|
|
|
|
Label isTrue(env);
|
|
|
|
|
Label isFalse(env);
|
|
|
|
|
|
|
|
|
|
Branch(TaggedIsTrue(*varAcc), &isTrue, &objNotTrue);
|
|
|
|
|
Bind(&objNotTrue);
|
|
|
|
|
{
|
|
|
|
|
Branch(TaggedIsFalse(*varAcc), &isFalse, &slowPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&slowPath);
|
2022-02-25 07:43:36 +00:00
|
|
|
|
GateRef result = CallRuntimeTrampoline(glue,
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GetInt64Constant(RTSTUB_ID(ToBoolean)), { *varAcc });
|
2022-02-25 07:43:36 +00:00
|
|
|
|
Branch(TaggedIsTrue(result), &isTrue, &isFalse);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Bind(&isTrue);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedFalse());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&isFalse);
|
|
|
|
|
{
|
|
|
|
|
varAcc = ChangeInt64ToTagged(TaggedTrue());
|
|
|
|
|
Jump(&dispatch);
|
|
|
|
|
}
|
|
|
|
|
Bind(&dispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_NONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleToNumberPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef value = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
Label valueIsNumber(env);
|
|
|
|
|
Label valueNotNumber(env);
|
|
|
|
|
Branch(TaggedIsNumber(value), &valueIsNumber, &valueNotNumber);
|
|
|
|
|
Bind(&valueIsNumber);
|
|
|
|
|
{
|
|
|
|
|
varAcc = value;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
Bind(&valueNotNumber);
|
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef res = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(ToNumber)), { value });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(res), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = res;
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleAdd2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
|
|
|
|
|
2022-03-14 03:50:02 +00:00
|
|
|
|
GateRef result = FastAdd(left, right);
|
|
|
|
|
Label notHole(env), slowPath(env);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label accDispatch(env);
|
2022-03-14 03:50:02 +00:00
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
2022-03-08 13:16:27 +00:00
|
|
|
|
{
|
2022-03-14 03:50:02 +00:00
|
|
|
|
varAcc = result;
|
2022-03-08 13:16:27 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-08 13:16:27 +00:00
|
|
|
|
Bind(&slowPath);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(Add2Dyn)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleSub2DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
2022-03-01 08:31:08 +00:00
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
|
|
|
|
|
GateRef v0 = ReadInst8_1(pc);
|
|
|
|
|
GateRef left = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
|
|
|
|
GateRef right = *varAcc;
|
|
|
|
|
|
2022-03-14 03:50:02 +00:00
|
|
|
|
GateRef result = FastSub(left, right);
|
|
|
|
|
Label notHole(env), slowPath(env);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label accDispatch(env);
|
2022-03-14 03:50:02 +00:00
|
|
|
|
Branch(TaggedIsHole(result), &slowPath, ¬Hole);
|
|
|
|
|
Bind(¬Hole);
|
2022-03-08 13:16:27 +00:00
|
|
|
|
{
|
2022-03-14 03:50:02 +00:00
|
|
|
|
varAcc = result;
|
2022-03-08 13:16:27 +00:00
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
2022-02-19 02:09:52 +00:00
|
|
|
|
// slow path
|
2022-03-08 13:16:27 +00:00
|
|
|
|
Bind(&slowPath);
|
2022-02-19 02:09:52 +00:00
|
|
|
|
{
|
2022-03-04 02:34:05 +00:00
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc);
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef taggedNumber = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(Sub2Dyn)),
|
2022-02-25 07:43:36 +00:00
|
|
|
|
{ left, right });
|
2022-02-19 02:09:52 +00:00
|
|
|
|
Label isException(env);
|
|
|
|
|
Label notException(env);
|
|
|
|
|
Branch(TaggedIsException(taggedNumber), &isException, ¬Exception);
|
|
|
|
|
Bind(&isException);
|
|
|
|
|
{
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST_WITH_ACC();
|
2022-02-19 02:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
Bind(¬Exception);
|
|
|
|
|
{
|
|
|
|
|
varAcc = taggedNumber;
|
|
|
|
|
Jump(&accDispatch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bind(&accDispatch);
|
|
|
|
|
DISPATCH_WITH_ACC(PREF_V8);
|
|
|
|
|
}
|
2022-03-12 10:47:21 +00:00
|
|
|
|
|
|
|
|
|
#define CALL_INITIALIZE() \
|
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), pc); \
|
|
|
|
|
GateRef func = GetVregValue(sp, ZExtInt8ToPtr(funcReg)); \
|
|
|
|
|
Label funcIsHeapObject(env); \
|
|
|
|
|
Label funcIsCallable(env); \
|
|
|
|
|
Label funcNotCallable(env); \
|
|
|
|
|
Branch(TaggedIsHeapObject(func), &funcIsHeapObject, &funcNotCallable); \
|
|
|
|
|
Bind(&funcIsHeapObject); \
|
|
|
|
|
Branch(IsCallable(func), &funcIsCallable, &funcNotCallable); \
|
|
|
|
|
Bind(&funcNotCallable); \
|
|
|
|
|
{ \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetNotCallableException)), {}); \
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST(); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&funcIsCallable); \
|
|
|
|
|
DEFVARIABLE(methodOffset, VariableType::INT32(), GetInt32Constant(0)); \
|
|
|
|
|
/* method = func->GetCallTarget() */ \
|
|
|
|
|
/* ASSERT(JSTaggedValue(func).IsJSFunctionBase() || JSTaggedValue(func).IsJSProxy()) */ \
|
|
|
|
|
Label funcIsJSFunctionBase(env); \
|
|
|
|
|
Label funcIsJSProxy(env); \
|
|
|
|
|
Label getMethod(env); \
|
|
|
|
|
Branch(IsJSFunctionBase(func), &funcIsJSFunctionBase, &funcIsJSProxy); \
|
|
|
|
|
Bind(&funcIsJSFunctionBase); \
|
|
|
|
|
{ \
|
|
|
|
|
methodOffset = GetInt32Constant(JSFunctionBase::METHOD_OFFSET); \
|
|
|
|
|
Jump(&getMethod); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&funcIsJSProxy); \
|
|
|
|
|
{ \
|
|
|
|
|
methodOffset = GetInt32Constant(JSProxy::METHOD_OFFSET); \
|
|
|
|
|
Jump(&getMethod); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&getMethod); \
|
|
|
|
|
GateRef method = Load(VariableType::POINTER(), func, ChangeInt32ToIntPtr(*methodOffset)); \
|
|
|
|
|
GateRef callFieldOffset = GetIntPtrConstant(JSMethod::GetCallFieldOffset(env->IsArch32Bit())); \
|
|
|
|
|
GateRef callField = Load(VariableType::INT64(), method, callFieldOffset); \
|
|
|
|
|
DEFVARIABLE(newSp, VariableType::POINTER(), \
|
|
|
|
|
PointerSub(sp, GetIntPtrConstant(InterpretedFrame::GetSize(env->IsArch32Bit()))))
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_UNDEFINED(n) \
|
|
|
|
|
i = GetInt32Constant(0); \
|
|
|
|
|
Label pushUndefined(env); \
|
|
|
|
|
Label pushUndefinedAgain(env); \
|
|
|
|
|
Label pushUndefinedEnd(env); \
|
|
|
|
|
Branch(Int32LessThan(*i, n), &pushUndefined, &pushUndefinedEnd); \
|
|
|
|
|
LoopBegin(&pushUndefined); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), \
|
|
|
|
|
GetInt64Constant(JSTaggedValue::VALUE_UNDEFINED)); \
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1)); \
|
|
|
|
|
Branch(Int32LessThan(*i, n), &pushUndefinedAgain, &pushUndefinedEnd); \
|
|
|
|
|
Bind(&pushUndefinedAgain); \
|
|
|
|
|
LoopEnd(&pushUndefined); \
|
|
|
|
|
Bind(&pushUndefinedEnd)
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS(format) \
|
|
|
|
|
DEFVARIABLE(i, VariableType::INT32(), GetInt32Constant(0)); \
|
|
|
|
|
GateRef isNativeMask = GetInt64Constant(static_cast<uint64_t>(1) << JSMethod::IsNativeBit::START_BIT); \
|
|
|
|
|
Label methodIsNative(env); \
|
|
|
|
|
Label methodNotNative(env); \
|
|
|
|
|
Branch(Int64NotEqual(Int64And(callField, isNativeMask), GetInt64Constant(0)), &methodIsNative, &methodNotNative); \
|
|
|
|
|
Bind(&methodIsNative); \
|
|
|
|
|
{ \
|
|
|
|
|
CALL_PUSH_ARGS_##format(); \
|
|
|
|
|
SET_VREGS_AND_FRAME_NATIVE(format); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&methodNotNative); \
|
|
|
|
|
GateRef numArgsOffset = GetInt64Constant(JSMethod::NumArgsBits::START_BIT); \
|
|
|
|
|
GateRef numArgsMask = GetInt64Constant((static_cast<uint64_t>(1) << JSMethod::NumArgsBits::SIZE) - 1); \
|
|
|
|
|
GateRef declaredNumArgs = ChangeInt64ToInt32(Int64And(UInt64LSR(callField, numArgsOffset), numArgsMask)); \
|
|
|
|
|
Label fastPath(env); \
|
|
|
|
|
Label slowPath(env); \
|
|
|
|
|
Label setVregsAndFrameNotNative(env); \
|
|
|
|
|
Branch(Int32Equal(actualNumArgs, declaredNumArgs), &fastPath, &slowPath); \
|
|
|
|
|
Bind(&fastPath); \
|
|
|
|
|
{ \
|
|
|
|
|
CALL_PUSH_ARGS_##format(); \
|
|
|
|
|
Jump(&setVregsAndFrameNotNative); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&slowPath); \
|
|
|
|
|
GateRef haveExtraMask = GetInt64Constant(static_cast<uint64_t>(1) << JSMethod::HaveExtraBit::START_BIT); \
|
|
|
|
|
Label methodNoExtra(env); \
|
|
|
|
|
Label methodHaveExtra(env); \
|
|
|
|
|
Branch(Int64NotEqual(Int64And(callField, haveExtraMask), GetInt64Constant(0)), &methodHaveExtra, &methodNoExtra); \
|
|
|
|
|
Bind(&methodNoExtra); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef undefinedNumArgs = Int32Sub(declaredNumArgs, actualNumArgs); \
|
|
|
|
|
CALL_PUSH_UNDEFINED(undefinedNumArgs); \
|
|
|
|
|
CALL_PUSH_ARGS_NO_EXTRA_##format(); \
|
|
|
|
|
Jump(&setVregsAndFrameNotNative); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&methodHaveExtra); \
|
|
|
|
|
{ \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), IntBuildTaggedTypeWithNoGC(actualNumArgs)); \
|
|
|
|
|
GateRef undefinedNumArgs = Int32Sub(declaredNumArgs, actualNumArgs); \
|
|
|
|
|
CALL_PUSH_UNDEFINED(undefinedNumArgs); \
|
|
|
|
|
CALL_PUSH_ARGS_##format(); \
|
|
|
|
|
Jump(&setVregsAndFrameNotNative); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&setVregsAndFrameNotNative); \
|
|
|
|
|
SET_VREGS_AND_FRAME_NOT_NATIVE(format)
|
|
|
|
|
|
|
|
|
|
#define SET_VREGS_AND_FRAME_NATIVE(format) \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Label pushThis(env); \
|
|
|
|
|
Label pushThisUndefined(env); \
|
|
|
|
|
Label pushNewTarget(env); \
|
|
|
|
|
Branch(callThis, &pushThis, &pushThisUndefined); \
|
|
|
|
|
Bind(&pushThis); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef thisValue = GetVregValue(sp, IntPtrAdd(ZExtInt8ToPtr(funcReg), GetIntPtrConstant(1))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), thisValue); \
|
|
|
|
|
Jump(&pushNewTarget); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&pushThisUndefined); \
|
|
|
|
|
{ \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), \
|
|
|
|
|
GetInt64Constant(JSTaggedValue::VALUE_UNDEFINED)); \
|
|
|
|
|
Jump(&pushNewTarget); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&pushNewTarget); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), \
|
|
|
|
|
GetInt64Constant(JSTaggedValue::VALUE_UNDEFINED)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), func); \
|
|
|
|
|
/* ASSERT(JSMethod::NumVregsBits::Decode(callField) == 0) */ \
|
|
|
|
|
/* thread->DoStackOverflowCheck(newSp) */ \
|
|
|
|
|
GateRef frameBaseOffset = GetIntPtrConstant(JSThread::GlueData::GetFrameBaseOffset(env->IsArch32Bit())); \
|
|
|
|
|
GateRef frameBase = Load(VariableType::POINTER(), glue, frameBaseOffset); \
|
|
|
|
|
Label stackOverflow(env); \
|
|
|
|
|
Label stackNotOverflow(env); \
|
|
|
|
|
Branch(UInt64LessThanOrEqual(*newSp, IntPtrAdd(frameBase, \
|
|
|
|
|
/* 2: double size in case */ \
|
|
|
|
|
GetIntPtrConstant(JSThread::RESERVE_STACK_SIZE * sizeof(JSTaggedType) * 2))), \
|
|
|
|
|
&stackOverflow, &stackNotOverflow); \
|
|
|
|
|
Bind(&stackOverflow); \
|
|
|
|
|
{ \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetStackOverflowException)), {}); \
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST(); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&stackNotOverflow); \
|
|
|
|
|
GateRef state = GetFrame(*newSp); \
|
|
|
|
|
GateRef prevOffset = GetIntPtrConstant(InterpretedFrame::GetBaseOffset(env->IsArch32Bit())); \
|
|
|
|
|
Store(VariableType::POINTER(), glue, state, prevOffset, sp); \
|
|
|
|
|
GateRef frameTypeOffset = IntPtrAdd(prevOffset, GetIntPtrSize()); \
|
|
|
|
|
Store(VariableType::INT64(), glue, state, frameTypeOffset, \
|
|
|
|
|
GetInt64Constant(static_cast<uint64_t>(FrameType::INTERPRETER_FRAME))); \
|
|
|
|
|
SetPcToFrame(glue, state, GetIntPtrConstant(0)); \
|
|
|
|
|
SetFunctionToFrame(glue, state, func); \
|
|
|
|
|
SetCurrentSpFrame(glue, *newSp); \
|
|
|
|
|
GateRef numArgs = Int32Add(GetInt32Constant(NUM_MANDATORY_JSFUNC_ARGS), actualNumArgs); \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
GateRef retValue = CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(CallNative)), \
|
2022-03-12 10:47:21 +00:00
|
|
|
|
{IntBuildTaggedTypeWithNoGC(numArgs), *newSp, method}); \
|
|
|
|
|
SetCurrentSpFrame(glue, sp); \
|
|
|
|
|
DEFVARIABLE(varAcc, VariableType::JS_ANY(), retValue); \
|
|
|
|
|
DISPATCH_WITH_ACC(format)
|
|
|
|
|
|
|
|
|
|
#define SET_VREGS_AND_FRAME_NOT_NATIVE(format) \
|
|
|
|
|
Label funcIsClassConstructor(env); \
|
|
|
|
|
Label funcNotClassConstructor(env); \
|
|
|
|
|
Branch(IsClassConstructor(func), &funcIsClassConstructor, &funcNotClassConstructor); \
|
|
|
|
|
Bind(&funcIsClassConstructor); \
|
|
|
|
|
{ \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetCallConstructorException)), {}); \
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST(); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&funcNotClassConstructor); \
|
|
|
|
|
Label notNormalCallType(env); \
|
|
|
|
|
Label isNormalCallType(env); \
|
|
|
|
|
Branch(Int64Equal(Int64And(callField, GetInt64Constant(CALL_TYPE_MASK)), GetInt64Constant(0)), \
|
|
|
|
|
&isNormalCallType, ¬NormalCallType); \
|
|
|
|
|
Bind(¬NormalCallType); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef haveThisMask = GetInt64Constant(static_cast<uint64_t>(1) << JSMethod::HaveThisBit::START_BIT); \
|
|
|
|
|
Label methodHaveThis(env); \
|
|
|
|
|
Label methodNoThis(env); \
|
|
|
|
|
Branch(Int64NotEqual(Int64And(callField, haveThisMask), GetInt64Constant(0)), \
|
|
|
|
|
&methodHaveThis, &methodNoThis); \
|
|
|
|
|
Bind(&methodHaveThis); \
|
|
|
|
|
{ \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Label pushThis(env); \
|
|
|
|
|
Label pushThisUndefined(env); \
|
|
|
|
|
Branch(callThis, &pushThis, &pushThisUndefined); \
|
|
|
|
|
Bind(&pushThis); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef thisValue = GetVregValue(sp, IntPtrAdd(ZExtInt8ToPtr(funcReg), GetIntPtrConstant(1))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), thisValue); \
|
|
|
|
|
Jump(&methodNoThis); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&pushThisUndefined); \
|
|
|
|
|
{ \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), \
|
|
|
|
|
GetInt64Constant(JSTaggedValue::VALUE_UNDEFINED)); \
|
|
|
|
|
Jump(&methodNoThis); \
|
|
|
|
|
} \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&methodNoThis); \
|
|
|
|
|
GateRef haveNewTargetMask = GetInt64Constant(static_cast<uint64_t>(1) << \
|
|
|
|
|
JSMethod::HaveNewTargetBit::START_BIT); \
|
|
|
|
|
Label methodHaveNewTarget(env); \
|
|
|
|
|
Label methodNoNewTarget(env); \
|
|
|
|
|
Branch(Int64NotEqual(Int64And(callField, haveNewTargetMask), GetInt64Constant(0)), \
|
|
|
|
|
&methodHaveNewTarget, &methodNoNewTarget); \
|
|
|
|
|
Bind(&methodHaveNewTarget); \
|
|
|
|
|
{ \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), \
|
|
|
|
|
GetInt64Constant(JSTaggedValue::VALUE_UNDEFINED)); \
|
|
|
|
|
Jump(&methodNoNewTarget); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&methodNoNewTarget); \
|
|
|
|
|
GateRef haveFuncMask = GetInt64Constant(static_cast<uint64_t>(1) << JSMethod::HaveFuncBit::START_BIT); \
|
|
|
|
|
Label methodHaveFunc(env); \
|
|
|
|
|
Label methodNoFunc(env); \
|
|
|
|
|
Branch(Int64NotEqual(Int64And(callField, haveFuncMask), GetInt64Constant(0)), \
|
|
|
|
|
&methodHaveFunc, &methodNoFunc); \
|
|
|
|
|
Bind(&methodHaveFunc); \
|
|
|
|
|
{ \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), func); \
|
|
|
|
|
Jump(&methodNoFunc); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&methodNoFunc); \
|
|
|
|
|
Jump(&isNormalCallType); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&isNormalCallType); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef numVregsOffset = GetInt64Constant(JSMethod::NumVregsBits::START_BIT); \
|
|
|
|
|
GateRef numVregsMask = GetInt64Constant((static_cast<uint64_t>(1) << JSMethod::NumVregsBits::SIZE) - 1); \
|
|
|
|
|
GateRef numVregs = ChangeInt64ToInt32(Int64And(UInt64LSR(callField, numVregsOffset), numVregsMask)); \
|
|
|
|
|
CALL_PUSH_UNDEFINED(numVregs); \
|
|
|
|
|
/* thread->DoStackOverflowCheck(newSp) */ \
|
|
|
|
|
GateRef frameBaseOffset = GetIntPtrConstant(JSThread::GlueData::GetFrameBaseOffset(env->IsArch32Bit())); \
|
|
|
|
|
GateRef frameBase = Load(VariableType::POINTER(), glue, frameBaseOffset); \
|
|
|
|
|
Label stackOverflow(env); \
|
|
|
|
|
Label stackNotOverflow(env); \
|
|
|
|
|
Branch(UInt64LessThanOrEqual(*newSp, IntPtrAdd(frameBase, \
|
|
|
|
|
/* 2: double size in case */ \
|
|
|
|
|
GetIntPtrConstant(JSThread::RESERVE_STACK_SIZE * sizeof(JSTaggedType) * 2))), \
|
|
|
|
|
&stackOverflow, &stackNotOverflow); \
|
|
|
|
|
Bind(&stackOverflow); \
|
|
|
|
|
{ \
|
2022-03-16 10:12:15 +00:00
|
|
|
|
CallRuntimeTrampoline(glue, GetInt64Constant(RTSTUB_ID(SetStackOverflowException)), {}); \
|
2022-03-12 10:47:21 +00:00
|
|
|
|
DISPATCH_LAST(); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&stackNotOverflow); \
|
|
|
|
|
SetPcToFrame(glue, GetFrame(sp), \
|
|
|
|
|
IntPtrAdd(pc, GetIntPtrConstant(BytecodeInstruction::Size(BytecodeInstruction::Format::format)))); \
|
|
|
|
|
GateRef state = GetFrame(*newSp); \
|
|
|
|
|
GateRef prevOffset = GetIntPtrConstant(InterpretedFrame::GetBaseOffset(env->IsArch32Bit())); \
|
|
|
|
|
Store(VariableType::POINTER(), glue, state, prevOffset, sp); \
|
|
|
|
|
GateRef frameTypeOffset = IntPtrAdd(prevOffset, GetIntPtrConstant( \
|
|
|
|
|
env->IsArch32Bit() ? InterpretedFrameBase::TYPE_OFFSET_32 : InterpretedFrameBase::TYPE_OFFSET_64)); \
|
|
|
|
|
Store(VariableType::INT64(), glue, state, frameTypeOffset, \
|
|
|
|
|
GetInt64Constant(static_cast<uint64_t>(FrameType::INTERPRETER_FRAME))); \
|
|
|
|
|
GateRef bytecodeArrayOffset = GetIntPtrConstant(JSMethod::GetBytecodeArrayOffset(env->IsArch32Bit())); \
|
|
|
|
|
GateRef bytecodeArray = Load(VariableType::POINTER(), method, bytecodeArrayOffset); \
|
|
|
|
|
SetPcToFrame(glue, state, bytecodeArray); \
|
|
|
|
|
SetFunctionToFrame(glue, state, func); \
|
|
|
|
|
SetAccToFrame(glue, state, GetHoleConstant(VariableType::JS_ANY())); \
|
|
|
|
|
GateRef newEnv = GetEnvFromFunction(func); \
|
|
|
|
|
SetEnvToFrame(glue, state, newEnv); \
|
|
|
|
|
SetCurrentSpFrame(glue, *newSp); \
|
|
|
|
|
GateRef newConstpool = GetConstpoolFromFunction(func); \
|
|
|
|
|
GateRef newProfileTypeInfo = GetProfileTypeInfoFromFunction(func); \
|
|
|
|
|
GateRef newHotnessCounter = Load(VariableType::INT32(), method, \
|
|
|
|
|
GetIntPtrConstant(JSMethod::HOTNESS_COUNTER_OFFSET)); \
|
|
|
|
|
Dispatch(glue, bytecodeArray, *newSp, newConstpool, newProfileTypeInfo, \
|
|
|
|
|
GetHoleConstant(VariableType::JS_ANY()), newHotnessCounter, GetIntPtrConstant(0)); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_PREF_V8() \
|
|
|
|
|
static_cast<void>(0) // do nothing when 0 arg
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_NO_EXTRA_PREF_V8() \
|
|
|
|
|
static_cast<void>(0) // do nothing when 0 arg
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_PREF_V8_V8() \
|
|
|
|
|
GateRef a0Value = GetVregValue(sp, ZExtInt8ToPtr(a0)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), a0Value)
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_NO_EXTRA_PREF_V8_V8() \
|
|
|
|
|
Label push0(env); \
|
|
|
|
|
Label skip0(env); \
|
|
|
|
|
Branch(Int32GreaterThanOrEqual(declaredNumArgs, \
|
|
|
|
|
GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARG1)), &push0, &skip0); \
|
|
|
|
|
Bind(&push0); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef a0Value = GetVregValue(sp, ZExtInt8ToPtr(a0)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), a0Value); \
|
|
|
|
|
Jump(&skip0); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&skip0)
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_PREF_V8_V8_V8() \
|
|
|
|
|
GateRef a1Value = GetVregValue(sp, ZExtInt8ToPtr(a1)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), a1Value); \
|
|
|
|
|
CALL_PUSH_ARGS_PREF_V8_V8()
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_NO_EXTRA_PREF_V8_V8_V8() \
|
|
|
|
|
Label push1(env); \
|
|
|
|
|
Label skip1(env); \
|
|
|
|
|
Branch(Int32GreaterThanOrEqual(declaredNumArgs, \
|
|
|
|
|
GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARGS2)), &push1, &skip1); \
|
|
|
|
|
Bind(&push1); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef a1Value = GetVregValue(sp, ZExtInt8ToPtr(a1)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), a1Value); \
|
|
|
|
|
Jump(&skip1); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&skip1); \
|
|
|
|
|
CALL_PUSH_ARGS_NO_EXTRA_PREF_V8_V8()
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_PREF_V8_V8_V8_V8() \
|
|
|
|
|
GateRef a2Value = GetVregValue(sp, ZExtInt8ToPtr(a2)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), a2Value); \
|
|
|
|
|
CALL_PUSH_ARGS_PREF_V8_V8_V8()
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_NO_EXTRA_PREF_V8_V8_V8_V8() \
|
|
|
|
|
Label push2(env); \
|
|
|
|
|
Label skip2(env); \
|
|
|
|
|
Branch(Int32GreaterThanOrEqual(declaredNumArgs, \
|
|
|
|
|
GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARGS3)), &push2, &skip2); \
|
|
|
|
|
Bind(&push2); \
|
|
|
|
|
{ \
|
|
|
|
|
GateRef a2Value = GetVregValue(sp, ZExtInt8ToPtr(a2)); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), a2Value); \
|
|
|
|
|
Jump(&skip2); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&skip2); \
|
|
|
|
|
CALL_PUSH_ARGS_NO_EXTRA_PREF_V8_V8_V8()
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_PREF_IMM16_V8() \
|
|
|
|
|
i = actualNumArgs; \
|
|
|
|
|
CALL_PUSH_ARGS_I()
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_NO_EXTRA_PREF_IMM16_V8() \
|
|
|
|
|
/* i = std::min(actualNumArgs, declaredNumArgs) */ \
|
|
|
|
|
i = actualNumArgs; \
|
|
|
|
|
Label declaredNumArgsSmaller(env); \
|
|
|
|
|
Label callPushArgsI(env); \
|
|
|
|
|
Branch(Int32LessThan(*i, declaredNumArgs), &callPushArgsI, &declaredNumArgsSmaller); \
|
|
|
|
|
Bind(&declaredNumArgsSmaller); \
|
|
|
|
|
i = declaredNumArgs; \
|
|
|
|
|
Jump(&callPushArgsI); \
|
|
|
|
|
Bind(&callPushArgsI); \
|
|
|
|
|
CALL_PUSH_ARGS_I()
|
|
|
|
|
|
|
|
|
|
#define CALL_PUSH_ARGS_I() \
|
|
|
|
|
Label pushWithThis(env); \
|
|
|
|
|
Label pushWithoutThis(env); \
|
|
|
|
|
Label pushArgsEnd(env); \
|
|
|
|
|
Branch(callThis, &pushWithThis, &pushWithoutThis); \
|
|
|
|
|
Bind(&pushWithThis); \
|
|
|
|
|
{ \
|
|
|
|
|
i = Int32Add(*i, GetInt32Constant(1)); /* 1: skip this */ \
|
|
|
|
|
Label pushArgs(env); \
|
|
|
|
|
Label pushArgsAgain(env); \
|
|
|
|
|
Branch(Int32GreaterThan(*i, GetInt32Constant(1)), &pushArgs, &pushArgsEnd); \
|
|
|
|
|
LoopBegin(&pushArgs); \
|
|
|
|
|
GateRef aValue = GetVregValue(sp, IntPtrAdd(ZExtInt8ToPtr(funcReg), ChangeInt32ToIntPtr(*i))); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), aValue); \
|
|
|
|
|
i = Int32Sub(*i, GetInt32Constant(1)); \
|
|
|
|
|
Branch(Int32GreaterThan(*i, GetInt32Constant(1)), &pushArgsAgain, &pushArgsEnd); \
|
|
|
|
|
Bind(&pushArgsAgain); \
|
|
|
|
|
LoopEnd(&pushArgs); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&pushWithoutThis); \
|
|
|
|
|
{ \
|
|
|
|
|
Label pushArgs(env); \
|
|
|
|
|
Label pushArgsAgain(env); \
|
|
|
|
|
Branch(Int32GreaterThan(*i, GetInt32Constant(0)), &pushArgs, &pushArgsEnd); \
|
|
|
|
|
LoopBegin(&pushArgs); \
|
|
|
|
|
GateRef aValue = GetVregValue(sp, IntPtrAdd(ZExtInt8ToPtr(funcReg), ChangeInt32ToIntPtr(*i))); \
|
|
|
|
|
newSp = PointerSub(*newSp, GetIntPtrConstant(sizeof(JSTaggedType))); \
|
|
|
|
|
Store(VariableType::INT64(), glue, *newSp, GetIntPtrConstant(0), aValue); \
|
|
|
|
|
i = Int32Sub(*i, GetInt32Constant(1)); \
|
|
|
|
|
Branch(Int32GreaterThan(*i, GetInt32Constant(0)), &pushArgsAgain, &pushArgsEnd); \
|
|
|
|
|
Bind(&pushArgsAgain); \
|
|
|
|
|
LoopEnd(&pushArgs); \
|
|
|
|
|
} \
|
|
|
|
|
Bind(&pushArgsEnd)
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallArg0DynPrefV8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef actualNumArgs = GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARG0);
|
|
|
|
|
GateRef funcReg = ReadInst8_1(pc);
|
|
|
|
|
CALL_INITIALIZE();
|
|
|
|
|
GateRef callThis = FalseConstant();
|
|
|
|
|
CALL_PUSH_ARGS(PREF_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallArg1DynPrefV8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef actualNumArgs = GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARG1);
|
|
|
|
|
GateRef funcReg = ReadInst8_1(pc);
|
|
|
|
|
GateRef a0 = ReadInst8_2(pc);
|
|
|
|
|
CALL_INITIALIZE();
|
|
|
|
|
GateRef callThis = FalseConstant();
|
|
|
|
|
CALL_PUSH_ARGS(PREF_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallArgs2DynPrefV8V8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef actualNumArgs = GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARGS2);
|
|
|
|
|
GateRef funcReg = ReadInst8_1(pc);
|
|
|
|
|
GateRef a0 = ReadInst8_2(pc);
|
|
|
|
|
GateRef a1 = ReadInst8_3(pc);
|
|
|
|
|
CALL_INITIALIZE();
|
|
|
|
|
GateRef callThis = FalseConstant();
|
|
|
|
|
CALL_PUSH_ARGS(PREF_V8_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallArgs3DynPrefV8V8V8V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef actualNumArgs = GetInt32Constant(EcmaInterpreter::ActualNumArgsOfCall::CALLARGS3);
|
|
|
|
|
GateRef funcReg = ReadInst8_1(pc);
|
|
|
|
|
GateRef a0 = ReadInst8_2(pc);
|
|
|
|
|
GateRef a1 = ReadInst8_3(pc);
|
|
|
|
|
GateRef a2 = ReadInst8_4(pc);
|
|
|
|
|
CALL_INITIALIZE();
|
|
|
|
|
GateRef callThis = FalseConstant();
|
|
|
|
|
CALL_PUSH_ARGS(PREF_V8_V8_V8_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallIRangeDynPrefImm16V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef actualNumArgs = ZExtInt16ToInt32(ReadInst16_1(pc));
|
|
|
|
|
GateRef funcReg = ReadInst8_3(pc);
|
|
|
|
|
CALL_INITIALIZE();
|
|
|
|
|
GateRef callThis = FalseConstant();
|
|
|
|
|
CALL_PUSH_ARGS(PREF_IMM16_V8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE_ASM_HANDLER(HandleCallIThisRangeDynPrefImm16V8)
|
|
|
|
|
{
|
|
|
|
|
auto env = GetEnvironment();
|
|
|
|
|
|
|
|
|
|
GateRef actualNumArgs = Int32Sub(ZExtInt16ToInt32(ReadInst16_1(pc)), GetInt32Constant(1)); // 1: exclude this
|
|
|
|
|
GateRef funcReg = ReadInst8_3(pc);
|
|
|
|
|
CALL_INITIALIZE();
|
|
|
|
|
GateRef callThis = TrueConstant();
|
|
|
|
|
CALL_PUSH_ARGS(PREF_IMM16_V8);
|
|
|
|
|
}
|
2022-02-19 02:09:52 +00:00
|
|
|
|
#undef DECLARE_ASM_HANDLER
|
|
|
|
|
#undef DISPATCH
|
|
|
|
|
#undef DISPATCH_WITH_ACC
|
|
|
|
|
#undef DISPATCH_LAST
|
2022-03-12 10:47:21 +00:00
|
|
|
|
#undef DISPATCH_LAST_WITH_ACC
|
2022-03-16 10:12:15 +00:00
|
|
|
|
|
|
|
|
|
CallSignature BytecodeStubCSigns::callSigns_[BytecodeStubCSigns::NUM_OF_VALID_STUBS];
|
|
|
|
|
|
|
|
|
|
void BytecodeStubCSigns::Initialize()
|
|
|
|
|
{
|
|
|
|
|
#define INIT_SIGNATURES(name, counter) \
|
|
|
|
|
BytecodeHandlerCallSignature::Initialize(&callSigns_[name]); \
|
|
|
|
|
callSigns_[name].SetID(ID_##name); \
|
|
|
|
|
callSigns_[name].SetConstructor( \
|
|
|
|
|
[](void* ciruit) { \
|
|
|
|
|
return static_cast<void*>( \
|
|
|
|
|
new name##Stub(static_cast<Circuit*>(ciruit))); \
|
|
|
|
|
});
|
|
|
|
|
INTERPRETER_BC_STUB_LIST(INIT_SIGNATURES)
|
2022-03-21 07:18:47 +00:00
|
|
|
|
#undef INIT_SIGNATURES
|
2022-03-16 10:12:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BytecodeStubCSigns::GetCSigns(std::vector<CallSignature*>& outCSigns)
|
|
|
|
|
{
|
|
|
|
|
for (size_t i = 0; i < NUM_OF_VALID_STUBS; i++) {
|
|
|
|
|
outCSigns.push_back(&callSigns_[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-19 02:09:52 +00:00
|
|
|
|
} // namespace panda::ecmascript::kungfu
|