2022-01-06 02:26:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
#include "bytecode_circuit_builder.h"
|
2022-03-07 02:58:13 +00:00
|
|
|
#include "ecmascript/ts_types/ts_loader.h"
|
2022-01-06 02:26:19 +00:00
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
namespace panda::ecmascript::kungfu {
|
2022-03-07 02:58:13 +00:00
|
|
|
void BytecodeCircuitBuilder::BytecodeToCircuit()
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-03-07 02:58:13 +00:00
|
|
|
auto curPc = pcArray_.front();
|
2022-01-06 02:26:19 +00:00
|
|
|
auto prePc = curPc;
|
2022-01-18 04:02:20 +00:00
|
|
|
std::map<uint8_t *, uint8_t *> byteCodeCurPrePc;
|
2022-01-19 01:11:02 +00:00
|
|
|
std::vector<CfgInfo> bytecodeBlockInfos;
|
2022-01-06 02:26:19 +00:00
|
|
|
auto startPc = curPc;
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(startPc, SplitKind::START, std::vector<uint8_t *>(1, startPc));
|
2022-01-06 02:26:19 +00:00
|
|
|
byteCodeCurPrePc.insert(std::pair<uint8_t *, uint8_t *>(curPc, prePc));
|
2022-03-07 02:58:13 +00:00
|
|
|
for (size_t i = 1; i < pcArray_.size() - 1; i++) {
|
|
|
|
curPc = pcArray_[i];
|
2022-01-06 02:26:19 +00:00
|
|
|
byteCodeCurPrePc.insert(std::pair<uint8_t *, uint8_t *>(curPc, prePc));
|
|
|
|
prePc = curPc;
|
2022-01-19 01:11:02 +00:00
|
|
|
CollectBytecodeBlockInfo(curPc, bytecodeBlockInfos);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-14 09:48:52 +00:00
|
|
|
// handle empty
|
2022-03-07 02:58:13 +00:00
|
|
|
byteCodeCurPrePc.insert(std::pair<uint8_t *, uint8_t *>(pcArray_[pcArray_.size() - 1], prePc));
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
// collect try catch block info
|
2022-03-07 02:58:13 +00:00
|
|
|
auto exceptionInfo = CollectTryCatchBlockInfo(byteCodeCurPrePc, bytecodeBlockInfos);
|
2022-01-06 02:26:19 +00:00
|
|
|
|
2022-03-07 02:58:13 +00:00
|
|
|
// Complete bytecode block Information
|
2022-01-19 01:11:02 +00:00
|
|
|
CompleteBytecodeBlockInfo(byteCodeCurPrePc, bytecodeBlockInfos);
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
// Building the basic block diagram of bytecode
|
2022-03-07 02:58:13 +00:00
|
|
|
BuildBasicBlocks(exceptionInfo, bytecodeBlockInfos, byteCodeCurPrePc);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::CollectBytecodeBlockInfo(uint8_t *pc, std::vector<CfgInfo> &bytecodeBlockInfos)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
auto opcode = static_cast<EcmaOpcode>(*pc);
|
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::JMP_IMM8: {
|
|
|
|
int8_t offset = READ_INST_8_0();
|
|
|
|
std::vector<uint8_t *> temp;
|
|
|
|
temp.emplace_back(pc + offset);
|
|
|
|
// current basic block end
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp);
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::TWO, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::TWO));
|
2022-01-06 02:26:19 +00:00
|
|
|
// jump basic block start
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START, std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::JMP_IMM16: {
|
|
|
|
int16_t offset = READ_INST_16_0();
|
|
|
|
std::vector<uint8_t *> temp;
|
|
|
|
temp.emplace_back(pc + offset);
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp);
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::THREE, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::THREE));
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START,
|
2022-01-22 11:09:02 +00:00
|
|
|
std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::JMP_IMM32: {
|
|
|
|
int32_t offset = READ_INST_32_0();
|
|
|
|
std::vector<uint8_t *> temp;
|
|
|
|
temp.emplace_back(pc + offset);
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp);
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::FIVE, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::FIVE));
|
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START, std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::JEQZ_IMM8: {
|
|
|
|
std::vector<uint8_t *> temp;
|
2022-01-22 11:09:02 +00:00
|
|
|
temp.emplace_back(pc + BytecodeOffset::TWO); // first successor
|
2022-01-06 02:26:19 +00:00
|
|
|
int8_t offset = READ_INST_8_0();
|
|
|
|
temp.emplace_back(pc + offset); // second successor
|
|
|
|
// condition branch current basic block end
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp);
|
2022-01-06 02:26:19 +00:00
|
|
|
// first branch basic block start
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::TWO, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::TWO));
|
2022-01-06 02:26:19 +00:00
|
|
|
// second branch basic block start
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START, std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::JEQZ_IMM16: {
|
|
|
|
std::vector<uint8_t *> temp;
|
2022-01-22 11:09:02 +00:00
|
|
|
temp.emplace_back(pc + BytecodeOffset::THREE); // first successor
|
2022-01-06 02:26:19 +00:00
|
|
|
int16_t offset = READ_INST_16_0();
|
|
|
|
temp.emplace_back(pc + offset); // second successor
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp); // end
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::THREE, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::THREE));
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START, std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::JNEZ_IMM8: {
|
|
|
|
std::vector<uint8_t *> temp;
|
2022-01-22 11:09:02 +00:00
|
|
|
temp.emplace_back(pc + BytecodeOffset::TWO); // first successor
|
2022-01-06 02:26:19 +00:00
|
|
|
int8_t offset = READ_INST_8_0();
|
2022-01-19 01:11:02 +00:00
|
|
|
temp.emplace_back(pc + offset); // second successor
|
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp);
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::TWO, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::TWO));
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START, std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::JNEZ_IMM16: {
|
|
|
|
std::vector<uint8_t *> temp;
|
2022-01-22 11:09:02 +00:00
|
|
|
temp.emplace_back(pc + BytecodeOffset::THREE); // first successor
|
2022-01-06 02:26:19 +00:00
|
|
|
int8_t offset = READ_INST_16_0();
|
2022-01-19 01:11:02 +00:00
|
|
|
temp.emplace_back(pc + offset); // second successor
|
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, temp);
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + BytecodeOffset::THREE, SplitKind::START,
|
|
|
|
std::vector<uint8_t *>(1, pc + BytecodeOffset::THREE));
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc + offset, SplitKind::START, std::vector<uint8_t *>(1, pc + offset));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::RETURN_DYN:
|
2022-04-01 06:33:39 +00:00
|
|
|
case EcmaOpcode::RETURNUNDEFINED_PREF:
|
2022-01-14 09:48:52 +00:00
|
|
|
case EcmaOpcode::THROWDYN_PREF:
|
|
|
|
case EcmaOpcode::THROWCONSTASSIGNMENT_PREF_V8:
|
|
|
|
case EcmaOpcode::THROWTHROWNOTEXISTS_PREF:
|
|
|
|
case EcmaOpcode::THROWPATTERNNONCOERCIBLE_PREF:
|
|
|
|
case EcmaOpcode::THROWDELETESUPERPROPERTY_PREF: {
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(pc, SplitKind::END, std::vector<uint8_t *>(1, pc));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
2022-04-01 06:33:39 +00:00
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
std::map<std::pair<uint8_t *, uint8_t *>, std::vector<uint8_t *>> BytecodeCircuitBuilder::CollectTryCatchBlockInfo(
|
2022-03-07 02:58:13 +00:00
|
|
|
std::map<uint8_t *, uint8_t*> &byteCodeCurPrePc, std::vector<CfgInfo> &bytecodeBlockInfos)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
// try contains many catch
|
2022-03-07 02:58:13 +00:00
|
|
|
const panda_file::File *file = file_->GetPandaFile();
|
2022-01-06 02:26:19 +00:00
|
|
|
std::map<std::pair<uint8_t *, uint8_t *>, std::vector<uint8_t *>> byteCodeException;
|
2022-03-07 02:58:13 +00:00
|
|
|
panda_file::MethodDataAccessor mda(*file, method_->GetFileId());
|
|
|
|
panda_file::CodeDataAccessor cda(*file, mda.GetCodeId().value());
|
|
|
|
cda.EnumerateTryBlocks([this, &byteCodeCurPrePc, &bytecodeBlockInfos, &byteCodeException](
|
2022-01-18 04:02:20 +00:00
|
|
|
panda_file::CodeDataAccessor::TryBlock &try_block) {
|
2022-01-19 01:11:02 +00:00
|
|
|
auto tryStartOffset = try_block.GetStartPc();
|
|
|
|
auto tryEndOffset = try_block.GetStartPc() + try_block.GetLength();
|
2022-03-07 02:58:13 +00:00
|
|
|
auto tryStartPc = const_cast<uint8_t *>(method_->GetBytecodeArray() + tryStartOffset);
|
|
|
|
auto tryEndPc = const_cast<uint8_t *>(method_->GetBytecodeArray() + tryEndOffset);
|
2022-01-06 02:26:19 +00:00
|
|
|
byteCodeException[std::make_pair(tryStartPc, tryEndPc)] = {};
|
|
|
|
uint32_t pcOffset = panda_file::INVALID_OFFSET;
|
|
|
|
try_block.EnumerateCatchBlocks([&](panda_file::CodeDataAccessor::CatchBlock &catch_block) {
|
|
|
|
pcOffset = catch_block.GetHandlerPc();
|
2022-03-07 02:58:13 +00:00
|
|
|
auto catchBlockPc = const_cast<uint8_t *>(method_->GetBytecodeArray() + pcOffset);
|
2022-01-06 02:26:19 +00:00
|
|
|
// try block associate catch block
|
|
|
|
byteCodeException[std::make_pair(tryStartPc, tryEndPc)].emplace_back(catchBlockPc);
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
// Check whether the previous block of the try block exists.
|
|
|
|
// If yes, add the current block; otherwise, create a new block.
|
|
|
|
bool flag = false;
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < bytecodeBlockInfos.size(); i++) {
|
|
|
|
if (bytecodeBlockInfos[i].splitKind == SplitKind::START) {
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
if (bytecodeBlockInfos[i].pc == byteCodeCurPrePc[tryStartPc]) {
|
2022-01-06 02:26:19 +00:00
|
|
|
flag = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!flag) {
|
|
|
|
// pre block
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(byteCodeCurPrePc[tryStartPc], SplitKind::END,
|
|
|
|
std::vector<uint8_t *>(1, tryStartPc));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
// try block
|
|
|
|
bytecodeBlockInfos.emplace_back(tryStartPc, SplitKind::START, std::vector<uint8_t *>(1, tryStartPc));
|
2022-01-06 02:26:19 +00:00
|
|
|
flag = false;
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < bytecodeBlockInfos.size(); i++) {
|
|
|
|
if (bytecodeBlockInfos[i].splitKind == SplitKind::START) {
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
if (bytecodeBlockInfos[i].pc == byteCodeCurPrePc[tryEndPc]) {
|
2022-01-22 11:09:02 +00:00
|
|
|
auto &succs = bytecodeBlockInfos[i].succs;
|
2022-01-19 01:11:02 +00:00
|
|
|
auto iter = std::find(succs.begin(), succs.end(), bytecodeBlockInfos[i].pc);
|
2022-01-06 02:26:19 +00:00
|
|
|
if (iter == succs.end()) {
|
2022-01-19 01:11:02 +00:00
|
|
|
auto opcode = static_cast<EcmaOpcode>(*(bytecodeBlockInfos[i].pc));
|
2022-01-06 02:26:19 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::JMP_IMM8:
|
|
|
|
case EcmaOpcode::JMP_IMM16:
|
|
|
|
case EcmaOpcode::JMP_IMM32:
|
|
|
|
case EcmaOpcode::JEQZ_IMM8:
|
|
|
|
case EcmaOpcode::JEQZ_IMM16:
|
|
|
|
case EcmaOpcode::JNEZ_IMM8:
|
|
|
|
case EcmaOpcode::JNEZ_IMM16:
|
|
|
|
case EcmaOpcode::RETURN_DYN:
|
|
|
|
case EcmaOpcode::RETURNUNDEFINED_PREF:
|
|
|
|
case EcmaOpcode::THROWDYN_PREF: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
succs.emplace_back(tryEndPc);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
flag = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!flag) {
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(byteCodeCurPrePc[tryEndPc], SplitKind::END,
|
|
|
|
std::vector<uint8_t *>(1, tryEndPc));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-22 11:09:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(tryEndPc, SplitKind::START, std::vector<uint8_t *>(1, tryEndPc)); // next block
|
2022-01-06 02:26:19 +00:00
|
|
|
return true;
|
|
|
|
});
|
|
|
|
return byteCodeException;
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::CompleteBytecodeBlockInfo(std::map<uint8_t *, uint8_t *> &byteCodeCurPrePc,
|
2022-01-19 01:11:02 +00:00
|
|
|
std::vector<CfgInfo> &bytecodeBlockInfos)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-19 01:11:02 +00:00
|
|
|
std::sort(bytecodeBlockInfos.begin(), bytecodeBlockInfos.end());
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-19 01:11:02 +00:00
|
|
|
PrintCollectBlockInfo(bytecodeBlockInfos);
|
2022-01-06 02:26:19 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Deduplicate
|
2022-01-19 01:11:02 +00:00
|
|
|
auto deduplicateIndex = std::unique(bytecodeBlockInfos.begin(), bytecodeBlockInfos.end());
|
|
|
|
bytecodeBlockInfos.erase(deduplicateIndex, bytecodeBlockInfos.end());
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
// Supplementary block information
|
|
|
|
std::vector<uint8_t *> endBlockPc;
|
|
|
|
std::vector<uint8_t *> startBlockPc;
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < bytecodeBlockInfos.size() - 1; i++) {
|
|
|
|
if (bytecodeBlockInfos[i].splitKind == bytecodeBlockInfos[i + 1].splitKind &&
|
|
|
|
bytecodeBlockInfos[i].splitKind == SplitKind::START) {
|
|
|
|
auto prePc = byteCodeCurPrePc[bytecodeBlockInfos[i + 1].pc];
|
2022-01-06 02:26:19 +00:00
|
|
|
endBlockPc.emplace_back(prePc); // Previous instruction of current instruction
|
2022-01-19 01:11:02 +00:00
|
|
|
endBlockPc.emplace_back(bytecodeBlockInfos[i + 1].pc); // current instruction
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
if (bytecodeBlockInfos[i].splitKind == bytecodeBlockInfos[i + 1].splitKind &&
|
|
|
|
bytecodeBlockInfos[i].splitKind == SplitKind::END) {
|
|
|
|
auto tempPc = bytecodeBlockInfos[i].pc;
|
2022-01-06 02:26:19 +00:00
|
|
|
auto findItem = std::find_if(byteCodeCurPrePc.begin(), byteCodeCurPrePc.end(),
|
2022-01-18 04:02:20 +00:00
|
|
|
[tempPc](const std::map<uint8_t *, uint8_t *>::value_type item) {
|
|
|
|
return item.second == tempPc;
|
|
|
|
});
|
|
|
|
if (findItem != byteCodeCurPrePc.end()) {
|
2022-01-06 02:26:19 +00:00
|
|
|
startBlockPc.emplace_back((*findItem).first);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Supplementary end block info
|
2022-01-22 11:09:02 +00:00
|
|
|
for (auto iter = endBlockPc.begin(); iter != endBlockPc.end(); iter += 2) { // 2: index
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(*iter, SplitKind::END,
|
|
|
|
std::vector<uint8_t *>(1, *(iter + 1)));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
// Supplementary start block info
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto iter = startBlockPc.begin(); iter != startBlockPc.end(); iter++) {
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(*iter, SplitKind::START, std::vector<uint8_t *>(1, *iter));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Deduplicate successor
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < bytecodeBlockInfos.size(); i++) {
|
|
|
|
if (bytecodeBlockInfos[i].splitKind == SplitKind::END) {
|
|
|
|
std::set<uint8_t *> tempSet(bytecodeBlockInfos[i].succs.begin(),
|
|
|
|
bytecodeBlockInfos[i].succs.end());
|
|
|
|
bytecodeBlockInfos[i].succs.assign(tempSet.begin(), tempSet.end());
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
std::sort(bytecodeBlockInfos.begin(), bytecodeBlockInfos.end());
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
// handling jumps to an empty block
|
2022-01-19 01:11:02 +00:00
|
|
|
auto endPc = bytecodeBlockInfos[bytecodeBlockInfos.size() - 1].pc;
|
2022-01-06 02:26:19 +00:00
|
|
|
auto iter = --byteCodeCurPrePc.end();
|
|
|
|
if (endPc == iter->first) {
|
2022-01-19 01:11:02 +00:00
|
|
|
bytecodeBlockInfos.emplace_back(endPc, SplitKind::END, std::vector<uint8_t *>(1, endPc));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
// Deduplicate
|
2022-01-19 01:11:02 +00:00
|
|
|
deduplicateIndex = std::unique(bytecodeBlockInfos.begin(), bytecodeBlockInfos.end());
|
|
|
|
bytecodeBlockInfos.erase(deduplicateIndex, bytecodeBlockInfos.end());
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-19 01:11:02 +00:00
|
|
|
PrintCollectBlockInfo(bytecodeBlockInfos);
|
2022-01-06 02:26:19 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-03-07 02:58:13 +00:00
|
|
|
void BytecodeCircuitBuilder::BuildBasicBlocks(std::map<std::pair<uint8_t *, uint8_t *>,
|
|
|
|
std::vector<uint8_t *>> &exception,
|
2022-01-22 11:09:02 +00:00
|
|
|
std::vector<CfgInfo> &bytecodeBlockInfo,
|
2022-03-25 01:31:39 +00:00
|
|
|
[[maybe_unused]] std::map<uint8_t *, uint8_t *> &byteCodeCurPrePc)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-22 11:09:02 +00:00
|
|
|
std::map<uint8_t *, BytecodeRegion *> startPcToBB; // [start, bb]
|
|
|
|
std::map<uint8_t *, BytecodeRegion *> endPcToBB; // [end, bb]
|
|
|
|
BytecodeGraph byteCodeGraph;
|
2022-01-06 02:26:19 +00:00
|
|
|
auto &blocks = byteCodeGraph.graph;
|
2022-03-07 02:58:13 +00:00
|
|
|
byteCodeGraph.method = method_;
|
2022-01-19 01:11:02 +00:00
|
|
|
blocks.resize(bytecodeBlockInfo.size() / 2); // 2 : half size
|
2022-01-06 02:26:19 +00:00
|
|
|
// build basic block
|
|
|
|
int blockId = 0;
|
|
|
|
int index = 0;
|
2022-01-22 11:09:02 +00:00
|
|
|
for (size_t i = 0; i < bytecodeBlockInfo.size() - 1; i += 2) { // 2:index
|
2022-01-19 01:11:02 +00:00
|
|
|
auto startPc = bytecodeBlockInfo[i].pc;
|
|
|
|
auto endPc = bytecodeBlockInfo[i + 1].pc;
|
2022-01-06 02:26:19 +00:00
|
|
|
auto block = &blocks[index++];
|
|
|
|
block->id = blockId++;
|
|
|
|
block->start = startPc;
|
|
|
|
block->end = endPc;
|
|
|
|
block->preds = {};
|
|
|
|
block->succs = {};
|
2022-01-19 01:11:02 +00:00
|
|
|
startPcToBB[startPc] = block;
|
|
|
|
endPcToBB[endPc] = block;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// add block associate
|
|
|
|
for (size_t i = 0; i < bytecodeBlockInfo.size(); i++) {
|
2022-01-19 01:11:02 +00:00
|
|
|
if (bytecodeBlockInfo[i].splitKind == SplitKind::START) {
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
auto curPc = bytecodeBlockInfo[i].pc;
|
|
|
|
auto &successors = bytecodeBlockInfo[i].succs;
|
2022-01-06 02:26:19 +00:00
|
|
|
for (size_t j = 0; j < successors.size(); j++) {
|
|
|
|
if (successors[j] == curPc) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
auto curBlock = endPcToBB[curPc];
|
|
|
|
auto succsBlock = startPcToBB[successors[j]];
|
2022-01-06 02:26:19 +00:00
|
|
|
curBlock->succs.emplace_back(succsBlock);
|
|
|
|
succsBlock->preds.emplace_back(curBlock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// try catch block associate
|
|
|
|
for (size_t i = 0; i < blocks.size(); i++) {
|
|
|
|
auto pc = blocks[i].start;
|
|
|
|
auto it = exception.begin();
|
2022-01-18 04:02:20 +00:00
|
|
|
for (; it != exception.end(); it++) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (pc < it->first.first || pc >= it->first.second) { // try block interval
|
2022-01-18 04:02:20 +00:00
|
|
|
continue;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
auto catchs = exception[it->first]; // catchs start pc
|
|
|
|
for (size_t j = i + 1; j < blocks.size(); j++) {
|
|
|
|
if (std::find(catchs.begin(), catchs.end(), blocks[j].start) != catchs.end()) {
|
|
|
|
blocks[i].catchs.insert(blocks[i].catchs.begin(), &blocks[j]);
|
|
|
|
blocks[i].succs.emplace_back(&blocks[j]);
|
|
|
|
blocks[j].preds.emplace_back(&blocks[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < blocks.size(); i++) {
|
|
|
|
bbIdToBasicBlock_[blocks[i].id] = &blocks[i];
|
|
|
|
}
|
|
|
|
|
2022-01-06 02:26:19 +00:00
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
PrintGraph(byteCodeGraph.graph);
|
|
|
|
#endif
|
|
|
|
ComputeDominatorTree(byteCodeGraph);
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::ComputeDominatorTree(BytecodeGraph &byteCodeGraph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
auto &graph = byteCodeGraph.graph;
|
|
|
|
// Construct graph backward order
|
2022-01-19 01:11:02 +00:00
|
|
|
std::map<size_t, size_t> bbIdToDfsTimestamp; // (basicblock id, dfs order)
|
2022-01-06 02:26:19 +00:00
|
|
|
size_t timestamp = 0;
|
|
|
|
std::deque<size_t> pendingList;
|
|
|
|
std::vector<size_t> visited(graph.size(), 0);
|
|
|
|
auto basicBlockId = graph[0].id;
|
|
|
|
pendingList.push_back(basicBlockId);
|
|
|
|
while (!pendingList.empty()) {
|
|
|
|
auto &curBlockId = pendingList.back();
|
|
|
|
pendingList.pop_back();
|
2022-01-19 01:11:02 +00:00
|
|
|
bbIdToDfsTimestamp[curBlockId] = timestamp++;
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &succBlock: graph[curBlockId].succs) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (visited[succBlock->id] == 0) {
|
|
|
|
visited[succBlock->id] = 1;
|
|
|
|
pendingList.push_back(succBlock->id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
RemoveDeadRegions(bbIdToDfsTimestamp, byteCodeGraph);
|
2022-01-06 02:26:19 +00:00
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
// print cfg order
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto iter : bbIdToDfsTimestamp) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << "BB_" << iter.first << " depth is : " << iter.second << std::endl;
|
|
|
|
}
|
|
|
|
#endif
|
2022-01-27 08:46:57 +00:00
|
|
|
std::vector<int32_t> immDom(graph.size()); // immediate dominator
|
2022-01-19 01:11:02 +00:00
|
|
|
std::vector<std::vector<size_t>> doms(graph.size()); // dominators set
|
|
|
|
doms[0] = {0};
|
|
|
|
for (size_t i = 1; i < doms.size(); i++) {
|
|
|
|
doms[i].resize(doms.size());
|
|
|
|
std::iota(doms[i].begin(), doms[i].end(), 0);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
bool changed = true;
|
|
|
|
while (changed) {
|
|
|
|
changed = false;
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 1; i < doms.size(); i++) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (graph[i].isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
auto &curDom = doms[i];
|
2022-01-06 02:26:19 +00:00
|
|
|
size_t curDomSize = curDom.size();
|
2022-01-19 01:11:02 +00:00
|
|
|
curDom.resize(doms.size());
|
2022-01-06 02:26:19 +00:00
|
|
|
std::iota(curDom.begin(), curDom.end(), 0);
|
|
|
|
// traverse the predecessor nodes of the current node, Computing Dominators
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &preBlock : graph[i].preds) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::vector<size_t> tmp(curDom.size());
|
2022-01-19 01:11:02 +00:00
|
|
|
auto preDom = doms[preBlock->id];
|
2022-01-22 11:09:02 +00:00
|
|
|
auto it = std::set_intersection(curDom.begin(), curDom.end(), preDom.begin(), preDom.end(),
|
|
|
|
tmp.begin());
|
2022-01-06 02:26:19 +00:00
|
|
|
tmp.resize(it - tmp.begin());
|
|
|
|
curDom = tmp;
|
|
|
|
}
|
|
|
|
auto it = std::find(curDom.begin(), curDom.end(), i);
|
|
|
|
if (it == curDom.end()) {
|
|
|
|
curDom.push_back(i);
|
|
|
|
std::sort(curDom.begin(), curDom.end());
|
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
if (doms[i].size() != curDomSize) {
|
2022-01-06 02:26:19 +00:00
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
// print dominators set
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < doms.size(); i++) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << "block " << i << " dominator blocks has: ";
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto j: doms[i]) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << j << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// compute immediate dominator
|
2022-01-19 01:11:02 +00:00
|
|
|
immDom[0] = doms[0].front();
|
|
|
|
for (size_t i = 1; i < doms.size(); i++) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (graph[i].isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
auto it = std::remove(doms[i].begin(), doms[i].end(), i);
|
|
|
|
doms[i].resize(it - doms[i].begin());
|
|
|
|
immDom[i] = *std::max_element(
|
|
|
|
doms[i].begin(), doms[i].end(), [graph, bbIdToDfsTimestamp](size_t lhs, size_t rhs) -> bool {
|
|
|
|
return bbIdToDfsTimestamp.at(graph[lhs].id) < bbIdToDfsTimestamp.at(graph[rhs].id);
|
|
|
|
});
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
// print immediate dominator
|
2022-01-18 04:02:20 +00:00
|
|
|
for (size_t i = 0; i < immDom.size(); i++) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << i << " immediate dominator: " << immDom[i] << std::endl;
|
|
|
|
}
|
|
|
|
PrintGraph(graph);
|
|
|
|
#endif
|
|
|
|
BuildImmediateDominator(immDom, byteCodeGraph);
|
|
|
|
}
|
|
|
|
|
2022-01-27 08:46:57 +00:00
|
|
|
void BytecodeCircuitBuilder::BuildImmediateDominator(std::vector<int32_t> &immDom, BytecodeGraph &byteCodeGraph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
auto &graph = byteCodeGraph.graph;
|
|
|
|
|
|
|
|
graph[0].iDominator = &graph[0];
|
2022-01-18 04:02:20 +00:00
|
|
|
for (size_t i = 1; i < immDom.size(); i++) {
|
2022-01-19 01:11:02 +00:00
|
|
|
auto dominatedBlock = bbIdToBasicBlock_.at(i);
|
2022-01-06 02:26:19 +00:00
|
|
|
if (dominatedBlock->isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
auto immDomBlock = bbIdToBasicBlock_.at(immDom[i]);
|
2022-01-06 02:26:19 +00:00
|
|
|
dominatedBlock->iDominator = immDomBlock;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto block : graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (block.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
std::cout << "current block " << block.id
|
|
|
|
<< " immediate dominator block id: " << block.iDominator->id << std::endl;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &block : graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (block.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (block.iDominator->id != block.id) {
|
|
|
|
block.iDominator->immDomBlocks.emplace_back(&block);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &block : graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (block.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
std::cout << "block " << block.id << " dominate block has: ";
|
2022-01-06 02:26:19 +00:00
|
|
|
for (size_t i = 0; i < block.immDomBlocks.size(); i++) {
|
|
|
|
std::cout << block.immDomBlocks[i]->id << ",";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
ComputeDomFrontiers(immDom, byteCodeGraph);
|
|
|
|
InsertPhi(byteCodeGraph);
|
2022-01-19 01:11:02 +00:00
|
|
|
UpdateCFG(byteCodeGraph);
|
2022-01-06 02:26:19 +00:00
|
|
|
BuildCircuit(byteCodeGraph);
|
|
|
|
}
|
|
|
|
|
2022-01-27 08:46:57 +00:00
|
|
|
void BytecodeCircuitBuilder::ComputeDomFrontiers(std::vector<int32_t> &immDom, BytecodeGraph &byteCodeGraph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
auto &graph = byteCodeGraph.graph;
|
2022-01-22 11:09:02 +00:00
|
|
|
std::vector<std::set<BytecodeRegion *>> domFrontiers(immDom.size());
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &bb : graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-22 11:09:02 +00:00
|
|
|
if (bb.preds.size() < 2) { // 2: pred num
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
for (size_t i = 0; i < bb.preds.size(); i++) {
|
|
|
|
auto runner = bb.preds[i];
|
2022-01-18 04:02:20 +00:00
|
|
|
while (runner->id != immDom[bb.id]) {
|
2022-01-06 02:26:19 +00:00
|
|
|
domFrontiers[runner->id].insert(&bb);
|
2022-01-19 01:11:02 +00:00
|
|
|
runner = bbIdToBasicBlock_.at(immDom[runner->id]);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t i = 0; i < domFrontiers.size(); i++) {
|
|
|
|
for (auto iter = domFrontiers[i].begin(); iter != domFrontiers[i].end(); iter++) {
|
|
|
|
graph[i].domFrontiers.emplace_back(*iter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
for (size_t i = 0; i < domFrontiers.size(); i++) {
|
|
|
|
std::cout << "basic block " << i << " dominate Frontiers is: ";
|
|
|
|
for (auto iter = domFrontiers[i].begin(); iter != domFrontiers[i].end(); iter++) {
|
|
|
|
std::cout << (*iter)->id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::RemoveDeadRegions(const std::map<size_t, size_t> &bbIdToDfsTimestamp,
|
|
|
|
BytecodeGraph &byteCodeGraph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
auto &graph = byteCodeGraph.graph;
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &block: graph) {
|
2022-01-22 11:09:02 +00:00
|
|
|
std::vector<BytecodeRegion *> newPreds;
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &bb : block.preds) {
|
|
|
|
if (bbIdToDfsTimestamp.count(bb->id)) {
|
2022-01-06 02:26:19 +00:00
|
|
|
newPreds.emplace_back(bb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
block.preds = newPreds;
|
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &block : graph) {
|
|
|
|
block.isDead = !bbIdToDfsTimestamp.count(block.id);
|
2022-01-06 02:26:19 +00:00
|
|
|
if (block.isDead) {
|
|
|
|
block.succs.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
BytecodeInfo BytecodeCircuitBuilder::GetBytecodeInfo(uint8_t *pc)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-22 11:09:02 +00:00
|
|
|
BytecodeInfo info;
|
2022-01-06 02:26:19 +00:00
|
|
|
auto opcode = static_cast<EcmaOpcode>(*pc);
|
|
|
|
info.opcode = opcode;
|
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::MOV_V4_V4: {
|
|
|
|
uint16_t vdst = READ_INST_4_0();
|
|
|
|
uint16_t vsrc = READ_INST_4_1();
|
|
|
|
info.vregOut.emplace_back(vdst);
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vsrc));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::MOV_DYN_V8_V8: {
|
|
|
|
uint16_t vdst = READ_INST_8_0();
|
|
|
|
uint16_t vsrc = READ_INST_8_1();
|
|
|
|
info.vregOut.emplace_back(vdst);
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vsrc));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::MOV_DYN_V16_V16: {
|
|
|
|
uint16_t vdst = READ_INST_16_0();
|
|
|
|
uint16_t vsrc = READ_INST_16_2();
|
|
|
|
info.vregOut.emplace_back(vdst);
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vsrc));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDA_STR_ID32: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint64_t imm = READ_INST_32_0();
|
|
|
|
info.inputs.emplace_back(StringId(imm));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JMP_IMM8: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JMP_IMM16: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JMP_IMM32: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JEQZ_IMM8: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JEQZ_IMM16: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JNEZ_IMM8: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::JNEZ_IMM16: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDA_DYN_V8: {
|
|
|
|
uint16_t vsrc = READ_INST_8_0();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vsrc));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STA_DYN_V8: {
|
|
|
|
uint16_t vdst = READ_INST_8_0();
|
|
|
|
info.vregOut.emplace_back(vdst);
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDAI_DYN_IMM32: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(READ_INST_32_0()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::FLDAI_DYN_IMM64: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::NINE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(READ_INST_64_0()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLARG0DYN_PREF_V8: {
|
|
|
|
uint32_t funcReg = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLARG1DYN_PREF_V8_V8: {
|
|
|
|
uint32_t funcReg = READ_INST_8_1();
|
|
|
|
uint32_t reg = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(reg));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLARGS2DYN_PREF_V8_V8_V8: {
|
|
|
|
uint32_t funcReg = READ_INST_8_1();
|
2022-03-16 06:14:38 +00:00
|
|
|
uint32_t reg0 = READ_INST_8_2();
|
|
|
|
uint32_t reg1 = READ_INST_8_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg));
|
2022-03-16 06:14:38 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(reg0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(reg1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLARGS3DYN_PREF_V8_V8_V8_V8: {
|
|
|
|
uint32_t funcReg = READ_INST_8_1();
|
2022-03-16 06:14:38 +00:00
|
|
|
uint32_t reg0 = READ_INST_8_2();
|
|
|
|
uint32_t reg1 = READ_INST_8_3();
|
|
|
|
uint32_t reg2 = READ_INST_8_4();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg));
|
2022-03-16 06:14:38 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(reg0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(reg1));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(reg2));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLITHISRANGEDYN_PREF_IMM16_V8: {
|
|
|
|
uint32_t funcReg = READ_INST_8_3();
|
2022-03-16 06:14:38 +00:00
|
|
|
uint32_t actualNumArgs = READ_INST_16_1();
|
|
|
|
|
|
|
|
info.inputs.emplace_back(Immediate(actualNumArgs));
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg));
|
2022-03-16 06:14:38 +00:00
|
|
|
for (size_t i = 1; i <= actualNumArgs; i++) {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg + i));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLSPREADDYN_PREF_V8_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
uint16_t v2 = READ_INST_8_3();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v2));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CALLIRANGEDYN_PREF_IMM16_V8: {
|
|
|
|
uint32_t funcReg = READ_INST_8_3();
|
|
|
|
uint32_t actualNumArgs = READ_INST_16_1();
|
2022-03-16 06:14:38 +00:00
|
|
|
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(actualNumArgs));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg));
|
2022-03-16 06:14:38 +00:00
|
|
|
for (size_t i = 1; i <= actualNumArgs; i++) {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(funcReg + i));
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
case EcmaOpcode::RETURN_DYN: {
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::ONE;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::RETURNUNDEFINED_PREF: {
|
2022-01-18 04:02:20 +00:00
|
|
|
info.accIn = true;
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDNAN_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDINFINITY_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDGLOBALTHIS_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDUNDEFINED_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDNULL_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDSYMBOL_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDGLOBAL_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDTRUE_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDFALSE_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDLEXENVDYN_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETUNMAPPEDARGS_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ASYNCFUNCTIONENTER_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::TONUMBER_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::NEGDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::NOTDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::INCDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DECDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWDYN_PREF: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::TYPEOFDYN_PREF: {
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETPROPITERATOR_PREF: {
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::RESUMEGENERATOR_PREF_V8: {
|
|
|
|
uint16_t vs = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vs));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETRESUMEMODE_PREF_V8: {
|
|
|
|
uint16_t vs = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vs));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETITERATOR_PREF: {
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWCONSTASSIGNMENT_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWTHROWNOTEXISTS_PREF: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWPATTERNNONCOERCIBLE_PREF: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWIFNOTOBJECT_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ITERNEXT_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CLOSEITERATOR_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ADD2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SUB2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::MUL2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DIV2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::MOD2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::EQDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::NOTEQDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LESSDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LESSEQDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GREATERDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GREATEREQDYN_PREF_V8: {
|
|
|
|
uint16_t vs = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(vs));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SHL2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SHR2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ASHR2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::AND2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::OR2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::XOR2DYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DELOBJPROP_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINEFUNCDYN_PREF_ID16_IMM16_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_5();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(MethodId(READ_INST_16_1()));
|
|
|
|
info.inputs.emplace_back(Immediate(READ_INST_16_3()));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINENCFUNCDYN_PREF_ID16_IMM16_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t methodId = READ_INST_16_1();
|
|
|
|
uint16_t length = READ_INST_16_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_5();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(MethodId(methodId));
|
|
|
|
info.inputs.emplace_back(Immediate(length));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINEMETHOD_PREF_ID16_IMM16_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t methodId = READ_INST_16_1();
|
|
|
|
uint16_t length = READ_INST_16_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_5();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(MethodId(methodId));
|
|
|
|
info.inputs.emplace_back(Immediate(length));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::NEWOBJDYNRANGE_PREF_IMM16_V8: {
|
|
|
|
uint16_t firstArgRegIdx = READ_INST_8_3();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(READ_INST_16_1()));
|
2022-04-01 06:33:39 +00:00
|
|
|
info.inputs.emplace_back(Immediate(firstArgRegIdx));
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(firstArgRegIdx));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(firstArgRegIdx + 1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::EXPDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ISINDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::INSTANCEOFDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STRICTNOTEQDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STRICTEQDYN_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDLEXVARDYN_PREF_IMM16_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t level = READ_INST_16_1();
|
|
|
|
uint16_t slot = READ_INST_16_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(level));
|
|
|
|
info.inputs.emplace_back(Immediate(slot));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDLEXVARDYN_PREF_IMM8_IMM8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t level = READ_INST_8_1();
|
|
|
|
uint16_t slot = READ_INST_8_2();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(level));
|
|
|
|
info.inputs.emplace_back(Immediate(slot));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDLEXVARDYN_PREF_IMM4_IMM4: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t level = READ_INST_4_2();
|
|
|
|
uint16_t slot = READ_INST_4_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(level));
|
|
|
|
info.inputs.emplace_back(Immediate(slot));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STLEXVARDYN_PREF_IMM16_IMM16_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t level = READ_INST_16_1();
|
|
|
|
uint16_t slot = READ_INST_16_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_5();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(level));
|
|
|
|
info.inputs.emplace_back(Immediate(slot));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STLEXVARDYN_PREF_IMM8_IMM8_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t level = READ_INST_8_1();
|
|
|
|
uint16_t slot = READ_INST_8_2();
|
2022-02-10 02:03:48 +00:00
|
|
|
uint16_t v0 = READ_INST_8_3();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(level));
|
|
|
|
info.inputs.emplace_back(Immediate(slot));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STLEXVARDYN_PREF_IMM4_IMM4_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t level = READ_INST_4_2();
|
|
|
|
uint16_t slot = READ_INST_4_3();
|
2022-02-10 02:03:48 +00:00
|
|
|
uint16_t v0 = READ_INST_8_2();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(level));
|
|
|
|
info.inputs.emplace_back(Immediate(slot));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::NEWLEXENVDYN_PREF_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t numVars = READ_INST_16_1();
|
2022-02-10 02:03:48 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(numVars));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-04-09 10:00:34 +00:00
|
|
|
case EcmaOpcode::NEWLEXENVWITHNAMEDYN_PREF_IMM16_IMM16: {
|
|
|
|
uint16_t numVars = READ_INST_16_1();
|
|
|
|
uint16_t scopeId = READ_INST_16_3();
|
|
|
|
info.accOut = true;
|
|
|
|
info.offset = BytecodeOffset::SIX;
|
|
|
|
info.inputs.emplace_back(Immediate(numVars));
|
|
|
|
info.inputs.emplace_back(Immediate(scopeId));
|
|
|
|
break;
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
case EcmaOpcode::POPLEXENVDYN_PREF: {
|
2022-04-09 10:00:34 +00:00
|
|
|
info.accOut = false;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEITERRESULTOBJ_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SUSPENDGENERATOR_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ASYNCFUNCTIONAWAITUNCAUGHT_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ASYNCFUNCTIONRESOLVE_PREF_V8_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v2 = READ_INST_8_3();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v2));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ASYNCFUNCTIONREJECT_PREF_V8_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v2 = READ_INST_8_3();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v2));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::NEWOBJSPREADDYN_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWUNDEFINEDIFHOLE_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOWNBYNAME_PREF_ID32_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint32_t v0 = READ_INST_8_5();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEEMPTYARRAY_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEEMPTYOBJECT_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEOBJECTWITHBUFFER_PREF_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t imm = READ_INST_16_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(imm));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SETOBJECTWITHPROTO_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEARRAYWITHBUFFER_PREF_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t imm = READ_INST_16_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(imm));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-01-30 08:01:33 +00:00
|
|
|
case EcmaOpcode::GETMODULENAMESPACE_PREF_ID32: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STMODULEVAR_PREF_ID32: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::COPYMODULE_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-01-30 08:01:33 +00:00
|
|
|
case EcmaOpcode::LDMODULEVAR_PREF_ID32_IMM8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
|
|
|
uint8_t innerFlag = READ_INST_8_5();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(Immediate(innerFlag));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEREGEXPWITHLITERAL_PREF_ID32_IMM8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
|
|
|
uint8_t flags = READ_INST_8_5();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(Immediate(flags));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETTEMPLATEOBJECT_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETNEXTPROPNAME_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::COPYDATAPROPERTIES_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOWNBYINDEX_PREF_V8_IMM32: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t index = READ_INST_32_2();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(Immediate(index));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOWNBYVALUE_PREF_V8_V8: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
|
|
|
uint32_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEOBJECTWITHEXCLUDEDKEYS_PREF_IMM16_V8_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t numKeys = READ_INST_16_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_3();
|
2022-03-31 12:11:37 +00:00
|
|
|
uint16_t firstArgRegIdx = READ_INST_8_4();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(numKeys));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-03-31 12:11:37 +00:00
|
|
|
info.inputs.emplace_back(Immediate(firstArgRegIdx));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINEGENERATORFUNC_PREF_ID16_IMM16_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t methodId = READ_INST_16_1();
|
|
|
|
uint16_t length = READ_INST_16_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_5();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(MethodId(methodId));
|
|
|
|
info.inputs.emplace_back(Immediate(length));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINEASYNCFUNC_PREF_ID16_IMM16_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t methodId = READ_INST_16_1();
|
|
|
|
uint16_t length = READ_INST_16_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_5();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(MethodId(methodId));
|
|
|
|
info.inputs.emplace_back(Immediate(length));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDHOLE_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::COPYRESTARGS_PREF_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t restIdx = READ_INST_16_1();
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(restIdx));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINEGETTERSETTERBYVALUE_PREF_V8_V8_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
uint16_t v2 = READ_INST_8_3();
|
|
|
|
uint16_t v3 = READ_INST_8_4();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v2));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v3));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDOBJBYINDEX_PREF_V8_IMM32: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t idx = READ_INST_32_2();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(Immediate(idx));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOBJBYINDEX_PREF_V8_IMM32: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t index = READ_INST_32_2();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(Immediate(index));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDOBJBYVALUE_PREF_V8_V8: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
|
|
|
uint32_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOBJBYVALUE_PREF_V8_V8: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
|
|
|
uint32_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDSUPERBYVALUE_PREF_V8_V8: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
|
|
|
uint32_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STSUPERBYVALUE_PREF_V8_V8: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
|
|
|
uint32_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::TRYLDGLOBALBYNAME_PREF_ID32: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(READ_INST_32_1()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::TRYSTGLOBALBYNAME_PREF_ID32: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(READ_INST_32_1()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STCONSTTOGLOBALRECORD_PREF_ID32: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(READ_INST_32_1()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STLETTOGLOBALRECORD_PREF_ID32: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(READ_INST_32_1()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STCLASSTOGLOBALRECORD_PREF_ID32: {
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(READ_INST_32_1()));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOWNBYVALUEWITHNAMESET_PREF_V8_V8: {
|
|
|
|
uint32_t v0 = READ_INST_8_1();
|
|
|
|
uint32_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOWNBYNAMEWITHNAMESET_PREF_ID32_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint32_t v0 = READ_INST_8_5();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDGLOBALVAR_PREF_ID32: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDOBJBYNAME_PREF_ID32_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint32_t v0 = READ_INST_8_5();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STOBJBYNAME_PREF_ID32_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint32_t v0 = READ_INST_8_5();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDSUPERBYNAME_PREF_ID32_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint32_t v0 = READ_INST_8_5();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STSUPERBYNAME_PREF_ID32_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint32_t v0 = READ_INST_8_5();
|
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SEVEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STGLOBALVAR_PREF_ID32: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint32_t stringId = READ_INST_32_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::SIX;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(StringId(stringId));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEGENERATOROBJ_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::STARRAYSPREAD_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::GETITERATORNEXT_PREF_V8_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
uint16_t v1 = READ_INST_8_2();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEFINECLASSWITHBUFFER_PREF_ID16_IMM16_IMM16_V8_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t methodId = READ_INST_16_1();
|
|
|
|
uint16_t imm = READ_INST_16_3();
|
|
|
|
uint16_t length = READ_INST_16_5();
|
2022-01-06 02:26:19 +00:00
|
|
|
uint16_t v0 = READ_INST_8_7();
|
|
|
|
uint16_t v1 = READ_INST_8_8();
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TEN;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(MethodId(methodId));
|
|
|
|
info.inputs.emplace_back(Immediate(imm));
|
|
|
|
info.inputs.emplace_back(Immediate(length));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
|
|
|
info.inputs.emplace_back(VirtualRegister(v1));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDFUNCTION_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SUPERCALL_PREF_IMM16_V8: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t range = READ_INST_16_1();
|
|
|
|
uint16_t v0 = READ_INST_8_3();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FIVE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(range));
|
|
|
|
info.inputs.emplace_back(Immediate(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::SUPERCALLSPREAD_PREF_V8: {
|
|
|
|
uint16_t v0 = READ_INST_8_1();
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::THREE;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(VirtualRegister(v0));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::CREATEOBJECTHAVINGMETHOD_PREF_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t imm = READ_INST_16_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(imm));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWIFSUPERNOTCORRECTCALL_PREF_IMM16: {
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
uint16_t imm = READ_INST_16_1();
|
2022-01-06 02:26:19 +00:00
|
|
|
info.accIn = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::FOUR;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
info.inputs.emplace_back(Immediate(imm));
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::LDHOMEOBJECT_PREF: {
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::THROWDELETESUPERPROPERTY_PREF: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::DEBUGGER_PREF: {
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ISTRUE_PREF: {
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EcmaOpcode::ISFALSE_PREF: {
|
|
|
|
info.accIn = true;
|
|
|
|
info.accOut = true;
|
2022-01-22 11:09:02 +00:00
|
|
|
info.offset = BytecodeOffset::TWO;
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
2022-04-09 10:00:34 +00:00
|
|
|
std::cout << "Error bytecode: " << opcode << ", pls check bytecode offset." << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
abort();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::InsertPhi(BytecodeGraph &byteCodeGraph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
|
|
|
auto &graph = byteCodeGraph.graph;
|
|
|
|
std::map<uint16_t, std::set<size_t>> defsitesInfo; // <vreg, bbs>
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &bb : graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
auto pc = bb.start;
|
|
|
|
while (pc <= bb.end) {
|
2022-01-22 11:09:02 +00:00
|
|
|
auto bytecodeInfo = GetBytecodeInfo(pc);
|
2022-01-06 02:26:19 +00:00
|
|
|
pc = pc + bytecodeInfo.offset; // next inst start pc
|
2022-01-18 04:02:20 +00:00
|
|
|
for (const auto &vreg: bytecodeInfo.vregOut) {
|
2022-01-06 02:26:19 +00:00
|
|
|
defsitesInfo[vreg].insert(bb.id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-19 01:11:02 +00:00
|
|
|
for (const auto&[variable, defsites] : defsitesInfo) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << "variable: " << variable << " locate block have: ";
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto id : defsites) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (const auto&[variable, defsites] : defsitesInfo) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::queue<uint16_t> workList;
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto blockId: defsites) {
|
2022-01-06 02:26:19 +00:00
|
|
|
workList.push(blockId);
|
|
|
|
}
|
|
|
|
while (!workList.empty()) {
|
|
|
|
auto currentId = workList.front();
|
|
|
|
workList.pop();
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto &block : graph[currentId].domFrontiers) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (!block->phi.count(variable)) {
|
|
|
|
block->phi.insert(variable);
|
|
|
|
if (!defsitesInfo[variable].count(block->id)) {
|
|
|
|
workList.push(block->id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
PrintGraph(graph);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
// Update CFG's predecessor, successor and try catch associations
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::UpdateCFG(BytecodeGraph &byteCodeGraph)
|
2022-01-19 01:11:02 +00:00
|
|
|
{
|
|
|
|
auto &graph = byteCodeGraph.graph;
|
|
|
|
for (auto &bb: graph) {
|
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
bb.preds.clear();
|
|
|
|
bb.trys.clear();
|
2022-01-22 11:09:02 +00:00
|
|
|
std::vector<BytecodeRegion *> newSuccs;
|
2022-01-19 01:11:02 +00:00
|
|
|
for (const auto &succ: bb.succs) {
|
|
|
|
if (std::count(bb.catchs.begin(), bb.catchs.end(), succ)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
newSuccs.push_back(succ);
|
|
|
|
}
|
|
|
|
bb.succs = newSuccs;
|
|
|
|
}
|
|
|
|
for (auto &bb: graph) {
|
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
for (auto &succ: bb.succs) {
|
|
|
|
succ->preds.push_back(&bb);
|
|
|
|
}
|
|
|
|
for (auto &catchBlock: bb.catchs) {
|
|
|
|
catchBlock->trys.push_back(&bb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsJump(EcmaOpcode opcode)
|
2022-01-18 04:02:20 +00:00
|
|
|
{
|
2022-01-06 02:26:19 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::JMP_IMM8:
|
|
|
|
case EcmaOpcode::JMP_IMM16:
|
|
|
|
case EcmaOpcode::JMP_IMM32:
|
|
|
|
case EcmaOpcode::JEQZ_IMM8:
|
|
|
|
case EcmaOpcode::JEQZ_IMM16:
|
|
|
|
case EcmaOpcode::JNEZ_IMM8:
|
|
|
|
case EcmaOpcode::JNEZ_IMM16:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsCondJump(EcmaOpcode opcode)
|
2022-01-18 04:02:20 +00:00
|
|
|
{
|
2022-01-06 02:26:19 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::JEQZ_IMM8:
|
|
|
|
case EcmaOpcode::JEQZ_IMM16:
|
|
|
|
case EcmaOpcode::JNEZ_IMM8:
|
|
|
|
case EcmaOpcode::JNEZ_IMM16:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsMov(EcmaOpcode opcode)
|
2022-01-18 04:02:20 +00:00
|
|
|
{
|
2022-01-06 02:26:19 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::MOV_V4_V4:
|
|
|
|
case EcmaOpcode::MOV_DYN_V8_V8:
|
|
|
|
case EcmaOpcode::MOV_DYN_V16_V16:
|
|
|
|
case EcmaOpcode::LDA_DYN_V8:
|
|
|
|
case EcmaOpcode::STA_DYN_V8:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsReturn(EcmaOpcode opcode)
|
2022-01-18 04:02:20 +00:00
|
|
|
{
|
2022-01-06 02:26:19 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::RETURN_DYN:
|
|
|
|
case EcmaOpcode::RETURNUNDEFINED_PREF:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsThrow(EcmaOpcode opcode)
|
2022-01-14 09:48:52 +00:00
|
|
|
{
|
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::THROWDYN_PREF:
|
|
|
|
case EcmaOpcode::THROWCONSTASSIGNMENT_PREF_V8:
|
|
|
|
case EcmaOpcode::THROWTHROWNOTEXISTS_PREF:
|
|
|
|
case EcmaOpcode::THROWPATTERNNONCOERCIBLE_PREF:
|
|
|
|
case EcmaOpcode::THROWDELETESUPERPROPERTY_PREF:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-31 12:11:37 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsDiscarded(EcmaOpcode opcode)
|
|
|
|
{
|
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::COPYMODULE_PREF_V8:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
bool BytecodeCircuitBuilder::IsGeneral(EcmaOpcode opcode)
|
2022-01-18 04:02:20 +00:00
|
|
|
{
|
2022-03-31 12:11:37 +00:00
|
|
|
return !IsMov(opcode) && !IsJump(opcode) && !IsReturn(opcode) && !IsSetConstant(opcode) && !IsDiscarded(opcode);
|
2022-02-10 02:03:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool BytecodeCircuitBuilder::IsSetConstant(EcmaOpcode opcode)
|
|
|
|
{
|
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::LDNAN_PREF:
|
|
|
|
case EcmaOpcode::LDINFINITY_PREF:
|
|
|
|
case EcmaOpcode::LDUNDEFINED_PREF:
|
|
|
|
case EcmaOpcode::LDNULL_PREF:
|
|
|
|
case EcmaOpcode::LDTRUE_PREF:
|
|
|
|
case EcmaOpcode::LDFALSE_PREF:
|
|
|
|
case EcmaOpcode::LDHOLE_PREF:
|
|
|
|
case EcmaOpcode::LDAI_DYN_IMM32:
|
|
|
|
case EcmaOpcode::FLDAI_DYN_IMM64:
|
2022-04-06 07:17:04 +00:00
|
|
|
case EcmaOpcode::LDFUNCTION_PREF:
|
2022-02-10 02:03:48 +00:00
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
GateRef BytecodeCircuitBuilder::SetGateConstant(const BytecodeInfo &info)
|
|
|
|
{
|
|
|
|
auto opcode = static_cast<EcmaOpcode>(info.opcode);
|
|
|
|
GateRef gate = 0;
|
|
|
|
// ts loader
|
|
|
|
panda::ecmascript::TSLoader* tsLoader = vm_->GetTSLoader();
|
2022-04-06 07:17:04 +00:00
|
|
|
uint64_t tsType = 0;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case EcmaOpcode::LDNAN_PREF:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_NUMBER).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::F64,
|
|
|
|
bit_cast<int64_t>(panda::ecmascript::base::NAN_VALUE),
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDINFINITY_PREF:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_NUMBER).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::F64,
|
|
|
|
bit_cast<int64_t>(panda::ecmascript::base::POSITIVE_INFINITY),
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDUNDEFINED_PREF:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_UNDEFINED).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64, JSTaggedValue::VALUE_UNDEFINED,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDNULL_PREF:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_NULL).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64, JSTaggedValue::VALUE_NULL,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDTRUE_PREF:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_BOOLEAN).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64, JSTaggedValue::VALUE_TRUE,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDFALSE_PREF:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_BOOLEAN).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64, JSTaggedValue::VALUE_FALSE,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDHOLE_PREF:
|
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64, JSTaggedValue::VALUE_HOLE,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
GateType::TAGGED_NO_POINTER);
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::LDAI_DYN_IMM32:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_NUMBER).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64,
|
|
|
|
std::get<Immediate>(info.inputs[0]).GetValue(),
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
|
|
|
case EcmaOpcode::FLDAI_DYN_IMM64:
|
2022-03-22 02:33:19 +00:00
|
|
|
tsType = tsLoader->GetPrimitiveGT(TSTypeKind::TS_NUMBER).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::F64,
|
|
|
|
std::get<Immediate>(info.inputs.at(0)).GetValue(),
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
static_cast<GateType>(tsType));
|
|
|
|
break;
|
2022-04-06 07:17:04 +00:00
|
|
|
case EcmaOpcode::LDFUNCTION_PREF:
|
|
|
|
gate = GetCommonArgByIndex(CommonArgIdx::FUNC);
|
|
|
|
break;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
default:
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
return gate;
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::BuildCircuit(BytecodeGraph &byteCodeGraph)
|
2022-01-18 04:02:20 +00:00
|
|
|
{
|
2022-01-06 02:26:19 +00:00
|
|
|
auto &graph = byteCodeGraph.graph;
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
|
|
|
PrintBBInfo(graph);
|
|
|
|
#endif
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
// create arg gates array
|
2022-01-06 02:26:19 +00:00
|
|
|
const size_t numArgs = byteCodeGraph.method->GetNumArgs();
|
|
|
|
const size_t offsetArgs = byteCodeGraph.method->GetNumVregs();
|
2022-02-12 08:15:41 +00:00
|
|
|
const size_t actualNumArgs = GetActualNumArgs(numArgs);
|
|
|
|
std::vector<GateRef> argGates(actualNumArgs);
|
|
|
|
|
2022-03-25 08:18:44 +00:00
|
|
|
auto glueGate = circuit_.NewGate(OpCode(OpCode::ARG), MachineType::I64, 0,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::ARG_LIST))},
|
|
|
|
GateType::C_VALUE);
|
|
|
|
argGates.at(0) = glueGate;
|
|
|
|
commonArgs_.at(0) = glueGate;
|
|
|
|
|
|
|
|
for (size_t argIdx = 1; argIdx < CommonArgIdx::NUM_OF_ARGS; argIdx++) {
|
2022-02-12 08:15:41 +00:00
|
|
|
auto argGate = circuit_.NewGate(OpCode(OpCode::ARG), MachineType::I64, argIdx,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::ARG_LIST))},
|
|
|
|
GateType::TAGGED_VALUE);
|
|
|
|
argGates.at(argIdx) = argGate;
|
|
|
|
commonArgs_.at(argIdx) = argGate;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t argIdx = CommonArgIdx::NUM_OF_ARGS; argIdx < actualNumArgs; argIdx++) {
|
2022-02-09 08:51:58 +00:00
|
|
|
argGates.at(argIdx) = circuit_.NewGate(OpCode(OpCode::ARG), MachineType::I64, argIdx,
|
2022-01-19 01:11:02 +00:00
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::ARG_LIST))},
|
2022-03-25 08:18:44 +00:00
|
|
|
GateType::TAGGED_VALUE);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
// get number of expanded state predicates of each block
|
|
|
|
// one block-level try catch edge may correspond to multiple bytecode-level edges
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.numOfStatePreds = 0;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
auto pc = bb.start;
|
|
|
|
while (pc <= bb.end) {
|
2022-01-22 11:09:02 +00:00
|
|
|
auto bytecodeInfo = GetBytecodeInfo(pc);
|
2022-01-06 02:26:19 +00:00
|
|
|
pc = pc + bytecodeInfo.offset; // next inst start pc
|
|
|
|
if (IsGeneral(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
|
|
|
if (!bb.catchs.empty()) {
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.catchs.at(0)->numOfStatePreds++;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &succ: bb.succs) {
|
2022-01-19 01:11:02 +00:00
|
|
|
succ->numOfStatePreds++;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
|
|
|
|
// build head of each block
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
if (bb.numOfStatePreds == 0) {
|
|
|
|
bb.stateStart = Circuit::GetCircuitRoot(OpCode(OpCode::STATE_ENTRY));
|
|
|
|
bb.dependStart = Circuit::GetCircuitRoot(OpCode(OpCode::DEPEND_ENTRY));
|
|
|
|
} else if (bb.numOfStatePreds == 1) {
|
|
|
|
bb.stateStart = circuit_.NewGate(OpCode(OpCode::ORDINARY_BLOCK), 0,
|
2022-01-27 08:46:57 +00:00
|
|
|
{Circuit::NullGate()}, GateType::EMPTY);
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.dependStart = circuit_.NewGate(OpCode(OpCode::DEPEND_RELAY), 0,
|
2022-01-27 08:46:57 +00:00
|
|
|
{bb.stateStart, Circuit::NullGate()}, GateType::EMPTY);
|
2022-01-06 02:26:19 +00:00
|
|
|
} else {
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.stateStart = circuit_.NewGate(OpCode(OpCode::MERGE), bb.numOfStatePreds,
|
|
|
|
std::vector<GateRef>(bb.numOfStatePreds, Circuit::NullGate()),
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::EMPTY);
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.dependStart = circuit_.NewGate(OpCode(OpCode::DEPEND_SELECTOR), bb.numOfStatePreds,
|
|
|
|
std::vector<GateRef>(bb.numOfStatePreds + 1, Circuit::NullGate()),
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::EMPTY);
|
2022-01-06 02:26:19 +00:00
|
|
|
circuit_.NewIn(bb.dependStart, 0, bb.stateStart);
|
|
|
|
}
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
// build states sub-circuit of each block
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
auto stateCur = bb.stateStart;
|
|
|
|
auto dependCur = bb.dependStart;
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(stateCur != Circuit::NullGate());
|
|
|
|
ASSERT(dependCur != Circuit::NullGate());
|
2022-02-10 02:03:48 +00:00
|
|
|
if (!bb.trys.empty()) {
|
|
|
|
dependCur = circuit_.NewGate(OpCode(OpCode::GET_EXCEPTION), 0, {dependCur}, GateType::EMPTY);
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
auto pc = bb.start;
|
|
|
|
while (pc <= bb.end) {
|
|
|
|
auto pcPrev = pc;
|
2022-01-22 11:09:02 +00:00
|
|
|
auto bytecodeInfo = GetBytecodeInfo(pc);
|
2022-01-06 02:26:19 +00:00
|
|
|
pc = pc + bytecodeInfo.offset; // next inst start pc
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
size_t numValueInputs = (bytecodeInfo.accIn ? 1 : 0) + bytecodeInfo.inputs.size();
|
2022-02-10 02:03:48 +00:00
|
|
|
if (IsSetConstant(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
|
|
|
// handle bytecode command to get constants
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
GateRef gate = SetGateConstant(bytecodeInfo);
|
2022-02-10 02:03:48 +00:00
|
|
|
jsgateToBytecode_[gate] = {bb.id, pcPrev};
|
|
|
|
} else if (IsGeneral(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
2022-01-19 01:11:02 +00:00
|
|
|
// handle general ecma.* bytecodes
|
2022-01-27 08:46:57 +00:00
|
|
|
GateRef gate = 0;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
const size_t length = 2; // 2: state and depend on input
|
|
|
|
std::vector<GateRef> inList(length + numValueInputs, Circuit::NullGate());
|
|
|
|
for (size_t i = 0; i < bytecodeInfo.inputs.size(); i++) {
|
|
|
|
const auto &input = bytecodeInfo.inputs[i];
|
|
|
|
if (std::holds_alternative<MethodId>(input)) {
|
|
|
|
inList[i + length] = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I16,
|
|
|
|
std::get<MethodId>(input).GetId(),
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
2022-04-06 07:17:04 +00:00
|
|
|
GateType::C_VALUE);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
} else if (std::holds_alternative<StringId>(input)) {
|
|
|
|
auto tsLoader = vm_->GetTSLoader();
|
|
|
|
JSHandle<ConstantPool> newConstPool(vm_->GetJSThread(), constantPool_.GetTaggedValue());
|
|
|
|
auto string = newConstPool->GetObjectFromCache(std::get<StringId>(input).GetId());
|
|
|
|
uint64_t index = tsLoader->AddConstString(string);
|
|
|
|
inList[i + length] = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I32, index,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
2022-04-06 07:17:04 +00:00
|
|
|
GateType::C_VALUE);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
} else if (std::holds_alternative<Immediate>(input)) {
|
|
|
|
inList[i + length] = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64,
|
|
|
|
std::get<Immediate>(input).GetValue(),
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
2022-04-06 07:17:04 +00:00
|
|
|
GateType::C_VALUE);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
} else {
|
|
|
|
ASSERT(std::holds_alternative<VirtualRegister>(input));
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2022-01-27 08:46:57 +00:00
|
|
|
if (!bytecodeInfo.vregOut.empty() || bytecodeInfo.accOut) {
|
2022-02-09 08:51:58 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::JS_BYTECODE), MachineType::I64, numValueInputs,
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
inList, GateType::JS_ANY);
|
2022-01-27 08:46:57 +00:00
|
|
|
} else {
|
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::JS_BYTECODE), MachineType::NOVALUE, numValueInputs,
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
inList, GateType::EMPTY);
|
2022-01-27 08:46:57 +00:00
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
circuit_.NewIn(gate, 0, stateCur);
|
|
|
|
circuit_.NewIn(gate, 1, dependCur);
|
2022-01-27 08:46:57 +00:00
|
|
|
auto ifSuccess = circuit_.NewGate(OpCode(OpCode::IF_SUCCESS), 0, {gate}, GateType::EMPTY);
|
|
|
|
auto ifException = circuit_.NewGate(OpCode(OpCode::IF_EXCEPTION), 0, {gate}, GateType::EMPTY);
|
2022-01-06 02:26:19 +00:00
|
|
|
if (!bb.catchs.empty()) {
|
|
|
|
auto bbNext = bb.catchs.at(0);
|
2022-01-19 01:11:02 +00:00
|
|
|
circuit_.NewIn(bbNext->stateStart, bbNext->statePredIndex, ifException);
|
|
|
|
circuit_.NewIn(bbNext->dependStart, bbNext->statePredIndex + 1, gate);
|
|
|
|
bbNext->statePredIndex++;
|
2022-01-22 11:09:02 +00:00
|
|
|
bbNext->expandedPreds.push_back( {bb.id, pcPrev, true} );
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bbNext->statePredIndex <= bbNext->numOfStatePreds);
|
2022-01-06 02:26:19 +00:00
|
|
|
} else {
|
2022-02-10 02:03:48 +00:00
|
|
|
auto constant = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64,
|
|
|
|
JSTaggedValue::VALUE_EXCEPTION,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
|
|
|
GateType::JS_ANY);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
circuit_.NewGate(OpCode(OpCode::RETURN), 0,
|
2022-02-10 02:03:48 +00:00
|
|
|
{ifException, gate, constant,
|
|
|
|
Circuit::GetCircuitRoot(OpCode(OpCode::RETURN_LIST))},
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::JS_ANY);
|
2022-01-19 01:11:02 +00:00
|
|
|
}
|
2022-01-22 11:09:02 +00:00
|
|
|
jsgateToBytecode_[gate] = {bb.id, pcPrev};
|
2022-01-19 01:11:02 +00:00
|
|
|
if (IsThrow(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
|
|
|
circuit_.NewGate(OpCode(OpCode::RETURN), 0,
|
|
|
|
{ifSuccess, gate, TaggedValue::VALUE_HOLE,
|
|
|
|
Circuit::GetCircuitRoot(OpCode(OpCode::RETURN_LIST))},
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::JS_ANY);
|
2022-01-19 01:11:02 +00:00
|
|
|
break;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
stateCur = ifSuccess;
|
|
|
|
dependCur = gate;
|
|
|
|
if (pcPrev == bb.end) {
|
|
|
|
auto bbNext = &graph.at(bb.id + 1);
|
2022-01-19 01:11:02 +00:00
|
|
|
circuit_.NewIn(bbNext->stateStart, bbNext->statePredIndex, stateCur);
|
|
|
|
circuit_.NewIn(bbNext->dependStart, bbNext->statePredIndex + 1, dependCur);
|
|
|
|
bbNext->statePredIndex++;
|
2022-01-22 11:09:02 +00:00
|
|
|
bbNext->expandedPreds.push_back( {bb.id, pcPrev, false} );
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bbNext->statePredIndex <= bbNext->numOfStatePreds);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
} else if (IsJump(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
2022-01-19 01:11:02 +00:00
|
|
|
// handle conditional jump and unconditional jump bytecodes
|
2022-01-06 02:26:19 +00:00
|
|
|
if (IsCondJump(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
2022-01-27 08:46:57 +00:00
|
|
|
GateRef gate = 0;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
gate = circuit_.NewGate(OpCode(OpCode::JS_BYTECODE), MachineType::NOVALUE, numValueInputs,
|
|
|
|
std::vector<GateRef>(2 + numValueInputs, // 2: state and depend input
|
|
|
|
Circuit::NullGate()),
|
|
|
|
GateType::EMPTY);
|
2022-01-06 02:26:19 +00:00
|
|
|
circuit_.NewIn(gate, 0, stateCur);
|
|
|
|
circuit_.NewIn(gate, 1, dependCur);
|
2022-01-27 08:46:57 +00:00
|
|
|
auto ifTrue = circuit_.NewGate(OpCode(OpCode::IF_TRUE), 0, {gate}, GateType::EMPTY);
|
|
|
|
auto ifFalse = circuit_.NewGate(OpCode(OpCode::IF_FALSE), 0, {gate}, GateType::EMPTY);
|
2022-01-22 11:09:02 +00:00
|
|
|
ASSERT(bb.succs.size() == 2); // 2 : 2 num of successors
|
2022-01-06 02:26:19 +00:00
|
|
|
int bitSet = 0;
|
|
|
|
for (auto &bbNext: bb.succs) {
|
|
|
|
if (bbNext->id == bb.id + 1) {
|
2022-01-19 01:11:02 +00:00
|
|
|
circuit_.NewIn(bbNext->stateStart, bbNext->statePredIndex, ifFalse);
|
|
|
|
circuit_.NewIn(bbNext->dependStart, bbNext->statePredIndex + 1, gate);
|
|
|
|
bbNext->statePredIndex++;
|
2022-01-22 11:09:02 +00:00
|
|
|
bbNext->expandedPreds.push_back( {bb.id, pcPrev, false} );
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bbNext->statePredIndex <= bbNext->numOfStatePreds);
|
2022-01-06 02:26:19 +00:00
|
|
|
bitSet |= 1;
|
|
|
|
} else {
|
2022-01-19 01:11:02 +00:00
|
|
|
circuit_.NewIn(bbNext->stateStart, bbNext->statePredIndex, ifTrue);
|
|
|
|
circuit_.NewIn(bbNext->dependStart, bbNext->statePredIndex + 1, gate);
|
|
|
|
bbNext->statePredIndex++;
|
2022-01-22 11:09:02 +00:00
|
|
|
bbNext->expandedPreds.push_back( {bb.id, pcPrev, false} );
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bbNext->statePredIndex <= bbNext->numOfStatePreds);
|
2022-01-22 11:09:02 +00:00
|
|
|
bitSet |= 2; // 2:verify
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-22 11:09:02 +00:00
|
|
|
ASSERT(bitSet == 3); // 3:Verify the number of successor blocks
|
|
|
|
jsgateToBytecode_[gate] = {bb.id, pcPrev};
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
ASSERT(bb.succs.size() == 1);
|
|
|
|
auto bbNext = bb.succs.at(0);
|
2022-01-19 01:11:02 +00:00
|
|
|
circuit_.NewIn(bbNext->stateStart, bbNext->statePredIndex, stateCur);
|
|
|
|
circuit_.NewIn(bbNext->dependStart, bbNext->statePredIndex + 1, dependCur);
|
|
|
|
bbNext->statePredIndex++;
|
2022-01-22 11:09:02 +00:00
|
|
|
bbNext->expandedPreds.push_back( {bb.id, pcPrev, false} );
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bbNext->statePredIndex <= bbNext->numOfStatePreds);
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-01-14 09:48:52 +00:00
|
|
|
} else if (static_cast<EcmaOpcode>(bytecodeInfo.opcode) == EcmaOpcode::RETURN_DYN) {
|
2022-01-19 01:11:02 +00:00
|
|
|
// handle return.dyn bytecode
|
2022-01-06 02:26:19 +00:00
|
|
|
ASSERT(bb.succs.empty());
|
2022-01-19 01:11:02 +00:00
|
|
|
auto gate = circuit_.NewGate(OpCode(OpCode::RETURN), 0,
|
|
|
|
{stateCur, dependCur, Circuit::NullGate(),
|
|
|
|
Circuit::GetCircuitRoot(OpCode(OpCode::RETURN_LIST))},
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::EMPTY);
|
2022-01-22 11:09:02 +00:00
|
|
|
jsgateToBytecode_[gate] = {bb.id, pcPrev};
|
2022-01-06 02:26:19 +00:00
|
|
|
break;
|
2022-01-14 09:48:52 +00:00
|
|
|
} else if (static_cast<EcmaOpcode>(bytecodeInfo.opcode) == EcmaOpcode::RETURNUNDEFINED_PREF) {
|
2022-01-19 01:11:02 +00:00
|
|
|
// handle returnundefined bytecode
|
2022-01-14 09:48:52 +00:00
|
|
|
ASSERT(bb.succs.empty());
|
2022-02-09 08:51:58 +00:00
|
|
|
auto constant = circuit_.NewGate(OpCode(OpCode::CONSTANT), MachineType::I64,
|
2022-01-19 01:11:02 +00:00
|
|
|
TaggedValue::VALUE_UNDEFINED,
|
|
|
|
{Circuit::GetCircuitRoot(OpCode(OpCode::CONSTANT_LIST))},
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::JS_ANY);
|
2022-01-19 01:11:02 +00:00
|
|
|
auto gate = circuit_.NewGate(OpCode(OpCode::RETURN), 0,
|
2022-01-14 09:48:52 +00:00
|
|
|
{stateCur, dependCur, constant,
|
2022-01-19 01:11:02 +00:00
|
|
|
Circuit::GetCircuitRoot(OpCode(OpCode::RETURN_LIST))},
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::EMPTY);
|
2022-01-22 11:09:02 +00:00
|
|
|
jsgateToBytecode_[gate] = {bb.id, pcPrev};
|
2022-01-14 09:48:52 +00:00
|
|
|
break;
|
|
|
|
} else if (IsMov(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
2022-01-19 01:11:02 +00:00
|
|
|
// handle mov.dyn lda.dyn sta.dyn bytecodes
|
2022-01-06 02:26:19 +00:00
|
|
|
if (pcPrev == bb.end) {
|
|
|
|
auto bbNext = &graph.at(bb.id + 1);
|
2022-01-19 01:11:02 +00:00
|
|
|
circuit_.NewIn(bbNext->stateStart, bbNext->statePredIndex, stateCur);
|
|
|
|
circuit_.NewIn(bbNext->dependStart, bbNext->statePredIndex + 1, dependCur);
|
|
|
|
bbNext->statePredIndex++;
|
2022-01-22 11:09:02 +00:00
|
|
|
bbNext->expandedPreds.push_back( {bb.id, pcPrev, false} );
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bbNext->statePredIndex <= bbNext->numOfStatePreds);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-03-31 12:11:37 +00:00
|
|
|
} else if (IsDiscarded(static_cast<EcmaOpcode>(bytecodeInfo.opcode))) {
|
|
|
|
continue;
|
2022-01-14 09:48:52 +00:00
|
|
|
} else {
|
|
|
|
abort();
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
// verification of soundness of CFG
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
ASSERT(bb.statePredIndex == bb.numOfStatePreds);
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.phiAcc = (bb.numOfStatePreds > 1) || (!bb.trys.empty());
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-22 11:09:02 +00:00
|
|
|
PrintBytecodeInfo(graph);
|
2022-01-06 02:26:19 +00:00
|
|
|
#endif
|
2022-01-22 11:09:02 +00:00
|
|
|
for (const auto &[key, value]: jsgateToBytecode_) {
|
2022-01-19 01:11:02 +00:00
|
|
|
byteCodeToJSGate_[value.second] = key;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
|
2022-03-07 02:58:13 +00:00
|
|
|
// ts loader
|
|
|
|
panda::ecmascript::TSLoader* tsLoader = vm_->GetTSLoader();
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
// resolve def-site of virtual regs and set all value inputs
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto gate: circuit_.GetAllGates()) {
|
2022-03-02 08:06:19 +00:00
|
|
|
auto valueCount = circuit_.GetOpCode(gate).GetInValueCount(circuit_.GetBitField(gate));
|
2022-01-22 11:09:02 +00:00
|
|
|
auto it = jsgateToBytecode_.find(gate);
|
|
|
|
if (it == jsgateToBytecode_.end()) {
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
if (circuit_.LoadGatePtrConst(gate)->GetOpCode() == OpCode::CONSTANT) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
const auto &[id, pc] = it->second;
|
2022-01-22 11:09:02 +00:00
|
|
|
auto bytecodeInfo = GetBytecodeInfo(pc);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
[[maybe_unused]] size_t numValueInputs = (bytecodeInfo.accIn ? 1 : 0) + bytecodeInfo.inputs.size();
|
2022-01-06 02:26:19 +00:00
|
|
|
[[maybe_unused]] size_t numValueOutputs = (bytecodeInfo.accOut ? 1 : 0) + bytecodeInfo.vregOut.size();
|
2022-03-02 08:06:19 +00:00
|
|
|
ASSERT(numValueInputs == valueCount);
|
2022-01-06 02:26:19 +00:00
|
|
|
ASSERT(numValueOutputs <= 1);
|
2022-01-19 01:11:02 +00:00
|
|
|
// recursive variables renaming algorithm
|
|
|
|
std::function<GateRef(size_t, const uint8_t *, uint16_t, bool)> defSiteOfReg =
|
|
|
|
[&](size_t bbId, const uint8_t *end, uint16_t reg, bool acc) -> GateRef {
|
|
|
|
// find def-site in bytecodes of basic block
|
|
|
|
auto ans = Circuit::NullGate();
|
2022-01-18 04:02:20 +00:00
|
|
|
auto &bb = graph.at(bbId);
|
|
|
|
std::vector<uint8_t *> instList;
|
|
|
|
{
|
|
|
|
auto pcIter = bb.start;
|
|
|
|
while (pcIter <= end) {
|
|
|
|
instList.push_back(pcIter);
|
2022-01-22 11:09:02 +00:00
|
|
|
auto curInfo = GetBytecodeInfo(pcIter);
|
2022-01-18 04:02:20 +00:00
|
|
|
pcIter += curInfo.offset;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
std::reverse(instList.begin(), instList.end());
|
2022-02-10 02:03:48 +00:00
|
|
|
for (auto pcIter: instList) { // upper bound
|
2022-01-22 11:09:02 +00:00
|
|
|
auto curInfo = GetBytecodeInfo(pcIter);
|
2022-01-18 04:02:20 +00:00
|
|
|
if (acc) {
|
|
|
|
if (curInfo.accOut) {
|
|
|
|
if (IsMov(static_cast<EcmaOpcode>(curInfo.opcode))) {
|
|
|
|
acc = curInfo.accIn;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
if (!curInfo.inputs.empty()) {
|
2022-01-18 04:02:20 +00:00
|
|
|
ASSERT(!acc);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
ASSERT(curInfo.inputs.size() == 1);
|
|
|
|
reg = std::get<VirtualRegister>(curInfo.inputs.at(0)).GetId();
|
2022-01-18 04:02:20 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-01-19 01:11:02 +00:00
|
|
|
ans = byteCodeToJSGate_.at(pcIter);
|
2022-01-18 04:02:20 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-01-18 04:02:20 +00:00
|
|
|
if (!curInfo.vregOut.empty() && curInfo.vregOut.at(0) == reg) {
|
|
|
|
if (IsMov(static_cast<EcmaOpcode>(curInfo.opcode))) {
|
|
|
|
acc = curInfo.accIn;
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
if (!curInfo.inputs.empty()) {
|
2022-01-18 04:02:20 +00:00
|
|
|
ASSERT(!acc);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
ASSERT(curInfo.inputs.size() == 1);
|
|
|
|
reg = std::get<VirtualRegister>(curInfo.inputs.at(0)).GetId();
|
2022-01-18 04:02:20 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-01-19 01:11:02 +00:00
|
|
|
ans = byteCodeToJSGate_.at(pcIter);
|
2022-01-18 04:02:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
2022-02-10 02:03:48 +00:00
|
|
|
// find GET_EXCEPTION gate if this is a catch block
|
|
|
|
if (ans == Circuit::NullGate() && acc) {
|
|
|
|
if (!bb.trys.empty()) {
|
|
|
|
const auto &outList = circuit_.GetOutVector(bb.dependStart);
|
|
|
|
ASSERT(outList.size() == 1);
|
|
|
|
const auto &getExceptionGate = outList.at(0);
|
|
|
|
ASSERT(circuit_.GetOpCode(getExceptionGate) == OpCode::GET_EXCEPTION);
|
|
|
|
ans = getExceptionGate;
|
|
|
|
}
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
// find def-site in value selectors of vregs
|
|
|
|
if (ans == Circuit::NullGate() && !acc && bb.phi.count(reg)) {
|
|
|
|
if (!bb.vregToValSelectorGate.count(reg)) {
|
2022-02-09 08:51:58 +00:00
|
|
|
auto gate = circuit_.NewGate(OpCode(OpCode::VALUE_SELECTOR), MachineType::I64,
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.numOfStatePreds,
|
|
|
|
std::vector<GateRef>(
|
|
|
|
1 + bb.numOfStatePreds, Circuit::NullGate()),
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::JS_ANY);
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.vregToValSelectorGate[reg] = gate;
|
2022-01-18 04:02:20 +00:00
|
|
|
circuit_.NewIn(gate, 0, bb.stateStart);
|
2022-01-27 08:46:57 +00:00
|
|
|
for (int32_t i = 0; i < bb.numOfStatePreds; ++i) {
|
2022-01-19 01:11:02 +00:00
|
|
|
auto &[predId, predPc, isException] = bb.expandedPreds.at(i);
|
2022-01-18 04:02:20 +00:00
|
|
|
circuit_.NewIn(gate, i + 1, defSiteOfReg(predId, predPc, reg, acc));
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
ans = bb.vregToValSelectorGate.at(reg);
|
2022-01-18 04:02:20 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
// find def-site in value selectors of acc
|
|
|
|
if (ans == Circuit::NullGate() && acc && bb.phiAcc) {
|
|
|
|
if (bb.valueSelectorAccGate == Circuit::NullGate()) {
|
2022-02-09 08:51:58 +00:00
|
|
|
auto gate = circuit_.NewGate(OpCode(OpCode::VALUE_SELECTOR), MachineType::I64,
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.numOfStatePreds,
|
|
|
|
std::vector<GateRef>(
|
|
|
|
1 + bb.numOfStatePreds, Circuit::NullGate()),
|
2022-01-27 08:46:57 +00:00
|
|
|
GateType::JS_ANY);
|
2022-01-19 01:11:02 +00:00
|
|
|
bb.valueSelectorAccGate = gate;
|
2022-01-18 04:02:20 +00:00
|
|
|
circuit_.NewIn(gate, 0, bb.stateStart);
|
2022-01-27 08:46:57 +00:00
|
|
|
for (int32_t i = 0; i < bb.numOfStatePreds; ++i) {
|
2022-01-19 01:11:02 +00:00
|
|
|
auto &[predId, predPc, isException] = bb.expandedPreds.at(i);
|
2022-02-10 02:03:48 +00:00
|
|
|
circuit_.NewIn(gate, i + 1, defSiteOfReg(predId, predPc, reg, acc));
|
2022-01-18 04:02:20 +00:00
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
ans = bb.valueSelectorAccGate;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
if (ans == Circuit::NullGate() && bbId == 0) { // entry block
|
|
|
|
// find def-site in function args
|
2022-01-18 04:02:20 +00:00
|
|
|
ASSERT(!acc && reg >= offsetArgs && reg < offsetArgs + argGates.size());
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
const panda_file::File *pf = file_->GetPandaFile();
|
|
|
|
auto argVreg = reg - offsetArgs;
|
2022-03-22 02:33:19 +00:00
|
|
|
auto tsType = tsLoader->GetGTFromPandaFile(*pf, argVreg, method_).GetGlobalTSTypeRef();
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
auto index = GetFunctionArgIndex(reg, offsetArgs);
|
|
|
|
circuit_.LoadGatePtr(ans)->SetGateType(static_cast<GateType>(tsType));
|
|
|
|
return argGates.at(index);
|
2022-01-18 04:02:20 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
if (ans == Circuit::NullGate()) {
|
|
|
|
// recursively find def-site in dominator block
|
2022-01-18 04:02:20 +00:00
|
|
|
return defSiteOfReg(bb.iDominator->id, bb.iDominator->end, reg, acc);
|
|
|
|
} else {
|
2022-01-19 01:11:02 +00:00
|
|
|
// def-site already found
|
2022-03-07 02:58:13 +00:00
|
|
|
const panda_file::File *pf = file_->GetPandaFile();
|
2022-03-22 02:33:19 +00:00
|
|
|
auto tsType = tsLoader->GetGTFromPandaFile(*pf, reg, method_).GetGlobalTSTypeRef();
|
2022-03-07 02:58:13 +00:00
|
|
|
circuit_.LoadGatePtr(ans)->SetGateType(static_cast<GateType>(tsType));
|
2022-01-18 04:02:20 +00:00
|
|
|
return ans;
|
|
|
|
}
|
|
|
|
};
|
2022-03-02 08:06:19 +00:00
|
|
|
auto stateCount = circuit_.GetOpCode(gate).GetStateCount(circuit_.GetBitField(gate));
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
auto dependCount = circuit_.GetOpCode(gate).GetDependCount(circuit_.GetBitField(gate));
|
2022-03-02 08:06:19 +00:00
|
|
|
for (size_t valueIdx = 0; valueIdx < valueCount; valueIdx++) {
|
|
|
|
auto inIdx = valueIdx + stateCount + dependCount;
|
2022-01-14 09:48:52 +00:00
|
|
|
if (!circuit_.IsInGateNull(gate, inIdx)) {
|
|
|
|
continue;
|
|
|
|
}
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
if (valueIdx < bytecodeInfo.inputs.size()) {
|
|
|
|
circuit_.NewIn(gate, inIdx,
|
|
|
|
defSiteOfReg(id, pc - 1,
|
|
|
|
std::get<VirtualRegister>(bytecodeInfo.inputs.at(valueIdx)).GetId(),
|
|
|
|
false));
|
2022-01-06 02:26:19 +00:00
|
|
|
} else {
|
|
|
|
circuit_.NewIn(gate, inIdx, defSiteOfReg(id, pc - 1, 0, true));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if ECMASCRIPT_ENABLE_TS_AOT_PRINT
|
2022-01-18 04:02:20 +00:00
|
|
|
circuit_.PrintAllGates(*this);
|
2022-01-06 02:26:19 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
size_t BytecodeCircuitBuilder::GetFunctionArgIndex(size_t currentVreg, size_t numVregs) const
|
|
|
|
{
|
|
|
|
return (currentVreg - numVregs + CommonArgIdx::NUM_OF_ARGS);
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::PrintCollectBlockInfo(std::vector<CfgInfo> &bytecodeBlockInfos)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-19 01:11:02 +00:00
|
|
|
for (auto iter = bytecodeBlockInfos.begin(); iter != bytecodeBlockInfos.end(); iter++) {
|
|
|
|
std::cout << "offset: " << static_cast<const void *>(iter->pc) << " splitKind: " <<
|
|
|
|
static_cast<int32_t>(iter->splitKind) << " successor are: ";
|
|
|
|
auto &vec = iter->succs;
|
2022-01-18 04:02:20 +00:00
|
|
|
for (size_t i = 0; i < vec.size(); i++) {
|
|
|
|
std::cout << static_cast<const void *>(vec[i]) << " , ";
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
std::cout << "" << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
std::cout << "-----------------------------------------------------------------------" << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::PrintGraph(std::vector<BytecodeRegion> &graph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t i = 0; i < graph.size(); i++) {
|
|
|
|
if (graph[i].isDead) {
|
|
|
|
std::cout << "BB_" << graph[i].id << ": ;predsId= invalid BB" << std::endl;
|
|
|
|
std::cout << "curStartPc: " << static_cast<const void *>(graph[i].start) <<
|
|
|
|
" curEndPc: " << static_cast<const void *>(graph[i].end) << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
std::cout << "BB_" << graph[i].id << ": ;predsId= ";
|
|
|
|
for (size_t k = 0; k < graph[i].preds.size(); ++k) {
|
|
|
|
std::cout << graph[i].preds[k]->id << ", ";
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
std::cout << "" << std::endl;
|
2022-01-19 01:11:02 +00:00
|
|
|
std::cout << "curStartPc: " << static_cast<const void *>(graph[i].start) <<
|
|
|
|
" curEndPc: " << static_cast<const void *>(graph[i].end) << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t j = 0; j < graph[i].preds.size(); j++) {
|
|
|
|
std::cout << "predsStartPc: " << static_cast<const void *>(graph[i].preds[j]->start) <<
|
|
|
|
" predsEndPc: " << static_cast<const void *>(graph[i].preds[j]->end) << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t j = 0; j < graph[i].succs.size(); j++) {
|
|
|
|
std::cout << "succesStartPc: " << static_cast<const void *>(graph[i].succs[j]->start) <<
|
|
|
|
" succesEndPc: " << static_cast<const void *>(graph[i].succs[j]->end) << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-18 04:02:20 +00:00
|
|
|
std::cout << "succesId: ";
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t j = 0; j < graph[i].succs.size(); j++) {
|
|
|
|
std::cout << graph[i].succs[j]->id << ", ";
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
std::cout << "" << std::endl;
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t j = 0; j < graph[i].catchs.size(); j++) {
|
|
|
|
std::cout << "catchStartPc: " << static_cast<const void *>(graph[i].catchs[j]->start) <<
|
|
|
|
" catchEndPc: " << static_cast<const void *>(graph[i].catchs[j]->end) << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
for (size_t j = 0; j < graph[i].immDomBlocks.size(); j++) {
|
|
|
|
std::cout << "dominate block id: " << graph[i].immDomBlocks[j]->id << " startPc: " <<
|
|
|
|
static_cast<const void *>(graph[i].immDomBlocks[j]->start) << " endPc: " <<
|
|
|
|
static_cast<const void *>(graph[i].immDomBlocks[j]->end) << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
if (graph[i].iDominator) {
|
|
|
|
std::cout << "current block " << graph[i].id <<
|
|
|
|
" immediate dominator is " << graph[i].iDominator->id << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
|
2022-03-07 02:58:13 +00:00
|
|
|
std::cout << "current block " << graph[i].id << " dominance Frontiers: ";
|
2022-01-19 01:11:02 +00:00
|
|
|
for (const auto &frontier: graph[i].domFrontiers) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << frontier->id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
2022-01-19 01:11:02 +00:00
|
|
|
std::cout << "current block " << graph[i].id << " phi variable: ";
|
|
|
|
for (auto variable: graph[i].phi) {
|
2022-01-18 04:02:20 +00:00
|
|
|
std::cout << variable << " , ";
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
2022-01-19 01:11:02 +00:00
|
|
|
std::cout << "-------------------------------------------------------" << std::endl;
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::PrintBytecodeInfo(std::vector<BytecodeRegion> &graph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
auto pc = bb.start;
|
|
|
|
std::cout << "BB_" << bb.id << ": " << std::endl;
|
|
|
|
while (pc <= bb.end) {
|
2022-01-22 11:09:02 +00:00
|
|
|
auto curInfo = GetBytecodeInfo(pc);
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
std::cout << "Inst_" << GetEcmaOpcodeStr(static_cast<EcmaOpcode>(*pc)) << ": ";
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << "In=[";
|
|
|
|
if (curInfo.accIn) {
|
|
|
|
std::cout << "acc" << ",";
|
|
|
|
}
|
Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.
For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5
Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-04 07:52:07 +00:00
|
|
|
for (const auto &in: curInfo.inputs) {
|
|
|
|
if (std::holds_alternative<VirtualRegister>(in)) {
|
|
|
|
std::cout << std::get<VirtualRegister>(in).GetId() << ",";
|
|
|
|
}
|
2022-01-06 02:26:19 +00:00
|
|
|
}
|
|
|
|
std::cout << "] Out=[";
|
|
|
|
if (curInfo.accOut) {
|
|
|
|
std::cout << "acc" << ",";
|
|
|
|
}
|
2022-01-18 04:02:20 +00:00
|
|
|
for (const auto &out: curInfo.vregOut) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << out << ",";
|
|
|
|
}
|
|
|
|
std::cout << "]";
|
|
|
|
std::cout << std::endl;
|
|
|
|
pc += curInfo.offset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:09:02 +00:00
|
|
|
void BytecodeCircuitBuilder::PrintBBInfo(std::vector<BytecodeRegion> &graph)
|
2022-01-06 02:26:19 +00:00
|
|
|
{
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto &bb: graph) {
|
2022-01-06 02:26:19 +00:00
|
|
|
if (bb.isDead) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
std::cout << "------------------------" << std::endl;
|
|
|
|
std::cout << "block: " << bb.id << std::endl;
|
|
|
|
std::cout << "preds: ";
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto pred: bb.preds) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << pred->id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << "succs: ";
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto succ: bb.succs) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << succ->id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << "catchs: ";
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto catchBlock: bb.catchs) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << catchBlock->id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << "trys: ";
|
2022-01-18 04:02:20 +00:00
|
|
|
for (auto tryBlock: bb.trys) {
|
2022-01-06 02:26:19 +00:00
|
|
|
std::cout << tryBlock->id << " , ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
}
|
2022-01-19 01:11:02 +00:00
|
|
|
} // namespace panda::ecmascript::kungfu
|