Lines Matching refs:gate
67 explicit Edge(GateRef gate, size_t index) : gate_(gate), index_(static_cast<uint32_t>(index)) {}
93 // do not create new gate or modify self during iteration
150 // do not create new gate or modify self during iteration
298 GateRef gate;
301 return GateAccessor(circuit).ConstUseBegin(gate);
311 GateRef gate;
314 return GateAccessor(circuit).UseBegin(gate);
324 const GateRef gate;
327 return GateAccessor(circuit).ConstInBegin(gate);
331 return GateAccessor(circuit).ConstInEnd(gate);
337 GateRef gate;
340 return GateAccessor(circuit).InBegin(gate);
344 return GateAccessor(circuit).InEnd(gate);
348 ConstInWrapper ConstIns(GateRef gate) const
350 return { circuit_, gate };
353 InWrapper Ins(GateRef gate) const
355 return { circuit_, gate };
358 ConstUseWrapper ConstUses(GateRef gate) const
360 return { circuit_, gate };
363 UseWrapper Uses(GateRef gate)
365 return { circuit_, gate };
379 size_t GetNumIns(GateRef gate) const;
380 OpCode GetOpCode(GateRef gate) const;
381 bool IsGCRelated(GateRef gate) const;
382 uint64_t TryGetValue(GateRef gate) const;
383 ICmpCondition GetICmpCondition(GateRef gate) const;
384 FCmpCondition GetFCmpCondition(GateRef gate) const;
385 size_t GetOffset(GateRef gate) const;
386 size_t GetInitOffset(GateRef gate) const;
387 uint32_t GetTrueWeight(GateRef gate) const;
388 uint32_t GetFalseWeight(GateRef gate) const;
389 bool HasBranchWeight(GateRef gate) const;
390 MemoryAttribute GetMemoryAttribute(GateRef gate) const;
391 size_t GetIndex(GateRef gate) const;
392 size_t GetJSType(GateRef gate) const;
393 uint32_t GetArraySize(GateRef gate) const;
394 void SetArraySize(GateRef gate, uint32_t size);
395 uint32_t GetStringStatus(GateRef gate) const;
396 void SetStringStatus(GateRef gate, uint32_t type);
397 ElementsKind GetElementsKind(GateRef gate) const;
398 void SetElementsKind(GateRef gate, ElementsKind kind);
399 RegionSpaceFlag GetRegionSpaceFlag(GateRef gate) const;
400 size_t GetVirtualRegisterIndex(GateRef gate) const;
401 bool TypedOpIsTypedArray(GateRef gate, TypedOpKind kind) const;
402 TypedLoadOp GetTypedLoadOp(GateRef gate) const;
403 TypedStoreOp GetTypedStoreOp(GateRef gate) const;
404 MemoryType GetMemoryType(GateRef gate) const;
405 uint32_t GetHClassIndex(GateRef gate) const;
406 TypedBinOp GetTypedBinaryOp(GateRef gate) const;
407 TypedCallTargetCheckOp GetTypedCallTargetCheckOp(GateRef gate) const;
408 bool HasNumberType(GateRef gate) const;
409 bool HasStringType(GateRef gate) const;
410 GlobalTSTypeRef GetFuncGT(GateRef gate) const;
411 GateType GetParamGateType(GateRef gate) const;
412 ParamType GetParamType(GateRef gate) const;
413 TypedUnaryAccessor GetTypedUnAccessor(GateRef gate) const;
414 TypedBinaryAccessor GetTypedBinaryAccessor(GateRef gate) const;
415 TypedJumpAccessor GetTypedJumpAccessor(GateRef gate) const;
416 ArrayMetaDataAccessor GetArrayMetaDataAccessor(GateRef gate) const;
417 CreateArgumentsAccessor GetCreateArgumentsAccessor(GateRef gate) const;
418 ObjectTypeAccessor GetObjectTypeAccessor(GateRef gate) const;
419 BuiltinPrototypeHClassAccessor GetBuiltinHClassAccessor(GateRef gate) const;
420 TypedArrayMetaDataAccessor GetTypedArrayMetaDataAccessor(GateRef gate) const;
421 LoadElementAccessor GetLoadElementAccessor(GateRef gate) const;
422 StoreElementAccessor GetStoreElementAccessor(GateRef gate) const;
423 bool NeedPushArgv(GateRef gate) const;
424 uint64_t GetConstantValue(GateRef gate) const;
425 const ChunkVector<char>& GetConstantString(GateRef gate) const;
426 bool IsVtable(GateRef gate) const;
427 bool GetNoGCFlag(GateRef gate) const;
428 bool TypedCallIsNoGC(GateRef gate) const;
429 bool IsNoGC(GateRef gate) const;
430 uint32_t TryGetPcOffset(GateRef gate) const;
431 uint32_t TryGetBcIndex(GateRef gate) const;
432 uint32_t TryGetMethodOffset(GateRef gate) const;
433 GateRef GetFrameArgs(GateRef gate) const;
434 void UpdateMethodOffset(GateRef gate, uint32_t methodOffset);
435 PGOTypeRef TryGetPGOType(GateRef gate) const;
436 void TrySetPGOType(GateRef gate, PGOTypeRef type);
437 uint32_t TryGetArrayElementsLength(GateRef gate) const;
438 void TrySetArrayElementsLength(GateRef gate, uint32_t length);
439 RegionSpaceFlag TryGetRegionSpaceFlag(GateRef gate) const;
440 void TrySetRegionSpaceFlag(GateRef gate, RegionSpaceFlag length);
441 ElementsKind TryGetElementsKind(GateRef gate) const;
442 ElementsKind TryGetArrayElementsKind(GateRef gate) const;
443 ElementsKind TryGetArrayElementsKindAfterTransition(GateRef gate) const;
444 void TrySetElementsKind(GateRef gate, ElementsKind kind);
445 void TrySetTransitionElementsKind(GateRef gate, ElementsKind kind);
446 void TrySetOnHeapMode(GateRef gate, OnHeapMode onHeapMode) const;
447 OnHeapMode TryGetOnHeapMode(GateRef gate) const;
448 EcmaOpcode GetByteCodeOpcode(GateRef gate) const;
449 void Print(GateRef gate) const DUMP_API_ATTR;
450 std::string ToString(GateRef gate) const DUMP_API_ATTR;
454 void PrintWithBytecode(GateRef gate) const DUMP_API_ATTR;
455 void ShortPrint(GateRef gate) const;
456 GateId GetId(GateRef gate) const;
457 GateRef GetValueIn(GateRef gate, size_t idx = 0) const;
458 size_t GetNumValueIn(GateRef gate) const;
459 std::vector<GateRef> GetValueIns(GateRef gate) const;
460 GateRef GetIn(GateRef gate, size_t idx) const;
461 GateRef GetState(GateRef gate, size_t idx = 0) const;
462 GateRef GetDep(GateRef gate, size_t idx = 0) const;
463 size_t GetImmediateId(GateRef gate) const;
464 void SetDep(GateRef gate, GateRef depGate, size_t idx = 0);
467 GateType GetGateType(GateRef gate) const;
468 bool IsConvertSupport(GateRef gate) const;
469 ValueType GetSrcType(GateRef gate) const;
470 ValueType GetDstType(GateRef gate) const;
471 void SetGateType(GateRef gate, GateType gt);
472 void DeleteIn(GateRef gate, size_t idx);
475 void DecreaseIn(GateRef gate, size_t index);
476 void NewIn(GateRef gate, size_t idx, GateRef in);
477 size_t GetStateCount(GateRef gate) const;
478 size_t GetDependCount(GateRef gate) const;
479 size_t GetInValueCount(GateRef gate) const;
480 size_t GetInValueStarts(GateRef gate) const;
481 void UpdateAllUses(GateRef gate, GateRef replaceValueIn);
482 void ReplaceControlGate(GateRef gate, GateRef newState);
484 void GetFrameStateDependIn(GateRef gate, GateRef &dependIn);
486 void ReplaceIn(GateRef gate, size_t index, GateRef in);
487 void ReplaceStateIn(GateRef gate, GateRef in, size_t index = 0);
488 void ReplaceDependIn(GateRef gate, GateRef in, size_t index = 0);
489 void ReplaceOrNewDependIn(GateRef gate, GateRef in, size_t index = 0);
490 void ReplaceValueIn(GateRef gate, GateRef in, size_t index = 0);
491 void DeleteGate(GateRef gate);
492 MachineType GetMachineType(GateRef gate) const;
493 void SetMachineType(GateRef gate, MachineType type);
496 double GetFloat64FromConstant(GateRef gate) const;
497 int GetInt32FromConstant(GateRef gate) const;
498 bool IsInGateNull(GateRef gate, size_t idx) const;
503 bool IsControlCase(GateRef gate) const;
504 bool IsLoopExit(GateRef gate) const;
505 bool IsLoopExitRelated(GateRef gate) const;
506 bool IsLoopHead(GateRef gate) const;
507 bool IsLoopBack(GateRef gate) const;
508 bool IsState(GateRef gate) const;
509 bool IsConstant(GateRef gate) const;
510 bool IsDependSelector(GateRef gate) const;
511 bool IsConstantValue(GateRef gate, uint64_t value) const;
512 bool IsConstantTaggedValue(GateRef gate, uint64_t value) const;
513 bool IsConstantUndefined(GateRef gate) const;
514 bool IsUndefinedOrNullOrHole(GateRef gate) const;
515 bool IsConstantNumber(GateRef gate) const;
516 bool IsTypedOperator(GateRef gate) const;
517 bool IsNotWrite(GateRef gate) const;
518 bool IsDead(GateRef gate) const;
519 bool IsCheckWithOneIn(GateRef gate) const;
520 bool IsCheckWithTwoIns(GateRef gate) const;
521 bool IsSchedulable(GateRef gate) const;
522 bool IsVirtualState(GateRef gate) const;
523 bool IsGeneralState(GateRef gate) const;
524 MarkCode GetMark(GateRef gate) const;
525 void SetMark(GateRef gate, MarkCode mark);
526 bool IsFinished(GateRef gate) const;
527 bool IsVisited(GateRef gate) const;
528 bool IsPrevisit(GateRef gate) const;
529 bool IsNotMarked(GateRef gate) const;
530 void SetFinished(GateRef gate);
531 void SetPrevisit(GateRef gate);
532 void SetVisited(GateRef gate);
537 bool IsStateIn(GateRef gate, size_t index) const;
538 bool IsDependIn(GateRef gate, size_t index) const;
539 bool IsValueIn(GateRef gate, size_t index) const;
540 void GetStateUses(GateRef gate, std::vector<GateRef> &stateUses);
541 void GetDependUses(GateRef gate, std::vector<GateRef> &dependUses);
542 void GetValueUses(GateRef gate, std::vector<GateRef> &valueUses);
543 size_t GetValueUsesCount(GateRef gate);
544 bool IsFrameStateIn(GateRef gate, size_t index) const;
546 void ReplaceGate(GateRef gate, GateRef state, GateRef depend, GateRef value);
547 void ReplaceGate(GateRef gate, StateDepend stateDepend, GateRef replacement);
548 void ReplaceGate(GateRef gate, GateRef replacement);
549 uint32_t GetFirstValue(GateRef gate) const;
550 uint32_t GetSecondValue(GateRef gate) const;
561 bool HasOuts(GateRef gate) const;
562 void DeleteGateIfNoUse(GateRef gate);
563 GateRef GetDependSelectorFromMerge(GateRef gate);
564 bool HasIfExceptionUse(GateRef gate) const;
566 bool IsHeapObjectFromElementsKind(GateRef gate);
567 bool IsConstString(GateRef gate);
568 bool IsSingleCharGate(GateRef gate);
569 bool UseForTypeOpProfilerGate(GateRef gate) const;
570 uint32_t GetStringIdFromLdaStrGate(GateRef gate);
571 bool IsIfOrSwitchRelated(GateRef gate) const;
572 uint32_t GetConstpoolId(GateRef gate) const;
573 GateRef GetFrameValue(GateRef gate);
600 inline bool IsStateRoot(GateRef gate) const
602 return gate == GetStateRoot();
605 size_t GetFrameDepth(GateRef gate, OpCode op);
606 GateRef GetFrameState(GateRef gate) const;
607 void ReplaceFrameStateIn(GateRef gate, GateRef in);
608 bool HasFrameState(GateRef gate) const;
609 GateRef FindNearestFrameState(GateRef gate) const;
610 GateRef FindNearestStateSplit(GateRef gate) const;
611 void SetMetaData(GateRef gate, const GateMetaData* meta);
617 bool IsLoopBackUse(GateRef gate, const UseIterator &useIt) const;
618 void GetOutStates(GateRef gate, std::vector<GateRef>& outStates) const;
619 bool IsCreateArray(GateRef gate) const;
620 void SetStoreNoBarrier(GateRef gate, bool isNoBarrier);
621 bool IsNoBarrier(GateRef gate) const;
622 void GetIns(GateRef gate, std::vector<GateRef>& ins) const;
628 const GateMetaData *GetMetaData(GateRef gate) const;
634 ConstUseIterator ConstUseBegin(GateRef gate) const
636 if (circuit_->LoadGatePtrConst(gate)->IsFirstOutNull()) {
639 auto use = circuit_->LoadGatePtrConst(gate)->GetFirstOutConst();
648 UseIterator UseBegin(GateRef gate) const
650 if (circuit_->LoadGatePtrConst(gate)->IsFirstOutNull()) {
653 auto use = circuit_->LoadGatePtr(gate)->GetFirstOut();
662 ConstInsIterator ConstInBegin(GateRef gate) const
664 return ConstInsIterator(circuit_, &reinterpret_cast<const In *>(circuit_->LoadGatePtrConst(gate) + 1)[0]);
667 ConstInsIterator ConstInEnd(GateRef gate) const
669 auto endIndex = circuit_->LoadGatePtrConst(gate)->GetNumIns();
671 &reinterpret_cast<const In *>(circuit_->LoadGatePtrConst(gate) + 1)[endIndex]);
674 InsIterator InBegin(GateRef gate)
676 return InsIterator(circuit_, &reinterpret_cast<In *>(circuit_->LoadGatePtr(gate) + 1)[0]);
679 InsIterator InEnd(GateRef gate)
681 auto endIndex = circuit_->LoadGatePtrConst(gate)->GetNumIns();
682 return InsIterator(circuit_, &reinterpret_cast<In *>(circuit_->LoadGatePtr(gate) + 1)[endIndex]);
685 void GetOuts(GateRef gate, std::vector<GateRef>& outs) const;
687 void GetInStates(GateRef gate, std::vector<GateRef>& ins) const;
745 const GateRef gate;
748 return ConstGateAccessor(circuit).ConstInBegin(gate);
752 return ConstGateAccessor(circuit).ConstInEnd(gate);
756 ConstInWrapper Ins(GateRef gate) const
758 return { circuit_, gate };
772 ConstInsIterator ConstInBegin(GateRef gate) const
774 return ConstInsIterator(circuit_, &reinterpret_cast<const In *>(circuit_->LoadGatePtrConst(gate) + 1)[0]);
777 ConstInsIterator ConstInEnd(GateRef gate) const
779 auto endIndex = circuit_->LoadGatePtrConst(gate)->GetNumIns();
781 &reinterpret_cast<const In *>(circuit_->LoadGatePtrConst(gate) + 1)[endIndex]);