diff --git a/ecmascript/compiler/circuit_builder.cpp b/ecmascript/compiler/circuit_builder.cpp index a5501bfac937b1a1b92f9e6249e658ca24f67855..9b591c8091671211cda0056d409494ee1c4c7bc3 100644 --- a/ecmascript/compiler/circuit_builder.cpp +++ b/ecmascript/compiler/circuit_builder.cpp @@ -368,14 +368,14 @@ void CircuitBuilder::ClearConstantCache(GateRef gate) void CircuitBuilder::DeoptCheck(GateRef condition, GateRef frameState, DeoptType type) { - std::string comment = Deoptimizier::DisplayItems(type); auto currentLabel = env_->GetCurrentLabel(); auto currentControl = currentLabel->GetControl(); auto currentDepend = currentLabel->GetDepend(); ASSERT(acc_.GetOpCode(frameState) == OpCode::FRAME_STATE); GateRef deoptCheck = GetCircuit()->NewGate(circuit_->DeoptCheck(), MachineType::I1, { currentControl, currentDepend, condition, - frameState, Int64(static_cast(type))}, GateType::NJSValue(), comment.c_str()); + frameState, Int64(static_cast(type))}, GateType::NJSValue(), + this->cmpCfg_->IsTraceBC() ? Deoptimizier::DisplayItems(type).c_str() : nullptr); // Add a state output to avoid schedule a phi node to deoptCheck's BB by mistake GateRef trueBB = circuit_->NewGate(circuit_->OrdinaryBlock(), { deoptCheck }); auto dependRelay = DependRelay(trueBB, currentDepend); diff --git a/ecmascript/compiler/graph_linearizer.cpp b/ecmascript/compiler/graph_linearizer.cpp index bbfbe88359ea22381637792f808aa9b241528c4b..43883ba9272da9283b47374a00c4e07be4b4819e 100644 --- a/ecmascript/compiler/graph_linearizer.cpp +++ b/ecmascript/compiler/graph_linearizer.cpp @@ -229,7 +229,7 @@ public: size_t UnionFind(size_t idx) { - std::stack allIdxs; + std::stack> allIdxs; allIdxs.emplace(idx); size_t pIdx = parentIdx_[idx]; while (pIdx != allIdxs.top()) { diff --git a/ecmascript/compiler/scheduler.cpp b/ecmascript/compiler/scheduler.cpp index e921879b3dd974d25866e273226ec061f5380c88..720141659b24b2fe236ee7ae0d0df48ce86b1194 100644 --- a/ecmascript/compiler/scheduler.cpp +++ b/ecmascript/compiler/scheduler.cpp @@ -20,7 +20,7 @@ namespace panda::ecmascript::kungfu { size_t UnionFind(std::vector &semiDom, std::vector &parent, std::vector &minIdx, size_t idx) { - std::stack allIdxs; + std::stack> allIdxs; allIdxs.emplace(idx); size_t pIdx = parent[idx]; while (pIdx != allIdxs.top()) { diff --git a/ecmascript/compiler/typed_bytecode_lowering.cpp b/ecmascript/compiler/typed_bytecode_lowering.cpp index 0517a10973fbaeee0886d54d504e8d3110f2d845..5e8b0d064c5930ce20ab2dcc90c28b8e5e4e056e 100644 --- a/ecmascript/compiler/typed_bytecode_lowering.cpp +++ b/ecmascript/compiler/typed_bytecode_lowering.cpp @@ -458,7 +458,9 @@ template void TypedBytecodeLowering::SpeculateNumbers(const BinOpTypeInfoAccessor &tacc) { AddProfiling(tacc.GetGate()); - pgoTypeLog_.CollectGateTypeLogInfo(tacc.GetGate(), true); + if (IsLogEnabled()) { + pgoTypeLog_.CollectGateTypeLogInfo(tacc.GetGate(), true); + } GateRef left = tacc.GetLeftGate(); GateRef right = tacc.GetReightGate(); GateRef result = builder_.TypedBinaryOp(left, right, tacc.GetParamType()); @@ -469,7 +471,9 @@ template void TypedBytecodeLowering::SpeculateNumber(const UnOpTypeInfoAccessor &tacc) { AddProfiling(tacc.GetGate()); - pgoTypeLog_.CollectGateTypeLogInfo(tacc.GetGate(), false); + if (IsLogEnabled()) { + pgoTypeLog_.CollectGateTypeLogInfo(tacc.GetGate(), false); + } GateRef result = builder_.TypedUnaryOp(tacc.GetValue(), tacc.GetParamType()); acc_.ReplaceHirAndReplaceDeadIfException(tacc.GetGate(), builder_.GetStateDepend(), result); }