diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc index 87a9f3b2ca..042cc0179b 100644 --- a/src/compiler/effect-control-linearizer.cc +++ b/src/compiler/effect-control-linearizer.cc @@ -5937,8 +5937,6 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { auto if_double = __ MakeDeferredLabel(); auto done = __ MakeLabel(MachineRepresentation::kTagged); - auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged); - auto done_double = __ MakeLabel(MachineRepresentation::kFloat64); // Check if field is a mutable double field. __ GotoIfNot(__ IntPtrEqual(__ WordAnd(index, one), zero), &if_double); @@ -5955,8 +5953,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { Node* offset = __ IntAdd(__ WordShl(index, __ IntPtrConstant(kTaggedSizeLog2 - 1)), __ IntPtrConstant(JSObject::kHeaderSize - kHeapObjectTag)); - Node* field = __ Load(MachineType::AnyTagged(), object, offset); - __ Goto(&loaded_field, field); + Node* result = __ Load(MachineType::AnyTagged(), object, offset); + __ Goto(&done, result); } // The field is located in the properties backing store of {object}. @@ -5970,8 +5968,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { __ IntPtrConstant(kTaggedSizeLog2 - 1)), __ IntPtrConstant((FixedArray::kHeaderSize - kTaggedSize) - kHeapObjectTag)); - Node* field = __ Load(MachineType::AnyTagged(), properties, offset); - __ Goto(&loaded_field, field); + Node* result = __ Load(MachineType::AnyTagged(), properties, offset); + __ Goto(&done, result); } } @@ -5979,6 +5977,9 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { // architectures, or a mutable HeapNumber. __ Bind(&if_double); { + auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged); + auto done_double = __ MakeLabel(MachineRepresentation::kFloat64); + index = __ WordSar(index, one); // Check if field is in-object or out-of-object. @@ -6006,27 +6007,27 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { Node* field = __ Load(MachineType::AnyTagged(), properties, offset); __ Goto(&loaded_field, field); } - } - __ Bind(&loaded_field); - { - Node* field = loaded_field.PhiAt(0); - // We may have transitioned in-place away from double, so check that - // this is a HeapNumber -- otherwise the load is fine and we don't need - // to copy anything anyway. - __ GotoIf(ObjectIsSmi(field), &done, field); - Node* field_map = __ LoadField(AccessBuilder::ForMap(), field); - __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done, - field); + __ Bind(&loaded_field); + { + Node* field = loaded_field.PhiAt(0); + // We may have transitioned in-place away from double, so check that + // this is a HeapNumber -- otherwise the load is fine and we don't need + // to copy anything anyway. + __ GotoIf(ObjectIsSmi(field), &done, field); + Node* field_map = __ LoadField(AccessBuilder::ForMap(), field); + __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done, + field); - Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field); - __ Goto(&done_double, value); - } + Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field); + __ Goto(&done_double, value); + } - __ Bind(&done_double); - { - Node* result = AllocateHeapNumberWithValue(done_double.PhiAt(0)); - __ Goto(&done, result); + __ Bind(&done_double); + { + Node* result = AllocateHeapNumberWithValue(done_double.PhiAt(0)); + __ Goto(&done, result); + } } __ Bind(&done); diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc index 23e77c56e8..14077ab267 100644 --- a/src/compiler/simplified-operator.cc +++ b/src/compiler/simplified-operator.cc @@ -1715,9 +1715,13 @@ const Operator* SimplifiedOperatorBuilder::CheckMaps( CheckMapsFlags flags, ZoneHandleSet maps, const FeedbackSource& feedback) { CheckMapsParameters const parameters(flags, maps, feedback); + Operator::Properties operator_props = Operator::kNoThrow; + if (!(flags & CheckMapsFlag::kTryMigrateInstance)) { + operator_props |= Operator::kNoWrite; + } return zone()->New>( // -- IrOpcode::kCheckMaps, // opcode - Operator::kNoThrow | Operator::kNoWrite, // flags + operator_props, // flags "CheckMaps", // name 1, 1, 1, 0, 1, 0, // counts parameters); // parameter