Lines Matching refs:gate
25 size_t GateAccessor::GetNumIns(GateRef gate) const in GetNumIns()
27 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetNumIns()
31 MarkCode GateAccessor::GetMark(GateRef gate) const in GetMark()
33 return circuit_->GetMark(gate); in GetMark()
36 void GateAccessor::SetMark(GateRef gate, MarkCode mark) in SetMark() argument
38 circuit_->SetMark(gate, mark); in SetMark()
41 bool GateAccessor::IsFinished(GateRef gate) const in IsFinished()
43 return GetMark(gate) == MarkCode::FINISHED; in IsFinished()
46 bool GateAccessor::IsVisited(GateRef gate) const in IsVisited()
48 return GetMark(gate) == MarkCode::VISITED; in IsVisited()
51 bool GateAccessor::IsPrevisit(GateRef gate) const in IsPrevisit()
53 return GetMark(gate) == MarkCode::PREVISIT; in IsPrevisit()
56 bool GateAccessor::IsNotMarked(GateRef gate) const in IsNotMarked()
58 return GetMark(gate) == MarkCode::NO_MARK; in IsNotMarked()
61 void GateAccessor::SetFinished(GateRef gate) in SetFinished() argument
63 SetMark(gate, MarkCode::FINISHED); in SetFinished()
66 void GateAccessor::SetVisited(GateRef gate) in SetVisited() argument
68 SetMark(gate, MarkCode::VISITED); in SetVisited()
71 void GateAccessor::SetPrevisit(GateRef gate) in SetPrevisit() argument
73 SetMark(gate, MarkCode::PREVISIT); in SetPrevisit()
76 OpCode GateAccessor::GetOpCode(GateRef gate) const in GetOpCode()
78 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetOpCode()
82 BitField GateAccessor::TryGetValue(GateRef gate) const in TryGetValue()
84 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetValue()
88 ICmpCondition GateAccessor::GetICmpCondition(GateRef gate) const in GetICmpCondition()
90 ASSERT(GetOpCode(gate) == OpCode::ICMP); in GetICmpCondition()
91 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetICmpCondition()
95 FCmpCondition GateAccessor::GetFCmpCondition(GateRef gate) const in GetFCmpCondition()
97 ASSERT(GetOpCode(gate) == OpCode::FCMP); in GetFCmpCondition()
98 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetFCmpCondition()
102 size_t GateAccessor::GetOffset(GateRef gate) const in GetOffset()
104 ASSERT(GetOpCode(gate) == OpCode::LOAD_CONST_OFFSET || in GetOffset()
105 GetOpCode(gate) == OpCode::STORE_CONST_OFFSET); in GetOffset()
106 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetOffset()
111 uint32_t GateAccessor::GetTrueWeight(GateRef gate) const in GetTrueWeight()
113 ASSERT(GetOpCode(gate) == OpCode::IF_BRANCH); in GetTrueWeight()
114 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTrueWeight()
119 uint32_t GateAccessor::GetFalseWeight(GateRef gate) const in GetFalseWeight()
121 ASSERT(GetOpCode(gate) == OpCode::IF_BRANCH); in GetFalseWeight()
122 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetFalseWeight()
127 MemoryOrder GateAccessor::GetMemoryOrder(GateRef gate) const in GetMemoryOrder()
129 auto op = GetOpCode(gate); in GetMemoryOrder()
130 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetMemoryOrder()
150 bool GateAccessor::HasBranchWeight(GateRef gate) const in HasBranchWeight()
152 ASSERT(GetOpCode(gate) == OpCode::IF_BRANCH); in HasBranchWeight()
153 Gate *gatePtr = circuit_->LoadGatePtr(gate); in HasBranchWeight()
158 size_t GateAccessor::GetIndex(GateRef gate) const in GetIndex()
160 ASSERT(GetOpCode(gate) == OpCode::GET_GLOBAL_ENV_OBJ_HCLASS || in GetIndex()
161 GetOpCode(gate) == OpCode::GET_GLOBAL_CONSTANT_VALUE || in GetIndex()
162 GetOpCode(gate) == OpCode::GET_GLOBAL_ENV_OBJ || in GetIndex()
163 GetOpCode(gate) == OpCode::LOAD_HCLASS_FROM_CONSTPOOL || in GetIndex()
164 GetOpCode(gate) == OpCode::LOAD_BUILTIN_OBJECT); in GetIndex()
165 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetIndex()
169 size_t GateAccessor::GetJSType(GateRef gate) const in GetJSType()
171 ASSERT(GetOpCode(gate) == OpCode::IS_SPECIFIC_OBJECT_TYPE); in GetJSType()
172 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetJSType()
176 uint32_t GateAccessor::GetArraySize(GateRef gate) const in GetArraySize()
178 ASSERT(GetOpCode(gate) == OpCode::CREATE_ARRAY || in GetArraySize()
179 GetOpCode(gate) == OpCode::CREATE_ARRAY_WITH_BUFFER); in GetArraySize()
180 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetArraySize()
185 void GateAccessor::SetArraySize(GateRef gate, uint32_t size) in SetArraySize() argument
187 ASSERT(GetOpCode(gate) == OpCode::CREATE_ARRAY || in SetArraySize()
188 GetOpCode(gate) == OpCode::CREATE_ARRAY_WITH_BUFFER); in SetArraySize()
189 uint32_t curSize = GetArraySize(gate); in SetArraySize()
191 Gate *gatePtr = circuit_->LoadGatePtr(gate); in SetArraySize()
194 if (GetOpCode(gate) == OpCode::CREATE_ARRAY) { in SetArraySize()
196 SetMetaData(gate, meta); in SetArraySize()
199 SetMetaData(gate, meta); in SetArraySize()
204 uint32_t GateAccessor::GetStringStatus(GateRef gate) const in GetStringStatus()
206 ASSERT(GetOpCode(gate) == OpCode::STRING_ADD); in GetStringStatus()
207 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetStringStatus()
212 void GateAccessor::SetStringStatus(GateRef gate, uint32_t type) in SetStringStatus() argument
214 ASSERT(GetOpCode(gate) == OpCode::STRING_ADD); in SetStringStatus()
215 uint32_t curStatus = GetStringStatus(gate); in SetStringStatus()
219 SetMetaData(gate, meta); in SetStringStatus()
223 TypedUnaryAccessor GateAccessor::GetTypedUnAccessor(GateRef gate) const in GetTypedUnAccessor()
225 ASSERT((GetOpCode(gate) == OpCode::TYPED_UNARY_OP)); in GetTypedUnAccessor()
226 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedUnAccessor()
230 TypedBinaryAccessor GateAccessor::GetTypedBinaryAccessor(GateRef gate) const in GetTypedBinaryAccessor()
232 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedBinaryAccessor()
236 TypedJumpAccessor GateAccessor::GetTypedJumpAccessor(GateRef gate) const in GetTypedJumpAccessor()
238 ASSERT(GetOpCode(gate) == OpCode::TYPED_CONDITION_JUMP); in GetTypedJumpAccessor()
239 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedJumpAccessor()
243 ArrayMetaDataAccessor GateAccessor::GetArrayMetaDataAccessor(GateRef gate) const in GetArrayMetaDataAccessor()
245 ASSERT(GetOpCode(gate) == OpCode::STABLE_ARRAY_CHECK || in GetArrayMetaDataAccessor()
246 GetOpCode(gate) == OpCode::HCLASS_STABLE_ARRAY_CHECK || in GetArrayMetaDataAccessor()
247 GetOpCode(gate) == OpCode::CREATE_ARRAY || in GetArrayMetaDataAccessor()
248 GetOpCode(gate) == OpCode::CREATE_ARRAY_WITH_BUFFER); in GetArrayMetaDataAccessor()
249 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetArrayMetaDataAccessor()
253 ObjectTypeAccessor GateAccessor::GetObjectTypeAccessor(GateRef gate) const in GetObjectTypeAccessor()
255 ASSERT(GetOpCode(gate) == OpCode::OBJECT_TYPE_CHECK || in GetObjectTypeAccessor()
256 GetOpCode(gate) == OpCode::OBJECT_TYPE_COMPARE); in GetObjectTypeAccessor()
257 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetObjectTypeAccessor()
261 BuiltinPrototypeHClassAccessor GateAccessor::GetBuiltinHClassAccessor(GateRef gate) const in GetBuiltinHClassAccessor()
263 ASSERT(GetOpCode(gate) == OpCode::BUILTIN_PROTOTYPE_HCLASS_CHECK); in GetBuiltinHClassAccessor()
264 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetBuiltinHClassAccessor()
268 TypedArrayMetaDateAccessor GateAccessor::GetTypedArrayMetaDateAccessor(GateRef gate) const in GetTypedArrayMetaDateAccessor()
270 …ASSERT(GetOpCode(gate) == OpCode::TYPED_ARRAY_CHECK || GetOpCode(gate) == OpCode::LOAD_TYPED_ARRAY… in GetTypedArrayMetaDateAccessor()
271 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedArrayMetaDateAccessor()
275 LoadElementAccessor GateAccessor::GetLoadElementAccessor(GateRef gate) const in GetLoadElementAccessor()
277 ASSERT(GetOpCode(gate) == OpCode::LOAD_ELEMENT); in GetLoadElementAccessor()
278 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetLoadElementAccessor()
282 StoreElementAccessor GateAccessor::GetStoreElementAccessor(GateRef gate) const in GetStoreElementAccessor()
284 ASSERT(GetOpCode(gate) == OpCode::STORE_ELEMENT); in GetStoreElementAccessor()
285 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetStoreElementAccessor()
289 bool GateAccessor::TypedOpIsTypedArray(GateRef gate, TypedOpKind kind) const in TypedOpIsTypedArray() argument
293 TypedLoadOp op = GetTypedLoadOp(gate); in TypedOpIsTypedArray()
297 TypedStoreOp op = GetTypedStoreOp(gate); in TypedOpIsTypedArray()
306 GateType GateAccessor::GetReceiverType([[maybe_unused]]GateRef gate) const in GetReceiverType()
311 GateType GateAccessor::GetHolderType([[maybe_unused]]GateRef gate) const in GetHolderType()
316 GateType GateAccessor::GetNewHolderType([[maybe_unused]]GateRef gate) const in GetNewHolderType()
321 TypedLoadOp GateAccessor::GetTypedLoadOp(GateRef gate) const in GetTypedLoadOp()
323 ASSERT(GetOpCode(gate) == OpCode::LOAD_ELEMENT); in GetTypedLoadOp()
324 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedLoadOp()
328 TypedStoreOp GateAccessor::GetTypedStoreOp(GateRef gate) const in GetTypedStoreOp()
330 ASSERT(GetOpCode(gate) == OpCode::STORE_ELEMENT); in GetTypedStoreOp()
331 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedStoreOp()
335 TypedCallTargetCheckOp GateAccessor::GetTypedCallTargetCheckOp(GateRef gate) const in GetTypedCallTargetCheckOp()
337 ASSERT(GetOpCode(gate) == OpCode::TYPED_CALLTARGETCHECK_OP); in GetTypedCallTargetCheckOp()
338 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedCallTargetCheckOp()
342 MemoryType GateAccessor::GetMemoryType(GateRef gate) const in GetMemoryType()
344 ASSERT(GetOpCode(gate) == OpCode::STORE_MEMORY); in GetMemoryType()
345 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetMemoryType()
349 uint32_t GateAccessor::GetHClassIndex(GateRef gate) const in GetHClassIndex()
351 ASSERT(GetOpCode(gate) == OpCode::STORE_PROPERTY || in GetHClassIndex()
352 GetOpCode(gate) == OpCode::PROTOTYPE_CHECK); in GetHClassIndex()
353 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetHClassIndex()
357 TypedBinOp GateAccessor::GetTypedBinaryOp(GateRef gate) const in GetTypedBinaryOp()
359 ASSERT(GetOpCode(gate) == OpCode::TYPED_BINARY_OP); in GetTypedBinaryOp()
360 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedBinaryOp()
364 PGOTypeRef GateAccessor::GetTypedBinaryType(GateRef gate) const in GetTypedBinaryType()
366 ASSERT(GetOpCode(gate) == OpCode::TYPED_BINARY_OP); in GetTypedBinaryType()
367 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetTypedBinaryType()
371 bool GateAccessor::HasNumberType(GateRef gate) const in HasNumberType()
373 auto sampleType = GetTypedBinaryType(gate).GetPGOSampleType(); in HasNumberType()
378 GateType leftType = GetLeftType(gate); in HasNumberType()
379 GateType rightType = GetRightType(gate); in HasNumberType()
387 bool GateAccessor::HasStringType(GateRef gate) const in HasStringType()
389 GateType leftType = GetLeftType(gate); in HasStringType()
390 GateType rightType = GetRightType(gate); in HasStringType()
391 const PGOSampleType *sampleType = TryGetPGOType(gate).GetPGOSampleType(); in HasStringType()
401 bool GateAccessor::HasPrimitiveNumberType(GateRef gate) const in HasPrimitiveNumberType()
403 auto sampleType = GetTypedBinaryType(gate).GetPGOSampleType(); in HasPrimitiveNumberType()
408 GateType leftType = GetLeftType(gate); in HasPrimitiveNumberType()
409 GateType rightType = GetRightType(gate); in HasPrimitiveNumberType()
417 GlobalTSTypeRef GateAccessor::GetFuncGT(GateRef gate) const in GetFuncGT()
419 ASSERT(GetOpCode(gate) == OpCode::JSINLINETARGET_TYPE_CHECK); in GetFuncGT()
420 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetFuncGT()
425 GateType GateAccessor::GetParamGateType(GateRef gate) const in GetParamGateType()
427 ASSERT(GetOpCode(gate) == OpCode::PRIMITIVE_TYPE_CHECK || in GetParamGateType()
428 GetOpCode(gate) == OpCode::INDEX_CHECK || in GetParamGateType()
429 GetOpCode(gate) == OpCode::TYPED_CALLTARGETCHECK_OP || in GetParamGateType()
430 GetOpCode(gate) == OpCode::CREATE_ARRAY_WITH_BUFFER || in GetParamGateType()
431 GetOpCode(gate) == OpCode::TYPE_OF_CHECK || in GetParamGateType()
432 GetOpCode(gate) == OpCode::TYPE_OF); in GetParamGateType()
433 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetParamGateType()
438 bool GateAccessor::IsConvertSupport(GateRef gate) const in IsConvertSupport()
440 ASSERT(GetOpCode(gate) == OpCode::CONVERT || in IsConvertSupport()
441 GetOpCode(gate) == OpCode::CHECK_AND_CONVERT); in IsConvertSupport()
442 Gate *gatePtr = circuit_->LoadGatePtr(gate); in IsConvertSupport()
447 ValueType GateAccessor::GetSrcType(GateRef gate) const in GetSrcType()
449 ASSERT(GetOpCode(gate) == OpCode::CONVERT || in GetSrcType()
450 GetOpCode(gate) == OpCode::CHECK_AND_CONVERT); in GetSrcType()
451 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetSrcType()
456 ValueType GateAccessor::GetDstType(GateRef gate) const in GetDstType()
458 ASSERT(GetOpCode(gate) == OpCode::CONVERT || in GetDstType()
459 GetOpCode(gate) == OpCode::CHECK_AND_CONVERT); in GetDstType()
460 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetDstType()
465 GateType GateAccessor::GetLeftType(GateRef gate) const in GetLeftType()
467 ASSERT(GetOpCode(gate) == OpCode::TYPED_UNARY_OP || in GetLeftType()
468 GetOpCode(gate) == OpCode::TYPED_BINARY_OP || in GetLeftType()
469 GetOpCode(gate) == OpCode::TYPE_CONVERT); in GetLeftType()
470 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetLeftType()
475 GateType GateAccessor::GetRightType(GateRef gate) const in GetRightType()
477 ASSERT(GetOpCode(gate) == OpCode::TYPED_BINARY_OP || in GetRightType()
478 GetOpCode(gate) == OpCode::TYPE_CONVERT); in GetRightType()
479 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetRightType()
484 uint32_t GateAccessor::GetFirstValue(GateRef gate) const in GetFirstValue()
486 ASSERT(GetOpCode(gate) == OpCode::RANGE_GUARD); in GetFirstValue()
487 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetFirstValue()
492 uint32_t GateAccessor::GetSecondValue(GateRef gate) const in GetSecondValue()
494 ASSERT(GetOpCode(gate) == OpCode::RANGE_GUARD); in GetSecondValue()
495 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetSecondValue()
500 size_t GateAccessor::GetVirtualRegisterIndex(GateRef gate) const in GetVirtualRegisterIndex()
502 ASSERT(GetOpCode(gate) == OpCode::SAVE_REGISTER || in GetVirtualRegisterIndex()
503 GetOpCode(gate) == OpCode::RESTORE_REGISTER); in GetVirtualRegisterIndex()
504 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetVirtualRegisterIndex()
508 uint64_t GateAccessor::GetConstantValue(GateRef gate) const in GetConstantValue()
510 ASSERT(GetOpCode(gate) == OpCode::CONSTANT); in GetConstantValue()
511 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetConstantValue()
515 const ChunkVector<char>& GateAccessor::GetConstantString(GateRef gate) const in GetConstantString()
517 ASSERT(GetOpCode(gate) == OpCode::CONSTSTRING); in GetConstantString()
518 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetConstantString()
522 bool GateAccessor::IsVtable(GateRef gate) const in IsVtable()
524 ASSERT(GetOpCode(gate) == OpCode::LOAD_PROPERTY); in IsVtable()
525 Gate *gatePtr = circuit_->LoadGatePtr(gate); in IsVtable()
529 bool GateAccessor::GetNoGCFlag(GateRef gate) const in GetNoGCFlag()
531 if (gate == Circuit::NullGate()) { in GetNoGCFlag()
534 OpCode op = GetOpCode(gate); in GetNoGCFlag()
538 return TypedCallIsNoGC(gate); in GetNoGCFlag()
541 bool GateAccessor::TypedCallIsNoGC(GateRef gate) const in TypedCallIsNoGC()
543 ASSERT(GetOpCode(gate) == OpCode::TYPEDCALL || GetOpCode(gate) == OpCode::TYPEDFASTCALL); in TypedCallIsNoGC()
544 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TypedCallIsNoGC()
548 bool GateAccessor::IsNoGC(GateRef gate) const in IsNoGC()
550 …ASSERT(GetOpCode(gate) == OpCode::CALL_OPTIMIZED || GetOpCode(gate) == OpCode::FAST_CALL_OPTIMIZED… in IsNoGC()
551 Gate *gatePtr = circuit_->LoadGatePtr(gate); in IsNoGC()
555 uint32_t GateAccessor::TryGetPcOffset(GateRef gate) const in TryGetPcOffset()
557 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetPcOffset()
558 OpCode op = GetOpCode(gate); in TryGetPcOffset()
580 uint32_t GateAccessor::TryGetBcIndex(GateRef gate) const in TryGetBcIndex()
582 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetBcIndex()
583 OpCode op = GetOpCode(gate); in TryGetBcIndex()
593 uint32_t GateAccessor::TryGetMethodOffset(GateRef gate) const in TryGetMethodOffset()
595 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetMethodOffset()
596 OpCode op = GetOpCode(gate); in TryGetMethodOffset()
611 GateRef GateAccessor::GetFrameArgs(GateRef gate) const in GetFrameArgs()
613 if (!HasFrameState(gate)) { in GetFrameArgs()
616 if (GetOpCode(gate) == OpCode::FRAME_STATE) { in GetFrameArgs()
617 return GetValueIn(gate, 0); // 0: frame args in GetFrameArgs()
619 GateRef frameState = GetFrameState(gate); in GetFrameArgs()
630 void GateAccessor::UpdateMethodOffset(GateRef gate, uint32_t methodOffset) in UpdateMethodOffset() argument
632 ASSERT(GetOpCode(gate) == OpCode::FRAME_ARGS); in UpdateMethodOffset()
633 Gate *gatePtr = circuit_->LoadGatePtr(gate); in UpdateMethodOffset()
638 PGOTypeRef GateAccessor::TryGetPGOType(GateRef gate) const in TryGetPGOType()
640 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetPGOType()
641 OpCode op = GetOpCode(gate); in TryGetPGOType()
646 return GetTypedBinaryType(gate); in TryGetPGOType()
651 void GateAccessor::TrySetPGOType(GateRef gate, PGOTypeRef type) in TrySetPGOType() argument
653 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TrySetPGOType()
654 OpCode op = GetOpCode(gate); in TrySetPGOType()
660 uint32_t GateAccessor::TryGetArrayElementsLength(GateRef gate) const in TryGetArrayElementsLength()
662 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetArrayElementsLength()
663 OpCode op = GetOpCode(gate); in TryGetArrayElementsLength()
670 void GateAccessor::TrySetArrayElementsLength(GateRef gate, uint32_t length) in TrySetArrayElementsLength() argument
672 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TrySetArrayElementsLength()
673 OpCode op = GetOpCode(gate); in TrySetArrayElementsLength()
679 ElementsKind GateAccessor::TryGetElementsKind(GateRef gate) const in TryGetElementsKind()
681 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetElementsKind()
682 OpCode op = GetOpCode(gate); in TryGetElementsKind()
689 ElementsKind GateAccessor::TryGetArrayElementsKind(GateRef gate) const in TryGetArrayElementsKind()
691 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetArrayElementsKind()
692 OpCode op = GetOpCode(gate); in TryGetArrayElementsKind()
707 void GateAccessor::TrySetElementsKind(GateRef gate, ElementsKind kind) in TrySetElementsKind() argument
709 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TrySetElementsKind()
710 OpCode op = GetOpCode(gate); in TrySetElementsKind()
716 void GateAccessor::TrySetOnHeapMode(GateRef gate, OnHeapMode onHeapMode) const in TrySetOnHeapMode() argument
718 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TrySetOnHeapMode()
719 OpCode op = GetOpCode(gate); in TrySetOnHeapMode()
725 OnHeapMode GateAccessor::TryGetOnHeapMode(GateRef gate) const in TryGetOnHeapMode()
727 Gate *gatePtr = circuit_->LoadGatePtr(gate); in TryGetOnHeapMode()
728 OpCode op = GetOpCode(gate); in TryGetOnHeapMode()
735 EcmaOpcode GateAccessor::GetByteCodeOpcode(GateRef gate) const in GetByteCodeOpcode()
737 ASSERT(GetOpCode(gate) == OpCode::JS_BYTECODE); in GetByteCodeOpcode()
738 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetByteCodeOpcode()
742 void GateAccessor::Print(GateRef gate) const in Print()
744 Gate *gatePtr = circuit_->LoadGatePtr(gate); in Print()
751 GateRef gate = circuit_->GetGateRefById(id); in PrintById() local
752 if (gate != Circuit::NullGate()) { in PrintById()
753 Gate *gatePtr = circuit_->LoadGatePtr(gate); in PrintById()
761 void GateAccessor::PrintWithBytecode(GateRef gate) const in PrintWithBytecode()
763 Gate *gatePtr = circuit_->LoadGatePtr(gate); in PrintWithBytecode()
767 void GateAccessor::ShortPrint(GateRef gate) const in ShortPrint()
769 Gate *gatePtr = circuit_->LoadGatePtr(gate); in ShortPrint()
773 GateId GateAccessor::GetId(GateRef gate) const in GetId()
775 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetId()
779 size_t GateAccessor::GetInValueStarts(GateRef gate) const in GetInValueStarts()
781 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetInValueStarts()
785 GateRef GateAccessor::GetValueIn(GateRef gate, size_t idx) const in GetValueIn() argument
787 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetValueIn()
790 return circuit_->GetIn(gate, valueIndex + idx); in GetValueIn()
793 size_t GateAccessor::GetNumValueIn(GateRef gate) const in GetNumValueIn()
795 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetNumValueIn()
799 bool GateAccessor::IsGCRelated(GateRef gate) const in IsGCRelated()
801 return GetGateType(gate).IsGCRelated(); in IsGCRelated()
804 GateRef GateAccessor::GetIn(GateRef gate, size_t idx) const in GetIn() argument
806 return circuit_->GetIn(gate, idx); in GetIn()
809 GateRef GateAccessor::GetState(GateRef gate, size_t idx) const in GetState() argument
811 ASSERT(idx < circuit_->LoadGatePtr(gate)->GetStateCount()); in GetState()
812 return circuit_->GetIn(gate, idx); in GetState()
815 void GateAccessor::GetInStates(GateRef gate, std::vector<GateRef>& ins) const in GetInStates() argument
817 const Gate *curGate = circuit_->LoadGatePtrConst(gate); in GetInStates()
823 void GateAccessor::GetIns(GateRef gate, std::vector<GateRef>& ins) const in GetIns() argument
825 const Gate *curGate = circuit_->LoadGatePtrConst(gate); in GetIns()
831 void GateAccessor::GetOuts(GateRef gate, std::vector<GateRef>& outs) const in GetOuts() argument
833 const Gate *curGate = circuit_->LoadGatePtrConst(gate); in GetOuts()
846 bool GateAccessor::HasOuts(GateRef gate) const in HasOuts()
848 const Gate *curGate = circuit_->LoadGatePtrConst(gate); in HasOuts()
852 void GateAccessor::DeleteGateIfNoUse(GateRef gate) in DeleteGateIfNoUse() argument
854 if (!HasOuts(gate)) { in DeleteGateIfNoUse()
855 DeleteGate(gate); in DeleteGateIfNoUse()
859 void GateAccessor::GetOutStates(GateRef gate, std::vector<GateRef>& outStates) const in GetOutStates() argument
861 const Gate *curGate = circuit_->LoadGatePtrConst(gate); in GetOutStates()
878 void GateAccessor::GetStateUses(GateRef gate, std::vector<GateRef> &stateUses) in GetStateUses() argument
881 auto uses = Uses(gate); in GetStateUses()
889 void GateAccessor::GetDependUses(GateRef gate, std::vector<GateRef> &dependUses) in GetDependUses() argument
892 auto uses = Uses(gate); in GetDependUses()
900 void GateAccessor::GetValueUses(GateRef gate, std::vector<GateRef> &valueUses) in GetValueUses() argument
903 auto uses = Uses(gate); in GetValueUses()
916 bool GateAccessor::IsInGateNull(GateRef gate, size_t idx) const in IsInGateNull() argument
918 return circuit_->IsInGateNull(gate, idx); in IsInGateNull()
965 bool GateAccessor::IsControlCase(GateRef gate) const in IsControlCase()
967 return circuit_->IsControlCase(gate); in IsControlCase()
970 bool GateAccessor::IsLoopExit(GateRef gate) const in IsLoopExit()
972 return (GetOpCode(gate) == OpCode::LOOP_EXIT); in IsLoopExit()
975 bool GateAccessor::IsLoopExitRelated(GateRef gate) const in IsLoopExitRelated()
977 return (GetOpCode(gate) == OpCode::LOOP_EXIT) || in IsLoopExitRelated()
978 (GetOpCode(gate) == OpCode::LOOP_EXIT_DEPEND) || in IsLoopExitRelated()
979 (GetOpCode(gate) == OpCode::LOOP_EXIT_VALUE); in IsLoopExitRelated()
982 bool GateAccessor::IsLoopHead(GateRef gate) const in IsLoopHead()
984 return circuit_->IsLoopHead(gate); in IsLoopHead()
987 bool GateAccessor::IsLoopBack(GateRef gate) const in IsLoopBack()
989 return GetOpCode(gate) == OpCode::LOOP_BACK; in IsLoopBack()
992 bool GateAccessor::IsState(GateRef gate) const in IsState()
994 return GetMetaData(gate)->IsState(); in IsState()
997 bool GateAccessor::IsConstant(GateRef gate) const in IsConstant()
999 return GetMetaData(gate)->IsConstant(); in IsConstant()
1002 bool GateAccessor::IsDependSelector(GateRef gate) const in IsDependSelector()
1004 return GetMetaData(gate)->IsDependSelector(); in IsDependSelector()
1007 bool GateAccessor::IsConstantValue(GateRef gate, uint64_t value) const in IsConstantValue() argument
1009 if (GetOpCode(gate) == OpCode::CONSTANT) { in IsConstantValue()
1010 uint64_t bitField = GetConstantValue(gate); in IsConstantValue()
1016 bool GateAccessor::IsConstantUndefined(GateRef gate) const in IsConstantUndefined()
1018 return IsConstantValue(gate, JSTaggedValue::VALUE_UNDEFINED); in IsConstantUndefined()
1021 bool GateAccessor::IsUndefinedOrNull(GateRef gate) const in IsUndefinedOrNull()
1023 return IsConstantValue(gate, JSTaggedValue::VALUE_UNDEFINED) || in IsUndefinedOrNull()
1024 IsConstantValue(gate, JSTaggedValue::VALUE_NULL); in IsUndefinedOrNull()
1027 bool GateAccessor::IsTypedOperator(GateRef gate) const in IsTypedOperator()
1029 return GetMetaData(gate)->IsTypedOperator(); in IsTypedOperator()
1032 bool GateAccessor::IsNotWrite(GateRef gate) const in IsNotWrite()
1034 return GetMetaData(gate)->IsNotWrite(); in IsNotWrite()
1037 bool GateAccessor::IsCheckWithTwoIns(GateRef gate) const in IsCheckWithTwoIns()
1039 return GetMetaData(gate)->IsCheckWithTwoIns(); in IsCheckWithTwoIns()
1042 bool GateAccessor::IsCheckWithOneIn(GateRef gate) const in IsCheckWithOneIn()
1044 return GetMetaData(gate)->IsCheckWithOneIn(); in IsCheckWithOneIn()
1047 bool GateAccessor::IsSchedulable(GateRef gate) const in IsSchedulable()
1049 return GetMetaData(gate)->IsSchedulable(); in IsSchedulable()
1052 bool GateAccessor::IsVirtualState(GateRef gate) const in IsVirtualState()
1054 return GetMetaData(gate)->IsVirtualState(); in IsVirtualState()
1057 bool GateAccessor::IsGeneralState(GateRef gate) const in IsGeneralState()
1059 return GetMetaData(gate)->IsGeneralState(); in IsGeneralState()
1062 bool GateAccessor::IsIfOrSwitchRelated(GateRef gate) const in IsIfOrSwitchRelated()
1064 return GetMetaData(gate)->IsIfOrSwitchRelated(); in IsIfOrSwitchRelated()
1067 GateRef GateAccessor::GetDep(GateRef gate, size_t idx) const in GetDep() argument
1069 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetDep()
1072 return circuit_->GetIn(gate, dependIndex + idx); in GetDep()
1075 size_t GateAccessor::GetImmediateId(GateRef gate) const in GetImmediateId()
1077 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetImmediateId()
1085 void GateAccessor::SetDep(GateRef gate, GateRef depGate, size_t idx) in SetDep() argument
1087 Gate *gatePtr = circuit_->LoadGatePtr(gate); in SetDep()
1103 GateType GateAccessor::GetGateType(GateRef gate) const in GetGateType()
1105 return circuit_->LoadGatePtr(gate)->GetGateType(); in GetGateType()
1108 void GateAccessor::SetGateType(GateRef gate, GateType gt) in SetGateType() argument
1110 circuit_->LoadGatePtr(gate)->SetGateType(gt); in SetGateType()
1269 void GateAccessor::DecreaseIn(GateRef gate, size_t index) in DecreaseIn() argument
1271 circuit_->DecreaseIn(gate, index); in DecreaseIn()
1274 void GateAccessor::NewIn(GateRef gate, size_t idx, GateRef in) in NewIn() argument
1276 circuit_->NewIn(gate, idx, in); in NewIn()
1279 size_t GateAccessor::GetStateCount(GateRef gate) const in GetStateCount()
1281 return circuit_->LoadGatePtr(gate)->GetStateCount(); in GetStateCount()
1284 size_t GateAccessor::GetDependCount(GateRef gate) const in GetDependCount()
1286 return circuit_->LoadGatePtr(gate)->GetDependCount(); in GetDependCount()
1289 size_t GateAccessor::GetInValueCount(GateRef gate) const in GetInValueCount()
1291 return circuit_->LoadGatePtr(gate)->GetInValueCount(); in GetInValueCount()
1305 void GateAccessor::ReplaceIn(GateRef gate, size_t index, GateRef in) in ReplaceIn() argument
1307 circuit_->ModifyIn(gate, index, in); in ReplaceIn()
1310 void GateAccessor::DeleteIn(GateRef gate, size_t idx) in DeleteIn() argument
1312 ASSERT(idx < circuit_->LoadGatePtrConst(gate)->GetNumIns()); in DeleteIn()
1313 ASSERT(!circuit_->IsInGateNull(gate, idx)); in DeleteIn()
1314 circuit_->LoadGatePtr(gate)->DeleteIn(idx); in DeleteIn()
1317 void GateAccessor::ReplaceStateIn(GateRef gate, GateRef in, size_t index) in ReplaceStateIn() argument
1319 ASSERT(index < GetStateCount(gate)); in ReplaceStateIn()
1320 circuit_->ModifyIn(gate, index, in); in ReplaceStateIn()
1323 void GateAccessor::ReplaceDependIn(GateRef gate, GateRef in, size_t index) in ReplaceDependIn() argument
1325 ASSERT(index < GetDependCount(gate)); in ReplaceDependIn()
1326 size_t stateCount = GetStateCount(gate); in ReplaceDependIn()
1327 circuit_->ModifyIn(gate, stateCount + index, in); in ReplaceDependIn()
1330 void GateAccessor::ReplaceOrNewDependIn(GateRef gate, GateRef in, size_t index) in ReplaceOrNewDependIn() argument
1332 ASSERT(index < GetDependCount(gate)); in ReplaceOrNewDependIn()
1333 size_t stateCount = GetStateCount(gate); in ReplaceOrNewDependIn()
1334 auto depend = GetDep(gate); in ReplaceOrNewDependIn()
1336 circuit_->NewIn(gate, stateCount + index, in); in ReplaceOrNewDependIn()
1338 circuit_->ModifyIn(gate, stateCount + index, in); in ReplaceOrNewDependIn()
1342 void GateAccessor::ReplaceValueIn(GateRef gate, GateRef in, size_t index) in ReplaceValueIn() argument
1344 ASSERT(index < GetInValueCount(gate)); in ReplaceValueIn()
1345 size_t valueStartIndex = GetInValueStarts(gate); in ReplaceValueIn()
1346 circuit_->ModifyIn(gate, valueStartIndex + index, in); in ReplaceValueIn()
1349 void GateAccessor::DeleteGate(GateRef gate) in DeleteGate() argument
1351 circuit_->DeleteGate(gate); in DeleteGate()
1354 MachineType GateAccessor::GetMachineType(GateRef gate) const in GetMachineType()
1356 return circuit_->GetMachineType(gate); in GetMachineType()
1359 void GateAccessor::SetMachineType(GateRef gate, MachineType type) in SetMachineType() argument
1361 circuit_->SetMachineType(gate, type); in SetMachineType()
1374 bool GateAccessor::IsConstantNumber(GateRef gate) const in IsConstantNumber()
1377 if (GetGateType(gate).IsNJSValueType() || in IsConstantNumber()
1378 (GetOpCode(gate) != OpCode::CONSTANT)) { in IsConstantNumber()
1381 JSTaggedValue value(GetConstantValue(gate)); in IsConstantNumber()
1385 double GateAccessor::GetFloat64FromConstant(GateRef gate) const in GetFloat64FromConstant()
1388 ASSERT(GetOpCode(gate) == OpCode::CONSTANT); in GetFloat64FromConstant()
1389 uint64_t rawValue = GetConstantValue(gate); in GetFloat64FromConstant()
1390 if (GetGateType(gate).IsNJSValueType()) { in GetFloat64FromConstant()
1391 ASSERT(GetMachineType(gate) == MachineType::F64); in GetFloat64FromConstant()
1398 int GateAccessor::GetInt32FromConstant(GateRef gate) const in GetInt32FromConstant()
1401 ASSERT(GetOpCode(gate) == OpCode::CONSTANT); in GetInt32FromConstant()
1402 uint64_t rawValue = GetConstantValue(gate); in GetInt32FromConstant()
1403 if (GetGateType(gate).IsNJSValueType()) { in GetInt32FromConstant()
1404 ASSERT(GetMachineType(gate) == MachineType::I32); in GetInt32FromConstant()
1441 bool GateAccessor::IsStateIn(GateRef gate, size_t index) const in IsStateIn() argument
1444 size_t stateEndIndex = stateStartIndex + GetStateCount(gate); in IsStateIn()
1448 bool GateAccessor::IsDependIn(GateRef gate, size_t index) const in IsDependIn() argument
1450 size_t dependStartIndex = GetStateCount(gate); in IsDependIn()
1451 size_t dependEndIndex = dependStartIndex + GetDependCount(gate); in IsDependIn()
1455 bool GateAccessor::IsValueIn(GateRef gate, size_t index) const in IsValueIn() argument
1457 size_t valueStartIndex = GetInValueStarts(gate); in IsValueIn()
1458 size_t valueEndIndex = valueStartIndex + GetInValueCount(gate); in IsValueIn()
1462 bool GateAccessor::IsFrameStateIn(GateRef gate, size_t index) const in IsFrameStateIn() argument
1464 Gate *gatePtr = circuit_->LoadGatePtr(gate); in IsFrameStateIn()
1470 void GateAccessor::ReplaceGate(GateRef gate, GateRef state, GateRef depend, GateRef value) in ReplaceGate() argument
1473 GateType type = GetGateType(gate); in ReplaceGate()
1480 auto uses = Uses(gate); in ReplaceGate()
1496 DeleteGate(gate); in ReplaceGate()
1499 void GateAccessor::ReplaceGate(GateRef gate, GateRef replacement) in ReplaceGate() argument
1502 if (GetDependCount(gate) > 0) { in ReplaceGate()
1503 ASSERT(GetDependCount(gate) == 1); // 1: one dep in ReplaceGate()
1504 depend = GetDep(gate); in ReplaceGate()
1507 if (GetStateCount(gate) > 0) { in ReplaceGate()
1508 ASSERT(GetStateCount(gate) == 1); // 1: one state in ReplaceGate()
1509 state = GetState(gate); in ReplaceGate()
1511 return ReplaceGate(gate, StateDepend {state, depend}, replacement); in ReplaceGate()
1514 void GateAccessor::ReplaceGate(GateRef gate, StateDepend stateDepend, GateRef replacement) in ReplaceGate() argument
1516 ASSERT(gate != replacement); in ReplaceGate()
1519 auto uses = Uses(gate); in ReplaceGate()
1531 DeleteGate(gate); in ReplaceGate()
1566 void GateAccessor::GetFrameStateDependIn(GateRef gate, GateRef &dependIn) in GetFrameStateDependIn() argument
1568 auto uses = Uses(gate); in GetFrameStateDependIn()
1621 size_t GateAccessor::GetFrameDepth(GateRef gate, OpCode op) in GetFrameDepth() argument
1623 if (GetOpCode(gate) != op) { in GetFrameDepth()
1627 GateRef prev = GetFrameState(gate); in GetFrameDepth()
1635 GateRef GateAccessor::GetFrameState(GateRef gate) const in GetFrameState()
1637 ASSERT(HasFrameState(gate)); in GetFrameState()
1638 Gate *gatePtr = circuit_->LoadGatePtr(gate); in GetFrameState()
1640 return circuit_->GetIn(gate, index); in GetFrameState()
1643 GateRef GateAccessor::FindNearestFrameState(GateRef gate) const in FindNearestFrameState()
1645 auto statesplit = FindNearestStateSplit(gate); in FindNearestFrameState()
1649 GateRef GateAccessor::FindNearestStateSplit(GateRef gate) const in FindNearestStateSplit()
1651 auto statesplit = gate; in FindNearestStateSplit()
1658 bool GateAccessor::HasFrameState(GateRef gate) const in HasFrameState()
1660 return GetMetaData(gate)->HasFrameState(); in HasFrameState()
1663 void GateAccessor::ReplaceFrameStateIn(GateRef gate, GateRef in) in ReplaceFrameStateIn() argument
1665 ASSERT(HasFrameState(gate)); in ReplaceFrameStateIn()
1666 Gate *gatePtr = circuit_->LoadGatePtr(gate); in ReplaceFrameStateIn()
1668 circuit_->ModifyIn(gate, index, in); in ReplaceFrameStateIn()
1713 const GateMetaData *GateAccessor::GetMetaData(GateRef gate) const in GetMetaData()
1715 return circuit_->LoadGatePtrConst(gate)->GetMetaData(); in GetMetaData()
1718 void GateAccessor::SetMetaData(GateRef gate, const GateMetaData* meta) in SetMetaData() argument
1720 return circuit_->LoadGatePtr(gate)->SetMetaData(meta); in SetMetaData()
1756 bool GateAccessor::IsDead(GateRef gate) const in IsDead()
1758 return GetMetaData(gate)->IsDead(); in IsDead()
1786 GateRef GateAccessor::GetDependSelectorFromMerge(GateRef gate) in GetDependSelectorFromMerge() argument
1789 auto uses = Uses(gate); in GetDependSelectorFromMerge()
1800 bool GateAccessor::HasIfExceptionUse(GateRef gate) const in HasIfExceptionUse()
1802 ASSERT(GetStateCount(gate) > 0); in HasIfExceptionUse()
1803 auto uses = ConstUses(gate); in HasIfExceptionUse()
1812 bool GateAccessor::IsHeapObjectFromElementsKind(GateRef gate) in IsHeapObjectFromElementsKind() argument
1814 OpCode opcode = GetOpCode(gate); in IsHeapObjectFromElementsKind()
1816 auto bc = GetByteCodeOpcode(gate); in IsHeapObjectFromElementsKind()
1819 ElementsKind kind = TryGetElementsKind(gate); in IsHeapObjectFromElementsKind()
1826 TypedLoadOp typedOp = GetTypedLoadOp(gate); in IsHeapObjectFromElementsKind()
1833 bool GateAccessor::IsConstString(GateRef gate) in IsConstString() argument
1835 OpCode op = GetOpCode(gate); in IsConstString()
1837 EcmaOpcode ecmaOpcode = GetByteCodeOpcode(gate); in IsConstString()
1843 bool GateAccessor::IsSingleCharGate(GateRef gate) in IsSingleCharGate() argument
1845 OpCode op = GetOpCode(gate); in IsSingleCharGate()
1847 return GetTypedLoadOp(gate) == TypedLoadOp::STRING_LOAD_ELEMENT; in IsSingleCharGate()
1852 uint32_t GateAccessor::GetStringIdFromLdaStrGate(GateRef gate) in GetStringIdFromLdaStrGate() argument
1854 ASSERT(GetByteCodeOpcode(gate) == EcmaOpcode::LDA_STR_ID16); in GetStringIdFromLdaStrGate()
1855 GateRef stringId = GetValueIn(gate, 0); in GetStringIdFromLdaStrGate()
1859 bool GateAccessor::IsLoopBackUse(GateRef gate, const UseIterator &useIt) const in IsLoopBackUse() argument
1861 if (IsLoopBack(gate) && IsStateIn(useIt)) { in IsLoopBackUse()
1871 bool GateAccessor::IsCreateArray(GateRef gate) const in IsCreateArray()
1873 if (GetOpCode(gate) != OpCode::JS_BYTECODE) { in IsCreateArray()
1876 EcmaOpcode ecmaop = GetByteCodeOpcode(gate); in IsCreateArray()
1890 void GateAccessor::SetStoreNoBarrier(GateRef gate, bool isNoBarrier) in SetStoreNoBarrier() argument
1892 ASSERT(GetOpCode(gate) == OpCode::MONO_STORE_PROPERTY_LOOK_UP_PROTO || in SetStoreNoBarrier()
1893 GetOpCode(gate) == OpCode::MONO_STORE_PROPERTY); in SetStoreNoBarrier()
1894 Gate *gatePtr = circuit_->LoadGatePtr(gate); in SetStoreNoBarrier()
1898 bool GateAccessor::IsNoBarrier(GateRef gate) const in IsNoBarrier()
1900 ASSERT(GetOpCode(gate) == OpCode::MONO_STORE_PROPERTY_LOOK_UP_PROTO || in IsNoBarrier()
1901 GetOpCode(gate) == OpCode::MONO_STORE_PROPERTY); in IsNoBarrier()
1902 Gate *gatePtr = circuit_->LoadGatePtr(gate); in IsNoBarrier()