mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
Descriptor: Fix multi constantpool bug and add testcase
Details: 1. Dont modify constpool in Method 2. Modify wrong cast of int16 to int32 3. Re-generate Constantpool when create Method 4. Add testcases of multi-constantpool Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5W5IP Signed-off-by: wengchangcheng <wengchangcheng@huawei.com> Change-Id: Ia76d5235eadba3cc117c3f0567044fd988dbfd1f
This commit is contained in:
parent
00733c0752
commit
8af2cd1e8b
@ -2148,7 +2148,7 @@ DECLARE_ASM_HANDLER(HandleStsuperbynameImm8Id16V8)
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef v0 = ReadInst8_3(pc);
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StSuperByValue), { receiver, propKey, acc });
|
||||
CHECK_EXCEPTION(result, INT_PTR(STSUPERBYNAME_IMM8_ID16_V8));
|
||||
}
|
||||
@ -2158,7 +2158,7 @@ DECLARE_ASM_HANDLER(HandleStsuperbynameImm16Id16V8)
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef v0 = ReadInst8_4(pc);
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StSuperByValue), { receiver, propKey, acc });
|
||||
CHECK_EXCEPTION(result, INT_PTR(STSUPERBYNAME_IMM16_ID16_V8));
|
||||
}
|
||||
@ -3035,14 +3035,14 @@ DECLARE_ASM_HANDLER(HandleStobjbynameImm8Id16V8)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = SetPropertyByName(glue, receiver, propKey, acc, false);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef ret = CallRuntime(glue, RTSTUB_ID(StoreICByName),
|
||||
{ profileTypeInfo, receiver, propKey, acc, IntToTaggedInt(slotId) });
|
||||
result = ret;
|
||||
@ -3072,14 +3072,14 @@ DECLARE_ASM_HANDLER(HandleStobjbynameImm16Id16V8)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = SetPropertyByName(glue, receiver, propKey, acc, false);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef ret = CallRuntime(glue, RTSTUB_ID(StoreICByName),
|
||||
{ profileTypeInfo, receiver, propKey, acc, IntToTaggedInt(slotId) });
|
||||
result = ret;
|
||||
@ -3181,7 +3181,7 @@ DECLARE_ASM_HANDLER(HandleStownbynameImm8Id16V8)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Label checkResult(env);
|
||||
@ -3219,7 +3219,7 @@ DECLARE_ASM_HANDLER(HandleStownbynameImm16Id16V8)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_4(pc)));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Hole());
|
||||
Label checkResult(env);
|
||||
@ -3258,7 +3258,7 @@ DECLARE_ASM_HANDLER(HandleStownbynamewithnamesetImm8Id16V8)
|
||||
auto env = GetEnvironment();
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_3(pc)));
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
Label isJSObject(env);
|
||||
Label notJSObject(env);
|
||||
Label notClassConstructor(env);
|
||||
@ -3300,7 +3300,7 @@ DECLARE_ASM_HANDLER(HandleStownbynamewithnamesetImm16Id16V8)
|
||||
auto env = GetEnvironment();
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_4(pc)));
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
Label isJSObject(env);
|
||||
Label notJSObject(env);
|
||||
Label notClassConstructor(env);
|
||||
@ -3378,7 +3378,7 @@ DECLARE_ASM_HANDLER(HandleLdaStrId16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst16_0(pc);
|
||||
varAcc = GetStringFromConstPool(constpool, stringId);
|
||||
varAcc = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
DISPATCH_WITH_ACC(LDA_STR_ID16);
|
||||
}
|
||||
|
||||
@ -3917,7 +3917,7 @@ DECLARE_ASM_HANDLER(HandleTryldglobalbynameImm8Id16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef prop = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef prop = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
|
||||
Label dispatch(env);
|
||||
Label icAvailable(env);
|
||||
@ -3996,7 +3996,7 @@ DECLARE_ASM_HANDLER(HandleTryldglobalbynameImm16Id16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef prop = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef prop = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
|
||||
Label dispatch(env);
|
||||
Label icAvailable(env);
|
||||
@ -4073,7 +4073,7 @@ DECLARE_ASM_HANDLER(HandleTrystglobalbynameImm8Id16)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
|
||||
Label checkResult(env);
|
||||
@ -4141,7 +4141,7 @@ DECLARE_ASM_HANDLER(HandleTrystglobalbynameImm16Id16)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
|
||||
Label checkResult(env);
|
||||
@ -4211,7 +4211,7 @@ DECLARE_ASM_HANDLER(HandleLdglobalvarImm16Id16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
|
||||
Label checkResult(env);
|
||||
@ -4270,7 +4270,7 @@ DECLARE_ASM_HANDLER(HandleStglobalvarImm16Id16)
|
||||
auto env = GetEnvironment();
|
||||
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
|
||||
Label checkResult(env);
|
||||
@ -4313,7 +4313,7 @@ DECLARE_ASM_HANDLER(HandleStglobalvarImm16Id16)
|
||||
DECLARE_ASM_HANDLER(HandleCreateregexpwithliteralImm8Id16Imm8)
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef pattern = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef pattern = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef flags = ReadInst8_3(pc);
|
||||
GateRef res = CallRuntime(glue, RTSTUB_ID(CreateRegExpWithLiteral),
|
||||
{ pattern, Int8ToTaggedInt(flags) });
|
||||
@ -4323,7 +4323,7 @@ DECLARE_ASM_HANDLER(HandleCreateregexpwithliteralImm8Id16Imm8)
|
||||
DECLARE_ASM_HANDLER(HandleCreateregexpwithliteralImm16Id16Imm8)
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef pattern = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef pattern = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef flags = ReadInst8_4(pc);
|
||||
GateRef res = CallRuntime(glue, RTSTUB_ID(CreateRegExpWithLiteral),
|
||||
{ pattern, Int8ToTaggedInt(flags) });
|
||||
@ -4463,7 +4463,7 @@ DECLARE_ASM_HANDLER(HandleSub2Imm8V8)
|
||||
DECLARE_ASM_HANDLER(HandleLdbigintId16)
|
||||
{
|
||||
GateRef stringId = ReadInst16_0(pc);
|
||||
GateRef numberBigInt = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef numberBigInt = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef res = CallRuntime(glue, RTSTUB_ID(LdBigInt), { numberBigInt });
|
||||
CHECK_EXCEPTION_WITH_ACC(res, INT_PTR(LDBIGINT_ID16));
|
||||
}
|
||||
@ -4775,7 +4775,7 @@ DECLARE_ASM_HANDLER(HandleLdsuperbynameImm8Id16)
|
||||
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef receiver = acc;
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(LdSuperByValue), { receiver, propKey });
|
||||
CHECK_EXCEPTION_WITH_VARACC(result, INT_PTR(LDSUPERBYNAME_IMM8_ID16));
|
||||
}
|
||||
@ -4786,7 +4786,7 @@ DECLARE_ASM_HANDLER(HandleLdsuperbynameImm16Id16)
|
||||
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef receiver = acc;
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(LdSuperByValue), { receiver, propKey });
|
||||
CHECK_EXCEPTION_WITH_VARACC(result, INT_PTR(LDSUPERBYNAME_IMM16_ID16));
|
||||
}
|
||||
@ -4798,7 +4798,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedLdsuperbynamePrefId32V8)
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef v0 = ReadInst8_5(pc);
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(v0));
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(LdSuperByValue), { receiver, propKey });
|
||||
CHECK_EXCEPTION_WITH_VARACC(result, INT_PTR(DEPRECATED_LDSUPERBYNAME_PREF_ID32_V8));
|
||||
}
|
||||
@ -4909,7 +4909,7 @@ DECLARE_ASM_HANDLER(HandleStconsttoglobalrecordImm16Id16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StGlobalRecord),
|
||||
{ propKey, *varAcc, TaggedTrue() });
|
||||
CHECK_EXCEPTION_VARACC(result, INT_PTR(STCONSTTOGLOBALRECORD_IMM16_ID16));
|
||||
@ -4920,7 +4920,7 @@ DECLARE_ASM_HANDLER(HandleSttoglobalrecordImm16Id16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StGlobalRecord),
|
||||
{ propKey, *varAcc, TaggedFalse() });
|
||||
CHECK_EXCEPTION_VARACC(result, INT_PTR(STTOGLOBALRECORD_IMM16_ID16));
|
||||
@ -4931,7 +4931,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedStconsttoglobalrecordPrefId32)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StGlobalRecord),
|
||||
{ propKey, *varAcc, TaggedTrue() });
|
||||
CHECK_EXCEPTION_VARACC(result, INT_PTR(DEPRECATED_STCONSTTOGLOBALRECORD_PREF_ID32));
|
||||
@ -4942,7 +4942,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedStlettoglobalrecordPrefId32)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StGlobalRecord),
|
||||
{ propKey, *varAcc, TaggedFalse() });
|
||||
CHECK_EXCEPTION_VARACC(result, INT_PTR(DEPRECATED_STLETTOGLOBALRECORD_PREF_ID32));
|
||||
@ -4953,7 +4953,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedStclasstoglobalrecordPrefId32)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StGlobalRecord),
|
||||
{ propKey, *varAcc, TaggedFalse() });
|
||||
CHECK_EXCEPTION_VARACC(result, INT_PTR(DEPRECATED_STCLASSTOGLOBALRECORD_PREF_ID32));
|
||||
@ -4974,7 +4974,7 @@ DECLARE_ASM_HANDLER(HandleWideGetmodulenamespacePrefImm16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef index = ReadInst16_1(pc);
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(GetModuleNamespaceByIndex), { IntToTaggedInt(index) });
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(GetModuleNamespaceByIndex), { Int16ToTaggedInt(index) });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(WIDE_GETMODULENAMESPACE_PREF_IMM16);
|
||||
}
|
||||
@ -4984,7 +4984,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedGetmodulenamespacePrefId32)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef prop = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef prop = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(GetModuleNamespace), { prop });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(DEPRECATED_GETMODULENAMESPACE_PREF_ID32);
|
||||
@ -4995,7 +4995,7 @@ DECLARE_ASM_HANDLER(HandleLdlocalmodulevarImm8)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef index = ReadInst8_0(pc);
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdLocalModuleVarByIndex), { IntToTaggedInt(index) });
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdLocalModuleVarByIndex), { Int8ToTaggedInt(index) });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(LDLOCALMODULEVAR_IMM8);
|
||||
}
|
||||
@ -5005,7 +5005,7 @@ DECLARE_ASM_HANDLER(HandleWideLdlocalmodulevarPrefImm16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef index = ReadInst16_1(pc);
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdLocalModuleVarByIndex), { IntToTaggedInt(index) });
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdLocalModuleVarByIndex), { Int16ToTaggedInt(index) });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(WIDE_LDLOCALMODULEVAR_PREF_IMM16);
|
||||
}
|
||||
@ -5015,7 +5015,7 @@ DECLARE_ASM_HANDLER(HandleLdexternalmodulevarImm8)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef index = ReadInst8_0(pc);
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdExternalModuleVarByIndex), { IntToTaggedInt(index) });
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdExternalModuleVarByIndex), { Int8ToTaggedInt(index) });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(LDEXTERNALMODULEVAR_IMM8);
|
||||
}
|
||||
@ -5025,7 +5025,7 @@ DECLARE_ASM_HANDLER(HandleWideLdexternalmodulevarPrefImm16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef index = ReadInst16_1(pc);
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdExternalModuleVarByIndex), { IntToTaggedInt(index) });
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdExternalModuleVarByIndex), { Int16ToTaggedInt(index) });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(WIDE_LDEXTERNALMODULEVAR_PREF_IMM16);
|
||||
}
|
||||
@ -5036,7 +5036,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedLdmodulevarPrefId32Imm8)
|
||||
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef flag = ZExtInt8ToInt32(ReadInst8_5(pc));
|
||||
GateRef key = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef key = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef moduleRef = CallRuntime(glue, RTSTUB_ID(LdModuleVar), { key, IntToTaggedInt(flag) });
|
||||
varAcc = moduleRef;
|
||||
DISPATCH_WITH_ACC(DEPRECATED_LDMODULEVAR_PREF_ID32_IMM8);
|
||||
@ -5056,7 +5056,7 @@ DECLARE_ASM_HANDLER(HandleWideStmodulevarPrefImm16)
|
||||
GateRef index = ReadInst16_1(pc);
|
||||
GateRef value = acc;
|
||||
|
||||
CallRuntime(glue, RTSTUB_ID(StModuleVarByIndex), { IntToTaggedInt(index), value });
|
||||
CallRuntime(glue, RTSTUB_ID(StModuleVarByIndex), { Int16ToTaggedInt(index), value });
|
||||
DISPATCH(WIDE_STMODULEVAR_PREF_IMM16);
|
||||
}
|
||||
|
||||
@ -5269,14 +5269,14 @@ DECLARE_ASM_HANDLER(HandleLdobjbynameImm8Id16)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = GetPropertyByName(glue, receiver, propKey);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = CallRuntime(glue, RTSTUB_ID(LoadICByName),
|
||||
{ profileTypeInfo, receiver, propKey, IntToTaggedInt(slotId) });
|
||||
Jump(&checkException);
|
||||
@ -5306,14 +5306,14 @@ DECLARE_ASM_HANDLER(HandleLdobjbynameImm16Id16)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = GetPropertyByName(glue, receiver, propKey);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = CallRuntime(glue, RTSTUB_ID(LoadICByName),
|
||||
{ profileTypeInfo, receiver, propKey, IntToTaggedInt(slotId) });
|
||||
Jump(&checkException);
|
||||
@ -5336,7 +5336,7 @@ DECLARE_ASM_HANDLER(HandleDeprecatedLdobjbynamePrefId32V8)
|
||||
|
||||
GateRef receiver = GetVregValue(sp, ZExtInt8ToPtr(ReadInst8_5(pc)));
|
||||
GateRef stringId = ReadInst32_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
Branch(TaggedIsHeapObject(receiver), &fastPath, &slowPath);
|
||||
Bind(&fastPath);
|
||||
{
|
||||
@ -6344,14 +6344,14 @@ DECLARE_ASM_HANDLER(HandleStthisbynameImm16Id16)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = SetPropertyByName(glue, receiver, propKey, acc, false);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef ret = CallRuntime(glue, RTSTUB_ID(StoreICByName),
|
||||
{ profileTypeInfo, receiver, propKey, acc, IntToTaggedInt(slotId) });
|
||||
result = ret;
|
||||
@ -6380,14 +6380,14 @@ DECLARE_ASM_HANDLER(HandleStthisbynameImm8Id16)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = SetPropertyByName(glue, receiver, propKey, acc, false);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
GateRef ret = CallRuntime(glue, RTSTUB_ID(StoreICByName),
|
||||
{ profileTypeInfo, receiver, propKey, acc, IntToTaggedInt(slotId) });
|
||||
result = ret;
|
||||
@ -6417,14 +6417,14 @@ DECLARE_ASM_HANDLER(HandleLdthisbynameImm16Id16)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = GetPropertyByName(glue, receiver, propKey);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_2(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = CallRuntime(glue, RTSTUB_ID(LoadICByName),
|
||||
{ profileTypeInfo, receiver, propKey, IntToTaggedInt(slotId) });
|
||||
Jump(&checkException);
|
||||
@ -6453,14 +6453,14 @@ DECLARE_ASM_HANDLER(HandleLdthisbynameImm8Id16)
|
||||
Bind(&tryFastPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = GetPropertyByName(glue, receiver, propKey);
|
||||
Branch(TaggedIsHole(*result), &slowPath, &checkException);
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
GateRef stringId = ReadInst16_1(pc);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, stringId);
|
||||
GateRef propKey = GetStringFromConstPool(constpool, ZExtInt16ToInt32(stringId));
|
||||
result = CallRuntime(glue, RTSTUB_ID(LoadICByName),
|
||||
{ profileTypeInfo, receiver, propKey, IntToTaggedInt(slotId) });
|
||||
Jump(&checkException);
|
||||
@ -6667,14 +6667,14 @@ DECLARE_ASM_HANDLER(HandleWideLdpatchvarPrefImm16)
|
||||
DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
|
||||
|
||||
GateRef index = ReadInst16_1(pc);
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(LdPatchVar), { IntToTaggedInt(index) });
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(LdPatchVar), { Int16ToTaggedInt(index) });
|
||||
CHECK_EXCEPTION_WITH_VARACC(result, INT_PTR(WIDE_LDPATCHVAR_PREF_IMM16));
|
||||
}
|
||||
|
||||
DECLARE_ASM_HANDLER(HandleWideStpatchvarPrefImm16)
|
||||
{
|
||||
GateRef index = ReadInst16_1(pc);
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StPatchVar), { IntToTaggedInt(index), acc });
|
||||
GateRef result = CallRuntime(glue, RTSTUB_ID(StPatchVar), { Int16ToTaggedInt(index), acc });
|
||||
CHECK_EXCEPTION(result, INT_PTR(WIDE_STPATCHVAR_PREF_IMM16));
|
||||
}
|
||||
#undef DECLARE_ASM_HANDLER
|
||||
|
@ -495,7 +495,25 @@ JSTaggedValue EcmaVM::FindConstpool(const JSPandaFile *jsPandaFile, int32_t inde
|
||||
if (iter == cachedConstpools_.end()) {
|
||||
return JSTaggedValue::Hole();
|
||||
}
|
||||
return iter->second[index];
|
||||
auto constpoolIter = iter->second.find(index);
|
||||
if (constpoolIter == iter->second.end()) {
|
||||
return JSTaggedValue::Hole();
|
||||
}
|
||||
return constpoolIter->second;
|
||||
}
|
||||
|
||||
JSHandle<ConstantPool> EcmaVM::FindOrCreateConstPool(const JSPandaFile *jsPandaFile, panda_file::File::EntityId id)
|
||||
{
|
||||
panda_file::IndexAccessor indexAccessor(*jsPandaFile->GetPandaFile(), id);
|
||||
int32_t index = static_cast<int32_t>(indexAccessor.GetHeaderIndex());
|
||||
JSTaggedValue constpool = FindConstpool(jsPandaFile, index);
|
||||
if (constpool.IsHole()) {
|
||||
JSHandle<ConstantPool> newConstpool = ConstantPool::CreateConstPool(this, jsPandaFile, id);
|
||||
AddConstpool(jsPandaFile, newConstpool.GetTaggedValue(), index);
|
||||
return newConstpool;
|
||||
}
|
||||
|
||||
return JSHandle<ConstantPool>(thread_, constpool);
|
||||
}
|
||||
|
||||
void EcmaVM::CJSExecution(JSHandle<JSFunction> &func, JSHandle<JSTaggedValue> &thisArg, const JSPandaFile *jsPandaFile)
|
||||
@ -536,15 +554,16 @@ void EcmaVM::CJSExecution(JSHandle<JSFunction> &func, JSHandle<JSTaggedValue> &t
|
||||
return;
|
||||
}
|
||||
|
||||
void EcmaVM::AddConstpool(const JSPandaFile *jsPandaFile, JSTaggedValue constpool, int32_t index, int32_t total)
|
||||
void EcmaVM::AddConstpool(const JSPandaFile *jsPandaFile, JSTaggedValue constpool, int32_t index)
|
||||
{
|
||||
ASSERT(constpool.IsConstantPool());
|
||||
if (cachedConstpools_.find(jsPandaFile) == cachedConstpools_.end()) {
|
||||
cachedConstpools_[jsPandaFile] = CVector<JSTaggedValue>(total);
|
||||
cachedConstpools_[jsPandaFile].reserve(total);
|
||||
cachedConstpools_[jsPandaFile] = CMap<int32_t, JSTaggedValue>();
|
||||
}
|
||||
auto &constpoolMap = cachedConstpools_[jsPandaFile];
|
||||
ASSERT(constpoolMap.find(index) == constpoolMap.end());
|
||||
|
||||
cachedConstpools_[jsPandaFile][index] = constpool;
|
||||
constpoolMap.insert({index, constpool});
|
||||
}
|
||||
|
||||
JSHandle<JSTaggedValue> EcmaVM::GetAndClearEcmaUncaughtException() const
|
||||
@ -623,19 +642,25 @@ void EcmaVM::ProcessNativeDelete(const WeakRootVisitor &visitor)
|
||||
auto iterator = cachedConstpools_.begin();
|
||||
while (iterator != cachedConstpools_.end()) {
|
||||
auto &constpools = iterator->second;
|
||||
auto size = constpools.size();
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
if (constpools[i].IsHeapObject()) {
|
||||
TaggedObject *obj = constpools[i].GetTaggedObject();
|
||||
auto constpoolIter = constpools.begin();
|
||||
while (constpoolIter != constpools.end()) {
|
||||
JSTaggedValue constpoolVal = constpoolIter->second;
|
||||
if (constpoolVal.IsHeapObject()) {
|
||||
TaggedObject *obj = constpoolVal.GetTaggedObject();
|
||||
auto fwd = visitor(obj);
|
||||
if (fwd == nullptr) {
|
||||
auto constantPool = ConstantPool::Cast(obj);
|
||||
JSPandaFileManager::RemoveJSPandaFile(constantPool->GetJSPandaFile());
|
||||
constpools[i] = JSTaggedValue::Hole();
|
||||
constpoolIter = constpools.erase(constpoolIter);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
++constpoolIter;
|
||||
}
|
||||
if (constpools.size() == 0) {
|
||||
JSPandaFileManager::RemoveJSPandaFile(const_cast<JSPandaFile *>(iterator->first));
|
||||
iterator = cachedConstpools_.erase(iterator);
|
||||
} else {
|
||||
++iterator;
|
||||
}
|
||||
++iterator;
|
||||
}
|
||||
}
|
||||
void EcmaVM::ProcessReferences(const WeakRootVisitor &visitor)
|
||||
@ -645,7 +670,8 @@ void EcmaVM::ProcessReferences(const WeakRootVisitor &visitor)
|
||||
}
|
||||
heap_->ResetNativeBindingSize();
|
||||
// array buffer
|
||||
for (auto iter = nativePointerList_.begin(); iter != nativePointerList_.end();) {
|
||||
auto iter = nativePointerList_.begin();
|
||||
while (iter != nativePointerList_.end()) {
|
||||
JSNativePointer *object = *iter;
|
||||
auto fwd = visitor(reinterpret_cast<TaggedObject *>(object));
|
||||
if (fwd == nullptr) {
|
||||
@ -661,23 +687,30 @@ void EcmaVM::ProcessReferences(const WeakRootVisitor &visitor)
|
||||
}
|
||||
|
||||
// program maps
|
||||
for (auto iter = cachedConstpools_.begin(); iter != cachedConstpools_.end();) {
|
||||
auto &constpools = iter->second;
|
||||
auto size = constpools.size();
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
if (constpools[i].IsHeapObject()) {
|
||||
TaggedObject *obj = constpools[i].GetTaggedObject();
|
||||
auto iterator = cachedConstpools_.begin();
|
||||
while (iterator != cachedConstpools_.end()) {
|
||||
auto &constpools = iterator->second;
|
||||
auto constpoolIter = constpools.begin();
|
||||
while (constpoolIter != constpools.end()) {
|
||||
JSTaggedValue constpoolVal = constpoolIter->second;
|
||||
if (constpoolVal.IsHeapObject()) {
|
||||
TaggedObject *obj = constpoolVal.GetTaggedObject();
|
||||
auto fwd = visitor(obj);
|
||||
if (fwd == nullptr) {
|
||||
auto constantPool = ConstantPool::Cast(obj);
|
||||
JSPandaFileManager::RemoveJSPandaFile(constantPool->GetJSPandaFile());
|
||||
constpools[i] = JSTaggedValue::Hole();
|
||||
constpoolIter = constpools.erase(constpoolIter);
|
||||
continue;
|
||||
} else if (fwd != obj) {
|
||||
constpools[i] = JSTaggedValue(fwd);
|
||||
constpoolIter->second = JSTaggedValue(fwd);
|
||||
}
|
||||
}
|
||||
++constpoolIter;
|
||||
}
|
||||
if (constpools.size() == 0) {
|
||||
JSPandaFileManager::RemoveJSPandaFile(const_cast<JSPandaFile *>(iterator->first));
|
||||
iterator = cachedConstpools_.erase(iterator);
|
||||
} else {
|
||||
++iterator;
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,7 @@ class SlowRuntimeStub;
|
||||
class RequireManager;
|
||||
struct CJSInfo;
|
||||
class QuickFixManager;
|
||||
class ConstantPool;
|
||||
|
||||
enum class MethodIndex : uint8_t {
|
||||
BUILTINS_GLOBAL_CALL_JS_BOUND_FUNCTION = 0,
|
||||
@ -376,10 +377,12 @@ public:
|
||||
return resolveBufferCallback_;
|
||||
}
|
||||
|
||||
void AddConstpool(const JSPandaFile *jsPandaFile, JSTaggedValue constpool, int32_t index, int32_t total = 0);
|
||||
void AddConstpool(const JSPandaFile *jsPandaFile, JSTaggedValue constpool, int32_t index = 0);
|
||||
|
||||
JSTaggedValue FindConstpool(const JSPandaFile *jsPandaFile, int32_t index);
|
||||
|
||||
JSHandle<ConstantPool> FindOrCreateConstPool(const JSPandaFile *jsPandaFile, panda_file::File::EntityId id);
|
||||
|
||||
void StoreBCOffsetInfo(const std::string& methodName, int32_t bcOffset)
|
||||
{
|
||||
exceptionBCList_.emplace_back(std::pair<std::string, int32_t>(methodName, bcOffset));
|
||||
@ -556,7 +559,7 @@ private:
|
||||
CString frameworkAbcFileName_;
|
||||
JSTaggedValue frameworkProgram_ {JSTaggedValue::Hole()};
|
||||
const JSPandaFile *frameworkPandaFile_ {nullptr};
|
||||
CMap<const JSPandaFile *, CVector<JSTaggedValue>> cachedConstpools_ {};
|
||||
CMap<const JSPandaFile *, CMap<int32_t, JSTaggedValue>> cachedConstpools_ {};
|
||||
|
||||
// VM resources.
|
||||
ModuleManager *moduleManager_ {nullptr};
|
||||
|
@ -288,11 +288,9 @@ JSHandle<JSHClass> ClassInfoExtractor::CreateConstructorHClass(JSThread *thread,
|
||||
|
||||
JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, const JSHandle<JSTaggedValue> &base,
|
||||
JSHandle<ClassInfoExtractor> &extractor,
|
||||
const JSHandle<JSTaggedValue> &constpool,
|
||||
const JSHandle<JSTaggedValue> &lexenv)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
JSHandle<ConstantPool> constantPool = JSHandle<ConstantPool>::Cast(constpool);
|
||||
JSHandle<TaggedArray> staticKeys(thread, extractor->GetStaticKeys());
|
||||
JSHandle<TaggedArray> staticProperties(thread, extractor->GetStaticProperties());
|
||||
JSHandle<JSHClass> constructorHClass = ClassInfoExtractor::CreateConstructorHClass(thread, base, staticKeys,
|
||||
@ -321,8 +319,6 @@ JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, con
|
||||
if (propValue->IsJSFunction()) {
|
||||
JSHandle<JSFunction> propFunc = factory->CloneJSFuction(JSHandle<JSFunction>::Cast(propValue));
|
||||
propFunc->SetHomeObject(thread, prototype);
|
||||
JSHandle<Method> propMethod(thread, propFunc->GetMethod());
|
||||
propMethod->SetConstantPool(thread, constantPool.GetTaggedValue());
|
||||
propFunc->SetLexicalEnv(thread, lexenv);
|
||||
propValue.Update(propFunc);
|
||||
}
|
||||
@ -330,14 +326,14 @@ JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, con
|
||||
}
|
||||
} else {
|
||||
JSHandle<NameDictionary> dict = BuildDictionaryProperties(thread, prototype, nonStaticKeys, nonStaticProperties,
|
||||
ClassPropertyType::NON_STATIC, constantPool, lexenv);
|
||||
ClassPropertyType::NON_STATIC, lexenv);
|
||||
prototype->SetProperties(thread, dict);
|
||||
}
|
||||
|
||||
// non-static elements
|
||||
if (UNLIKELY(extractor->GetNonStaticWithElements())) {
|
||||
JSHandle<TaggedArray> nonStaticElements(thread, extractor->GetNonStaticElements());
|
||||
ClassHelper::HandleElementsProperties(thread, prototype, nonStaticElements, constantPool);
|
||||
ClassHelper::HandleElementsProperties(thread, prototype, nonStaticElements);
|
||||
}
|
||||
|
||||
// static
|
||||
@ -349,8 +345,6 @@ JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, con
|
||||
if (propValue->IsJSFunction()) {
|
||||
JSHandle<JSFunction> propFunc = factory->CloneJSFuction(JSHandle<JSFunction>::Cast(propValue));
|
||||
propFunc->SetHomeObject(thread, constructor);
|
||||
JSHandle<Method> propMethod(thread, propFunc->GetMethod());
|
||||
propMethod->SetConstantPool(thread, constantPool.GetTaggedValue());
|
||||
propFunc->SetLexicalEnv(thread, lexenv);
|
||||
propValue.Update(propFunc);
|
||||
}
|
||||
@ -358,15 +352,14 @@ JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, con
|
||||
}
|
||||
} else {
|
||||
JSHandle<NameDictionary> dict = BuildDictionaryProperties(thread, JSHandle<JSObject>(constructor), staticKeys,
|
||||
staticProperties, ClassPropertyType::STATIC,
|
||||
constantPool, lexenv);
|
||||
staticProperties, ClassPropertyType::STATIC, lexenv);
|
||||
constructor->SetProperties(thread, dict);
|
||||
}
|
||||
|
||||
// static elements
|
||||
if (UNLIKELY(extractor->GetStaticWithElements())) {
|
||||
JSHandle<TaggedArray> staticElements(thread, extractor->GetStaticElements());
|
||||
ClassHelper::HandleElementsProperties(thread, JSHandle<JSObject>(constructor), staticElements, constantPool);
|
||||
ClassHelper::HandleElementsProperties(thread, JSHandle<JSObject>(constructor), staticElements);
|
||||
}
|
||||
|
||||
PropertyDescriptor ctorDesc(thread, JSHandle<JSTaggedValue>(constructor), true, false, true);
|
||||
@ -382,12 +375,10 @@ JSHandle<JSFunction> ClassHelper::DefineClassFromExtractor(JSThread *thread, con
|
||||
|
||||
JSHandle<JSFunction> ClassHelper::DefineClassWithIHClass(JSThread *thread, const JSHandle<JSTaggedValue> &base,
|
||||
JSHandle<ClassInfoExtractor> &extractor,
|
||||
const JSHandle<JSTaggedValue> &constpool,
|
||||
const JSHandle<JSTaggedValue> &lexenv,
|
||||
const JSHandle<JSHClass> &ihclass)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
JSHandle<ConstantPool> constantPool = JSHandle<ConstantPool>::Cast(constpool);
|
||||
JSHandle<TaggedArray> staticKeys(thread, extractor->GetStaticKeys());
|
||||
JSHandle<TaggedArray> staticProperties(thread, extractor->GetStaticProperties());
|
||||
JSHandle<JSHClass> constructorHClass = ClassInfoExtractor::CreateConstructorHClass(thread, base, staticKeys,
|
||||
@ -413,8 +404,6 @@ JSHandle<JSFunction> ClassHelper::DefineClassWithIHClass(JSThread *thread, const
|
||||
if (propValue->IsJSFunction()) {
|
||||
JSHandle<JSFunction> propFunc = factory->CloneJSFuction(JSHandle<JSFunction>::Cast(propValue));
|
||||
propFunc->SetHomeObject(thread, prototype);
|
||||
JSHandle<Method> propMethod(thread, propFunc->GetMethod());
|
||||
propMethod->SetConstantPool(thread, constantPool.GetTaggedValue());
|
||||
propFunc->SetLexicalEnv(thread, lexenv);
|
||||
propValue.Update(propFunc);
|
||||
}
|
||||
@ -422,14 +411,14 @@ JSHandle<JSFunction> ClassHelper::DefineClassWithIHClass(JSThread *thread, const
|
||||
}
|
||||
} else {
|
||||
JSHandle<NameDictionary> dict = BuildDictionaryProperties(thread, prototype, nonStaticKeys, nonStaticProperties,
|
||||
ClassPropertyType::NON_STATIC, constantPool, lexenv);
|
||||
ClassPropertyType::NON_STATIC, lexenv);
|
||||
prototype->SetProperties(thread, dict);
|
||||
}
|
||||
|
||||
// non-static elements
|
||||
if (UNLIKELY(extractor->GetNonStaticWithElements())) {
|
||||
JSHandle<TaggedArray> nonStaticElements(thread, extractor->GetNonStaticElements());
|
||||
ClassHelper::HandleElementsProperties(thread, prototype, nonStaticElements, constantPool);
|
||||
ClassHelper::HandleElementsProperties(thread, prototype, nonStaticElements);
|
||||
}
|
||||
|
||||
// static
|
||||
@ -441,8 +430,6 @@ JSHandle<JSFunction> ClassHelper::DefineClassWithIHClass(JSThread *thread, const
|
||||
if (propValue->IsJSFunction()) {
|
||||
JSHandle<JSFunction> propFunc = factory->CloneJSFuction(JSHandle<JSFunction>::Cast(propValue));
|
||||
propFunc->SetHomeObject(thread, constructor);
|
||||
JSHandle<Method> propMethod(thread, propFunc->GetMethod());
|
||||
propMethod->SetConstantPool(thread, constantPool.GetTaggedValue());
|
||||
propFunc->SetLexicalEnv(thread, lexenv);
|
||||
propValue.Update(propFunc);
|
||||
}
|
||||
@ -450,15 +437,14 @@ JSHandle<JSFunction> ClassHelper::DefineClassWithIHClass(JSThread *thread, const
|
||||
}
|
||||
} else {
|
||||
JSHandle<NameDictionary> dict = BuildDictionaryProperties(thread, JSHandle<JSObject>(constructor), staticKeys,
|
||||
staticProperties, ClassPropertyType::STATIC,
|
||||
constantPool, lexenv);
|
||||
staticProperties, ClassPropertyType::STATIC, lexenv);
|
||||
constructor->SetProperties(thread, dict);
|
||||
}
|
||||
|
||||
// static elements
|
||||
if (UNLIKELY(extractor->GetStaticWithElements())) {
|
||||
JSHandle<TaggedArray> staticElements(thread, extractor->GetStaticElements());
|
||||
ClassHelper::HandleElementsProperties(thread, JSHandle<JSObject>(constructor), staticElements, constantPool);
|
||||
ClassHelper::HandleElementsProperties(thread, JSHandle<JSObject>(constructor), staticElements);
|
||||
}
|
||||
|
||||
PropertyDescriptor ctorDesc(thread, JSHandle<JSTaggedValue>(constructor), true, false, true);
|
||||
@ -476,7 +462,6 @@ JSHandle<NameDictionary> ClassHelper::BuildDictionaryProperties(JSThread *thread
|
||||
JSHandle<TaggedArray> &keys,
|
||||
JSHandle<TaggedArray> &properties,
|
||||
ClassPropertyType type,
|
||||
const JSHandle<ConstantPool> &constantpool,
|
||||
const JSHandle<JSTaggedValue> &lexenv)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
@ -519,8 +504,6 @@ JSHandle<NameDictionary> ClassHelper::BuildDictionaryProperties(JSThread *thread
|
||||
JSHandle<JSFunction> propFunc = factory->CloneJSFuction(JSHandle<JSFunction>::Cast(propValue));
|
||||
propFunc->SetHomeObject(thread, object);
|
||||
propFunc->SetLexicalEnv(thread, lexenv);
|
||||
JSHandle<Method> method(thread, propFunc->GetMethod());
|
||||
method->SetConstantPool(thread, constantpool.GetTaggedValue());
|
||||
propValue.Update(propFunc);
|
||||
}
|
||||
JSHandle<NameDictionary> newDict = NameDictionary::PutIfAbsent(thread, dict, propKey, propValue, attributes);
|
||||
@ -530,7 +513,7 @@ JSHandle<NameDictionary> ClassHelper::BuildDictionaryProperties(JSThread *thread
|
||||
}
|
||||
|
||||
void ClassHelper::HandleElementsProperties(JSThread *thread, const JSHandle<JSObject> &object,
|
||||
JSHandle<TaggedArray> &elements, const JSHandle<ConstantPool> &constantpool)
|
||||
JSHandle<TaggedArray> &elements)
|
||||
{
|
||||
JSMutableHandle<JSTaggedValue> elementsKey(thread, JSTaggedValue::Undefined());
|
||||
JSMutableHandle<JSTaggedValue> elementsValue(thread, JSTaggedValue::Undefined());
|
||||
@ -543,8 +526,6 @@ void ClassHelper::HandleElementsProperties(JSThread *thread, const JSHandle<JSOb
|
||||
if (elementsValue->IsJSFunction()) {
|
||||
JSHandle<JSFunction> elementsFunc = JSHandle<JSFunction>::Cast(elementsValue);
|
||||
elementsFunc->SetHomeObject(thread, object);
|
||||
JSHandle<Method> method(thread, elementsFunc->GetMethod());
|
||||
method->SetConstantPool(thread, constantpool.GetTaggedValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,12 +90,10 @@ class ClassHelper {
|
||||
public:
|
||||
static JSHandle<JSFunction> DefineClassFromExtractor(JSThread *thread, const JSHandle<JSTaggedValue> &base,
|
||||
JSHandle<ClassInfoExtractor> &extractor,
|
||||
const JSHandle<JSTaggedValue> &constpool,
|
||||
const JSHandle<JSTaggedValue> &lexenv);
|
||||
|
||||
static JSHandle<JSFunction> DefineClassWithIHClass(JSThread *thread, const JSHandle<JSTaggedValue> &base,
|
||||
JSHandle<ClassInfoExtractor> &extractor,
|
||||
const JSHandle<JSTaggedValue> &constpool,
|
||||
const JSHandle<JSTaggedValue> &lexenv,
|
||||
const JSHandle<JSHClass> &ihclass);
|
||||
|
||||
@ -103,11 +101,10 @@ private:
|
||||
static JSHandle<NameDictionary> BuildDictionaryProperties(JSThread *thread, const JSHandle<JSObject> &object,
|
||||
JSHandle<TaggedArray> &keys,
|
||||
JSHandle<TaggedArray> &properties, ClassPropertyType type,
|
||||
const JSHandle<ConstantPool> &constantpool,
|
||||
const JSHandle<JSTaggedValue> &lexenv);
|
||||
|
||||
static void HandleElementsProperties(JSThread *thread, const JSHandle<JSObject> &object,
|
||||
JSHandle<TaggedArray> &elements, const JSHandle<ConstantPool> &constantpool);
|
||||
JSHandle<TaggedArray> &elements);
|
||||
};
|
||||
} // namespace panda::ecmascript
|
||||
#endif // ECMASCRIPT_JSPANDAFILE_CLASS_INFO_EXTRACTOR_H
|
||||
|
@ -34,7 +34,8 @@ void LiteralDataExtractor::ExtractObjectDatas(JSThread *thread, const JSPandaFil
|
||||
JSHandle<JSTaggedValue> constpool,
|
||||
const CString &entryPoint)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
|
||||
LOG_ECMA(VERBOSE) << "Panda File" << jsPandaFile->GetJSPandaFileDesc();
|
||||
const panda_file::File *pf = jsPandaFile->GetPandaFile();
|
||||
@ -50,7 +51,7 @@ void LiteralDataExtractor::ExtractObjectDatas(JSThread *thread, const JSPandaFil
|
||||
uint32_t methodId;
|
||||
FunctionKind kind;
|
||||
lda.EnumerateLiteralVals(
|
||||
index, [elements, properties, &epos, &ppos, factory, thread, jsPandaFile, pf,
|
||||
index, [elements, properties, &epos, &ppos, vm, factory, thread, jsPandaFile, pf,
|
||||
&methodId, &kind, &constpool, &entryPoint]
|
||||
(const LiteralValue &value, const LiteralTag &tag) {
|
||||
JSTaggedValue jt = JSTaggedValue::Null();
|
||||
@ -96,7 +97,13 @@ void LiteralDataExtractor::ExtractObjectDatas(JSThread *thread, const JSPandaFil
|
||||
methodLiteral->SetFunctionKind(kind);
|
||||
|
||||
JSHandle<Method> method = factory->NewMethod(methodLiteral);
|
||||
method->SetConstantPool(thread, constpool.GetTaggedValue());
|
||||
if (jsPandaFile->IsNewVersion()) {
|
||||
JSHandle<ConstantPool> newConstpool =
|
||||
vm->FindOrCreateConstPool(jsPandaFile, panda_file::File::EntityId(methodId));
|
||||
method->SetConstantPool(thread, newConstpool);
|
||||
} else {
|
||||
method->SetConstantPool(thread, constpool);
|
||||
}
|
||||
JSHandle<JSFunction> jsFunc =
|
||||
DefineMethodInLiteral(thread, jsPandaFile, method, kind, length, entryPoint);
|
||||
jt = jsFunc.GetTaggedValue();
|
||||
@ -154,14 +161,15 @@ JSHandle<TaggedArray> LiteralDataExtractor::GetDatasIgnoreType(JSThread *thread,
|
||||
JSHandle<TaggedArray> LiteralDataExtractor::EnumerateLiteralVals(JSThread *thread, panda_file::LiteralDataAccessor &lda,
|
||||
const JSPandaFile *jsPandaFile, size_t index, JSHandle<JSTaggedValue> constpool, const CString &entryPoint)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
uint32_t num = lda.GetLiteralValsNum(index) / 2; // 2: half
|
||||
JSHandle<TaggedArray> literals = factory->NewOldSpaceTaggedArray(num);
|
||||
uint32_t pos = 0;
|
||||
uint32_t methodId;
|
||||
FunctionKind kind;
|
||||
lda.EnumerateLiteralVals(
|
||||
index, [literals, &pos, factory, thread, jsPandaFile, &methodId, &kind, &constpool, &entryPoint]
|
||||
index, [literals, &pos, vm, factory, thread, jsPandaFile, &methodId, &kind, &constpool, &entryPoint]
|
||||
(const panda_file::LiteralDataAccessor::LiteralValue &value, const LiteralTag &tag) {
|
||||
JSTaggedValue jt = JSTaggedValue::Null();
|
||||
switch (tag) {
|
||||
@ -201,7 +209,13 @@ JSHandle<TaggedArray> LiteralDataExtractor::EnumerateLiteralVals(JSThread *threa
|
||||
ASSERT(methodLiteral != nullptr);
|
||||
|
||||
JSHandle<Method> method = factory->NewMethod(methodLiteral);
|
||||
method->SetConstantPool(thread, constpool.GetTaggedValue());
|
||||
if (jsPandaFile->IsNewVersion()) {
|
||||
JSHandle<ConstantPool> newConstpool =
|
||||
vm->FindOrCreateConstPool(jsPandaFile, panda_file::File::EntityId(methodId));
|
||||
method->SetConstantPool(thread, newConstpool);
|
||||
} else {
|
||||
method->SetConstantPool(thread, constpool);
|
||||
}
|
||||
JSHandle<JSFunction> jsFunc =
|
||||
DefineMethodInLiteral(thread, jsPandaFile, method, kind, length, entryPoint);
|
||||
jt = jsFunc.GetTaggedValue();
|
||||
@ -319,7 +333,8 @@ void LiteralDataExtractor::ExtractObjectDatas(JSThread *thread, const JSPandaFil
|
||||
JSMutableHandle<TaggedArray> properties,
|
||||
JSHandle<JSTaggedValue> constpool, const CString &entry)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
|
||||
LOG_ECMA(VERBOSE) << "Panda File" << jsPandaFile->GetJSPandaFileDesc();
|
||||
const panda_file::File *pf = jsPandaFile->GetPandaFile();
|
||||
@ -335,7 +350,7 @@ void LiteralDataExtractor::ExtractObjectDatas(JSThread *thread, const JSPandaFil
|
||||
uint32_t methodId;
|
||||
FunctionKind kind;
|
||||
lda.EnumerateLiteralVals(
|
||||
index, [elements, properties, &epos, &ppos, factory, thread, jsPandaFile,
|
||||
index, [elements, properties, &epos, &ppos, vm, factory, thread, jsPandaFile,
|
||||
pf, &methodId, &kind, &constpool, &entry]
|
||||
(const LiteralValue &value, const LiteralTag &tag) {
|
||||
JSTaggedValue jt = JSTaggedValue::Null();
|
||||
@ -382,7 +397,13 @@ void LiteralDataExtractor::ExtractObjectDatas(JSThread *thread, const JSPandaFil
|
||||
methodLiteral->SetFunctionKind(kind);
|
||||
|
||||
JSHandle<Method> method = factory->NewMethod(methodLiteral);
|
||||
method->SetConstantPool(thread, constpool.GetTaggedValue());
|
||||
if (jsPandaFile->IsNewVersion()) {
|
||||
JSHandle<ConstantPool> newConstpool =
|
||||
vm->FindOrCreateConstPool(jsPandaFile, panda_file::File::EntityId(methodId));
|
||||
method->SetConstantPool(thread, newConstpool);
|
||||
} else {
|
||||
method->SetConstantPool(thread, constpool);
|
||||
}
|
||||
JSHandle<JSFunction> jsFunc = DefineMethodInLiteral(thread, jsPandaFile, method, kind, length, entry);
|
||||
jt = jsFunc.GetTaggedValue();
|
||||
break;
|
||||
@ -415,7 +436,8 @@ JSHandle<TaggedArray> LiteralDataExtractor::GetDatasIgnoreType(JSThread *thread,
|
||||
JSHandle<JSTaggedValue> constpool,
|
||||
const CString &entryPoint)
|
||||
{
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
|
||||
LOG_ECMA(VERBOSE) << "Panda File" << jsPandaFile->GetJSPandaFileDesc();
|
||||
const panda_file::File *pf = jsPandaFile->GetPandaFile();
|
||||
@ -428,7 +450,7 @@ JSHandle<TaggedArray> LiteralDataExtractor::GetDatasIgnoreType(JSThread *thread,
|
||||
uint32_t methodId;
|
||||
FunctionKind kind;
|
||||
lda.EnumerateLiteralVals(
|
||||
index, [literals, &pos, factory, thread, jsPandaFile, &methodId, &kind, &constpool, &entryPoint]
|
||||
index, [literals, &pos, vm, factory, thread, jsPandaFile, &methodId, &kind, &constpool, &entryPoint]
|
||||
(const panda_file::LiteralDataAccessor::LiteralValue &value, const LiteralTag &tag) {
|
||||
JSTaggedValue jt = JSTaggedValue::Null();
|
||||
switch (tag) {
|
||||
@ -468,7 +490,13 @@ JSHandle<TaggedArray> LiteralDataExtractor::GetDatasIgnoreType(JSThread *thread,
|
||||
ASSERT(methodLiteral != nullptr);
|
||||
|
||||
JSHandle<Method> method = factory->NewMethod(methodLiteral);
|
||||
method->SetConstantPool(thread, constpool.GetTaggedValue());
|
||||
if (jsPandaFile->IsNewVersion()) {
|
||||
JSHandle<ConstantPool> newConstpool =
|
||||
vm->FindOrCreateConstPool(jsPandaFile, panda_file::File::EntityId(methodId));
|
||||
method->SetConstantPool(thread, newConstpool);
|
||||
} else {
|
||||
method->SetConstantPool(thread, constpool);
|
||||
}
|
||||
JSHandle<JSFunction> jsFunc =
|
||||
DefineMethodInLiteral(thread, jsPandaFile, method, kind, length, entryPoint);
|
||||
jt = jsFunc.GetTaggedValue();
|
||||
|
@ -135,34 +135,25 @@ JSHandle<Program> PandaFileTranslator::GenerateProgram(EcmaVM *vm, const JSPanda
|
||||
JSThread *thread = vm->GetJSThread();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
JSHandle<Program> program = factory->NewProgram();
|
||||
|
||||
uint32_t mainMethodIndex = jsPandaFile->GetMainMethodIndex(entryPoint.data());
|
||||
int32_t index = 0;
|
||||
int32_t total = 1;
|
||||
bool isNewVersion = jsPandaFile->IsNewVersion();
|
||||
if (isNewVersion) {
|
||||
panda_file::IndexAccessor indexAccessor(
|
||||
*jsPandaFile->GetPandaFile(), panda_file::File::EntityId(mainMethodIndex));
|
||||
index = static_cast<int32_t>(indexAccessor.GetHeaderIndex());
|
||||
total = static_cast<int32_t>(indexAccessor.GetNumHeaders());
|
||||
}
|
||||
|
||||
JSHandle<ConstantPool> constpool;
|
||||
// Parse constpool.
|
||||
JSTaggedValue constpoolVal = vm->FindConstpool(jsPandaFile, index);
|
||||
if (constpoolVal.IsHole()) {
|
||||
if (isNewVersion) {
|
||||
constpool = ConstantPool::CreateConstPool(vm, jsPandaFile, mainMethodIndex);
|
||||
} else {
|
||||
constpool = ParseConstPool(vm, jsPandaFile);
|
||||
}
|
||||
vm->AddConstpool(jsPandaFile, constpool.GetTaggedValue(), index, total);
|
||||
bool isNewVersion = jsPandaFile->IsNewVersion();
|
||||
if (isNewVersion) {
|
||||
constpool = vm->FindOrCreateConstPool(jsPandaFile, panda_file::File::EntityId(mainMethodIndex));
|
||||
} else {
|
||||
constpool = JSHandle<ConstantPool>(thread, constpoolVal);
|
||||
}
|
||||
JSTaggedValue constpoolVal = vm->FindConstpool(jsPandaFile, 0);
|
||||
if (constpoolVal.IsHole()) {
|
||||
constpool = ParseConstPool(vm, jsPandaFile);
|
||||
// 1: old version dont support multi constpool
|
||||
vm->AddConstpool(jsPandaFile, constpool.GetTaggedValue());
|
||||
} else {
|
||||
constpool = JSHandle<ConstantPool>(thread, constpoolVal);
|
||||
}
|
||||
|
||||
if (!jsPandaFile->IsBundlePack() && !isNewVersion) {
|
||||
ParseFuncAndLiteralConstPool(vm, jsPandaFile, entryPoint.data(), constpool);
|
||||
if (!jsPandaFile->IsBundlePack()) {
|
||||
ParseFuncAndLiteralConstPool(vm, jsPandaFile, entryPoint.data(), constpool);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -69,12 +69,13 @@ public:
|
||||
return static_cast<ConstantPool *>(object);
|
||||
}
|
||||
|
||||
static JSHandle<ConstantPool> CreateConstPool(EcmaVM *vm, const JSPandaFile *jsPandaFile, uint32_t methodId)
|
||||
static JSHandle<ConstantPool> CreateConstPool(EcmaVM *vm, const JSPandaFile *jsPandaFile,
|
||||
panda_file::File::EntityId id)
|
||||
{
|
||||
const panda_file::File::IndexHeader *mainIndex =
|
||||
jsPandaFile->GetPandaFile()->GetIndexHeader(panda_file::File::EntityId(methodId));
|
||||
LOG_ECMA_IF(mainIndex == nullptr, FATAL) << "Unknown methodId: " << methodId;
|
||||
auto constpoolSize = mainIndex->method_idx_size + RESERVED_POOL_LENGTH;
|
||||
jsPandaFile->GetPandaFile()->GetIndexHeader(id);
|
||||
LOG_ECMA_IF(mainIndex == nullptr, FATAL) << "Unknown methodId: " << id.GetOffset();
|
||||
auto constpoolSize = mainIndex->method_idx_size;
|
||||
|
||||
JSHandle<ConstantPool> constpool;
|
||||
bool isLoadedAOT = jsPandaFile->IsLoadedAOT();
|
||||
@ -96,6 +97,15 @@ public:
|
||||
return constpool;
|
||||
}
|
||||
|
||||
panda_file::File::EntityId GetEntityId(uint32_t index) const
|
||||
{
|
||||
JSPandaFile *jsPandaFile = GetJSPandaFile();
|
||||
panda_file::File::IndexHeader *indexHeader = GetIndexHeader();
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
Span<const panda_file::File::EntityId> indexs = pf->GetMethodIndex(indexHeader);
|
||||
return indexs[index];
|
||||
}
|
||||
|
||||
inline void SetIndexHeader(const panda_file::File::IndexHeader *indexHeadre)
|
||||
{
|
||||
Barriers::SetPrimitive(GetData(), GetIndexHeaderOffset(), indexHeadre);
|
||||
@ -121,6 +131,7 @@ public:
|
||||
Barriers::SetPrimitive<JSTaggedType>(GetData(), offset, initValue.GetRawData());
|
||||
}
|
||||
SetJSPandaFile(nullptr);
|
||||
SetIndexHeader(nullptr);
|
||||
}
|
||||
|
||||
inline uint32_t GetCacheLength() const
|
||||
@ -162,28 +173,18 @@ public:
|
||||
}
|
||||
|
||||
if (val.IsHole()) {
|
||||
EcmaHandleScope handleScope(thread);
|
||||
JSHandle<ConstantPool> constpoolHandle(thread, constpool);
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
|
||||
panda_file::File::IndexHeader *indexHeader = taggedPool->GetIndexHeader();
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
Span<const panda_file::File::EntityId> indexs = pf->GetMethodIndex(indexHeader);
|
||||
panda_file::File::EntityId id = indexs[index];
|
||||
|
||||
ASSERT(jsPandaFile->IsNewVersion());
|
||||
panda_file::File::EntityId id = constpoolHandle->GetEntityId(index);
|
||||
MethodLiteral *methodLiteral = jsPandaFile->FindMethodLiteral(id.GetOffset());
|
||||
ASSERT(methodLiteral != nullptr);
|
||||
|
||||
EcmaHandleScope handleScope(thread);
|
||||
JSHandle<Method> method = factory->NewMethod(methodLiteral);
|
||||
|
||||
panda_file::IndexAccessor newIndexAccessor(*pf, id);
|
||||
auto constpoolIndex = newIndexAccessor.GetHeaderIndex();
|
||||
JSTaggedValue newConstpool = vm->FindConstpool(jsPandaFile, constpoolIndex);
|
||||
if (newConstpool.IsHole()) {
|
||||
newConstpool = ConstantPool::CreateConstPool(vm, jsPandaFile, id.GetOffset()).GetTaggedValue();
|
||||
vm->AddConstpool(jsPandaFile, newConstpool, constpoolIndex);
|
||||
}
|
||||
JSHandle<ConstantPool> newConstpool = vm->FindOrCreateConstPool(jsPandaFile, id);
|
||||
method->SetConstantPool(thread, newConstpool);
|
||||
if (isLoadedAOT) {
|
||||
vm->GetAOTFileManager()->SetAOTFuncEntry(jsPandaFile, *method, entryIndex);
|
||||
@ -210,25 +211,17 @@ public:
|
||||
}
|
||||
|
||||
if (val.IsHole()) {
|
||||
EcmaHandleScope handleScope(thread);
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
|
||||
panda_file::File::IndexHeader *indexHeader = constpool->GetIndexHeader();
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
Span<const panda_file::File::EntityId> indexs = pf->GetMethodIndex(indexHeader);
|
||||
panda_file::File::EntityId id = indexs[index];
|
||||
|
||||
ASSERT(jsPandaFile->IsNewVersion());
|
||||
panda_file::File::EntityId id = constpool->GetEntityId(index);
|
||||
MethodLiteral *methodLiteral = jsPandaFile->FindMethodLiteral(id.GetOffset());
|
||||
ASSERT(methodLiteral != nullptr);
|
||||
JSHandle<Method> method = factory->NewMethod(methodLiteral);
|
||||
|
||||
panda_file::IndexAccessor newIndexAccessor(*pf, id);
|
||||
auto constpoolIndex = newIndexAccessor.GetHeaderIndex();
|
||||
JSTaggedValue newConstpool = vm->FindConstpool(jsPandaFile, constpoolIndex);
|
||||
if (newConstpool.IsHole()) {
|
||||
newConstpool = ConstantPool::CreateConstPool(vm, jsPandaFile, id.GetOffset()).GetTaggedValue();
|
||||
vm->AddConstpool(jsPandaFile, newConstpool, constpoolIndex);
|
||||
}
|
||||
JSHandle<ConstantPool> newConstpool = vm->FindOrCreateConstPool(jsPandaFile, id);
|
||||
method->SetConstantPool(thread, newConstpool);
|
||||
if (isLoadedAOT) {
|
||||
vm->GetAOTFileManager()->SetAOTFuncEntry(jsPandaFile, *method, entryIndex);
|
||||
@ -247,26 +240,13 @@ public:
|
||||
{
|
||||
auto val = constpool->Get(literal);
|
||||
if (val.IsHole()) {
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
EcmaHandleScope handleScope(thread);
|
||||
|
||||
JSPandaFile *jsPandaFile = constpool->GetJSPandaFile();
|
||||
panda_file::File::IndexHeader *indexHeader = constpool->GetIndexHeader();
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
Span<const panda_file::File::EntityId> indexs = pf->GetMethodIndex(indexHeader);
|
||||
panda_file::File::EntityId literalId = indexs[literal];
|
||||
|
||||
panda_file::IndexAccessor newIndexAccessor(*pf, literalId);
|
||||
auto constpoolIndex = newIndexAccessor.GetHeaderIndex();
|
||||
JSHandle<ConstantPool> newConstpoolHandle;
|
||||
JSTaggedValue newConstpool = vm->FindConstpool(jsPandaFile, constpoolIndex);
|
||||
if (newConstpool.IsHole()) {
|
||||
newConstpoolHandle = ConstantPool::CreateConstPool(vm, jsPandaFile, literalId.GetOffset());
|
||||
vm->AddConstpool(jsPandaFile, newConstpoolHandle.GetTaggedValue(), constpoolIndex);
|
||||
} else {
|
||||
newConstpoolHandle = JSHandle<ConstantPool>(thread, newConstpool);
|
||||
}
|
||||
ASSERT(jsPandaFile->IsNewVersion());
|
||||
panda_file::File::EntityId literalId = constpool->GetEntityId(literal);
|
||||
JSHandle<TaggedArray> literalArray = LiteralDataExtractor::GetDatasIgnoreType(
|
||||
thread, jsPandaFile, literalId, JSHandle<JSTaggedValue>(newConstpoolHandle), entry);
|
||||
thread, jsPandaFile, literalId, JSHandle<JSTaggedValue>(constpool), entry);
|
||||
|
||||
val = literalArray.GetTaggedValue();
|
||||
constpool->Set(thread, literal, val);
|
||||
@ -284,12 +264,12 @@ public:
|
||||
|
||||
auto val = taggedPool->Get(index);
|
||||
if (val.IsHole()) {
|
||||
EcmaHandleScope handleScope(thread);
|
||||
|
||||
JSHandle<ConstantPool> constpoolHandle(thread, constpool);
|
||||
JSPandaFile *jsPandaFile = taggedPool->GetJSPandaFile();
|
||||
panda_file::File::IndexHeader *indexHeader = taggedPool->GetIndexHeader();
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
Span<const panda_file::File::EntityId> indexs = pf->GetMethodIndex(indexHeader);
|
||||
panda_file::File::EntityId id = indexs[index];
|
||||
ASSERT(jsPandaFile->IsNewVersion());
|
||||
panda_file::File::EntityId id = taggedPool->GetEntityId(index);
|
||||
|
||||
// New inst
|
||||
switch (type)
|
||||
@ -317,9 +297,7 @@ public:
|
||||
case ConstPoolType::ARRAY_LITERAL: {
|
||||
JSHandle<TaggedArray> literal = LiteralDataExtractor::GetDatasIgnoreType(
|
||||
thread, jsPandaFile, id, JSHandle<JSTaggedValue>(constpoolHandle), entry);
|
||||
|
||||
uint32_t length = literal->GetLength();
|
||||
|
||||
JSHandle<JSArray> arr(JSArray::ArrayCreate(thread, JSTaggedNumber(length)));
|
||||
arr->SetElements(thread, literal);
|
||||
val = arr.GetTaggedValue();
|
||||
@ -348,18 +326,16 @@ public:
|
||||
const ConstantPool *taggedPool = ConstantPool::Cast(constpool.GetTaggedObject());
|
||||
auto val = taggedPool->Get(index);
|
||||
if (val.IsHole()) {
|
||||
JSHandle<ConstantPool> constpoolHandle(thread, constpool);
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
EcmaHandleScope handleScope(thread);
|
||||
|
||||
JSPandaFile *jsPandaFile = taggedPool->GetJSPandaFile();
|
||||
panda_file::File::IndexHeader *indexHeader = taggedPool->GetIndexHeader();
|
||||
panda_file::File::EntityId id = taggedPool->GetEntityId(index);
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
Span<const panda_file::File::EntityId> indexs = pf->GetMethodIndex(indexHeader);
|
||||
panda_file::File::EntityId id = indexs[index];
|
||||
|
||||
auto foundStr = pf->GetStringData(id);
|
||||
|
||||
EcmaVM *vm = thread->GetEcmaVM();
|
||||
ObjectFactory *factory = vm->GetFactory();
|
||||
JSHandle<ConstantPool> constpoolHandle(thread, constpool);
|
||||
auto string = factory->GetRawStringFromStringTable(
|
||||
foundStr.data, foundStr.utf16_length, foundStr.is_ascii, MemSpaceType::OLD_SPACE);
|
||||
val = JSTaggedValue(string);
|
||||
|
@ -156,28 +156,29 @@ CVector<JSHandle<Program>> QuickFixLoader::ParseAllConstpoolWithMerge(JSThread *
|
||||
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
|
||||
JSHandle<JSHClass> hclass = JSHandle<JSHClass>::Cast(vm->GetGlobalEnv()->GetFunctionClassWithProto());
|
||||
|
||||
bool isNewVersion = jsPandaFile->IsNewVersion();
|
||||
JSHandle<ConstantPool> constpool;
|
||||
JSTaggedValue constpoolValue = vm->FindConstpool(jsPandaFile, 0);
|
||||
if (constpoolValue.IsHole()) {
|
||||
if (isNewVersion) {
|
||||
const CString &filename = jsPandaFile->GetJSPandaFileDesc();
|
||||
const CString &filename = jsPandaFile->GetJSPandaFileDesc();
|
||||
#if defined(PANDA_TARGET_LINUX)
|
||||
CString entry = JSPandaFile::ParseRecordName(filename);
|
||||
CString entry = JSPandaFile::ParseRecordName(filename);
|
||||
#else
|
||||
CString entry = JSPandaFile::ParseOhmUrl(filename);
|
||||
CString entry = JSPandaFile::ParseOhmUrl(filename);
|
||||
#endif
|
||||
uint32_t mainMethodIndex = jsPandaFile->GetMainMethodIndex(entry);
|
||||
ASSERT(mainMethodIndex != 0);
|
||||
constpool = ConstantPool::CreateConstPool(vm, jsPandaFile, mainMethodIndex);
|
||||
} else {
|
||||
constpool = PandaFileTranslator::ParseConstPool(vm, jsPandaFile);
|
||||
}
|
||||
int32_t index = 0;
|
||||
int32_t total = 1;
|
||||
vm->AddConstpool(jsPandaFile, constpool.GetTaggedValue(), index, total);
|
||||
uint32_t mainMethodIndex = jsPandaFile->GetMainMethodIndex(entry);
|
||||
ASSERT(mainMethodIndex != 0);
|
||||
|
||||
JSHandle<ConstantPool> constpool;
|
||||
bool isNewVersion = jsPandaFile->IsNewVersion();
|
||||
if (isNewVersion) {
|
||||
constpool = vm->FindOrCreateConstPool(jsPandaFile, panda_file::File::EntityId(mainMethodIndex));
|
||||
GenerateConstpoolCache(thread, jsPandaFile, constpool);
|
||||
} else {
|
||||
constpool = JSHandle<ConstantPool>(thread, constpoolValue);
|
||||
JSTaggedValue constpoolVal = vm->FindConstpool(jsPandaFile, 0);
|
||||
if (constpoolVal.IsHole()) {
|
||||
constpool = PandaFileTranslator::ParseConstPool(vm, jsPandaFile);
|
||||
// 1: old version dont support multi constpool
|
||||
vm->AddConstpool(jsPandaFile, constpool.GetTaggedValue());
|
||||
} else {
|
||||
constpool = JSHandle<ConstantPool>(thread, constpoolVal);
|
||||
}
|
||||
}
|
||||
|
||||
CVector<JSHandle<Program>> programs;
|
||||
|
@ -41,6 +41,9 @@ void Log::SetLogLevelFromString(const std::string& level)
|
||||
if (level == "debug") {
|
||||
level_ = DEBUG;
|
||||
}
|
||||
if (level == "verbose") {
|
||||
level_ = VERBOSE;
|
||||
}
|
||||
}
|
||||
|
||||
void Log::SetLogComponentFromString(const std::vector<std::string>& components)
|
||||
|
@ -746,7 +746,7 @@ JSTaggedValue RuntimeStubs::RuntimeCreateClassWithBuffer(JSThread *thread,
|
||||
JSHandle<ClassInfoExtractor> extractor = factory->NewClassInfoExtractor(method);
|
||||
|
||||
ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, literalHandle);
|
||||
JSHandle<JSFunction> cls = ClassHelper::DefineClassFromExtractor(thread, base, extractor, constpool, lexenv);
|
||||
JSHandle<JSFunction> cls = ClassHelper::DefineClassFromExtractor(thread, base, extractor, lexenv);
|
||||
|
||||
RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
@ -777,7 +777,7 @@ JSTaggedValue RuntimeStubs::RuntimeCreateClassWithIHClass(JSThread *thread,
|
||||
JSHandle<ClassInfoExtractor> extractor = factory->NewClassInfoExtractor(method);
|
||||
|
||||
ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, literalHandle);
|
||||
JSHandle<JSFunction> cls = ClassHelper::DefineClassWithIHClass(thread, base, extractor, constpool, lexenv, ihclass);
|
||||
JSHandle<JSFunction> cls = ClassHelper::DefineClassWithIHClass(thread, base, extractor, lexenv, ihclass);
|
||||
|
||||
RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
|
@ -57,9 +57,7 @@ def judge_output(args):
|
||||
try:
|
||||
out, err = subp.communicate(timeout=timeout_limit)
|
||||
except subprocess.TimeoutExpired:
|
||||
print('Run [', cmd, '] timeout, timeout_limit = ', timeout_limit, 's')
|
||||
subp.kill()
|
||||
out, err = subp.communicate()
|
||||
raise RuntimeError('Run [', cmd, '] timeout, timeout_limit = ', timeout_limit, 's')
|
||||
|
||||
if args.expect_output:
|
||||
returncode = str(subp.returncode)
|
||||
|
@ -65,7 +65,11 @@ group("ark_js_moduletest") {
|
||||
]
|
||||
if (!is_debug) {
|
||||
deps += [
|
||||
# "weaktransitions:weaktransitionsAsmAction",
|
||||
"multiconstpoolarray:multiconstpoolarrayAction",
|
||||
"multiconstpoolclass:multiconstpoolclassAction",
|
||||
"multiconstpoolconstructor:multiconstpoolconstructorAction",
|
||||
"multiconstpoolfunc:multiconstpoolfuncAction",
|
||||
"multiconstpoolobj:multiconstpoolobjAction",
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -122,7 +126,11 @@ group("ark_asm_test") {
|
||||
]
|
||||
if (!is_debug) {
|
||||
deps += [
|
||||
# "weaktransitions:weaktransitionsAsmAction",
|
||||
"multiconstpoolarray:multiconstpoolarrayAsmAction",
|
||||
"multiconstpoolclass:multiconstpoolclassAsmAction",
|
||||
"multiconstpoolconstructor:multiconstpoolconstructorAsmAction",
|
||||
"multiconstpoolfunc:multiconstpoolfuncAsmAction",
|
||||
"multiconstpoolobj:multiconstpoolobjAsmAction",
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -174,8 +182,11 @@ group("ark_asm_single_step_test") {
|
||||
]
|
||||
if (!is_debug) {
|
||||
deps += [
|
||||
# "weaktransitions:weaktransitionsAsmSingleStepAction",
|
||||
"wrapperclassfunc:wrapperclassfuncAsmSingleStepAction",
|
||||
"multiconstpoolarray:multiconstpoolarrayAsmSingleStepAction",
|
||||
"multiconstpoolclass:multiconstpoolclassAsmSingleStepAction",
|
||||
"multiconstpoolconstructor:multiconstpoolconstructorAsmSingleStepAction",
|
||||
"multiconstpoolfunc:multiconstpoolfuncAsmSingleStepAction",
|
||||
"multiconstpoolobj:multiconstpoolobjAsmSingleStepAction",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
18
test/moduletest/multiconstpoolarray/BUILD.gn
Normal file
18
test/moduletest/multiconstpoolarray/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_moduletest_action("multiconstpoolarray") {
|
||||
deps = []
|
||||
}
|
14
test/moduletest/multiconstpoolarray/expect_output.txt
Normal file
14
test/moduletest/multiconstpoolarray/expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# 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.
|
||||
|
||||
foo foo2
|
12797
test/moduletest/multiconstpoolarray/multiconstpoolarray.js
Normal file
12797
test/moduletest/multiconstpoolarray/multiconstpoolarray.js
Normal file
File diff suppressed because it is too large
Load Diff
18
test/moduletest/multiconstpoolclass/BUILD.gn
Normal file
18
test/moduletest/multiconstpoolclass/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_moduletest_action("multiconstpoolclass") {
|
||||
deps = []
|
||||
}
|
15
test/moduletest/multiconstpoolclass/expect_output.txt
Normal file
15
test/moduletest/multiconstpoolclass/expect_output.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
|
||||
A
|
||||
foo foo2
|
12801
test/moduletest/multiconstpoolclass/multiconstpoolclass.js
Normal file
12801
test/moduletest/multiconstpoolclass/multiconstpoolclass.js
Normal file
File diff suppressed because it is too large
Load Diff
18
test/moduletest/multiconstpoolconstructor/BUILD.gn
Normal file
18
test/moduletest/multiconstpoolconstructor/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_moduletest_action("multiconstpoolconstructor") {
|
||||
deps = []
|
||||
}
|
15
test/moduletest/multiconstpoolconstructor/expect_output.txt
Normal file
15
test/moduletest/multiconstpoolconstructor/expect_output.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
|
||||
A
|
||||
foo
|
12798
test/moduletest/multiconstpoolconstructor/multiconstpoolconstructor.js
Normal file
12798
test/moduletest/multiconstpoolconstructor/multiconstpoolconstructor.js
Normal file
File diff suppressed because it is too large
Load Diff
18
test/moduletest/multiconstpoolfunc/BUILD.gn
Normal file
18
test/moduletest/multiconstpoolfunc/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_moduletest_action("multiconstpoolfunc") {
|
||||
deps = []
|
||||
}
|
14
test/moduletest/multiconstpoolfunc/expect_output.txt
Normal file
14
test/moduletest/multiconstpoolfunc/expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# 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.
|
||||
|
||||
foo foo2
|
12796
test/moduletest/multiconstpoolfunc/multiconstpoolfunc.js
Normal file
12796
test/moduletest/multiconstpoolfunc/multiconstpoolfunc.js
Normal file
File diff suppressed because it is too large
Load Diff
18
test/moduletest/multiconstpoolobj/BUILD.gn
Normal file
18
test/moduletest/multiconstpoolobj/BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_moduletest_action("multiconstpoolobj") {
|
||||
deps = []
|
||||
}
|
14
test/moduletest/multiconstpoolobj/expect_output.txt
Normal file
14
test/moduletest/multiconstpoolobj/expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# 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.
|
||||
|
||||
foo foo2
|
12797
test/moduletest/multiconstpoolobj/multiconstpoolobj.js
Normal file
12797
test/moduletest/multiconstpoolobj/multiconstpoolobj.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user