diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc index fb850093c8..6cab5f259e 100644 --- a/src/compiler/effect-control-linearizer.cc +++ b/src/compiler/effect-control-linearizer.cc @@ -1281,10 +1281,7 @@ void EffectControlLinearizer::TruncateTaggedPointerToBit( &if_heapnumber); // Check if {value} is a BigInt. - Node* value_instance_type = - __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); - __ GotoIf(__ Word32Equal(value_instance_type, __ Int32Constant(BIGINT_TYPE)), - &if_bigint); + __ GotoIf(__ WordEqual(value_map, __ BigIntMapConstant()), &if_bigint); // All other values that reach here are true. __ Goto(done, __ Int32Constant(1)); @@ -2478,10 +2475,7 @@ Node* EffectControlLinearizer::LowerObjectIsBigInt(Node* node) { Node* check = ObjectIsSmi(value); __ GotoIf(check, &if_smi); Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); - Node* value_instance_type = - __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); - Node* vfalse = - __ Word32Equal(value_instance_type, __ Uint32Constant(BIGINT_TYPE)); + Node* vfalse = __ WordEqual(value_map, __ BigIntMapConstant()); __ Goto(&done, vfalse); __ Bind(&if_smi); diff --git a/src/compiler/graph-assembler.h b/src/compiler/graph-assembler.h index c8e4517f66..eeebcd7ee5 100644 --- a/src/compiler/graph-assembler.h +++ b/src/compiler/graph-assembler.h @@ -92,6 +92,7 @@ namespace compiler { V(TrueConstant) \ V(FalseConstant) \ V(NullConstant) \ + V(BigIntMapConstant) \ V(BooleanMapConstant) \ V(HeapNumberMapConstant) \ V(NoContextConstant) \ diff --git a/src/compiler/js-graph.cc b/src/compiler/js-graph.cc index eca30ad525..dc5746ae96 100644 --- a/src/compiler/js-graph.cc +++ b/src/compiler/js-graph.cc @@ -134,6 +134,8 @@ DEFINE_GETTER(AllocateInOldSpaceStubConstant, DEFINE_GETTER(ArrayConstructorStubConstant, HeapConstant(BUILTIN_CODE(isolate(), ArrayConstructorImpl))) +DEFINE_GETTER(BigIntMapConstant, HeapConstant(factory()->bigint_map())) + DEFINE_GETTER(BooleanMapConstant, HeapConstant(factory()->boolean_map())) DEFINE_GETTER(ToNumberBuiltinConstant, diff --git a/src/compiler/js-graph.h b/src/compiler/js-graph.h index 3ce87d37a6..52c618122e 100644 --- a/src/compiler/js-graph.h +++ b/src/compiler/js-graph.h @@ -84,6 +84,7 @@ class V8_EXPORT_PRIVATE JSGraph : public MachineGraph { V(AllocateInNewSpaceStubConstant) \ V(AllocateInOldSpaceStubConstant) \ V(ArrayConstructorStubConstant) \ + V(BigIntMapConstant) \ V(BooleanMapConstant) \ V(ToNumberBuiltinConstant) \ V(EmptyFixedArrayConstant) \