Commit 2850bdd7 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[CSA] Use IsHeapNumber helper in older CSA code

Change-Id: I224ea998eccf8fa18766b71962d487bb02768c78
Reviewed-on: https://chromium-review.googlesource.com/518146Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45980}
parent 1539f125
...@@ -285,8 +285,7 @@ TF_BUILTIN(ToLength, CodeStubAssembler) { ...@@ -285,8 +285,7 @@ TF_BUILTIN(ToLength, CodeStubAssembler) {
// Check if {len} is a HeapNumber. // Check if {len} is a HeapNumber.
Label if_lenisheapnumber(this), Label if_lenisheapnumber(this),
if_lenisnotheapnumber(this, Label::kDeferred); if_lenisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(len)), &if_lenisheapnumber, Branch(IsHeapNumber(len), &if_lenisheapnumber, &if_lenisnotheapnumber);
&if_lenisnotheapnumber);
BIND(&if_lenisheapnumber); BIND(&if_lenisheapnumber);
{ {
......
...@@ -30,8 +30,7 @@ TF_BUILTIN(GlobalIsFinite, CodeStubAssembler) { ...@@ -30,8 +30,7 @@ TF_BUILTIN(GlobalIsFinite, CodeStubAssembler) {
// Check if {num} is a HeapNumber. // Check if {num} is a HeapNumber.
Label if_numisheapnumber(this), Label if_numisheapnumber(this),
if_numisnotheapnumber(this, Label::kDeferred); if_numisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber, Branch(IsHeapNumber(num), &if_numisheapnumber, &if_numisnotheapnumber);
&if_numisnotheapnumber);
BIND(&if_numisheapnumber); BIND(&if_numisheapnumber);
{ {
...@@ -77,8 +76,7 @@ TF_BUILTIN(GlobalIsNaN, CodeStubAssembler) { ...@@ -77,8 +76,7 @@ TF_BUILTIN(GlobalIsNaN, CodeStubAssembler) {
// Check if {num} is a HeapNumber. // Check if {num} is a HeapNumber.
Label if_numisheapnumber(this), Label if_numisheapnumber(this),
if_numisnotheapnumber(this, Label::kDeferred); if_numisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber, Branch(IsHeapNumber(num), &if_numisheapnumber, &if_numisnotheapnumber);
&if_numisnotheapnumber);
BIND(&if_numisheapnumber); BIND(&if_numisheapnumber);
{ {
......
...@@ -93,8 +93,7 @@ TF_BUILTIN(MathAbs, CodeStubAssembler) { ...@@ -93,8 +93,7 @@ TF_BUILTIN(MathAbs, CodeStubAssembler) {
{ {
// Check if {x} is a HeapNumber. // Check if {x} is a HeapNumber.
Label if_xisheapnumber(this), if_xisnotheapnumber(this, Label::kDeferred); Label if_xisheapnumber(this), if_xisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(x)), &if_xisheapnumber, Branch(IsHeapNumber(x), &if_xisheapnumber, &if_xisnotheapnumber);
&if_xisnotheapnumber);
BIND(&if_xisheapnumber); BIND(&if_xisheapnumber);
{ {
...@@ -139,8 +138,7 @@ void MathBuiltinsAssembler::MathRoundingOperation( ...@@ -139,8 +138,7 @@ void MathBuiltinsAssembler::MathRoundingOperation(
{ {
// Check if {x} is a HeapNumber. // Check if {x} is a HeapNumber.
Label if_xisheapnumber(this), if_xisnotheapnumber(this, Label::kDeferred); Label if_xisheapnumber(this), if_xisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(x)), &if_xisheapnumber, Branch(IsHeapNumber(x), &if_xisheapnumber, &if_xisnotheapnumber);
&if_xisnotheapnumber);
BIND(&if_xisheapnumber); BIND(&if_xisheapnumber);
{ {
...@@ -287,8 +285,7 @@ TF_BUILTIN(MathClz32, CodeStubAssembler) { ...@@ -287,8 +285,7 @@ TF_BUILTIN(MathClz32, CodeStubAssembler) {
{ {
// Check if {x} is a HeapNumber. // Check if {x} is a HeapNumber.
Label if_xisheapnumber(this), if_xisnotheapnumber(this, Label::kDeferred); Label if_xisheapnumber(this), if_xisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(x)), &if_xisheapnumber, Branch(IsHeapNumber(x), &if_xisheapnumber, &if_xisnotheapnumber);
&if_xisnotheapnumber);
BIND(&if_xisheapnumber); BIND(&if_xisheapnumber);
{ {
......
...@@ -70,7 +70,7 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) { ...@@ -70,7 +70,7 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_true); GotoIf(TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber. // Check if {number} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false); GotoIfNot(IsHeapNumber(number), &return_false);
// Check if {number} contains a finite, non-NaN value. // Check if {number} contains a finite, non-NaN value.
Node* number_value = LoadHeapNumberValue(number); Node* number_value = LoadHeapNumberValue(number);
...@@ -94,7 +94,7 @@ TF_BUILTIN(NumberIsInteger, CodeStubAssembler) { ...@@ -94,7 +94,7 @@ TF_BUILTIN(NumberIsInteger, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_true); GotoIf(TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber. // Check if {number} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false); GotoIfNot(IsHeapNumber(number), &return_false);
// Load the actual value of {number}. // Load the actual value of {number}.
Node* number_value = LoadHeapNumberValue(number); Node* number_value = LoadHeapNumberValue(number);
...@@ -123,7 +123,7 @@ TF_BUILTIN(NumberIsNaN, CodeStubAssembler) { ...@@ -123,7 +123,7 @@ TF_BUILTIN(NumberIsNaN, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_false); GotoIf(TaggedIsSmi(number), &return_false);
// Check if {number} is a HeapNumber. // Check if {number} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false); GotoIfNot(IsHeapNumber(number), &return_false);
// Check if {number} contains a NaN value. // Check if {number} contains a NaN value.
Node* number_value = LoadHeapNumberValue(number); Node* number_value = LoadHeapNumberValue(number);
...@@ -146,7 +146,7 @@ TF_BUILTIN(NumberIsSafeInteger, CodeStubAssembler) { ...@@ -146,7 +146,7 @@ TF_BUILTIN(NumberIsSafeInteger, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_true); GotoIf(TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber. // Check if {number} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false); GotoIfNot(IsHeapNumber(number), &return_false);
// Load the actual value of {number}. // Load the actual value of {number}.
Node* number_value = LoadHeapNumberValue(number); Node* number_value = LoadHeapNumberValue(number);
......
...@@ -1541,7 +1541,7 @@ TF_BUILTIN(StringPrototypeSubstr, StringBuiltinsAssembler) { ...@@ -1541,7 +1541,7 @@ TF_BUILTIN(StringPrototypeSubstr, StringBuiltinsAssembler) {
// two cases according to the spec: if it is negative, "" is returned; if // two cases according to the spec: if it is negative, "" is returned; if
// it is positive, then length is set to {string_length} - {start}. // it is positive, then length is set to {string_length} - {start}.
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(var_length.value()))); CSA_ASSERT(this, IsHeapNumber(var_length.value()));
Label if_isnegative(this), if_ispositive(this); Label if_isnegative(this), if_ispositive(this);
Node* const float_zero = Float64Constant(0.); Node* const float_zero = Float64Constant(0.);
...@@ -1603,7 +1603,7 @@ compiler::Node* StringBuiltinsAssembler::ToSmiBetweenZeroAnd(Node* context, ...@@ -1603,7 +1603,7 @@ compiler::Node* StringBuiltinsAssembler::ToSmiBetweenZeroAnd(Node* context,
BIND(&if_isnotsmi); BIND(&if_isnotsmi);
{ {
// {value} is a heap number - in this case, it is definitely out of bounds. // {value} is a heap number - in this case, it is definitely out of bounds.
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(value_int))); CSA_ASSERT(this, IsHeapNumber(value_int));
Node* const float_zero = Float64Constant(0.); Node* const float_zero = Float64Constant(0.);
Node* const smi_zero = SmiConstant(Smi::kZero); Node* const smi_zero = SmiConstant(Smi::kZero);
......
...@@ -2729,8 +2729,7 @@ Node* CodeStubAssembler::TryTaggedToFloat64(Node* value, ...@@ -2729,8 +2729,7 @@ Node* CodeStubAssembler::TryTaggedToFloat64(Node* value,
{ {
// Check if {value} is a HeapNumber. // Check if {value} is a HeapNumber.
Label if_valueisheapnumber(this); Label if_valueisheapnumber(this);
Branch(IsHeapNumberMap(LoadMap(value)), &if_valueisheapnumber, Branch(IsHeapNumber(value), &if_valueisheapnumber, if_valueisnotnumber);
if_valueisnotnumber);
BIND(&if_valueisheapnumber); BIND(&if_valueisheapnumber);
{ {
...@@ -2801,7 +2800,7 @@ Node* CodeStubAssembler::TruncateTaggedToWord32(Node* context, Node* value) { ...@@ -2801,7 +2800,7 @@ Node* CodeStubAssembler::TruncateTaggedToWord32(Node* context, Node* value) {
// Check if {value} is a HeapNumber. // Check if {value} is a HeapNumber.
Label if_valueisheapnumber(this), Label if_valueisheapnumber(this),
if_valueisnotheapnumber(this, Label::kDeferred); if_valueisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(value)), &if_valueisheapnumber, Branch(IsHeapNumber(value), &if_valueisheapnumber,
&if_valueisnotheapnumber); &if_valueisnotheapnumber);
BIND(&if_valueisheapnumber); BIND(&if_valueisheapnumber);
...@@ -4259,8 +4258,7 @@ Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) { ...@@ -4259,8 +4258,7 @@ Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) {
GotoIf(TaggedIsSmi(argument), &smi); GotoIf(TaggedIsSmi(argument), &smi);
// Argument isn't smi, check to see if it's a heap-number. // Argument isn't smi, check to see if it's a heap-number.
Node* map = LoadMap(argument); GotoIfNot(IsHeapNumber(argument), &runtime);
GotoIfNot(IsHeapNumberMap(map), &runtime);
// Make a hash from the two 32-bit values of the double. // Make a hash from the two 32-bit values of the double.
Node* low = Node* low =
...@@ -4275,8 +4273,7 @@ Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) { ...@@ -4275,8 +4273,7 @@ Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) {
// Cache entry's key must be a heap number // Cache entry's key must be a heap number
Node* number_key = LoadFixedArrayElement(number_string_cache, index); Node* number_key = LoadFixedArrayElement(number_string_cache, index);
GotoIf(TaggedIsSmi(number_key), &runtime); GotoIf(TaggedIsSmi(number_key), &runtime);
map = LoadMap(number_key); GotoIfNot(IsHeapNumber(number_key), &runtime);
GotoIfNot(IsHeapNumberMap(map), &runtime);
// Cache entry's key must match the heap number value we're looking for. // Cache entry's key must match the heap number value we're looking for.
Node* low_compare = LoadObjectField(number_key, HeapNumber::kValueOffset, Node* low_compare = LoadObjectField(number_key, HeapNumber::kValueOffset,
...@@ -4369,7 +4366,7 @@ Node* CodeStubAssembler::ToName(Node* context, Node* value) { ...@@ -4369,7 +4366,7 @@ Node* CodeStubAssembler::ToName(Node* context, Node* value) {
Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) { Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) {
// Assert input is a HeapObject (not smi or heap number) // Assert input is a HeapObject (not smi or heap number)
CSA_ASSERT(this, Word32BinaryNot(TaggedIsSmi(input))); CSA_ASSERT(this, Word32BinaryNot(TaggedIsSmi(input)));
CSA_ASSERT(this, Word32BinaryNot(IsHeapNumberMap(LoadMap(input)))); CSA_ASSERT(this, Word32BinaryNot(IsHeapNumber(input)));
// We might need to loop once here due to ToPrimitive conversions. // We might need to loop once here due to ToPrimitive conversions.
VARIABLE(var_input, MachineRepresentation::kTagged, input); VARIABLE(var_input, MachineRepresentation::kTagged, input);
...@@ -4418,9 +4415,7 @@ Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) { ...@@ -4418,9 +4415,7 @@ Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) {
// Check if the {result} is already a Number. // Check if the {result} is already a Number.
Label if_resultisnumber(this), if_resultisnotnumber(this); Label if_resultisnumber(this), if_resultisnotnumber(this);
GotoIf(TaggedIsSmi(result), &if_resultisnumber); GotoIf(TaggedIsSmi(result), &if_resultisnumber);
Node* result_map = LoadMap(result); Branch(IsHeapNumber(result), &if_resultisnumber, &if_resultisnotnumber);
Branch(IsHeapNumberMap(result_map), &if_resultisnumber,
&if_resultisnotnumber);
BIND(&if_resultisnumber); BIND(&if_resultisnumber);
{ {
...@@ -4467,8 +4462,7 @@ Node* CodeStubAssembler::ToNumber(Node* context, Node* input) { ...@@ -4467,8 +4462,7 @@ Node* CodeStubAssembler::ToNumber(Node* context, Node* input) {
BIND(&not_smi); BIND(&not_smi);
{ {
Label not_heap_number(this, Label::kDeferred); Label not_heap_number(this, Label::kDeferred);
Node* input_map = LoadMap(input); GotoIfNot(IsHeapNumber(input), &not_heap_number);
GotoIfNot(IsHeapNumberMap(input_map), &not_heap_number);
var_result.Bind(input); var_result.Bind(input);
Goto(&end); Goto(&end);
...@@ -4749,8 +4743,7 @@ Node* CodeStubAssembler::ToInteger(Node* context, Node* input, ...@@ -4749,8 +4743,7 @@ Node* CodeStubAssembler::ToInteger(Node* context, Node* input,
// Check if {arg} is a HeapNumber. // Check if {arg} is a HeapNumber.
Label if_argisheapnumber(this), Label if_argisheapnumber(this),
if_argisnotheapnumber(this, Label::kDeferred); if_argisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(arg)), &if_argisheapnumber, Branch(IsHeapNumber(arg), &if_argisheapnumber, &if_argisnotheapnumber);
&if_argisnotheapnumber);
BIND(&if_argisheapnumber); BIND(&if_argisheapnumber);
{ {
...@@ -6229,7 +6222,7 @@ Node* CodeStubAssembler::TryToIntptr(Node* key, Label* miss) { ...@@ -6229,7 +6222,7 @@ Node* CodeStubAssembler::TryToIntptr(Node* key, Label* miss) {
Label done(this, &var_intptr_key), key_is_smi(this); Label done(this, &var_intptr_key), key_is_smi(this);
GotoIf(TaggedIsSmi(key), &key_is_smi); GotoIf(TaggedIsSmi(key), &key_is_smi);
// Try to convert a heap number to a Smi. // Try to convert a heap number to a Smi.
GotoIfNot(IsHeapNumberMap(LoadMap(key)), miss); GotoIfNot(IsHeapNumber(key), miss);
{ {
Node* value = LoadHeapNumberValue(key); Node* value = LoadHeapNumberValue(key);
Node* int_value = RoundFloat64ToInt32(value); Node* int_value = RoundFloat64ToInt32(value);
...@@ -6464,7 +6457,7 @@ Node* CodeStubAssembler::PrepareValueForWriteToTypedArray( ...@@ -6464,7 +6457,7 @@ Node* CodeStubAssembler::PrepareValueForWriteToTypedArray(
Label done(this, &var_result), if_smi(this); Label done(this, &var_result), if_smi(this);
GotoIf(TaggedIsSmi(input), &if_smi); GotoIf(TaggedIsSmi(input), &if_smi);
// Try to convert a heap number to a Smi. // Try to convert a heap number to a Smi.
GotoIfNot(IsHeapNumberMap(LoadMap(input)), bailout); GotoIfNot(IsHeapNumber(input), bailout);
{ {
Node* value = LoadHeapNumberValue(input); Node* value = LoadHeapNumberValue(input);
if (rep == MachineRepresentation::kWord32) { if (rep == MachineRepresentation::kWord32) {
...@@ -7072,7 +7065,7 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison( ...@@ -7072,7 +7065,7 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison(
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(rhs))); CSA_ASSERT(this, IsHeapNumber(rhs));
// Convert the {lhs} and {rhs} to floating point values, and // Convert the {lhs} and {rhs} to floating point values, and
// perform a floating point comparison. // perform a floating point comparison.
var_fcmp_lhs.Bind(SmiToFloat64(lhs)); var_fcmp_lhs.Bind(SmiToFloat64(lhs));
...@@ -7083,7 +7076,7 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison( ...@@ -7083,7 +7076,7 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison(
BIND(&if_lhsisnotsmi); BIND(&if_lhsisnotsmi);
{ {
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(lhs))); CSA_ASSERT(this, IsHeapNumber(lhs));
// Check if {rhs} is a Smi or a HeapObject. // Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this); Label if_rhsissmi(this), if_rhsisnotsmi(this);
...@@ -7100,7 +7093,7 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison( ...@@ -7100,7 +7093,7 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison(
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(rhs))); CSA_ASSERT(this, IsHeapNumber(rhs));
// Convert the {lhs} and {rhs} to floating point values, and // Convert the {lhs} and {rhs} to floating point values, and
// perform a floating point comparison. // perform a floating point comparison.
...@@ -7207,12 +7200,9 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode, ...@@ -7207,12 +7200,9 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
// Load the map of {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if the {rhs} is a HeapNumber. // Check if the {rhs} is a HeapNumber.
Label if_rhsisnumber(this), if_rhsisnotnumber(this, Label::kDeferred); Label if_rhsisnumber(this), if_rhsisnotnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(rhs_map), &if_rhsisnumber, &if_rhsisnotnumber); Branch(IsHeapNumber(rhs), &if_rhsisnumber, &if_rhsisnotnumber);
BIND(&if_rhsisnumber); BIND(&if_rhsisnumber);
{ {
...@@ -8841,8 +8831,7 @@ Node* CodeStubAssembler::NumberInc(Node* value) { ...@@ -8841,8 +8831,7 @@ Node* CodeStubAssembler::NumberInc(Node* value) {
BIND(&if_isnotsmi); BIND(&if_isnotsmi);
{ {
// Check if the value is a HeapNumber. CSA_ASSERT(this, IsHeapNumber(value));
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(value)));
// Load the HeapNumber value. // Load the HeapNumber value.
var_finc_value.Bind(LoadHeapNumberValue(value)); var_finc_value.Bind(LoadHeapNumberValue(value));
...@@ -8893,8 +8882,7 @@ Node* CodeStubAssembler::NumberDec(Node* value) { ...@@ -8893,8 +8882,7 @@ Node* CodeStubAssembler::NumberDec(Node* value) {
BIND(&if_isnotsmi); BIND(&if_isnotsmi);
{ {
// Check if the value is a HeapNumber. CSA_ASSERT(this, IsHeapNumber(value));
CSA_ASSERT(this, IsHeapNumberMap(LoadMap(value)));
// Load the HeapNumber value. // Load the HeapNumber value.
var_fdec_value.Bind(LoadHeapNumberValue(value)); var_fdec_value.Bind(LoadHeapNumberValue(value));
...@@ -8917,15 +8905,13 @@ Node* CodeStubAssembler::NumberDec(Node* value) { ...@@ -8917,15 +8905,13 @@ Node* CodeStubAssembler::NumberDec(Node* value) {
void CodeStubAssembler::GotoIfNotNumber(Node* input, Label* is_not_number) { void CodeStubAssembler::GotoIfNotNumber(Node* input, Label* is_not_number) {
Label is_number(this); Label is_number(this);
GotoIf(TaggedIsSmi(input), &is_number); GotoIf(TaggedIsSmi(input), &is_number);
Node* input_map = LoadMap(input); Branch(IsHeapNumber(input), &is_number, is_not_number);
Branch(IsHeapNumberMap(input_map), &is_number, is_not_number);
BIND(&is_number); BIND(&is_number);
} }
void CodeStubAssembler::GotoIfNumber(Node* input, Label* is_number) { void CodeStubAssembler::GotoIfNumber(Node* input, Label* is_number) {
GotoIf(TaggedIsSmi(input), is_number); GotoIf(TaggedIsSmi(input), is_number);
Node* input_map = LoadMap(input); GotoIf(IsHeapNumber(input), is_number);
GotoIf(IsHeapNumberMap(input_map), is_number);
} }
Node* CodeStubAssembler::CreateArrayIterator(Node* array, Node* array_map, Node* CodeStubAssembler::CreateArrayIterator(Node* array, Node* array_map,
......
...@@ -64,11 +64,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs, ...@@ -64,11 +64,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs,
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
// Load the map of {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if the {rhs} is a HeapNumber. // Check if the {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
var_fadd_lhs.Bind(SmiToFloat64(lhs)); var_fadd_lhs.Bind(SmiToFloat64(lhs));
var_fadd_rhs.Bind(LoadHeapNumberValue(rhs)); var_fadd_rhs.Bind(LoadHeapNumberValue(rhs));
...@@ -78,11 +75,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs, ...@@ -78,11 +75,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs,
BIND(&if_lhsisnotsmi); BIND(&if_lhsisnotsmi);
{ {
// Load the map of {lhs}.
Node* lhs_map = LoadMap(lhs);
// Check if {lhs} is a HeapNumber. // Check if {lhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(lhs_map), &if_lhsisnotnumber); GotoIfNot(IsHeapNumber(lhs), &if_lhsisnotnumber);
// Check if the {rhs} is Smi. // Check if the {rhs} is Smi.
Label if_rhsissmi(this), if_rhsisnotsmi(this); Label if_rhsissmi(this), if_rhsisnotsmi(this);
...@@ -97,11 +91,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs, ...@@ -97,11 +91,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs,
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
// Load the map of {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if the {rhs} is a HeapNumber. // Check if the {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
var_fadd_lhs.Bind(LoadHeapNumberValue(lhs)); var_fadd_lhs.Bind(LoadHeapNumberValue(lhs));
var_fadd_rhs.Bind(LoadHeapNumberValue(rhs)); var_fadd_rhs.Bind(LoadHeapNumberValue(rhs));
...@@ -130,12 +121,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs, ...@@ -130,12 +121,8 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs,
BIND(&if_lhsisoddball); BIND(&if_lhsisoddball);
{ {
GotoIf(TaggedIsSmi(rhs), &call_with_oddball_feedback); GotoIf(TaggedIsSmi(rhs), &call_with_oddball_feedback);
// Load the map of the {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if {rhs} is a HeapNumber. // Check if {rhs} is a HeapNumber.
Branch(IsHeapNumberMap(rhs_map), &call_with_oddball_feedback, Branch(IsHeapNumber(rhs), &call_with_oddball_feedback,
&check_rhsisoddball); &check_rhsisoddball);
} }
...@@ -252,11 +239,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs, ...@@ -252,11 +239,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs,
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
// Load the map of the {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if {rhs} is a HeapNumber. // Check if {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
// Perform a floating point subtraction. // Perform a floating point subtraction.
var_fsub_lhs.Bind(SmiToFloat64(lhs)); var_fsub_lhs.Bind(SmiToFloat64(lhs));
...@@ -267,11 +251,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs, ...@@ -267,11 +251,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs,
BIND(&if_lhsisnotsmi); BIND(&if_lhsisnotsmi);
{ {
// Load the map of the {lhs}.
Node* lhs_map = LoadMap(lhs);
// Check if the {lhs} is a HeapNumber. // Check if the {lhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(lhs_map), &if_lhsisnotnumber); GotoIfNot(IsHeapNumber(lhs), &if_lhsisnotnumber);
// Check if the {rhs} is a Smi. // Check if the {rhs} is a Smi.
Label if_rhsissmi(this), if_rhsisnotsmi(this); Label if_rhsissmi(this), if_rhsisnotsmi(this);
...@@ -287,11 +268,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs, ...@@ -287,11 +268,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs,
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
// Load the map of the {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if the {rhs} is a HeapNumber. // Check if the {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
// Perform a floating point subtraction. // Perform a floating point subtraction.
var_fsub_lhs.Bind(LoadHeapNumberValue(lhs)); var_fsub_lhs.Bind(LoadHeapNumberValue(lhs));
...@@ -331,11 +309,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs, ...@@ -331,11 +309,8 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs,
BIND(&if_rhsisnotsmi); BIND(&if_rhsisnotsmi);
{ {
// Load the map of the {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if {rhs} is a HeapNumber. // Check if {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
var_type_feedback.Bind( var_type_feedback.Bind(
SmiConstant(BinaryOperationFeedback::kNumberOrOddball)); SmiConstant(BinaryOperationFeedback::kNumberOrOddball));
...@@ -410,10 +385,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs, ...@@ -410,10 +385,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs,
BIND(&rhs_is_not_smi); BIND(&rhs_is_not_smi);
{ {
Node* rhs_map = LoadMap(rhs);
// Check if {rhs} is a HeapNumber. // Check if {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
// Convert {lhs} to a double and multiply it with the value of {rhs}. // Convert {lhs} to a double and multiply it with the value of {rhs}.
var_lhs_float64.Bind(SmiToFloat64(lhs)); var_lhs_float64.Bind(SmiToFloat64(lhs));
...@@ -424,10 +397,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs, ...@@ -424,10 +397,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs,
BIND(&lhs_is_not_smi); BIND(&lhs_is_not_smi);
{ {
Node* lhs_map = LoadMap(lhs);
// Check if {lhs} is a HeapNumber. // Check if {lhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(lhs_map), &if_lhsisnotnumber); GotoIfNot(IsHeapNumber(lhs), &if_lhsisnotnumber);
// Check if {rhs} is a Smi. // Check if {rhs} is a Smi.
Label rhs_is_smi(this), rhs_is_not_smi(this); Label rhs_is_smi(this), rhs_is_not_smi(this);
...@@ -443,10 +414,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs, ...@@ -443,10 +414,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs,
BIND(&rhs_is_not_smi); BIND(&rhs_is_not_smi);
{ {
Node* rhs_map = LoadMap(rhs);
// Check if {rhs} is a HeapNumber. // Check if {rhs} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(rhs_map), &check_rhsisoddball); GotoIfNot(IsHeapNumber(rhs), &check_rhsisoddball);
// Both {lhs} and {rhs} are HeapNumbers. Load their values and // Both {lhs} and {rhs} are HeapNumbers. Load their values and
// multiply them. // multiply them.
...@@ -476,12 +445,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs, ...@@ -476,12 +445,8 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs,
GotoIf(TaggedIsSmi(rhs), &call_with_oddball_feedback); GotoIf(TaggedIsSmi(rhs), &call_with_oddball_feedback);
// Load the map of the {rhs}.
Node* rhs_map = LoadMap(rhs);
// Check if {rhs} is a HeapNumber. // Check if {rhs} is a HeapNumber.
Branch(IsHeapNumberMap(rhs_map), &call_with_oddball_feedback, Branch(IsHeapNumber(rhs), &call_with_oddball_feedback, &check_rhsisoddball);
&check_rhsisoddball);
} }
BIND(&check_rhsisoddball); BIND(&check_rhsisoddball);
...@@ -562,10 +527,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback( ...@@ -562,10 +527,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback(
BIND(&divisor_is_not_smi); BIND(&divisor_is_not_smi);
{ {
Node* divisor_map = LoadMap(divisor);
// Check if {divisor} is a HeapNumber. // Check if {divisor} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(divisor_map), &check_divisor_for_oddball); GotoIfNot(IsHeapNumber(divisor), &check_divisor_for_oddball);
// Convert {dividend} to a double and divide it with the value of // Convert {dividend} to a double and divide it with the value of
// {divisor}. // {divisor}.
...@@ -576,10 +539,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback( ...@@ -576,10 +539,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback(
BIND(&dividend_is_not_smi); BIND(&dividend_is_not_smi);
{ {
Node* dividend_map = LoadMap(dividend);
// Check if {dividend} is a HeapNumber. // Check if {dividend} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(dividend_map), &dividend_is_not_number); GotoIfNot(IsHeapNumber(dividend), &dividend_is_not_number);
// Check if {divisor} is a Smi. // Check if {divisor} is a Smi.
Label divisor_is_smi(this), divisor_is_not_smi(this); Label divisor_is_smi(this), divisor_is_not_smi(this);
...@@ -596,10 +557,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback( ...@@ -596,10 +557,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback(
BIND(&divisor_is_not_smi); BIND(&divisor_is_not_smi);
{ {
Node* divisor_map = LoadMap(divisor);
// Check if {divisor} is a HeapNumber. // Check if {divisor} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(divisor_map), &check_divisor_for_oddball); GotoIfNot(IsHeapNumber(divisor), &check_divisor_for_oddball);
// Both {dividend} and {divisor} are HeapNumbers. Load their values // Both {dividend} and {divisor} are HeapNumbers. Load their values
// and divide them. // and divide them.
...@@ -629,12 +588,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback( ...@@ -629,12 +588,8 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback(
GotoIfNot(dividend_is_oddball, &call_with_any_feedback); GotoIfNot(dividend_is_oddball, &call_with_any_feedback);
GotoIf(TaggedIsSmi(divisor), &call_with_oddball_feedback); GotoIf(TaggedIsSmi(divisor), &call_with_oddball_feedback);
// Load the map of the {divisor}.
Node* divisor_map = LoadMap(divisor);
// Check if {divisor} is a HeapNumber. // Check if {divisor} is a HeapNumber.
Branch(IsHeapNumberMap(divisor_map), &call_with_oddball_feedback, Branch(IsHeapNumber(divisor), &call_with_oddball_feedback,
&check_divisor_for_oddball); &check_divisor_for_oddball);
} }
...@@ -706,10 +661,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback( ...@@ -706,10 +661,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback(
BIND(&divisor_is_not_smi); BIND(&divisor_is_not_smi);
{ {
Node* divisor_map = LoadMap(divisor);
// Check if {divisor} is a HeapNumber. // Check if {divisor} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(divisor_map), &check_divisor_for_oddball); GotoIfNot(IsHeapNumber(divisor), &check_divisor_for_oddball);
// Convert {dividend} to a double and divide it with the value of // Convert {dividend} to a double and divide it with the value of
// {divisor}. // {divisor}.
...@@ -721,10 +674,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback( ...@@ -721,10 +674,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback(
BIND(&dividend_is_not_smi); BIND(&dividend_is_not_smi);
{ {
Node* dividend_map = LoadMap(dividend);
// Check if {dividend} is a HeapNumber. // Check if {dividend} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(dividend_map), &dividend_is_not_number); GotoIfNot(IsHeapNumber(dividend), &dividend_is_not_number);
// Check if {divisor} is a Smi. // Check if {divisor} is a Smi.
Label divisor_is_smi(this), divisor_is_not_smi(this); Label divisor_is_smi(this), divisor_is_not_smi(this);
...@@ -741,10 +692,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback( ...@@ -741,10 +692,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback(
BIND(&divisor_is_not_smi); BIND(&divisor_is_not_smi);
{ {
Node* divisor_map = LoadMap(divisor);
// Check if {divisor} is a HeapNumber. // Check if {divisor} is a HeapNumber.
GotoIfNot(IsHeapNumberMap(divisor_map), &check_divisor_for_oddball); GotoIfNot(IsHeapNumber(divisor), &check_divisor_for_oddball);
// Both {dividend} and {divisor} are HeapNumbers. Load their values // Both {dividend} and {divisor} are HeapNumbers. Load their values
// and divide them. // and divide them.
...@@ -773,12 +722,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback( ...@@ -773,12 +722,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback(
GotoIfNot(dividend_is_oddball, &call_with_any_feedback); GotoIfNot(dividend_is_oddball, &call_with_any_feedback);
GotoIf(TaggedIsSmi(divisor), &call_with_oddball_feedback); GotoIf(TaggedIsSmi(divisor), &call_with_oddball_feedback);
// Load the map of the {divisor}.
Node* divisor_map = LoadMap(divisor);
// Check if {divisor} is a HeapNumber. // Check if {divisor} is a HeapNumber.
Branch(IsHeapNumberMap(divisor_map), &call_with_oddball_feedback, Branch(IsHeapNumber(divisor), &call_with_oddball_feedback,
&check_divisor_for_oddball); &check_divisor_for_oddball);
} }
......
...@@ -1435,8 +1435,7 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) { ...@@ -1435,8 +1435,7 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) {
if_objectisother(this, Label::kDeferred); if_objectisother(this, Label::kDeferred);
GotoIf(TaggedIsSmi(object), &if_objectissmi); GotoIf(TaggedIsSmi(object), &if_objectissmi);
Node* object_map = LoadMap(object); Branch(IsHeapNumber(object), &if_objectisnumber, &if_objectisother);
Branch(IsHeapNumberMap(object_map), &if_objectisnumber, &if_objectisother);
BIND(&if_objectissmi); BIND(&if_objectissmi);
{ {
......
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