Lines Matching refs:builder_
110 Environment env(gate, circuit_, &builder_); in LowerConvertHoleAsUndefined()
112 Label returnUndefined(&builder_); in LowerConvertHoleAsUndefined()
113 Label exit(&builder_); in LowerConvertHoleAsUndefined()
115 DEFVAlUE(result, (&builder_), VariableType::JS_ANY(), receiver); in LowerConvertHoleAsUndefined()
117 builder_.Branch(builder_.TaggedIsHole(*result), &returnUndefined, &exit); in LowerConvertHoleAsUndefined()
118 builder_.Bind(&returnUndefined); in LowerConvertHoleAsUndefined()
120 result = builder_.UndefineConstant(); in LowerConvertHoleAsUndefined()
121 builder_.Jump(&exit); in LowerConvertHoleAsUndefined()
123 builder_.Bind(&exit); in LowerConvertHoleAsUndefined()
124 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), *result); in LowerConvertHoleAsUndefined()
129 Environment env(gate, circuit_, &builder_); in LowerLoadConstOffset()
131 GateRef offset = builder_.IntPtr(acc_.GetOffset(gate)); in LowerLoadConstOffset()
133 GateRef result = builder_.Load(type, receiver, offset); in LowerLoadConstOffset()
134 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), result); in LowerLoadConstOffset()
139 Environment env(gate, circuit_, &builder_); in LowerStoreConstOffset()
143 GateRef offset = builder_.IntPtr(acc_.GetOffset(gate)); in LowerStoreConstOffset()
145 builder_.Store(type, glue_, receiver, offset, value); in LowerStoreConstOffset()
146 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerStoreConstOffset()
151 Environment env(gate, circuit_, &builder_); in LowerHeapObjectCheck()
155 GateRef heapObjectCheck = builder_.TaggedIsHeapObject(receiver); in LowerHeapObjectCheck()
156 builder_.DeoptCheck(heapObjectCheck, frameState, DeoptType::NOTHEAPOBJECT); in LowerHeapObjectCheck()
158 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerHeapObjectCheck()
163 Environment env(gate, circuit_, &builder_); in LowerGetConstPool()
165 GateRef newGate = builder_.GetConstPoolFromFunction(jsFunc); in LowerGetConstPool()
183 Environment env(gate, circuit_, &builder_); in LowerArrayGuardianCheck()
186 …GateRef guardiansOffset = builder_.IntPtr(JSThread::GlueData::GetStableArrayElementsGuardiansOffse… in LowerArrayGuardianCheck()
187 GateRef check = builder_.Load(VariableType::BOOL(), glue_, guardiansOffset); in LowerArrayGuardianCheck()
188 builder_.DeoptCheck(check, frameState, DeoptType::NOTSARRAY); in LowerArrayGuardianCheck()
190 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerArrayGuardianCheck()
195 Environment env(gate, circuit_, &builder_); in LowerHClassStableArrayCheck()
200 GateRef stableCheck = builder_.IsIsStableElementsByHClass(hclass); in LowerHClassStableArrayCheck()
204 GateRef elementsKindCheck = builder_.Equal(builder_.Int32(static_cast<int32_t>(kind)), in LowerHClassStableArrayCheck()
205 builder_.GetElementsKindByHClass(hclass)); in LowerHClassStableArrayCheck()
206 check = builder_.BoolAnd(stableCheck, elementsKindCheck); in LowerHClassStableArrayCheck()
210 builder_.DeoptCheck(check, frameState, DeoptType::NOTSARRAY); in LowerHClassStableArrayCheck()
212 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerHClassStableArrayCheck()
217 Environment env(stateDepend.State(), stateDepend.Depend(), {}, circuit_, &builder_); in LowerConvert()
221 Label exit(&builder_); in LowerConvert()
234 result = builder_.NotEqual(value, builder_.Int32(0)); in LowerConvert()
244 result = builder_.NotEqual(value, builder_.Int32(0)); in LowerConvert()
274 return builder_.GetStateDepend(); in LowerConvert()
279 DEFVAlUE(result, (&builder_), VariableType::BOOL(), builder_.Boolean(false)); in ConvertTaggedNumberToBool()
280 Label isInt(&builder_); in ConvertTaggedNumberToBool()
281 Label isDouble(&builder_); in ConvertTaggedNumberToBool()
282 Label toInt32(&builder_); in ConvertTaggedNumberToBool()
283 builder_.Branch(builder_.TaggedIsInt(gate), &isInt, &isDouble); in ConvertTaggedNumberToBool()
284 builder_.Bind(&isInt); in ConvertTaggedNumberToBool()
286 GateRef intVal = builder_.GetInt64OfTInt(gate); in ConvertTaggedNumberToBool()
287 result = builder_.NotEqual(intVal, builder_.Int64(0)); in ConvertTaggedNumberToBool()
289 builder_.Jump(exit); in ConvertTaggedNumberToBool()
290 builder_.Bind(&isDouble); in ConvertTaggedNumberToBool()
292 GateRef doubleVal = builder_.GetDoubleOfTDouble(gate); in ConvertTaggedNumberToBool()
295 builder_.Jump(exit); in ConvertTaggedNumberToBool()
296 builder_.Bind(exit); in ConvertTaggedNumberToBool()
302 DEFVAlUE(result, (&builder_), VariableType::INT32(), builder_.Int32(0)); in ConvertTaggedNumberToInt32()
303 Label isInt(&builder_); in ConvertTaggedNumberToInt32()
304 Label isDouble(&builder_); in ConvertTaggedNumberToInt32()
305 Label toInt32(&builder_); in ConvertTaggedNumberToInt32()
306 builder_.Branch(builder_.TaggedIsInt(gate), &isInt, &isDouble); in ConvertTaggedNumberToInt32()
307 builder_.Bind(&isInt); in ConvertTaggedNumberToInt32()
309 builder_.Jump(exit); in ConvertTaggedNumberToInt32()
310 builder_.Bind(&isDouble); in ConvertTaggedNumberToInt32()
312 builder_.Jump(exit); in ConvertTaggedNumberToInt32()
313 builder_.Bind(exit); in ConvertTaggedNumberToInt32()
319 DEFVAlUE(result, (&builder_), VariableType::FLOAT64(), builder_.Double(0)); in ConvertTaggedNumberToFloat64()
320 Label isInt(&builder_); in ConvertTaggedNumberToFloat64()
321 Label isDouble(&builder_); in ConvertTaggedNumberToFloat64()
322 builder_.Branch(builder_.TaggedIsInt(gate), &isInt, &isDouble); in ConvertTaggedNumberToFloat64()
323 builder_.Bind(&isInt); in ConvertTaggedNumberToFloat64()
325 builder_.Jump(exit); in ConvertTaggedNumberToFloat64()
326 builder_.Bind(&isDouble); in ConvertTaggedNumberToFloat64()
328 builder_.Jump(exit); in ConvertTaggedNumberToFloat64()
329 builder_.Bind(exit); in ConvertTaggedNumberToFloat64()
335 Environment env(gate, circuit_, &builder_); in LowerCheckAndConvert()
338 Label exit(&builder_); in LowerCheckAndConvert()
366 GateRef upperBound = builder_.Int32(INT32_MAX); in LowerCheckUInt32AndConvert()
367 GateRef check = builder_.Int32UnsignedLessThanOrEqual(value, upperBound); in LowerCheckUInt32AndConvert()
368 builder_.DeoptCheck(check, frameState, DeoptType::INT32OVERFLOW); in LowerCheckUInt32AndConvert()
369 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), value); in LowerCheckUInt32AndConvert()
375 GateRef typeCheck = builder_.TaggedIsInt(value); in LowerCheckTaggedIntAndConvert()
376 builder_.DeoptCheck(typeCheck, frameState, DeoptType::NOTINT); in LowerCheckTaggedIntAndConvert()
385 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), result); in LowerCheckTaggedIntAndConvert()
391 GateRef typeCheck = builder_.TaggedIsDouble(value); in LowerCheckTaggedDoubleAndConvert()
392 builder_.DeoptCheck(typeCheck, frameState, DeoptType::NOTDOUBLE); in LowerCheckTaggedDoubleAndConvert()
401 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), result); in LowerCheckTaggedDoubleAndConvert()
407 GateRef typeCheck = builder_.TaggedIsNumber(value); in LowerCheckTaggedNumberAndConvert()
408 builder_.DeoptCheck(typeCheck, frameState, DeoptType::NOTNUMBER); in LowerCheckTaggedNumberAndConvert()
419 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), result); in LowerCheckTaggedNumberAndConvert()
431 builder_.DeoptCheck(builder_.Boolean(support), frameState, DeoptType::NOTINT); in LowerCheckSupportAndConvert()
432 result = builder_.BooleanToInt32(value); in LowerCheckSupportAndConvert()
434 builder_.DeoptCheck(builder_.Boolean(support), frameState, DeoptType::NOTDOUBLE); in LowerCheckSupportAndConvert()
435 result = builder_.BooleanToFloat64(value); in LowerCheckSupportAndConvert()
437 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), result); in LowerCheckSupportAndConvert()
443 GateRef typeCheck = builder_.TaggedIsBoolean(value); in LowerCheckTaggedBoolAndConvert()
444 builder_.DeoptCheck(typeCheck, frameState, DeoptType::NOTBOOL); in LowerCheckTaggedBoolAndConvert()
448 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), result); in LowerCheckTaggedBoolAndConvert()
453 return builder_.TaggedIsTrue(value); in ConvertTaggedBooleanToBool()
458 return builder_.BooleanToTaggedBooleanPtr(gate); in ConvertBoolToTaggedBoolean()
463 return builder_.ChangeInt32ToFloat64(gate); in ConvertInt32ToFloat64()
468 return builder_.ChangeUInt32ToFloat64(gate); in ConvertUInt32ToFloat64()
473 return builder_.Int32ToTaggedPtr(gate); in ConvertInt32ToTaggedInt()
478 Label isOverFlow(&builder_); in ConvertUInt32ToTaggedNumber()
479 Label notOverFlow(&builder_); in ConvertUInt32ToTaggedNumber()
480 GateRef upperBound = builder_.Int32(INT32_MAX); in ConvertUInt32ToTaggedNumber()
481 DEFVAlUE(taggedVal, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant()); in ConvertUInt32ToTaggedNumber()
482 …builder_.Branch(builder_.Int32UnsignedLessThanOrEqual(gate, upperBound), ¬OverFlow, &isOverFlow… in ConvertUInt32ToTaggedNumber()
483 builder_.Bind(¬OverFlow); in ConvertUInt32ToTaggedNumber()
484 taggedVal = builder_.Int32ToTaggedPtr(gate); in ConvertUInt32ToTaggedNumber()
485 builder_.Jump(exit); in ConvertUInt32ToTaggedNumber()
486 builder_.Bind(&isOverFlow); in ConvertUInt32ToTaggedNumber()
487 taggedVal = builder_.DoubleToTaggedDoublePtr(builder_.ChangeUInt32ToFloat64(gate)); in ConvertUInt32ToTaggedNumber()
488 builder_.Jump(exit); in ConvertUInt32ToTaggedNumber()
489 builder_.Bind(exit); in ConvertUInt32ToTaggedNumber()
495 return builder_.DoubleToInt(gate, exit); in ConvertFloat64ToInt32()
500 GateRef doubleNotZero = builder_.DoubleNotEqual(gate, builder_.Double(0.0)); in ConvertFloat64ToBool()
501 GateRef doubleNotNAN = builder_.BoolNot(builder_.DoubleIsNAN(gate)); in ConvertFloat64ToBool()
502 return builder_.BoolAnd(doubleNotZero, doubleNotNAN); in ConvertFloat64ToBool()
507 return builder_.DoubleToTaggedDoublePtr(gate); in ConvertFloat64ToTaggedDouble()
512 return builder_.GetInt32OfTInt(gate); in ConvertTaggedIntToInt32()
517 return builder_.ChangeInt32ToFloat64(builder_.GetInt32OfTInt(gate)); in ConvertTaggedIntToFloat64()
522 return builder_.DoubleToInt(builder_.GetDoubleOfTDouble(gate), exit); in ConvertTaggedDoubleToInt32()
527 return builder_.GetDoubleOfTDouble(gate); in ConvertTaggedDoubleToFloat64()
532 Environment env(gate, circuit_, &builder_); in LowerGetGlobalEnv()
533 … GateRef glueGlobalEnvOffset = builder_.IntPtr(JSThread::GlueData::GetGlueGlobalEnvOffset(false)); in LowerGetGlobalEnv()
534 GateRef glueGlobalEnv = builder_.Load(VariableType::JS_POINTER(), glue_, glueGlobalEnvOffset); in LowerGetGlobalEnv()
535 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), glueGlobalEnv); in LowerGetGlobalEnv()
540 Environment env(gate, circuit_, &builder_); in LowerGetGlobalEnvObjHClass()
543 …GateRef offset = builder_.IntPtr(GlobalEnv::HEADER_SIZE + JSTaggedValue::TaggedTypeSize() * index); in LowerGetGlobalEnvObjHClass()
544 GateRef object = builder_.Load(VariableType::JS_ANY(), globalEnv, offset); in LowerGetGlobalEnvObjHClass()
545 auto hclass = builder_.Load(VariableType::JS_POINTER(), object, in LowerGetGlobalEnvObjHClass()
546 builder_.IntPtr(JSFunction::PROTO_OR_DYNCLASS_OFFSET)); in LowerGetGlobalEnvObjHClass()
547 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), hclass); in LowerGetGlobalEnvObjHClass()
552 Environment env(gate, circuit_, &builder_); in LowerGetGlobalConstantValue()
554 GateRef gConstAddr = builder_.Load(VariableType::JS_POINTER(), glue_, in LowerGetGlobalConstantValue()
555 builder_.IntPtr(JSThread::GlueData::GetGlobalConstOffset(false))); in LowerGetGlobalConstantValue()
556 GateRef constantIndex = builder_.IntPtr(JSTaggedValue::TaggedTypeSize() * index); in LowerGetGlobalConstantValue()
557 GateRef result = builder_.Load(VariableType::JS_POINTER(), gConstAddr, constantIndex); in LowerGetGlobalConstantValue()
558 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), result); in LowerGetGlobalConstantValue()
563 Environment env(gate, circuit_, &builder_); in LowerHeapAllocate()
577 Label success(&builder_); in HeapAllocateInYoung()
578 Label callRuntime(&builder_); in HeapAllocateInYoung()
579 Label exit(&builder_); in HeapAllocateInYoung()
583 …GateRef topAddress = builder_.Load(VariableType::NATIVE_POINTER(), glue_, builder_.IntPtr(topOffse… in HeapAllocateInYoung()
584 …GateRef endAddress = builder_.Load(VariableType::NATIVE_POINTER(), glue_, builder_.IntPtr(endOffse… in HeapAllocateInYoung()
585 GateRef top = builder_.Load(VariableType::JS_POINTER(), topAddress, builder_.IntPtr(0)); in HeapAllocateInYoung()
586 GateRef end = builder_.Load(VariableType::JS_POINTER(), endAddress, builder_.IntPtr(0)); in HeapAllocateInYoung()
588 DEFVAlUE(result, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant()); in HeapAllocateInYoung()
589 GateRef newTop = builder_.PtrAdd(top, size); in HeapAllocateInYoung()
590 builder_.Branch(builder_.IntPtrGreaterThan(newTop, end), &callRuntime, &success); in HeapAllocateInYoung()
591 builder_.Bind(&success); in HeapAllocateInYoung()
593 … builder_.Store(VariableType::NATIVE_POINTER(), glue_, topAddress, builder_.IntPtr(0), newTop); in HeapAllocateInYoung()
595 builder_.Jump(&exit); in HeapAllocateInYoung()
597 builder_.Bind(&callRuntime); in HeapAllocateInYoung()
599 result = builder_.CallRuntime(glue_, RTSTUB_ID(AllocateInYoung), Gate::InvalidGateRef, in HeapAllocateInYoung()
600 {builder_.ToTaggedInt(size)}, gate); in HeapAllocateInYoung()
601 builder_.Jump(&exit); in HeapAllocateInYoung()
603 builder_.Bind(&exit); in HeapAllocateInYoung()
605 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), *result); in HeapAllocateInYoung()
610 Environment env(gate, circuit_, &builder_); in LowerInt32CheckRightIsZero()
613 GateRef rightNotZero = builder_.Int32NotEqual(right, builder_.Int32(0)); in LowerInt32CheckRightIsZero()
614 builder_.DeoptCheck(rightNotZero, frameState, DeoptType::MODZERO); in LowerInt32CheckRightIsZero()
615 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerInt32CheckRightIsZero()
620 Environment env(gate, circuit_, &builder_); in LowerFloat64CheckRightIsZero()
623 GateRef rightNotZero = builder_.DoubleNotEqual(right, builder_.Double(0.0)); in LowerFloat64CheckRightIsZero()
624 builder_.DeoptCheck(rightNotZero, frameState, DeoptType::DIVZERO); in LowerFloat64CheckRightIsZero()
625 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerFloat64CheckRightIsZero()
630 Environment env(gate, circuit_, &builder_); in LowerLexVarIsHoleCheck()
633 GateRef valueIsNotHole = builder_.TaggedIsNotHole(value); in LowerLexVarIsHoleCheck()
634 builder_.DeoptCheck(valueIsNotHole, frameState, DeoptType::LEXVARISHOLE); in LowerLexVarIsHoleCheck()
635 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerLexVarIsHoleCheck()
640 Environment env(gate, circuit_, &builder_); in LowerValueCheckNegOverflow()
643 GateRef valueNotZero = builder_.NotEqual(value, builder_.Int32(0)); in LowerValueCheckNegOverflow()
644 builder_.DeoptCheck(valueNotZero, frameState, DeoptType::NOTNEGOV); in LowerValueCheckNegOverflow()
645 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerValueCheckNegOverflow()
650 Environment env(gate, circuit_, &builder_); in LowerOverflowCheck()
653 …GateRef condition = builder_.BoolNot(builder_.ExtractValue(MachineType::I1, result, builder_.Int32… in LowerOverflowCheck()
654 builder_.DeoptCheck(condition, frameState, DeoptType::NOTINT); in LowerOverflowCheck()
655 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerOverflowCheck()
660 Environment env(gate, circuit_, &builder_); in LowerInt32UnsignedUpperBoundCheck()
664 GateRef condition = builder_.Int32UnsignedLessThanOrEqual(value, upperBound); in LowerInt32UnsignedUpperBoundCheck()
665 builder_.DeoptCheck(condition, frameState, DeoptType::NOTINT); in LowerInt32UnsignedUpperBoundCheck()
666 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerInt32UnsignedUpperBoundCheck()
671 Environment env(gate, circuit_, &builder_); in LowerInt32DivWithCheck()
676 GateRef rightGreaterZero = builder_.Int32GreaterThan(right, builder_.Int32(0)); in LowerInt32DivWithCheck()
677 GateRef rightLessZero = builder_.Int32LessThan(right, builder_.Int32(0)); in LowerInt32DivWithCheck()
678 GateRef leftNotZero = builder_.Int32NotEqual(left, builder_.Int32(0)); in LowerInt32DivWithCheck()
679 …GateRef condition = builder_.BoolOr(rightGreaterZero, builder_.BoolAnd(rightLessZero, leftNotZero)… in LowerInt32DivWithCheck()
680 builder_.DeoptCheck(condition, frameState, DeoptType::DIVZERO); in LowerInt32DivWithCheck()
681 …result = builder_.BinaryArithmetic(circuit_->Sdiv(), MachineType::I32, left, right, GateType::NJSV… in LowerInt32DivWithCheck()
682 GateRef truncated = builder_.BinaryArithmetic(circuit_->Mul(), in LowerInt32DivWithCheck()
684 GateRef overCheck = builder_.Int32Equal(truncated, left); in LowerInt32DivWithCheck()
685 builder_.DeoptCheck(overCheck, frameState, DeoptType::NOTINT); in LowerInt32DivWithCheck()
686 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), result); in LowerInt32DivWithCheck()
691 Environment env(gate, circuit_, &builder_); in LowerStoreMemory()
695 builder_.Store(VariableType::VOID(), glue_, receiver, index, value); in LowerStoreMemory()
696 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerStoreMemory()
702 Label begin(&builder_); in InitializeWithSpeicalValue()
703 Label storeValue(&builder_); in InitializeWithSpeicalValue()
704 Label endLoop(&builder_); in InitializeWithSpeicalValue()
706 DEFVAlUE(startOffset, (&builder_), VariableType::INT32(), start); in InitializeWithSpeicalValue()
707 builder_.Jump(&begin); in InitializeWithSpeicalValue()
708 builder_.LoopBegin(&begin); in InitializeWithSpeicalValue()
710 builder_.Branch(builder_.Int32UnsignedLessThan(*startOffset, end), &storeValue, exit); in InitializeWithSpeicalValue()
711 builder_.Bind(&storeValue); in InitializeWithSpeicalValue()
713 … builder_.Store(VariableType::INT64(), glue, object, builder_.ZExtInt32ToPtr(*startOffset), value); in InitializeWithSpeicalValue()
714 … startOffset = builder_.Int32Add(*startOffset, builder_.Int32(JSTaggedValue::TaggedTypeSize())); in InitializeWithSpeicalValue()
715 builder_.Jump(&endLoop); in InitializeWithSpeicalValue()
717 builder_.Bind(&endLoop); in InitializeWithSpeicalValue()
718 builder_.LoopEnd(&begin); in InitializeWithSpeicalValue()