fix codecheck warning and Delete extra licenses

Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
This commit is contained in:
hjzhangcm 2022-07-18 14:11:20 +08:00
parent c4e329ffcd
commit ba72cb79a2
14 changed files with 385 additions and 368 deletions

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper functions for gcc_toolchain.gni wrappers."""

View File

@ -165,8 +165,8 @@ DEF_CALL_SIGNATURE(SetPropertyByName)
CallSignature setPropertyByName("SetPropertyByName", 0, 4, ArgumentsOrder::DEFAULT_ORDER,
VariableType::INT64());
*callSign = setPropertyByName;
std::array<VariableType, 4> params = { // 4 : 4 input parameters
// 4 : 4 input parameters
std::array<VariableType, 4> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_POINTER(),
VariableType::JS_POINTER(),
@ -182,8 +182,8 @@ DEF_CALL_SIGNATURE(SetPropertyByNameWithOwn)
CallSignature setPropertyByNameWithOwn("SetPropertyByNameWithOwn", 0, 4, ArgumentsOrder::DEFAULT_ORDER,
VariableType::INT64());
*callSign = setPropertyByNameWithOwn;
std::array<VariableType, 4> params = { // 4 : 4 input parameters
// 4 : 4 input parameters
std::array<VariableType, 4> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_POINTER(),
VariableType::JS_POINTER(),
@ -199,8 +199,8 @@ DEF_CALL_SIGNATURE(SetPropertyByValue)
CallSignature setPropertyByName("SetPropertyByValue", 0, 4, ArgumentsOrder::DEFAULT_ORDER,
VariableType::INT64());
*callSign = setPropertyByName;
std::array<VariableType, 4> params = { // 4 : 4 input parameters
// 4 : 4 input parameters
std::array<VariableType, 4> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_POINTER(),
VariableType::JS_ANY(),
@ -216,8 +216,8 @@ DEF_CALL_SIGNATURE(SetPropertyByValueWithOwn)
CallSignature setPropertyByValueWithOwn("SetPropertyByValueWithOwn", 0, 4, ArgumentsOrder::DEFAULT_ORDER,
VariableType::INT64());
*callSign = setPropertyByValueWithOwn;
std::array<VariableType, 4> params = { // 4 : 4 input parameters
// 4 : 4 input parameters
std::array<VariableType, 4> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_POINTER(),
VariableType::JS_ANY(),
@ -229,7 +229,7 @@ DEF_CALL_SIGNATURE(SetPropertyByValueWithOwn)
DEF_CALL_SIGNATURE(GetPropertyByName)
{
// 3 : 3 input parameters
// 3 : 3 input parameters
CallSignature getPropertyByName("GetPropertyByName", 0, 3, ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = getPropertyByName;
// 3 : 3 input parameters
@ -418,7 +418,8 @@ DEF_CALL_SIGNATURE(BytecodeHandler)
CallSignature bytecodeHandler("BytecodeHandler", 0, 7,
ArgumentsOrder::DEFAULT_ORDER, VariableType::VOID());
*callSign = bytecodeHandler;
std::array<VariableType, 7> params = { // 7 : 7 input parameters
// 7 : 7 input parameters
std::array<VariableType, 7> params = {
VariableType::NATIVE_POINTER(),
VariableType::NATIVE_POINTER(),
VariableType::NATIVE_POINTER(),
@ -438,6 +439,7 @@ DEF_CALL_SIGNATURE(BytecodeDebuggerHandler)
CallSignature bytecodeHandler("BytecodeDebuggerHandler", 0, 7,
ArgumentsOrder::DEFAULT_ORDER, VariableType::VOID());
*callSign = bytecodeHandler;
// 7 : 7 input parameters
std::array<VariableType, 7> params = { VariableType::NATIVE_POINTER(),
VariableType::NATIVE_POINTER(),
VariableType::NATIVE_POINTER(),
@ -455,7 +457,8 @@ DEF_CALL_SIGNATURE(CallRuntime)
CallSignature runtimeCallTrampoline("CallRuntime", 0, 3,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = runtimeCallTrampoline;
std::array<VariableType, 3> params = { /* 3 : 3 input parameters */
/* 3 : 3 input parameters */
std::array<VariableType, 3> params = {
VariableType::NATIVE_POINTER(),
VariableType::INT64(),
VariableType::INT64(),
@ -472,7 +475,8 @@ DEF_CALL_SIGNATURE(AsmInterpreterEntry)
CallSignature asmInterpreterEntry("AsmInterpreterEntry", 0, 3,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = asmInterpreterEntry;
std::array<VariableType, 3> params = { /* 3 : 3 input parameters */
/* 3 : 3 input parameters */
std::array<VariableType, 3> params = {
VariableType::NATIVE_POINTER(), // glue
VariableType::INT32(), // argc
VariableType::NATIVE_POINTER(), // argv
@ -535,7 +539,7 @@ DEF_CALL_SIGNATURE(OptimizedCallOptimized)
DEF_CALL_SIGNATURE(JSCall)
{
// 5 : 5 input parameters
// 6 : 6 input parameters
CallSignature jSCall("JSCall", 0, 6,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = jSCall;
@ -633,7 +637,8 @@ DEF_CALL_SIGNATURE(ResumeCaughtFrameAndDispatch)
CallSignature resumeCaughtFrameAndDispatch("ResumeCaughtFrameAndDispatch", 0, 7,
ArgumentsOrder::DEFAULT_ORDER, VariableType::VOID());
*callSign = resumeCaughtFrameAndDispatch;
std::array<VariableType, 7> params = { // 7 : 7 input parameters
// 7 : 7 input parameters
std::array<VariableType, 7> params = {
VariableType::NATIVE_POINTER(),
VariableType::NATIVE_POINTER(),
VariableType::NATIVE_POINTER(),
@ -915,7 +920,8 @@ DEF_CALL_SIGNATURE(CallArg0Dyn)
CallSignature callArg0Dyn("callArg0Dyn", 0, 2,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = callArg0Dyn;
std::array<VariableType, 2> params = { // 2 : 2 input parameters
// 2 : 2 input parameters
std::array<VariableType, 2> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_ANY()
};
@ -929,7 +935,8 @@ DEF_CALL_SIGNATURE(CallArg1Dyn)
CallSignature callArg1Dyn("callArg1Dyn", 0, 3,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = callArg1Dyn;
std::array<VariableType, 3> params = { // 3 : 3 input parameters
// 3 : 3 input parameters
std::array<VariableType, 3> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_ANY(),
VariableType::JS_ANY()
@ -944,7 +951,8 @@ DEF_CALL_SIGNATURE(CallArgs2Dyn)
CallSignature callArgs2Dyn("callArgs2Dyn", 0, 4,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = callArgs2Dyn;
std::array<VariableType, 4> params = { // 4 : 4 input parameters
// 4 : 4 input parameters
std::array<VariableType, 4> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_ANY(),
VariableType::JS_ANY(),
@ -960,7 +968,8 @@ DEF_CALL_SIGNATURE(CallArgs3Dyn)
CallSignature callArgs3Dyn("callArgs3Dyn", 0, 5,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = callArgs3Dyn;
std::array<VariableType, 5> params = { // 5 : 5 input parameters
// 5 : 5 input parameters
std::array<VariableType, 5> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_ANY(),
VariableType::JS_ANY(),
@ -977,7 +986,8 @@ DEF_CALL_SIGNATURE(CallIThisRangeDyn)
CallSignature callIThisRangeDyn("callIThisRangeDyn", 0, 3,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = callIThisRangeDyn;
std::array<VariableType, 3> params = { // 3 : 3 input parameters
// 3 : 3 input parameters
std::array<VariableType, 3> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_ANY(),
VariableType::JS_ANY()
@ -993,7 +1003,8 @@ DEF_CALL_SIGNATURE(CallIRangeDyn)
CallSignature callIRangeDyn("callIRangeDyn", 0, 2,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_ANY());
*callSign = callIRangeDyn;
std::array<VariableType, 2> params = { // 2 : 2 input parameters
// 2 : 2 input parameters
std::array<VariableType, 2> params = {
VariableType::NATIVE_POINTER(),
VariableType::JS_ANY()
};
@ -1008,7 +1019,8 @@ DEF_CALL_SIGNATURE(JsProxyCallInternal)
CallSignature proxyCallInternal("JsProxyCallInternal", 0, 4,
ArgumentsOrder::DEFAULT_ORDER, VariableType::JS_POINTER());
*callSign = proxyCallInternal;
std::array<VariableType, 4> params = { // 4 : 4 input parameters
// 4 : 4 input parameters
std::array<VariableType, 4> params = {
VariableType::NATIVE_POINTER(), // glue
VariableType::INT64(), // actual argC
VariableType::JS_POINTER(), // callTarget

View File

@ -33,7 +33,7 @@ GateRef InterpreterStub::GetVregValue(GateRef sp, GateRef idx)
GateRef InterpreterStub::ReadInst8_0(GateRef pc)
{
return Load(VariableType::INT8(), pc, IntPtr(1));
return Load(VariableType::INT8(), pc, IntPtr(1)); // 1 : skip 1 byte of bytecode
}
GateRef InterpreterStub::ReadInst8_1(GateRef pc)
@ -83,24 +83,27 @@ GateRef InterpreterStub::ReadInst4_0(GateRef pc)
GateRef InterpreterStub::ReadInst4_1(GateRef pc)
{
// 1 : skip 1 byte of bytecode
return Int8And(
Int8LSR(Load(VariableType::INT8(), pc, IntPtr(1)), Int8(4)), Int8(0xf));
Int8LSR(Load(VariableType::INT8(), pc, IntPtr(1)), Int8(4)), Int8(0xf)); // 4: read 4 byte of bytecode
}
GateRef InterpreterStub::ReadInst4_2(GateRef pc)
{
// 2 : skip 1 byte of bytecode
return Int8And(Load(VariableType::INT8(), pc, IntPtr(2)), Int8(0xf));
}
GateRef InterpreterStub::ReadInst4_3(GateRef pc)
{
// 2 : skip 1 byte of bytecode
return Int8And(
Int8LSR(Load(VariableType::INT8(), pc, IntPtr(2)), Int8(4)), Int8(0xf));
Int8LSR(Load(VariableType::INT8(), pc, IntPtr(2)), Int8(4)), Int8(0xf)); // 4 : read 4 byte of bytecode
}
GateRef InterpreterStub::ReadInstSigned8_0(GateRef pc)
{
GateRef x = Load(VariableType::INT8(), pc, IntPtr(1));
GateRef x = Load(VariableType::INT8(), pc, IntPtr(1)); // 1 : skip 1 byte of bytecode
return GetEnvironment()->GetBulder()->UnaryArithmetic(OpCode(OpCode::SEXT_TO_INT32), x);
}
@ -119,11 +122,11 @@ GateRef InterpreterStub::ReadInstSigned32_0(GateRef pc)
/* 4 : skip 8 bits of opcode and 24 bits of low bits */
GateRef x = Load(VariableType::INT8(), pc, IntPtr(4));
GateRef currentInst = GetEnvironment()->GetBulder()->UnaryArithmetic(OpCode(OpCode::SEXT_TO_INT32), x);
GateRef currentInst1 = Int32LSL(currentInst, Int32(8));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst2 = Int32Add(currentInst1, ZExtInt8ToInt32(ReadInst8_2(pc)));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst4 = Int32Add(currentInst3, ZExtInt8ToInt32(ReadInst8_1(pc)));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8)); // 8 : set as high 8 bits
return Int32Add(currentInst5, ZExtInt8ToInt32(ReadInst8_0(pc)));
}
@ -140,7 +143,7 @@ GateRef InterpreterStub::ReadInst16_1(GateRef pc)
/* 3 : skip 8 bits of opcode, 8 bits of prefix and 8 bits of low bits */
GateRef currentInst1 = ZExtInt8ToInt16(ReadInst8_2(pc));
GateRef currentInst2 = Int16LSL(currentInst1, Int16(8)); // 8 : set as high 8 bits
/* 2: skip 8 bits of opcode and 8 bits of prefix */
/* 2 : skip 8 bits of opcode and 8 bits of prefix */
return Int16Add(currentInst2, ZExtInt8ToInt16(ReadInst8_1(pc)));
}
@ -149,7 +152,7 @@ GateRef InterpreterStub::ReadInst16_2(GateRef pc)
/* 4 : skip 8 bits of opcode, first parameter of 16 bits and 8 bits of low bits */
GateRef currentInst1 = ZExtInt8ToInt16(ReadInst8_3(pc));
GateRef currentInst2 = Int16LSL(currentInst1, Int16(8)); // 8 : set as high 8 bits
/* 3: skip 8 bits of opcode and first parameter of 16 bits */
/* 3 : skip 8 bits of opcode and first parameter of 16 bits */
return Int16Add(currentInst2, ZExtInt8ToInt16(ReadInst8_2(pc)));
}
@ -158,7 +161,7 @@ GateRef InterpreterStub::ReadInst16_3(GateRef pc)
/* 5 : skip 8 bits of opcode, 8 bits of prefix, first parameter of 16 bits and 8 bits of low bits */
GateRef currentInst1 = ZExtInt8ToInt16(ReadInst8_4(pc));
GateRef currentInst2 = Int16LSL(currentInst1, Int16(8)); // 8 : set as high 8 bits
/* 4: skip 8 bits of opcode, 8 bits of prefix and first parameter of 16 bits */
/* 4 : skip 8 bits of opcode, 8 bits of prefix and first parameter of 16 bits */
return Int16Add(currentInst2, ZExtInt8ToInt16(ReadInst8_3(pc)));
}
@ -167,7 +170,7 @@ GateRef InterpreterStub::ReadInst16_5(GateRef pc)
/* 7 : skip 8 bits of opcode, 8 bits of prefix, first 2 parameters of 16 bits and 8 bits of low bits */
GateRef currentInst1 = ZExtInt8ToInt16(ReadInst8_6(pc));
GateRef currentInst2 = Int16LSL(currentInst1, Int16(8)); // 8 : set as high 8 bits
/* 6: skip 8 bits of opcode, 8 bits of prefix and first 2 parameters of 16 bits */
/* 6 : skip 8 bits of opcode, 8 bits of prefix and first 2 parameters of 16 bits */
return Int16Add(currentInst2, ZExtInt8ToInt16(ReadInst8_5(pc)));
}
@ -352,6 +355,7 @@ GateRef InterpreterStub::CheckStackOverflow(GateRef glue, GateRef sp)
GateRef InterpreterStub::PushArg(GateRef glue, GateRef sp, GateRef value)
{
GateRef newSp = PointerSub(sp, IntPtr(sizeof(JSTaggedType)));
// 0 : skip 0 byte of bytecode
Store(VariableType::INT64(), glue, newSp, IntPtr(0), value);
return newSp;
}
@ -369,7 +373,7 @@ GateRef InterpreterStub::PushUndefined(GateRef glue, GateRef sp, GateRef num)
Branch(Int32LessThan(*i, num), &pushUndefinedBegin, &pushUndefinedEnd);
LoopBegin(&pushUndefinedBegin);
newSp = PushArg(glue, *newSp, Int64(JSTaggedValue::VALUE_UNDEFINED));
i = Int32Add(*i, Int32(1));
i = Int32Add(*i, Int32(1)); // 1 : set as high 1 bits
Branch(Int32LessThan(*i, num), &pushUndefinedAgain, &pushUndefinedEnd);
Bind(&pushUndefinedAgain);
LoopEnd(&pushUndefinedBegin);
@ -393,7 +397,7 @@ GateRef InterpreterStub::PushRange(GateRef glue, GateRef sp, GateRef array, Gate
LoopBegin(&pushArgsBegin);
GateRef arg = GetVregValue(array, ChangeInt32ToIntPtr(*i));
newSp = PushArg(glue, *newSp, arg);
i = Int32Sub(*i, Int32(1));
i = Int32Sub(*i, Int32(1)); // 1 : set as high 1 bits
Branch(Int32GreaterThanOrEqual(*i, startIndex), &pushArgsAgain, &pushArgsEnd);
Bind(&pushArgsAgain);
LoopEnd(&pushArgsBegin);
@ -411,52 +415,52 @@ GateRef InterpreterStub::GetCurrentFrame(GateRef glue)
GateRef InterpreterStub::ReadInst32_0(GateRef pc)
{
GateRef currentInst = ZExtInt8ToInt32(ReadInst8_3(pc));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst2 = Int32Add(currentInst1, ZExtInt8ToInt32(ReadInst8_2(pc)));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst4 = Int32Add(currentInst3, ZExtInt8ToInt32(ReadInst8_1(pc)));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8)); // 8 : set as high 8 bits
return Int32Add(currentInst5, ZExtInt8ToInt32(ReadInst8_0(pc)));
}
GateRef InterpreterStub::ReadInst32_1(GateRef pc)
{
GateRef currentInst = ZExtInt8ToInt32(ReadInst8_4(pc));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst2 = Int32Add(currentInst1, ZExtInt8ToInt32(ReadInst8_3(pc)));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst4 = Int32Add(currentInst3, ZExtInt8ToInt32(ReadInst8_2(pc)));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8)); // 8 : set as high 8 bits
return Int32Add(currentInst5, ZExtInt8ToInt32(ReadInst8_1(pc)));
}
GateRef InterpreterStub::ReadInst32_2(GateRef pc)
{
GateRef currentInst = ZExtInt8ToInt32(ReadInst8_5(pc));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8));
GateRef currentInst1 = Int32LSL(currentInst, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst2 = Int32Add(currentInst1, ZExtInt8ToInt32(ReadInst8_4(pc)));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8));
GateRef currentInst3 = Int32LSL(currentInst2, Int32(8)); // 8 : set as high 8 bits
GateRef currentInst4 = Int32Add(currentInst3, ZExtInt8ToInt32(ReadInst8_3(pc)));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8));
GateRef currentInst5 = Int32LSL(currentInst4, Int32(8)); // 8 : set as high 8 bits
return Int32Add(currentInst5, ZExtInt8ToInt32(ReadInst8_2(pc)));
}
GateRef InterpreterStub::ReadInst64_0(GateRef pc)
{
GateRef currentInst = ZExtInt8ToInt64(ReadInst8_7(pc));
GateRef currentInst1 = Int64LSL(currentInst, Int64(8));
GateRef currentInst1 = Int64LSL(currentInst, Int64(8)); // 8 : set as high 8 bits
GateRef currentInst2 = Int64Add(currentInst1, ZExtInt8ToInt64(ReadInst8_6(pc)));
GateRef currentInst3 = Int64LSL(currentInst2, Int64(8));
GateRef currentInst3 = Int64LSL(currentInst2, Int64(8)); // 8 : set as high 8 bits
GateRef currentInst4 = Int64Add(currentInst3, ZExtInt8ToInt64(ReadInst8_5(pc)));
GateRef currentInst5 = Int64LSL(currentInst4, Int64(8));
GateRef currentInst5 = Int64LSL(currentInst4, Int64(8)); // 8 : set as high 8 bits
GateRef currentInst6 = Int64Add(currentInst5, ZExtInt8ToInt64(ReadInst8_4(pc)));
GateRef currentInst7 = Int64LSL(currentInst6, Int64(8));
GateRef currentInst7 = Int64LSL(currentInst6, Int64(8)); // 8 : set as high 8 bits
GateRef currentInst8 = Int64Add(currentInst7, ZExtInt8ToInt64(ReadInst8_3(pc)));
GateRef currentInst9 = Int64LSL(currentInst8, Int64(8));
GateRef currentInst9 = Int64LSL(currentInst8, Int64(8)); // 8 : set as high 8 bits
GateRef currentInst10 = Int64Add(currentInst9, ZExtInt8ToInt64(ReadInst8_2(pc)));
GateRef currentInst11 = Int64LSL(currentInst10, Int64(8));
GateRef currentInst11 = Int64LSL(currentInst10, Int64(8)); // 8 : set as high 8 bits
GateRef currentInst12 = Int64Add(currentInst11, ZExtInt8ToInt64(ReadInst8_1(pc)));
GateRef currentInst13 = Int64LSL(currentInst12, Int64(8));
GateRef currentInst13 = Int64LSL(currentInst12, Int64(8)); // 8 : set as high 8 bits
return Int64Add(currentInst13, ZExtInt8ToInt64(ReadInst8_0(pc)));
}

View File

@ -78,21 +78,23 @@ void AssemblerStubs::CallRuntime(ExtendedAssembler *assembler)
Register frameType(X2);
// construct Leave Frame and callee save
__ Mov(frameType, Immediate(static_cast<int64_t>(FrameType::LEAVE_FRAME)));
// 2 : 2 means pairs
__ Stp(tmp, frameType, MemoryOperand(sp, -FRAME_SLOT_SIZE * 2, AddrMode::PREINDEX));
__ Add(fp, sp, Immediate(16)); // 16: skip frame type and tmp
__ Str(fp, MemoryOperand(glue, JSThread::GlueData::GetLeaveFrameOffset(false)));
// load runtime trampoline address
Register rtfunc(X19);
__ Ldr(tmp, MemoryOperand(fp, GetStackArgOffSetToFp(0)));
__ Ldr(tmp, MemoryOperand(fp, GetStackArgOffSetToFp(0))); // 0: the first arg id
// 3 : 3 means 2 << 3 = 8
__ Add(tmp, glue, Operand(tmp, LSL, 3));
__ Ldr(rtfunc, MemoryOperand(tmp, JSThread::GlueData::GetRTStubEntriesOffset(false)));
__ Ldr(argC, MemoryOperand(fp, GetStackArgOffSetToFp(1)));
__ Add(argV, fp, Immediate(GetStackArgOffSetToFp(2)));
__ Ldr(argC, MemoryOperand(fp, GetStackArgOffSetToFp(1))); // 1: the second arg id
__ Add(argV, fp, Immediate(GetStackArgOffSetToFp(2))); // 2: the third arg id
__ Blr(rtfunc);
// callee restore
// 0 : 0 restore size
__ Ldr(tmp, MemoryOperand(sp, 0));
// descontruct frame
@ -184,6 +186,7 @@ void AssemblerStubs::JSFunctionEntry(ExtendedAssembler *assembler)
__ Mov(Register(X19), expectedNumArgs);
__ Ldr(env, MemoryOperand(argV, actualNumArgs, UXTW, SHIFT_OF_FRAMESLOT));
__ Str(actualNumArgs, MemoryOperand(sp, FRAME_SLOT_SIZE));
// 0 : 0 restore size
__ Str(env, MemoryOperand(sp, 0));
__ Blr(codeAddr);
}
@ -261,7 +264,7 @@ void AssemblerStubs::OptimizedCallOptimized(ExtendedAssembler *assembler)
{
__ Mov(Register(X19), expectedNumArgs);
__ Str(actualNumArgs, MemoryOperand(sp, FRAME_SLOT_SIZE));
__ Str(env, MemoryOperand(sp, 0));
__ Str(env, MemoryOperand(sp, 0)); // 0: means zero size
__ Blr(codeAddr);
}
@ -336,8 +339,7 @@ void AssemblerStubs::PopLeaveFrame(ExtendedAssembler *assembler, bool isBuiltin)
// uint64_t CallBuiltinTrampoline(uintptr_t glue, uintptr_t codeAddress, uint32_t argc, ...)
// webkit_jscc calling convention call runtime_id's runtion function(c-abi)
// Input:
// %x0 - glue
// Input: %x0 - glue
// stack layout: sp + N*8 argvN
// ........
// sp + 24: argv0
@ -524,7 +526,7 @@ void AssemblerStubs::JSCallBody(ExtendedAssembler *assembler, Register jsfunc)
Register env(X5);
Register argV(X6);
__ Add(argV, basefp, Immediate(GetStackArgOffSetToFp(0)));
__ Add(argV, basefp, Immediate(GetStackArgOffSetToFp(0))); // 0: first index id
__ Ldr(actualArgC, MemoryOperand(argV, FRAME_SLOT_SIZE));
__ Ldr(env, MemoryOperand(argV, 0));

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 1U);
ASSERT_EQ(breakpointCounter_, 1U); // 1: break point
return true;
};
}

View File

@ -58,7 +58,7 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 2U);
ASSERT_EQ(breakpointCounter_, 2U); // 2: break point counter
return true;
};
}

View File

@ -24,7 +24,7 @@ public:
JsBreakpointTest()
{
vmStart = [this] {
location_ = TestUtil::GetLocation("Sample.js", 22, 0, pandaFile_.c_str());
location_ = TestUtil::GetLocation("Sample.js", 22, 0, pandaFile_.c_str()); // 22: breakpointer line
ASSERT_TRUE(location_.GetMethodId().IsValid());
return true;
};
@ -58,7 +58,7 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 2U);
ASSERT_EQ(breakpointCounter_, 2U); // 2: break point counter
return true;
};
}

View File

@ -24,7 +24,7 @@ public:
JsExceptionTest()
{
vmStart = [this] {
location_ = TestUtil::GetLocation("exception.js", 22, 0, pandaFile_.c_str());
location_ = TestUtil::GetLocation("exception.js", 22, 0, pandaFile_.c_str()); // 22breakpointer line
ASSERT_TRUE(location_.GetMethodId().IsValid());
return true;
};
@ -81,8 +81,8 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 1U);
ASSERT_EQ(exceptionCounter_, 1U);
ASSERT_EQ(breakpointCounter_, 1U); // 1: break point counter
ASSERT_EQ(exceptionCounter_, 1U); // 1: exception counter
return true;
};
}

View File

@ -24,7 +24,7 @@ public:
JsRangeErrorTest()
{
vmStart = [this] {
location_ = TestUtil::GetLocation("RangeError.js", 20, 0, pandaFile_.c_str());
location_ = TestUtil::GetLocation("RangeError.js", 20, 0, pandaFile_.c_str()); // 20: breakpointer line
ASSERT_TRUE(location_.GetMethodId().IsValid());
return true;
};
@ -81,8 +81,8 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 1U);
ASSERT_EQ(exceptionCounter_, 1U);
ASSERT_EQ(breakpointCounter_, 1U); // 1: break point counter
ASSERT_EQ(exceptionCounter_, 1U); // 1: exception counter
return true;
};
}

View File

@ -24,14 +24,14 @@ public:
JsSingleStepTest()
{
vmStart = [this] {
locationStart_ = TestUtil::GetLocation("Sample.js", 19, 0, pandaFile_.c_str());
locationEnd_ = TestUtil::GetLocation("Sample.js", 22, 0, pandaFile_.c_str());
locationStart_ = TestUtil::GetLocation("Sample.js", 19, 0, pandaFile_.c_str()); // 19: line number
locationEnd_ = TestUtil::GetLocation("Sample.js", 22, 0, pandaFile_.c_str()); // 22: line number
return true;
};
vmDeath = [this]() {
ASSERT_NE(stepCounter_, 0);
ASSERT_EQ(breakpointCounter_, 2);
ASSERT_NE(stepCounter_, 0); // 0: step counter
ASSERT_EQ(breakpointCounter_, 2); // 2: break point counter
return true;
};

View File

@ -30,8 +30,8 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 1);
ASSERT_EQ(stepCompleteCounter_, 1);
ASSERT_EQ(breakpointCounter_, 1); // 1: break point counter
ASSERT_EQ(stepCompleteCounter_, 1); // 1: step complete counter
return true;
};

View File

@ -38,8 +38,8 @@ public:
ASSERT_TRUE(callFrames.size() > 0);
auto jsLocation = callFrames[0]->GetLocation();
ASSERT_TRUE(jsLocation != nullptr);
ASSERT_EQ(jsLocation->GetLine(), 27); // 27: breakpointer line
ASSERT_EQ(jsLocation->GetColumn(), 0);
ASSERT_EQ(jsLocation->GetLine(), 27); // 27: breakpoint line
ASSERT_EQ(jsLocation->GetColumn(), 0); // 0: breakpoint column
TestUtil::SuspendUntilContinue(DebugEvent::BREAKPOINT, location);
return true;
};
@ -81,8 +81,8 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 1U);
ASSERT_EQ(exceptionCounter_, 1U);
ASSERT_EQ(breakpointCounter_, 1U); // 1: break point counter
ASSERT_EQ(exceptionCounter_, 1U); // 1: exception counter
return true;
};
}

View File

@ -40,8 +40,8 @@ public:
ASSERT_TRUE(callFrames.size() > 0);
auto jsLocation = callFrames[0]->GetLocation();
ASSERT_TRUE(jsLocation != nullptr);
ASSERT_EQ(jsLocation->GetLine(), 28); // 28: breakpointer line
ASSERT_EQ(jsLocation->GetColumn(), 0);
ASSERT_EQ(jsLocation->GetLine(), 28); // 28: breakpoint line
ASSERT_EQ(jsLocation->GetColumn(), 0); // 0: breakpoint column
TestUtil::SuspendUntilContinue(DebugEvent::BREAKPOINT, location);
return true;
};
@ -84,8 +84,8 @@ public:
};
vmDeath = [this]() {
ASSERT_EQ(breakpointCounter_, 1U);
ASSERT_EQ(exceptionCounter_, 2U);
ASSERT_EQ(breakpointCounter_, 1U); // 1: break point counter
ASSERT_EQ(exceptionCounter_, 2U); // 2: exception counter
return true;
};
}