[cleanup][bigint] Compare maps instead of instance type

... when the latter is not already available.

Bug: v8:8834
Change-Id: Ib45b0e04c35a797e2d36a96b891ff1f82d4de02c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1505574
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60059}
This commit is contained in:
Igor Sheludko 2019-03-06 13:12:32 +01:00 committed by Commit Bot
parent 8104f1d4d3
commit d36fd844a2
4 changed files with 6 additions and 8 deletions

View File

@ -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);

View File

@ -92,6 +92,7 @@ namespace compiler {
V(TrueConstant) \
V(FalseConstant) \
V(NullConstant) \
V(BigIntMapConstant) \
V(BooleanMapConstant) \
V(HeapNumberMapConstant) \
V(NoContextConstant) \

View File

@ -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,

View File

@ -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) \