diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc index a3ceab07a1..8e13e1c3ce 100644 --- a/src/codegen/code-stub-assembler.cc +++ b/src/codegen/code-stub-assembler.cc @@ -6995,7 +6995,7 @@ TNode CodeStubAssembler::ToUint32(SloppyTNode context, Label out(this); - VARIABLE(var_result, MachineRepresentation::kTagged, input); + TVARIABLE(Object, var_result, input); // Early exit for positive smis. { @@ -7007,7 +7007,7 @@ TNode CodeStubAssembler::ToUint32(SloppyTNode context, } const TNode number = ToNumber(context, input); - var_result.Bind(number); + var_result = number; // Perhaps we have a positive smi now. { @@ -7023,7 +7023,7 @@ TNode CodeStubAssembler::ToUint32(SloppyTNode context, { const TNode uint32_value = SmiToInt32(CAST(number)); TNode float64_value = ChangeUint32ToFloat64(uint32_value); - var_result.Bind(AllocateHeapNumberWithValue(float64_value)); + var_result = AllocateHeapNumberWithValue(float64_value); Goto(&out); } @@ -7075,13 +7075,13 @@ TNode CodeStubAssembler::ToUint32(SloppyTNode context, x = Float64Mod(x, float_two_32); const TNode result = ChangeFloat64ToTagged(x); - var_result.Bind(result); + var_result = result; Goto(&out); } BIND(&return_zero); { - var_result.Bind(SmiConstant(0)); + var_result = SmiConstant(0); Goto(&out); } } @@ -7092,14 +7092,14 @@ TNode CodeStubAssembler::ToUint32(SloppyTNode context, TNode CodeStubAssembler::ToString_Inline(SloppyTNode context, SloppyTNode input) { - VARIABLE(var_result, MachineRepresentation::kTagged, input); + TVARIABLE(Object, var_result, input); Label stub_call(this, Label::kDeferred), out(this); GotoIf(TaggedIsSmi(input), &stub_call); Branch(IsString(CAST(input)), &out, &stub_call); BIND(&stub_call); - var_result.Bind(CallBuiltin(Builtins::kToString, context, input)); + var_result = CallBuiltin(Builtins::kToString, context, input); Goto(&out); BIND(&out); @@ -9543,7 +9543,7 @@ Node* CodeStubAssembler::PrepareValueForWriteToTypedArray( } VARIABLE(var_result, rep); - VARIABLE(var_input, MachineRepresentation::kTagged, input); + TVARIABLE(Object, var_input, input); Label done(this, &var_result), if_smi(this), if_heapnumber_or_oddball(this), convert(this), loop(this, &var_input); Goto(&loop); @@ -9552,16 +9552,17 @@ Node* CodeStubAssembler::PrepareValueForWriteToTypedArray( // We can handle both HeapNumber and Oddball here, since Oddball has the // same layout as the HeapNumber for the HeapNumber::value field. This // way we can also properly optimize stores of oddballs to typed arrays. - GotoIf(IsHeapNumber(CAST(var_input.value())), &if_heapnumber_or_oddball); + TNode heap_object = CAST(var_input.value()); + GotoIf(IsHeapNumber(heap_object), &if_heapnumber_or_oddball); STATIC_ASSERT_FIELD_OFFSETS_EQUAL(HeapNumber::kValueOffset, Oddball::kToNumberRawOffset); - Branch(HasInstanceType(var_input.value(), ODDBALL_TYPE), - &if_heapnumber_or_oddball, &convert); + Branch(HasInstanceType(heap_object, ODDBALL_TYPE), &if_heapnumber_or_oddball, + &convert); BIND(&if_heapnumber_or_oddball); { - TNode value = UncheckedCast(LoadObjectField( - var_input.value(), HeapNumber::kValueOffset, MachineType::Float64())); + TNode value = + LoadObjectField(heap_object, HeapNumber::kValueOffset); if (rep == MachineRepresentation::kWord32) { if (elements_kind == UINT8_CLAMPED_ELEMENTS) { var_result.Bind(Float64ToUint8Clamped(value)); @@ -9579,7 +9580,7 @@ Node* CodeStubAssembler::PrepareValueForWriteToTypedArray( BIND(&if_smi); { - TNode value = SmiToInt32(var_input.value()); + TNode value = SmiToInt32(CAST(var_input.value())); if (rep == MachineRepresentation::kFloat32) { var_result.Bind(RoundInt32ToFloat32(value)); } else if (rep == MachineRepresentation::kFloat64) { @@ -9597,7 +9598,7 @@ Node* CodeStubAssembler::PrepareValueForWriteToTypedArray( BIND(&convert); { - var_input.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, input)); + var_input = CallBuiltin(Builtins::kNonNumberToNumber, context, input); Goto(&loop); } @@ -9794,8 +9795,8 @@ void CodeStubAssembler::EmitElementStore( if (IsGrowStoreMode(store_mode) && !(IsSealedElementsKind(elements_kind) || IsNonextensibleElementsKind(elements_kind))) { - elements = CAST(CheckForCapacityGrow(object, elements, elements_kind, - length, intptr_key, bailout)); + elements = CheckForCapacityGrow(object, elements, elements_kind, length, + intptr_key, bailout); } else { GotoIfNot(UintPtrLessThan(Unsigned(intptr_key), length), bailout); } @@ -9824,11 +9825,11 @@ void CodeStubAssembler::EmitElementStore( parameter_mode); } -Node* CodeStubAssembler::CheckForCapacityGrow( +TNode CodeStubAssembler::CheckForCapacityGrow( TNode object, TNode elements, ElementsKind kind, TNode length, TNode key, Label* bailout) { DCHECK(IsFastElementsKind(kind)); - VARIABLE(checked_elements, MachineRepresentation::kTagged); + TVARIABLE(FixedArrayBase, checked_elements); Label grow_case(this), no_grow_case(this), done(this), grow_bailout(this, Label::kDeferred); @@ -9845,15 +9846,15 @@ Node* CodeStubAssembler::CheckForCapacityGrow( { TNode current_capacity = SmiUntag(LoadFixedArrayBaseLength(elements)); - checked_elements.Bind(elements); + checked_elements = elements; Label fits_capacity(this); // If key is negative, we will notice in Runtime::kGrowArrayElements. GotoIf(UintPtrLessThan(key, current_capacity), &fits_capacity); { - Node* new_elements = TryGrowElementsCapacity( + TNode new_elements = TryGrowElementsCapacity( object, elements, kind, key, current_capacity, &grow_bailout); - checked_elements.Bind(new_elements); + checked_elements = new_elements; Goto(&fits_capacity); } @@ -9864,8 +9865,9 @@ Node* CodeStubAssembler::CheckForCapacityGrow( TNode maybe_elements = CallRuntime( Runtime::kGrowArrayElements, NoContextConstant(), object, tagged_key); GotoIf(TaggedIsSmi(maybe_elements), bailout); - CSA_ASSERT(this, IsFixedArrayWithKind(CAST(maybe_elements), kind)); - checked_elements.Bind(maybe_elements); + TNode new_elements = CAST(maybe_elements); + CSA_ASSERT(this, IsFixedArrayWithKind(new_elements, kind)); + checked_elements = new_elements; Goto(&fits_capacity); } @@ -9881,7 +9883,7 @@ Node* CodeStubAssembler::CheckForCapacityGrow( BIND(&no_grow_case); { GotoIfNot(UintPtrLessThan(key, length), bailout); - checked_elements.Bind(elements); + checked_elements = elements; Goto(&done); } diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h index d264a0e349..81ff37c2ea 100644 --- a/src/codegen/code-stub-assembler.h +++ b/src/codegen/code-stub-assembler.h @@ -3317,10 +3317,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler TNode context, TVariable* maybe_converted_value = nullptr); - Node* CheckForCapacityGrow(TNode object, - TNode elements, ElementsKind kind, - TNode length, TNode key, - Label* bailout); + TNode CheckForCapacityGrow( + TNode object, TNode elements, ElementsKind kind, + TNode length, TNode key, Label* bailout); TNode CopyElementsOnWrite(TNode object, TNode elements,