Commit d36fd844 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[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/+/1505574Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60059}
parent 8104f1d4
...@@ -1281,10 +1281,7 @@ void EffectControlLinearizer::TruncateTaggedPointerToBit( ...@@ -1281,10 +1281,7 @@ void EffectControlLinearizer::TruncateTaggedPointerToBit(
&if_heapnumber); &if_heapnumber);
// Check if {value} is a BigInt. // Check if {value} is a BigInt.
Node* value_instance_type = __ GotoIf(__ WordEqual(value_map, __ BigIntMapConstant()), &if_bigint);
__ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
__ GotoIf(__ Word32Equal(value_instance_type, __ Int32Constant(BIGINT_TYPE)),
&if_bigint);
// All other values that reach here are true. // All other values that reach here are true.
__ Goto(done, __ Int32Constant(1)); __ Goto(done, __ Int32Constant(1));
...@@ -2478,10 +2475,7 @@ Node* EffectControlLinearizer::LowerObjectIsBigInt(Node* node) { ...@@ -2478,10 +2475,7 @@ Node* EffectControlLinearizer::LowerObjectIsBigInt(Node* node) {
Node* check = ObjectIsSmi(value); Node* check = ObjectIsSmi(value);
__ GotoIf(check, &if_smi); __ GotoIf(check, &if_smi);
Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
Node* value_instance_type = Node* vfalse = __ WordEqual(value_map, __ BigIntMapConstant());
__ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
Node* vfalse =
__ Word32Equal(value_instance_type, __ Uint32Constant(BIGINT_TYPE));
__ Goto(&done, vfalse); __ Goto(&done, vfalse);
__ Bind(&if_smi); __ Bind(&if_smi);
......
...@@ -92,6 +92,7 @@ namespace compiler { ...@@ -92,6 +92,7 @@ namespace compiler {
V(TrueConstant) \ V(TrueConstant) \
V(FalseConstant) \ V(FalseConstant) \
V(NullConstant) \ V(NullConstant) \
V(BigIntMapConstant) \
V(BooleanMapConstant) \ V(BooleanMapConstant) \
V(HeapNumberMapConstant) \ V(HeapNumberMapConstant) \
V(NoContextConstant) \ V(NoContextConstant) \
......
...@@ -134,6 +134,8 @@ DEFINE_GETTER(AllocateInOldSpaceStubConstant, ...@@ -134,6 +134,8 @@ DEFINE_GETTER(AllocateInOldSpaceStubConstant,
DEFINE_GETTER(ArrayConstructorStubConstant, DEFINE_GETTER(ArrayConstructorStubConstant,
HeapConstant(BUILTIN_CODE(isolate(), ArrayConstructorImpl))) HeapConstant(BUILTIN_CODE(isolate(), ArrayConstructorImpl)))
DEFINE_GETTER(BigIntMapConstant, HeapConstant(factory()->bigint_map()))
DEFINE_GETTER(BooleanMapConstant, HeapConstant(factory()->boolean_map())) DEFINE_GETTER(BooleanMapConstant, HeapConstant(factory()->boolean_map()))
DEFINE_GETTER(ToNumberBuiltinConstant, DEFINE_GETTER(ToNumberBuiltinConstant,
......
...@@ -84,6 +84,7 @@ class V8_EXPORT_PRIVATE JSGraph : public MachineGraph { ...@@ -84,6 +84,7 @@ class V8_EXPORT_PRIVATE JSGraph : public MachineGraph {
V(AllocateInNewSpaceStubConstant) \ V(AllocateInNewSpaceStubConstant) \
V(AllocateInOldSpaceStubConstant) \ V(AllocateInOldSpaceStubConstant) \
V(ArrayConstructorStubConstant) \ V(ArrayConstructorStubConstant) \
V(BigIntMapConstant) \
V(BooleanMapConstant) \ V(BooleanMapConstant) \
V(ToNumberBuiltinConstant) \ V(ToNumberBuiltinConstant) \
V(EmptyFixedArrayConstant) \ V(EmptyFixedArrayConstant) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment