/arkcompiler/ets_runtime/ecmascript/compiler/ |
H A D | graph_editor.cpp | 46 auto uses = acc_.Uses(gate); in ReplaceGate() 48 if (acc_.IsDependIn(useIt)) { in ReplaceGate() 49 GateRef depend = acc_.GetDep(gate); in ReplaceGate() 50 useIt = acc_.ReplaceIn(useIt, depend); in ReplaceGate() 53 useIt = acc_.ReplaceIn(useIt, circuit_->DeadGate()); in ReplaceGate() 56 acc_.DeleteGate(gate); in ReplaceGate() 65 auto opcode = acc_.GetOpCode(gate); in RemoveGate() 88 if (acc_.IsStateIn(gate, edge.GetIndex())) { in PropagateGate() 89 ASSERT(acc_.GetStateCount(gate) == 1); in PropagateGate() 95 if (acc_ in PropagateGate() [all...] |
H A D | dead_code_elimination.cpp | 22 auto opcode = acc_.GetOpCode(gate); in VisitGate() 44 auto state = acc_.GetState(gate); in StateIsDead() 45 if (acc_.IsDead(state)) { in StateIsDead() 54 if (state != Circuit::NullGate() && acc_.IsDead(state)) { in EliminateDependSelector() 57 auto stateInput = acc_.GetState(gate); in EliminateDependSelector() 58 size_t dependCount = acc_.GetDependCount(gate); in EliminateDependSelector() 61 auto depend = acc_.GetDep(gate, i); in EliminateDependSelector() 62 if (acc_.IsDead(depend)) { in EliminateDependSelector() 63 acc_.ReplaceStateIn(stateInput, deadGate_, i); in EliminateDependSelector() 74 if (state != Circuit::NullGate() && acc_ in EliminateIfException() [all...] |
H A D | ntype_bytecode_lowering.cpp | 33 auto op = acc_.GetOpCode(gate); in RunNTypeBytecodeLowering() 55 EcmaOpcode ecmaOpcode = acc_.GetByteCodeOpcode(gate); in Lower() 123 GateRef value = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerThrowUndefinedIfHoleWithName() 125 acc_.ReplaceHirAndDeleteIfException(gate, builder_.GetStateDepend(), Circuit::NullGate()); in LowerThrowUndefinedIfHoleWithName() 131 GateRef index = acc_.GetValueIn(gate, 0); in LowerThrowIfSuperNotCorrectCall() 132 GateRef value = acc_.GetValueIn(gate, 1); in LowerThrowIfSuperNotCorrectCall() 133 uint32_t indexValue = static_cast<uint32_t>(acc_.GetConstantValue(index)); in LowerThrowIfSuperNotCorrectCall() 141 acc_.ReplaceHirAndDeleteIfException(gate, builder_.GetStateDepend(), builder_.TaggedTrue()); in LowerThrowIfSuperNotCorrectCall() 147 GateRef value = acc_.GetValueIn(gate, 0); // 0: the first parameter in LowerThrowIfNotObject() 149 acc_ in LowerThrowIfNotObject() [all...] |
H A D | loop_analysis.cpp | 26 LOG_COMPILER(INFO) << "Head: " << acc_.GetId(loopInfo->loopHead); in PrintLoop() 31 acc_.ShortPrint(gate); in PrintLoop() 36 acc_.ShortPrint(gate); in PrintLoop() 59 auto use = acc_.Uses(cur); in CollectUseGate() 64 if (isCurLoop && acc_.IsLoopExit(cur) && (!acc_.IsFixed(*it))) { in CollectUseGate() 66 } else if (isCurLoop && acc_.IsLoopExitRelated(cur) && acc_.IsFixed(cur)) { in CollectUseGate() 68 } else if (acc_.GetDependCount(nex) == 0 && acc_ in CollectUseGate() [all...] |
H A D | loop_peeling.cpp | 26 ASSERT(acc_.GetOpCode(exit) == OpCode::LOOP_EXIT); in CopyLoopExit() 28 GateRef copyExit = GetCopy(acc_.GetState(exit)); in CopyLoopExit() 30 auto exitUse = acc_.Uses(exit); in CopyLoopExit() 32 if (acc_.GetOpCode(*it) == OpCode::LOOP_EXIT_DEPEND) { in CopyLoopExit() 34 GateRef copyDepend = GetCopy(acc_.GetDep(depend)); in CopyLoopExit() 36 acc_.UpdateAllUses(depend, selector); in CopyLoopExit() 37 acc_.ReplaceIn(selector, 1, depend); // 0: index of exit depend in CopyLoopExit() 39 } else if (acc_.GetOpCode(*it) == OpCode::LOOP_EXIT_VALUE) { in CopyLoopExit() 41 GateRef copyValue = GetCopy(acc_.GetValueIn(value)); in CopyLoopExit() 42 ASSERT(acc_ in CopyLoopExit() [all...] |
H A D | ts_hcr_opt_pass.cpp | 24 auto opcode = acc_.GetOpCode(gate); in VisitGate() 36 if (IsTypedOpProfiling() && acc_.UseForTypeOpProfilerGate(gate)) { in AddProfiling() 38 OpCode opcode = acc_.GetOpCode(gate); in AddProfiling() 41 GateRef traceGate = builder_.CallRuntime(acc_.GetGlueFromArgList(), RTSTUB_ID(ProfileTypedOp), in AddProfiling() 42 acc_.GetDep(gate), { constOpcode }, gate); in AddProfiling() 43 acc_.SetDep(gate, traceGate); in AddProfiling() 44 builder_.SetDepend(acc_.GetDep(gate)); in AddProfiling() 50 if (acc_.HasStringType(gate)) { in VisitTypedBinaryOp() 58 TypedBinOp op = acc_.GetTypedBinaryOp(gate); in VisitStringBinOp() 72 GateRef left = acc_ in VisitStringEqual() [all...] |
H A D | induction_variable_analysis.cpp | 22 if (acc_.GetOpCode(gate) != OpCode::CONSTANT) { in IsIntConstant() 25 JSTaggedValue value(acc_.GetConstantValue(gate)); in IsIntConstant() 31 if (acc_.GetOpCode(gate) != OpCode::VALUE_SELECTOR) { in IsInductionVariable() 34 size_t numValueIn = acc_.GetNumValueIn(gate); in IsInductionVariable() 35 GateRef startGate = acc_.GetValueIn(gate, 0); in IsInductionVariable() 36 GateRef valueGate = acc_.GetValueIn(gate, 1); in IsInductionVariable() 40 if (acc_.GetOpCode(valueGate) != OpCode::TYPED_BINARY_OP) { in IsInductionVariable() 43 TypedBinOp binOp = acc_.GetTypedBinaryOp(valueGate); in IsInductionVariable() 47 TypedBinaryAccessor accessor(acc_.TryGetValue(valueGate)); in IsInductionVariable() 54 if (acc_ in IsInductionVariable() [all...] |
H A D | early_elimination.cpp | 24 GateRef entry = acc_.GetDependRoot(); in Initialize() 30 auto depIn = acc_.GetDep(depend); in GetLoopDependInfo() 40 visited.insert(acc_.GetDep(depend)); in GetLoopDependInfo() 47 if (!acc_.IsNotWrite(curDep)) { in GetLoopDependInfo() 51 auto depCount = acc_.GetDependCount(curDep); in GetLoopDependInfo() 53 workList.push(acc_.GetDep(curDep, i)); in GetLoopDependInfo() 67 auto opcode = acc_.GetOpCode(gate); in VisitGate() 108 if (acc_.GetDependCount(gate) == 1) { // 1: depend in is 1 in VisitGate() 118 ASSERT(acc_.GetDependCount(gate) >= 1); in TryEliminateOther() 119 auto depIn = acc_ in TryEliminateOther() [all...] |
H A D | lexical_env_specialization_pass.cpp | 24 GateRef entry = acc_.GetDependRoot(); in Initialize() 36 auto opcode = acc_.GetOpCode(gate); in VisitGate() 39 EcmaOpcode ecmaOpcode = acc_.GetByteCodeOpcode(gate); in VisitGate() 48 if (acc_.GetDependCount(gate) == 1) { // 1: depend in is 1 in VisitGate() 57 ASSERT(acc_.GetDependCount(gate) >= 1); in VisitOther() 58 auto depIn = acc_.GetDep(gate); in VisitOther() 69 auto state = acc_.GetState(gate); in VisitDependSelector() 70 if (acc_.IsLoopHead(state)) { in VisitDependSelector() 75 auto dependCount = acc_.GetDependCount(gate); in VisitDependSelector() 77 auto depend = acc_ in VisitDependSelector() [all...] |
H A D | later_elimination.cpp | 22 GateRef entry = acc_.GetDependRoot(); in Initialize() 34 auto opcode = acc_.GetOpCode(gate); in VisitGate() 62 if (acc_.GetDependCount(gate) == 1) { // 1: depend in is 1 in VisitGate() 71 ASSERT(acc_.GetDependCount(gate) >= 1); in TryEliminateOther() 72 auto depIn = acc_.GetDep(gate); in TryEliminateOther() 82 ASSERT(acc_.GetDependCount(gate) == 1); in TryEliminateGate() 83 auto depIn = acc_.GetDep(gate); in TryEliminateGate() 101 auto state = acc_.GetState(gate); in TryEliminateDependSelector() 102 if (acc_.IsLoopHead(state)) { in TryEliminateDependSelector() 107 auto dependCount = acc_ in TryEliminateDependSelector() [all...] |
H A D | number_speculative_retype.cpp | 104 GateType gateType = acc_.GetGateType(gate); in GetNumberTypeInfo() 139 OpCode op = acc_.GetOpCode(gate); in VisitGate() 360 if (acc_.HasStringType(gate)) { in VisitTypedBinaryOp() 364 if (acc_.GetTypedBinaryOp(gate) != TypedBinOp::TYPED_STRICTEQ && in VisitTypedBinaryOp() 365 acc_.GetTypedBinaryOp(gate) != TypedBinOp::TYPED_STRICTNOTEQ && in VisitTypedBinaryOp() 366 acc_.GetTypedBinaryOp(gate) != TypedBinOp::TYPED_EQ && in VisitTypedBinaryOp() 367 acc_.GetTypedBinaryOp(gate) != TypedBinOp::TYPED_NOTEQ) { in VisitTypedBinaryOp() 368 if (acc_.HasNumberType(gate)) { in VisitTypedBinaryOp() 379 ASSERT(acc_.GetOpCode(gate) == OpCode::ARRAY_FIND_OR_FINDINDEX); in VisitArrayFindOrFindIndex() 380 ASSERT(acc_ in VisitArrayFindOrFindIndex() [all...] |
H A D | combined_pass_visitor.cpp | 22 auto id = acc_.GetId(gate); in GetGateOrder() 26 return orderList_[acc_.GetId(gate)]; in GetGateOrder() 31 auto id = acc_.GetId(gate); in SetGateOrder() 35 orderList_[acc_.GetId(gate)] = orderId; in SetGateOrder() 50 auto uses = acc_.Uses(gate); in LogicallyReplaceGate() 52 if (acc_.GetMark(*it) == MarkCode::FINISHED) { in LogicallyReplaceGate() 55 it = acc_.ReplaceIn(it, replacement); in LogicallyReplaceGate() 60 ReplaceGate(gate, StateDepend {acc_.GetState(gate), acc_.GetDep(gate)}, gate); in RelaxStateAndDepend() 66 if (acc_ in ReplaceGate() [all...] |
H A D | number_speculative_lowering.cpp | 34 acc_.GetAllGates(gateList); in Run() 36 auto op = acc_.GetOpCode(gate); in Run() 54 OpCode op = acc_.GetOpCode(gate); in VisitGate() 121 if (acc_.HasStringType(gate)) { in VisitTypedBinaryOp() 125 auto op = acc_.GetTypedBinaryOp(gate); in VisitTypedBinaryOp() 138 if (acc_.HasNumberType(gate)) { in VisitTypedBinaryOp() 148 if (acc_.HasNumberType(gate)) { in VisitEqualOrNotEqual() 157 if (acc_.HasNumberType(gate)) { in VisitStrictEqualOrStrictNotEqual() 166 TypedBinOp Op = acc_.GetTypedBinaryOp(gate); in VisitNumberBinaryOp() 252 TypedUnOp Op = acc_ in VisitTypedUnaryOp() [all...] |
H A D | string_builder_optimizer.cpp | 32 acc_.GetAllGates(gateList); in VisitGraph() 49 auto op = acc_.GetOpCode(gate); in FindBuilderBegin() 52 GateRef left = acc_.GetValueIn(gate, 0); in FindBuilderBegin() 62 auto leftOp = acc_.GetOpCode(left); in FindBuilderBegin() 66 curStringAddId_ = acc_.GetId(gate); in FindBuilderBegin() 90 auto uses = acc_.Uses(curr); in FindInBuilder() 93 if (!acc_.IsValueIn(it)) { in FindInBuilder() 108 auto useOpCode = acc_.GetOpCode(use); in VisitGateUse() 122 GateRef left = acc_.GetValueIn(use, 0); in VisitGateUse() 123 auto leftOp = acc_ in VisitGateUse() [all...] |
H A D | value_numbering.cpp | 23 auto opcode = acc_.GetOpCode(gate); in VisitGate() 27 if (acc_.GetStateCount(gate) > 0 || acc_.GetDependCount(gate) > 0) { in VisitGate() 61 if (acc_.IsNop(entry)) { in VisitGate() 70 acc_.Print(gate); in VisitGate() 71 acc_.Print(entry); in VisitGate() 97 if (oldEnrty == Circuit::NullGate() || acc_.IsNop(oldEnrty)) { in Grow() 146 size_t valueCount = acc_.GetNumValueIn(gate); in HashCode() 147 size_t hash = HashCombine(static_cast<size_t>(acc_.GetOpCode(gate)), valueCount); in HashCode() 149 GateRef input = acc_ in HashCode() [all...] |
H A D | constant_folding.cpp | 30 auto op = acc_.GetOpCode(gate); in VisitGate() 51 auto input = acc_.GetValueIn(gate, 0); in VisitZEXT() 52 if (acc_.GetMachineType(gate) == acc_.GetMachineType(input)) { in VisitZEXT() 59 int value = acc_.GetInt32FromConstant(input); in VisitZEXT() 60 auto machineType = acc_.GetMachineType(gate); in VisitZEXT() 78 auto left = acc_.GetValueIn(gate, 0); in VisitSMOD() 79 auto right = acc_.GetValueIn(gate, 1); in VisitSMOD() 86 int lvalue = acc_.GetInt32FromConstant(left); in VisitSMOD() 87 int rvalue = acc_ in VisitSMOD() [all...] |
H A D | range_guard.cpp | 22 GateRef entry = acc_.GetDependRoot(); in Initialize() 28 auto op = acc_.GetOpCode(gate); in VisitGate() 40 if (acc_.GetDependCount(gate) == 1) { // 1: depend in is 1 in VisitGate() 51 ASSERT(acc_.GetDependCount(gate) >= 1); in TraverseOthers() 52 auto depIn = acc_.GetDep(gate); in TraverseOthers() 63 auto state = acc_.GetState(gate); in TraverseDependSelector() 64 if (acc_.IsLoopHead(state)) { in TraverseDependSelector() 68 auto dependCount = acc_.GetDependCount(gate); in TraverseDependSelector() 70 auto depend = acc_.GetDep(gate, i); in TraverseDependSelector() 78 auto depend = acc_ in TraverseDependSelector() [all...] |
H A D | native_inline_lowering.cpp | 35 EcmaOpcode ecmaOpcode = acc_.GetByteCodeOpcode(gate); in GetCallInfo() 71 auto op = acc_.GetOpCode(gate); in RunNativeInlineLowering() 409 GateRef frameState = acc_.GetFrameState(gate); in AddTraceLogs() 410 GateRef frameArgs = acc_.GetValueIn(frameState); in AddTraceLogs() 411 GateRef callerFunc = acc_.GetValueIn(frameArgs, 0); in AddTraceLogs() 438 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), ret); in TryInlineStringFromCharCode() 448 GateRef thisValue = acc_.GetValueIn(gate, 0); in TryInlineStringCharCodeAt() 449 GateRef posTag = (argc == 0) ? (builder_.Int32(0)) : (acc_.GetValueIn(gate, 1)); in TryInlineStringCharCodeAt() 450 GateRef func = acc_.GetValueIn(gate, argc + 1); in TryInlineStringCharCodeAt() 464 acc_ in TryInlineStringCharCodeAt() [all...] |
H A D | useless_gate_elimination.cpp | 23 acc_.SetMark(gate, MarkCode::VISITED); in PushGate() 29 GateRef returnList = acc_.GetReturnRoot(); in InitList() 30 auto uses = acc_.Uses(returnList); in InitList() 36 if (acc_.GetOpCode(gate) == OpCode::LOOP_BEGIN) { in InitList() 38 } else if (acc_.IsProlog(gate) || acc_.IsRoot(gate)) { in InitList() 39 acc_.SetMark(gate, MarkCode::VISITED); in InitList() 50 acc_.GetIns(gate, ins); in MarkGate() 52 if (acc_.GetMark(in) != MarkCode::VISITED) { in MarkGate() 61 auto uses = acc_ in ReplaceDead() [all...] |
H A D | array_bounds_check_elimination.cpp | 172 int constValue = static_cast<int>(acc_.GetConstantValue(gate)); in DoConstant() 178 auto op = acc_.GetTypedBinaryOp(gate); in DoBinaryArithmeticOp() 179 auto x = FindBoundGate(acc_.GetValueIn(gate, 0)); in DoBinaryArithmeticOp() 180 auto y = FindBoundGate(acc_.GetValueIn(gate, 1)); in DoBinaryArithmeticOp() 181 if (!acc_.IsConstant(x) || !acc_.IsConstant(y)) { // One of the operands must be non-constant! in DoBinaryArithmeticOp() 182 if (op == TypedBinOp::TYPED_AND && (acc_.IsConstant(x) || acc_.IsConstant(y))) { in DoBinaryArithmeticOp() 184 if (acc_.IsConstant(x)) { in DoBinaryArithmeticOp() 185 constValue = static_cast<int>(acc_ in DoBinaryArithmeticOp() [all...] |
H A D | escape_analysis.cpp | 67 : circuit_(circuit), acc_(circuit), curGate_(curGate), escapeAnalysis_(escapeAnalysis), state_(chunk) in GateInfo() 69 if (acc_.GetOpCode(curGate) == OpCode::DEPEND_SELECTOR) { in GateInfo() 72 ASSERT(acc_.GetDependCount(curGate) <= 1); in GateInfo() 73 if (acc_.GetDependCount(curGate) == 1) { in GateInfo() 74 state_ = escapeAnalysis_->GetOrCreateState(acc_.GetDep(curGate)); in GateInfo() 99 size_t numIn = acc_.GetDependCount(gate); in MergeState() 100 State& preState = escapeAnalysis_->GetOrCreateState(acc_.GetDep(gate, 0)); in MergeState() 108 input.push_back(acc_.GetState(gate)); in MergeState() 113 State& inputState = escapeAnalysis_->GetOrCreateState(acc_.GetDep(gate, i)); in MergeState() 124 if (numAliveState == 1 && acc_ in MergeState() [all...] |
H A D | state_split_linearizer.cpp | 87 acc_(linearizer->circuit_), map_(chunk), pendingEdges_(chunk) {} in StateDependBuilder() 91 maxGateId_ = acc_.GetCircuit()->GetMaxGateId(); in Run() 92 replacement_.SetDepend(acc_.GetDependRoot()); in Run() 95 acc_.GetCircuit()->AdvanceTime(); in Run() 96 entry->SetVisited(acc_); in Run() 104 if (!succ->IsVisited(acc_)) { in Run() 105 succ->SetVisited(acc_); in Run() 117 auto circuit = acc_.GetCircuit(); in DeleteUnusedGates() 121 if (acc_.GetMark(gate) == MarkCode::NO_MARK && in DeleteUnusedGates() 122 !acc_ in DeleteUnusedGates() 334 GateAccessor acc_; global() member in panda::ecmascript::kungfu::StateDependBuilder [all...] |
H A D | mcr_lowering.cpp | 32 auto op = acc_.GetOpCode(gate); in VisitGate() 148 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerConvertHoleAsUndefined() 159 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), *result); in LowerConvertHoleAsUndefined() 165 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerLoadConstOffset() 166 GateRef offset = builder_.IntPtr(acc_.GetOffset(gate)); in LowerLoadConstOffset() 167 VariableType type = VariableType(acc_.GetMachineType(gate), acc_.GetGateType(gate)); in LowerLoadConstOffset() 168 GateRef result = builder_.Load(type, receiver, offset, acc_.GetMemoryAttribute(gate)); in LowerLoadConstOffset() 169 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), result); in LowerLoadConstOffset() 175 GateRef constpool = acc_ in LowerLoadHClassFromConstpool() [all...] |
H A D | slowpath_lowering.cpp | 52 auto op = acc_.GetOpCode(gate); in CallRuntimeLowering() 102 GateRef sharedConstPool = acc_.GetValueIn(gate, 0); in CallRuntimeLowering() 103 ASSERT(acc_.GetOpCode(sharedConstPool) == OpCode::GET_SHARED_CONSTPOOL); in CallRuntimeLowering() 121 GateRef jsFunc = acc_.GetValueIn(gate, 0); in LowerGetEnv() 123 GateRef env = builder_.Load(VariableType::JS_ANY(), jsFunc, envOffset, acc_.GetDep(gate)); in LowerGetEnv() 124 acc_.UpdateAllUses(gate, env); in LowerGetEnv() 125 acc_.DeleteGate(gate); in LowerGetEnv() 130 auto state = acc_.GetState(gate); in DeleteLoopExit() 131 acc_.ReplaceGate(gate, state, Circuit::NullGate(), Circuit::NullGate()); in DeleteLoopExit() 136 auto state = acc_ in DeleteLoopExitValue() [all...] |
H A D | range_analysis.cpp | 22 auto &range = rangeInfos_[acc_.GetId(gate)]; in UpdateRange() 33 ASSERT(acc_.GetId(gate) < rangeInfos_.size()); in GetRange() 34 return rangeInfos_[acc_.GetId(gate)]; in GetRange() 39 auto id = acc_.GetId(gate); in IsInt32Type() 41 return acc_.GetMachineType(gate) == MachineType::I32; in IsInt32Type() 48 auto op = acc_.GetOpCode(gate); in VisitGate() 81 auto numIn = acc_.GetInValueCount(gate); in VisitPhi() 83 auto valueIn = acc_.GetValueIn(gate, i); in VisitPhi() 102 auto value = acc_.GetInt32FromConstant(gate); in VisitConstant() 111 auto op = acc_ in VisitTypedUnaryOp() [all...] |