Commit 87cc641e authored by epertoso's avatar epertoso Committed by Commit bot

[stubs] Renames WordIsSmi to TaggedIsSmi, introducing an appropriate bitcast of the parameter.

WordIsSmi, by itself, is not that descriptive, as it just ands a word with the heap object tag. With this change, the MachineGraphVerifier can check that the input to TaggedIsSmi actually has a tagged representation.

This CL also introduces a few bitcast operators in the Smi* macros in the CodeStubAssembler.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2407303002
Cr-Commit-Position: refs/heads/master@{#40209}
parent a18ff08b
......@@ -1236,7 +1236,7 @@ void Builtins::Generate_ArrayIsArray(CodeStubAssembler* assembler) {
Label call_runtime(assembler), return_true(assembler),
return_false(assembler);
assembler->GotoIf(assembler->WordIsSmi(object), &return_false);
assembler->GotoIf(assembler->TaggedIsSmi(object), &return_false);
Node* instance_type = assembler->LoadInstanceType(object);
assembler->GotoIf(assembler->Word32Equal(
......@@ -1296,7 +1296,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
{
// Handle case where JSArray length is not an Smi in the runtime
Node* len = assembler->LoadObjectField(array, JSArray::kLengthOffset);
assembler->GotoUnless(assembler->WordIsSmi(len), &call_runtime);
assembler->GotoUnless(assembler->TaggedIsSmi(len), &call_runtime);
len_var.Bind(assembler->SmiToWord(len));
assembler->Branch(assembler->WordEqual(len_var.value(), intptr_zero),
......@@ -1309,7 +1309,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
init_k_zero(assembler), init_k_n(assembler);
Node* tagged_n = assembler->ToInteger(context, start_from);
assembler->Branch(assembler->WordIsSmi(tagged_n), &init_k_smi,
assembler->Branch(assembler->TaggedIsSmi(tagged_n), &init_k_smi,
&init_k_heap_num);
assembler->Bind(&init_k_smi);
......@@ -1395,7 +1395,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
undef_loop(assembler, &index_var), not_smi(assembler),
not_heap_num(assembler);
assembler->GotoUnless(assembler->WordIsSmi(search_element), &not_smi);
assembler->GotoUnless(assembler->TaggedIsSmi(search_element), &not_smi);
search_num.Bind(assembler->SmiToFloat64(search_element));
assembler->Goto(&heap_num_loop);
......@@ -1464,7 +1464,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0,
CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoUnless(assembler->WordIsSmi(element_k), &not_smi);
assembler->GotoUnless(assembler->TaggedIsSmi(element_k), &not_smi);
assembler->Branch(
assembler->Float64Equal(search_num.value(),
assembler->SmiToFloat64(element_k)),
......@@ -1492,7 +1492,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0,
CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
assembler->GotoIf(assembler->TaggedIsSmi(element_k), &continue_loop);
assembler->GotoIf(assembler->WordNotEqual(assembler->LoadMap(element_k),
heap_number_map),
&continue_loop);
......@@ -1514,7 +1514,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
&return_false);
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
assembler->GotoIf(assembler->TaggedIsSmi(element_k), &continue_loop);
assembler->GotoUnless(assembler->IsStringInstanceType(
assembler->LoadInstanceType(element_k)),
&continue_loop);
......@@ -1546,7 +1546,7 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
assembler->GotoIf(assembler->TaggedIsSmi(element_k), &continue_loop);
Node* map_k = assembler->LoadMap(element_k);
assembler->BranchIfSimd128Equal(search_element, map, element_k, map_k,
......@@ -1564,7 +1564,8 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
hole_loop(assembler, &index_var), search_notnan(assembler);
Variable search_num(assembler, MachineRepresentation::kFloat64);
assembler->GotoUnless(assembler->WordIsSmi(search_element), &search_notnan);
assembler->GotoUnless(assembler->TaggedIsSmi(search_element),
&search_notnan);
search_num.Bind(assembler->SmiToFloat64(search_element));
assembler->Goto(&not_nan_loop);
......@@ -1618,7 +1619,8 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
hole_loop(assembler, &index_var), search_notnan(assembler);
Variable search_num(assembler, MachineRepresentation::kFloat64);
assembler->GotoUnless(assembler->WordIsSmi(search_element), &search_notnan);
assembler->GotoUnless(assembler->TaggedIsSmi(search_element),
&search_notnan);
search_num.Bind(assembler->SmiToFloat64(search_element));
assembler->Goto(&not_nan_loop);
......@@ -1738,7 +1740,7 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
{
// Handle case where JSArray length is not an Smi in the runtime
Node* len = assembler->LoadObjectField(array, JSArray::kLengthOffset);
assembler->GotoUnless(assembler->WordIsSmi(len), &call_runtime);
assembler->GotoUnless(assembler->TaggedIsSmi(len), &call_runtime);
len_var.Bind(assembler->SmiToWord(len));
assembler->Branch(assembler->WordEqual(len_var.value(), intptr_zero),
......@@ -1751,7 +1753,7 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
init_k_zero(assembler), init_k_n(assembler);
Node* tagged_n = assembler->ToInteger(context, start_from);
assembler->Branch(assembler->WordIsSmi(tagged_n), &init_k_smi,
assembler->Branch(assembler->TaggedIsSmi(tagged_n), &init_k_smi,
&init_k_heap_num);
assembler->Bind(&init_k_smi);
......@@ -1837,7 +1839,7 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
undef_loop(assembler, &index_var), not_smi(assembler),
not_heap_num(assembler);
assembler->GotoUnless(assembler->WordIsSmi(search_element), &not_smi);
assembler->GotoUnless(assembler->TaggedIsSmi(search_element), &not_smi);
search_num.Bind(assembler->SmiToFloat64(search_element));
assembler->Goto(&heap_num_loop);
......@@ -1903,7 +1905,7 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0,
CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoUnless(assembler->WordIsSmi(element_k), &not_smi);
assembler->GotoUnless(assembler->TaggedIsSmi(element_k), &not_smi);
assembler->Branch(
assembler->Float64Equal(search_num.value(),
assembler->SmiToFloat64(element_k)),
......@@ -1931,7 +1933,7 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
&return_not_found);
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
assembler->GotoIf(assembler->TaggedIsSmi(element_k), &continue_loop);
assembler->GotoUnless(assembler->IsStringInstanceType(
assembler->LoadInstanceType(element_k)),
&continue_loop);
......@@ -1963,7 +1965,7 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
assembler->GotoIf(assembler->TaggedIsSmi(element_k), &continue_loop);
Node* map_k = assembler->LoadMap(element_k);
assembler->BranchIfSimd128Equal(search_element, map, element_k, map_k,
......@@ -1980,7 +1982,8 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
Label not_nan_loop(assembler, &index_var), search_notnan(assembler);
Variable search_num(assembler, MachineRepresentation::kFloat64);
assembler->GotoUnless(assembler->WordIsSmi(search_element), &search_notnan);
assembler->GotoUnless(assembler->TaggedIsSmi(search_element),
&search_notnan);
search_num.Bind(assembler->SmiToFloat64(search_element));
assembler->Goto(&not_nan_loop);
......@@ -2017,7 +2020,8 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
Label not_nan_loop(assembler, &index_var), search_notnan(assembler);
Variable search_num(assembler, MachineRepresentation::kFloat64);
assembler->GotoUnless(assembler->WordIsSmi(search_element), &search_notnan);
assembler->GotoUnless(assembler->TaggedIsSmi(search_element),
&search_notnan);
search_num.Bind(assembler->SmiToFloat64(search_element));
assembler->Goto(&not_nan_loop);
......
......@@ -60,7 +60,7 @@ void Generate_NonPrimitiveToPrimitive(CodeStubAssembler* assembler,
// Verify that the {result} is actually a primitive.
Label if_resultisprimitive(assembler),
if_resultisnotprimitive(assembler, Label::kDeferred);
assembler->GotoIf(assembler->WordIsSmi(result), &if_resultisprimitive);
assembler->GotoIf(assembler->TaggedIsSmi(result), &if_resultisprimitive);
Node* result_instance_type = assembler->LoadInstanceType(result);
STATIC_ASSERT(FIRST_PRIMITIVE_TYPE == FIRST_TYPE);
assembler->Branch(assembler->Int32LessThanOrEqual(
......@@ -162,7 +162,7 @@ void Builtins::Generate_ToString(CodeStubAssembler* assembler) {
Label is_number(assembler);
Label runtime(assembler);
assembler->GotoIf(assembler->WordIsSmi(input), &is_number);
assembler->GotoIf(assembler->TaggedIsSmi(input), &is_number);
Node* input_map = assembler->LoadMap(input);
Node* input_instance_type = assembler->LoadMapInstanceType(input_map);
......@@ -252,7 +252,7 @@ void Generate_OrdinaryToPrimitive(CodeStubAssembler* assembler,
// Check if the {method} is callable.
Label if_methodiscallable(assembler),
if_methodisnotcallable(assembler, Label::kDeferred);
assembler->GotoIf(assembler->WordIsSmi(method), &if_methodisnotcallable);
assembler->GotoIf(assembler->TaggedIsSmi(method), &if_methodisnotcallable);
Node* method_map = assembler->LoadMap(method);
Node* method_bit_field = assembler->LoadMapBitField(method_map);
assembler->Branch(
......@@ -270,7 +270,7 @@ void Generate_OrdinaryToPrimitive(CodeStubAssembler* assembler,
var_result.Bind(result);
// Return the {result} if it is a primitive.
assembler->GotoIf(assembler->WordIsSmi(result), &return_result);
assembler->GotoIf(assembler->TaggedIsSmi(result), &return_result);
Node* result_instance_type = assembler->LoadInstanceType(result);
STATIC_ASSERT(FIRST_PRIMITIVE_TYPE == FIRST_TYPE);
assembler->GotoIf(assembler->Int32LessThanOrEqual(
......@@ -345,7 +345,7 @@ void Builtins::Generate_ToLength(CodeStubAssembler* assembler) {
assembler->GotoIf(assembler->WordIsPositiveSmi(len), &return_len);
// Check if {len} is a (negative) Smi.
assembler->GotoIf(assembler->WordIsSmi(len), &return_zero);
assembler->GotoIf(assembler->TaggedIsSmi(len), &return_zero);
// Check if {len} is a HeapNumber.
Label if_lenisheapnumber(assembler),
......@@ -420,7 +420,7 @@ void Builtins::Generate_ToObject(CodeStubAssembler* assembler) {
Variable constructor_function_index_var(assembler,
MachineType::PointerRepresentation());
assembler->Branch(assembler->WordIsSmi(object), &if_number, &if_notsmi);
assembler->Branch(assembler->TaggedIsSmi(object), &if_number, &if_notsmi);
assembler->Bind(&if_notsmi);
Node* map = assembler->LoadMap(object);
......
......@@ -919,7 +919,7 @@ void Builtins::Generate_DatePrototype_GetField(CodeStubAssembler* assembler,
Label receiver_not_date(assembler, Label::kDeferred);
assembler->GotoIf(assembler->WordIsSmi(receiver), &receiver_not_date);
assembler->GotoIf(assembler->TaggedIsSmi(receiver), &receiver_not_date);
Node* receiver_instance_type = assembler->LoadInstanceType(receiver);
assembler->GotoIf(
assembler->Word32NotEqual(receiver_instance_type,
......
......@@ -26,7 +26,8 @@ void Generate_GeneratorPrototypeResume(
// Check if the {receiver} is actually a JSGeneratorObject.
Label if_receiverisincompatible(assembler, Label::kDeferred);
assembler->GotoIf(assembler->WordIsSmi(receiver), &if_receiverisincompatible);
assembler->GotoIf(assembler->TaggedIsSmi(receiver),
&if_receiverisincompatible);
Node* receiver_instance_type = assembler->LoadInstanceType(receiver);
assembler->GotoUnless(assembler->Word32Equal(
receiver_instance_type,
......
......@@ -121,7 +121,7 @@ void Builtins::Generate_GlobalIsFinite(CodeStubAssembler* assembler) {
Node* num = var_num.value();
// Check if {num} is a Smi or a HeapObject.
assembler->GotoIf(assembler->WordIsSmi(num), &return_true);
assembler->GotoIf(assembler->TaggedIsSmi(num), &return_true);
// Check if {num} is a HeapNumber.
Label if_numisheapnumber(assembler),
......@@ -176,7 +176,7 @@ void Builtins::Generate_GlobalIsNaN(CodeStubAssembler* assembler) {
Node* num = var_num.value();
// Check if {num} is a Smi or a HeapObject.
assembler->GotoIf(assembler->WordIsSmi(num), &return_false);
assembler->GotoIf(assembler->TaggedIsSmi(num), &return_false);
// Check if {num} is a HeapNumber.
Label if_numisheapnumber(assembler),
......
......@@ -133,7 +133,7 @@ void Generate_MathRoundingOperation(
// Check if {x} is a Smi or a HeapObject.
Label if_xissmi(assembler), if_xisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(x), &if_xissmi, &if_xisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(x), &if_xissmi, &if_xisnotsmi);
assembler->Bind(&if_xissmi);
{
......@@ -214,7 +214,7 @@ void Builtins::Generate_MathClz32(CodeStubAssembler* assembler) {
// Check if {x} is a Smi or a HeapObject.
Label if_xissmi(assembler), if_xisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(x), &if_xissmi, &if_xisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(x), &if_xissmi, &if_xisnotsmi);
assembler->Bind(&if_xissmi);
{
......
......@@ -22,7 +22,7 @@ void Builtins::Generate_NumberIsFinite(CodeStubAssembler* assembler) {
Label return_true(assembler), return_false(assembler);
// Check if {number} is a Smi.
assembler->GotoIf(assembler->WordIsSmi(number), &return_true);
assembler->GotoIf(assembler->TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber.
assembler->GotoUnless(
......@@ -53,7 +53,7 @@ void Builtins::Generate_NumberIsInteger(CodeStubAssembler* assembler) {
Label return_true(assembler), return_false(assembler);
// Check if {number} is a Smi.
assembler->GotoIf(assembler->WordIsSmi(number), &return_true);
assembler->GotoIf(assembler->TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber.
assembler->GotoUnless(
......@@ -89,7 +89,7 @@ void Builtins::Generate_NumberIsNaN(CodeStubAssembler* assembler) {
Label return_true(assembler), return_false(assembler);
// Check if {number} is a Smi.
assembler->GotoIf(assembler->WordIsSmi(number), &return_false);
assembler->GotoIf(assembler->TaggedIsSmi(number), &return_false);
// Check if {number} is a HeapNumber.
assembler->GotoUnless(
......@@ -118,7 +118,7 @@ void Builtins::Generate_NumberIsSafeInteger(CodeStubAssembler* assembler) {
Label return_true(assembler), return_false(assembler);
// Check if {number} is a Smi.
assembler->GotoIf(assembler->WordIsSmi(number), &return_true);
assembler->GotoIf(assembler->TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber.
assembler->GotoUnless(
......@@ -170,7 +170,7 @@ void Builtins::Generate_NumberParseFloat(CodeStubAssembler* assembler) {
// Check if the {input} is a HeapObject or a Smi.
Label if_inputissmi(assembler), if_inputisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(input), &if_inputissmi,
assembler->Branch(assembler->TaggedIsSmi(input), &if_inputissmi,
&if_inputisnotsmi);
assembler->Bind(&if_inputissmi);
......@@ -511,13 +511,14 @@ void Builtins::Generate_Add(CodeStubAssembler* assembler) {
// Check if the {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(assembler), if_lhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(lhs), &if_lhsissmi,
&if_lhsisnotsmi);
assembler->Bind(&if_lhsissmi);
{
// Check if the {rhs} is also a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi,
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
......@@ -630,7 +631,7 @@ void Builtins::Generate_Add(CodeStubAssembler* assembler) {
{
// Check if {rhs} is a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi,
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
......@@ -872,13 +873,14 @@ void Builtins::Generate_Subtract(CodeStubAssembler* assembler) {
// Check if the {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(assembler), if_lhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(lhs), &if_lhsissmi,
&if_lhsisnotsmi);
assembler->Bind(&if_lhsissmi);
{
// Check if the {rhs} is also a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi,
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
......@@ -950,7 +952,7 @@ void Builtins::Generate_Subtract(CodeStubAssembler* assembler) {
{
// Check if the {rhs} is a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi,
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
......@@ -1045,12 +1047,13 @@ void Builtins::Generate_Multiply(CodeStubAssembler* assembler) {
Node* rhs = var_rhs.value();
Label lhs_is_smi(assembler), lhs_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(lhs), &lhs_is_smi, &lhs_is_not_smi);
assembler->Branch(assembler->TaggedIsSmi(lhs), &lhs_is_smi,
&lhs_is_not_smi);
assembler->Bind(&lhs_is_smi);
{
Label rhs_is_smi(assembler), rhs_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &rhs_is_smi,
assembler->Branch(assembler->TaggedIsSmi(rhs), &rhs_is_smi,
&rhs_is_not_smi);
assembler->Bind(&rhs_is_smi);
......@@ -1103,7 +1106,7 @@ void Builtins::Generate_Multiply(CodeStubAssembler* assembler) {
{
// Check if {rhs} is a Smi.
Label rhs_is_smi(assembler), rhs_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &rhs_is_smi,
assembler->Branch(assembler->TaggedIsSmi(rhs), &rhs_is_smi,
&rhs_is_not_smi);
assembler->Bind(&rhs_is_smi);
......@@ -1198,13 +1201,13 @@ void Builtins::Generate_Divide(CodeStubAssembler* assembler) {
Node* divisor = var_divisor.value();
Label dividend_is_smi(assembler), dividend_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(dividend), &dividend_is_smi,
assembler->Branch(assembler->TaggedIsSmi(dividend), &dividend_is_smi,
&dividend_is_not_smi);
assembler->Bind(&dividend_is_smi);
{
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......@@ -1321,7 +1324,7 @@ void Builtins::Generate_Divide(CodeStubAssembler* assembler) {
{
// Check if {divisor} is a Smi.
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......@@ -1418,14 +1421,14 @@ void Builtins::Generate_Modulus(CodeStubAssembler* assembler) {
Node* divisor = var_divisor.value();
Label dividend_is_smi(assembler), dividend_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(dividend), &dividend_is_smi,
assembler->Branch(assembler->TaggedIsSmi(dividend), &dividend_is_smi,
&dividend_is_not_smi);
assembler->Bind(&dividend_is_smi);
{
Label dividend_is_not_zero(assembler);
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......@@ -1479,7 +1482,7 @@ void Builtins::Generate_Modulus(CodeStubAssembler* assembler) {
{
// Check if {divisor} is a Smi.
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......
......@@ -28,7 +28,7 @@ void Builtins::Generate_ObjectHasOwnProperty(CodeStubAssembler* assembler) {
// Smi receivers do not have own properties.
Label if_objectisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(object), &return_false,
assembler->Branch(assembler->TaggedIsSmi(object), &return_false,
&if_objectisnotsmi);
assembler->Bind(&if_objectisnotsmi);
......@@ -224,7 +224,7 @@ void IsString(CodeStubAssembler* assembler, compiler::Node* object,
typedef CodeStubAssembler::Label Label;
Label if_notsmi(assembler);
assembler->Branch(assembler->WordIsSmi(object), if_notstring, &if_notsmi);
assembler->Branch(assembler->TaggedIsSmi(object), if_notstring, &if_notsmi);
assembler->Bind(&if_notsmi);
{
......@@ -302,7 +302,7 @@ void Builtins::Generate_ObjectProtoToString(CodeStubAssembler* assembler) {
assembler->GotoIf(assembler->Word32Equal(receiver, assembler->NullConstant()),
&return_null);
assembler->GotoIf(assembler->WordIsSmi(receiver), &return_number);
assembler->GotoIf(assembler->TaggedIsSmi(receiver), &return_number);
Node* receiver_instance_type = assembler->LoadInstanceType(receiver);
ReturnIfPrimitive(assembler, receiver_instance_type, &return_string,
......@@ -427,7 +427,7 @@ void Builtins::Generate_ObjectProtoToString(CodeStubAssembler* assembler) {
assembler->Bind(&return_jsvalue);
{
Node* value = assembler->LoadJSValueValue(receiver);
assembler->GotoIf(assembler->WordIsSmi(value), &return_number);
assembler->GotoIf(assembler->TaggedIsSmi(value), &return_number);
ReturnIfPrimitive(assembler, assembler->LoadInstanceType(value),
&return_string, &return_boolean, &return_number);
......
......@@ -379,7 +379,7 @@ void Builtins::Generate_RegExpPrototypeExec(CodeStubAssembler* a) {
var_lastindex.Bind(lastindex);
Label if_isoob(a, Label::kDeferred);
a->GotoUnless(a->WordIsSmi(lastindex), &if_isoob);
a->GotoUnless(a->TaggedIsSmi(lastindex), &if_isoob);
a->GotoUnless(a->SmiLessThanOrEqual(lastindex, string_length), &if_isoob);
a->Goto(&run_exec);
......@@ -460,7 +460,7 @@ compiler::Node* ThrowIfNotJSReceiver(CodeStubAssembler* a, Isolate* isolate,
Label out(a), throw_exception(a, Label::kDeferred);
Variable var_value_map(a, MachineRepresentation::kTagged);
a->GotoIf(a->WordIsSmi(value), &throw_exception);
a->GotoIf(a->TaggedIsSmi(value), &throw_exception);
// Load the instance type of the {value}.
var_value_map.Bind(a->LoadMap(value));
......@@ -727,7 +727,7 @@ void Generate_FlagGetter(CodeStubAssembler* a, JSRegExp::Flag flag,
Label if_isunmodifiedjsregexp(a),
if_isnotunmodifiedjsregexp(a, Label::kDeferred);
a->GotoIf(a->WordIsSmi(receiver), &if_isnotunmodifiedjsregexp);
a->GotoIf(a->TaggedIsSmi(receiver), &if_isnotunmodifiedjsregexp);
Node* const receiver_map = a->LoadMap(receiver);
Node* const instance_type = a->LoadMapInstanceType(receiver_map);
......
......@@ -37,7 +37,7 @@ void ValidateSharedTypedArray(CodeStubAssembler* a, compiler::Node* tagged,
not_float_or_clamped(a), invalid(a);
// Fail if it is not a heap object.
a->Branch(a->WordIsSmi(tagged), &is_smi, &not_smi);
a->Branch(a->TaggedIsSmi(tagged), &is_smi, &not_smi);
a->Bind(&is_smi);
a->Goto(&invalid);
......@@ -102,7 +102,7 @@ compiler::Node* ConvertTaggedAtomicIndexToWord32(CodeStubAssembler* a,
CodeStubAssembler::Label done(a, &var_result);
CodeStubAssembler::Label if_numberissmi(a), if_numberisnotsmi(a);
a->Branch(a->WordIsSmi(number_index), &if_numberissmi, &if_numberisnotsmi);
a->Branch(a->TaggedIsSmi(number_index), &if_numberissmi, &if_numberisnotsmi);
a->Bind(&if_numberissmi);
{
......
......@@ -713,7 +713,8 @@ void Builtins::Generate_StringPrototypeCharAt(CodeStubAssembler* assembler) {
Label return_emptystring(assembler, Label::kDeferred);
position = assembler->ToInteger(context, position,
CodeStubAssembler::kTruncateMinusZero);
assembler->GotoUnless(assembler->WordIsSmi(position), &return_emptystring);
assembler->GotoUnless(assembler->TaggedIsSmi(position),
&return_emptystring);
// Determine the actual length of the {receiver} String.
Node* receiver_length =
......@@ -758,7 +759,7 @@ void Builtins::Generate_StringPrototypeCharCodeAt(
Label return_nan(assembler, Label::kDeferred);
position = assembler->ToInteger(context, position,
CodeStubAssembler::kTruncateMinusZero);
assembler->GotoUnless(assembler->WordIsSmi(position), &return_nan);
assembler->GotoUnless(assembler->TaggedIsSmi(position), &return_nan);
// Determine the actual length of the {receiver} String.
Node* receiver_length =
......@@ -999,7 +1000,7 @@ void Builtins::Generate_StringPrototypeSubstr(CodeStubAssembler* a) {
a->ToInteger(context, start, CodeStubAssembler::kTruncateMinusZero);
Label if_issmi(a), if_isheapnumber(a, Label::kDeferred);
a->Branch(a->WordIsSmi(start_int), &if_issmi, &if_isheapnumber);
a->Branch(a->TaggedIsSmi(start_int), &if_issmi, &if_isheapnumber);
a->Bind(&if_issmi);
{
......@@ -1043,7 +1044,7 @@ void Builtins::Generate_StringPrototypeSubstr(CodeStubAssembler* a) {
a->ToInteger(context, length, CodeStubAssembler::kTruncateMinusZero));
}
a->Branch(a->WordIsSmi(var_length.value()), &if_issmi, &if_isheapnumber);
a->Branch(a->TaggedIsSmi(var_length.value()), &if_issmi, &if_isheapnumber);
// Set {length} to min(max({length}, 0), {string_length} - {start}
a->Bind(&if_issmi);
......@@ -1109,7 +1110,7 @@ compiler::Node* ToSmiBetweenZeroAnd(CodeStubAssembler* a,
a->ToInteger(context, value, CodeStubAssembler::kTruncateMinusZero);
Label if_issmi(a), if_isnotsmi(a, Label::kDeferred);
a->Branch(a->WordIsSmi(value_int), &if_issmi, &if_isnotsmi);
a->Branch(a->TaggedIsSmi(value_int), &if_issmi, &if_isnotsmi);
a->Bind(&if_issmi);
{
......@@ -1429,7 +1430,7 @@ void Builtins::Generate_StringIteratorPrototypeNext(
Node* iterator = assembler->Parameter(0);
Node* context = assembler->Parameter(3);
assembler->GotoIf(assembler->WordIsSmi(iterator), &throw_bad_receiver);
assembler->GotoIf(assembler->TaggedIsSmi(iterator), &throw_bad_receiver);
assembler->GotoUnless(
assembler->WordEqual(assembler->LoadInstanceType(iterator),
assembler->Int32Constant(JS_STRING_ITERATOR_TYPE)),
......
......@@ -31,7 +31,8 @@ void Generate_TypedArrayProtoypeGetter(CodeStubAssembler* assembler,
// Check if the {receiver} is actually a JSTypedArray.
Label if_receiverisincompatible(assembler, Label::kDeferred);
assembler->GotoIf(assembler->WordIsSmi(receiver), &if_receiverisincompatible);
assembler->GotoIf(assembler->TaggedIsSmi(receiver),
&if_receiverisincompatible);
Node* receiver_instance_type = assembler->LoadInstanceType(receiver);
assembler->GotoUnless(
assembler->Word32Equal(receiver_instance_type,
......
......@@ -291,38 +291,47 @@ Node* CodeStubAssembler::SmiToFloat64(Node* value) {
return ChangeInt32ToFloat64(SmiToWord32(value));
}
Node* CodeStubAssembler::SmiAdd(Node* a, Node* b) { return IntPtrAdd(a, b); }
Node* CodeStubAssembler::SmiAdd(Node* a, Node* b) {
return BitcastWordToTaggedSigned(
IntPtrAdd(BitcastTaggedToWord(a), BitcastTaggedToWord(b)));
}
Node* CodeStubAssembler::SmiAddWithOverflow(Node* a, Node* b) {
return IntPtrAddWithOverflow(a, b);
return IntPtrAddWithOverflow(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiSub(Node* a, Node* b) { return IntPtrSub(a, b); }
Node* CodeStubAssembler::SmiSub(Node* a, Node* b) {
return BitcastWordToTaggedSigned(
IntPtrSub(BitcastTaggedToWord(a), BitcastTaggedToWord(b)));
}
Node* CodeStubAssembler::SmiSubWithOverflow(Node* a, Node* b) {
return IntPtrSubWithOverflow(a, b);
return IntPtrSubWithOverflow(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiEqual(Node* a, Node* b) { return WordEqual(a, b); }
Node* CodeStubAssembler::SmiEqual(Node* a, Node* b) {
return WordEqual(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiAbove(Node* a, Node* b) {
return UintPtrGreaterThan(a, b);
return UintPtrGreaterThan(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiAboveOrEqual(Node* a, Node* b) {
return UintPtrGreaterThanOrEqual(a, b);
return UintPtrGreaterThanOrEqual(BitcastTaggedToWord(a),
BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiBelow(Node* a, Node* b) {
return UintPtrLessThan(a, b);
return UintPtrLessThan(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiLessThan(Node* a, Node* b) {
return IntPtrLessThan(a, b);
return IntPtrLessThan(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiLessThanOrEqual(Node* a, Node* b) {
return IntPtrLessThanOrEqual(a, b);
return IntPtrLessThanOrEqual(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
Node* CodeStubAssembler::SmiMax(Node* a, Node* b) {
......@@ -457,8 +466,9 @@ Node* CodeStubAssembler::SmiMul(Node* a, Node* b) {
return var_result.value();
}
Node* CodeStubAssembler::WordIsSmi(Node* a) {
return WordEqual(WordAnd(a, IntPtrConstant(kSmiTagMask)), IntPtrConstant(0));
Node* CodeStubAssembler::TaggedIsSmi(Node* a) {
return WordEqual(WordAnd(BitcastTaggedToWord(a), IntPtrConstant(kSmiTagMask)),
IntPtrConstant(0));
}
Node* CodeStubAssembler::WordIsPositiveSmi(Node* a) {
......@@ -569,7 +579,7 @@ void CodeStubAssembler::BranchIfPrototypesHaveNoElements(
void CodeStubAssembler::BranchIfFastJSArray(Node* object, Node* context,
Label* if_true, Label* if_false) {
// Bailout if receiver is a Smi.
GotoIf(WordIsSmi(object), if_false);
GotoIf(TaggedIsSmi(object), if_false);
Node* map = LoadMap(object);
......@@ -736,7 +746,7 @@ void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true,
GotoIf(WordEqual(value, BooleanConstant(false)), if_false);
// Check if {value} is a Smi or a HeapObject.
Branch(WordIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Bind(&if_valueissmi);
{
......@@ -978,7 +988,7 @@ Node* CodeStubAssembler::LoadMapConstructor(Node* map) {
Goto(&loop);
Bind(&loop);
{
GotoIf(WordIsSmi(result.value()), &done);
GotoIf(TaggedIsSmi(result.value()), &done);
Node* is_map_type =
Word32Equal(LoadInstanceType(result.value()), Int32Constant(MAP_TYPE));
GotoUnless(is_map_type, &done);
......@@ -1418,7 +1428,8 @@ CodeStubAssembler::AllocateUninitializedJSArrayWithElements(
Node* array = AllocateUninitializedJSArray(kind, array_map, length,
allocation_site, size);
Node* elements = InnerAllocate(array, elements_offset);
// The bitcast here is safe because InnerAllocate doesn't actually allocate.
Node* elements = InnerAllocate(BitcastTaggedToWord(array), elements_offset);
StoreObjectField(array, JSObject::kElementsOffset, elements);
return {array, elements};
......@@ -1464,8 +1475,10 @@ Node* CodeStubAssembler::AllocateJSArray(ElementsKind kind, Node* array_map,
TagParameter(capacity, capacity_mode));
// Fill in the elements with holes.
FillFixedArrayWithValue(kind, elements, IntPtrConstant(0), capacity,
Heap::kTheHoleValueRootIndex, capacity_mode);
FillFixedArrayWithValue(
kind, elements, capacity_mode == SMI_PARAMETERS ? SmiConstant(Smi::kZero)
: IntPtrConstant(0),
capacity, Heap::kTheHoleValueRootIndex, capacity_mode);
return array;
}
......@@ -1633,8 +1646,8 @@ void CodeStubAssembler::CopyFixedArrayElements(
StoreNoWriteBarrier(MachineRepresentation::kFloat64, to_array, to_offset,
value);
} else {
StoreNoWriteBarrier(MachineType::PointerRepresentation(), to_array,
to_offset, value);
StoreNoWriteBarrier(MachineRepresentation::kTagged, to_array, to_offset,
value);
}
Goto(&next_iter);
......@@ -1753,7 +1766,7 @@ Node* CodeStubAssembler::LoadElementAndPrepareForStore(Node* array,
return value;
} else {
Node* value = Load(MachineType::Pointer(), array, offset);
Node* value = Load(MachineType::AnyTagged(), array, offset);
if (if_hole) {
GotoIf(WordEqual(value, TheHoleConstant()), if_hole);
}
......@@ -1857,7 +1870,7 @@ void CodeStubAssembler::InitializeAllocationMemento(
if (FLAG_allocation_site_pretenuring) {
Node* count = LoadObjectField(allocation_site,
AllocationSite::kPretenureCreateCountOffset);
Node* incremented_count = IntPtrAdd(count, SmiConstant(Smi::FromInt(1)));
Node* incremented_count = SmiAdd(count, SmiConstant(Smi::FromInt(1)));
StoreObjectFieldNoWriteBarrier(allocation_site,
AllocationSite::kPretenureCreateCountOffset,
incremented_count);
......@@ -1878,7 +1891,7 @@ Node* CodeStubAssembler::TruncateTaggedToFloat64(Node* context, Node* value) {
// Check if the {value} is a Smi or a HeapObject.
Label if_valueissmi(this), if_valueisnotsmi(this);
Branch(WordIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Bind(&if_valueissmi);
{
......@@ -1929,7 +1942,7 @@ Node* CodeStubAssembler::TruncateTaggedToWord32(Node* context, Node* value) {
// Check if the {value} is a Smi or a HeapObject.
Label if_valueissmi(this), if_valueisnotsmi(this);
Branch(WordIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Bind(&if_valueissmi);
{
......@@ -2091,7 +2104,7 @@ Node* CodeStubAssembler::ToThisString(Node* context, Node* value,
// Check if the {value} is a Smi or a HeapObject.
Label if_valueissmi(this, Label::kDeferred), if_valueisnotsmi(this),
if_valueisstring(this);
Branch(WordIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Bind(&if_valueisnotsmi);
{
// Load the instance type of the {value}.
......@@ -2159,9 +2172,9 @@ Node* CodeStubAssembler::ToThisValue(Node* context, Node* value,
value = var_value.value();
// Check if the {value} is a Smi or a HeapObject.
GotoIf(WordIsSmi(value), (primitive_type == PrimitiveType::kNumber)
? &done_loop
: &done_throw);
GotoIf(TaggedIsSmi(value), (primitive_type == PrimitiveType::kNumber)
? &done_loop
: &done_throw);
// Load the mape of the {value}.
Node* value_map = LoadMap(value);
......@@ -2223,7 +2236,7 @@ Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value,
Label out(this), throw_exception(this, Label::kDeferred);
Variable var_value_map(this, MachineRepresentation::kTagged);
GotoIf(WordIsSmi(value), &throw_exception);
GotoIf(TaggedIsSmi(value), &throw_exception);
// Load the instance type of the {value}.
var_value_map.Bind(LoadMap(value));
......@@ -2554,7 +2567,7 @@ Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from,
// Make sure first argument is a string.
// Bailout if receiver is a Smi.
GotoIf(WordIsSmi(string), &runtime);
GotoIf(TaggedIsSmi(string), &runtime);
// Load the instance type of the {string}.
Node* const instance_type = LoadInstanceType(string);
......@@ -2852,7 +2865,7 @@ Node* CodeStubAssembler::NumberToString(compiler::Node* context,
Node* one = IntPtrConstant(1);
mask = IntPtrSub(mask, one);
GotoIf(WordIsSmi(argument), &smi);
GotoIf(TaggedIsSmi(argument), &smi);
// Argument isn't smi, check to see if it's a heap-number.
Node* map = LoadMap(argument);
......@@ -2871,7 +2884,7 @@ Node* CodeStubAssembler::NumberToString(compiler::Node* context,
// Cache entry's key must be a heap number
Node* number_key =
LoadFixedArrayElement(number_string_cache, index, 0, INTPTR_PARAMETERS);
GotoIf(WordIsSmi(number_key), &runtime);
GotoIf(TaggedIsSmi(number_key), &runtime);
map = LoadMap(number_key);
GotoUnless(WordEqual(map, HeapNumberMapConstant()), &runtime);
......@@ -2923,7 +2936,7 @@ Node* CodeStubAssembler::ToName(Node* context, Node* value) {
Variable var_result(this, MachineRepresentation::kTagged);
Label is_number(this);
GotoIf(WordIsSmi(value), &is_number);
GotoIf(TaggedIsSmi(value), &is_number);
Label not_name(this);
Node* value_instance_type = LoadInstanceType(value);
......@@ -2966,7 +2979,7 @@ Node* CodeStubAssembler::ToName(Node* context, Node* value) {
Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) {
// Assert input is a HeapObject (not smi or heap number)
Assert(Word32BinaryNot(WordIsSmi(input)));
Assert(Word32BinaryNot(TaggedIsSmi(input)));
Assert(Word32NotEqual(LoadMap(input), HeapNumberMapConstant()));
// We might need to loop once here due to ToPrimitive conversions.
......@@ -3016,7 +3029,7 @@ Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) {
// Check if the {result} is already a Number.
Label if_resultisnumber(this), if_resultisnotnumber(this);
GotoIf(WordIsSmi(result), &if_resultisnumber);
GotoIf(TaggedIsSmi(result), &if_resultisnumber);
Node* result_map = LoadMap(result);
Branch(WordEqual(result_map, HeapNumberMapConstant()), &if_resultisnumber,
&if_resultisnotnumber);
......@@ -3058,7 +3071,7 @@ Node* CodeStubAssembler::ToNumber(Node* context, Node* input) {
Label end(this);
Label not_smi(this, Label::kDeferred);
GotoUnless(WordIsSmi(input), &not_smi);
GotoUnless(TaggedIsSmi(input), &not_smi);
var_result.Bind(input);
Goto(&end);
......@@ -3099,7 +3112,7 @@ Node* CodeStubAssembler::ToInteger(Node* context, Node* input,
Node* arg = var_arg.value();
// Check if {arg} is a Smi.
GotoIf(WordIsSmi(arg), &out);
GotoIf(TaggedIsSmi(arg), &out);
// Check if {arg} is a HeapNumber.
Label if_argisheapnumber(this),
......@@ -3362,7 +3375,7 @@ void CodeStubAssembler::NumberDictionaryLookup(Node* dictionary,
Label next_probe(this);
{
Label if_currentissmi(this), if_currentisnotsmi(this);
Branch(WordIsSmi(current), &if_currentissmi, &if_currentisnotsmi);
Branch(TaggedIsSmi(current), &if_currentissmi, &if_currentisnotsmi);
Bind(&if_currentissmi);
{
Node* current_value = SmiUntag(current);
......@@ -3879,7 +3892,7 @@ void CodeStubAssembler::TryPrototypeChainLookup(
Label* if_bailout) {
// Ensure receiver is JSReceiver, otherwise bailout.
Label if_objectisnotsmi(this);
Branch(WordIsSmi(receiver), if_bailout, &if_objectisnotsmi);
Branch(TaggedIsSmi(receiver), if_bailout, &if_objectisnotsmi);
Bind(&if_objectisnotsmi);
Node* map = LoadMap(receiver);
......@@ -3989,7 +4002,7 @@ Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
return_runtime(this, Label::kDeferred), return_result(this);
// Goto runtime if {object} is a Smi.
GotoIf(WordIsSmi(object), &return_runtime);
GotoIf(TaggedIsSmi(object), &return_runtime);
// Load map of {object}.
Node* object_map = LoadMap(object);
......@@ -4012,7 +4025,7 @@ Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
}
// Goto runtime if {callable} is a Smi.
GotoIf(WordIsSmi(callable), &return_runtime);
GotoIf(TaggedIsSmi(callable), &return_runtime);
// Load map of {callable}.
Node* callable_map = LoadMap(callable);
......@@ -4131,6 +4144,7 @@ compiler::Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
element_size_shift -= kSmiShiftBits;
constant_index = ToIntPtrConstant(index_node, index);
index = index >> kSmiShiftBits;
index_node = BitcastTaggedToWord(index_node);
} else if (mode == INTEGER_PARAMETERS) {
int32_t temp = 0;
constant_index = ToInt32Constant(index_node, temp);
......@@ -4185,7 +4199,7 @@ compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) {
Label load_smi_map(this /*, Label::kDeferred*/), load_receiver_map(this),
if_result(this);
Branch(WordIsSmi(receiver), &load_smi_map, &load_receiver_map);
Branch(TaggedIsSmi(receiver), &load_smi_map, &load_receiver_map);
Bind(&load_smi_map);
{
var_receiver_map.Bind(LoadRoot(Heap::kHeapNumberMapRootIndex));
......@@ -4367,7 +4381,7 @@ void CodeStubAssembler::TryProbeStubCache(
IncrementCounter(counters->megamorphic_stub_cache_probes(), 1);
// Check that the {receiver} isn't a smi.
GotoIf(WordIsSmi(receiver), &miss);
GotoIf(TaggedIsSmi(receiver), &miss);
Node* receiver_map = LoadMap(receiver);
......@@ -4394,7 +4408,7 @@ void CodeStubAssembler::TryProbeStubCache(
Node* CodeStubAssembler::TryToIntptr(Node* key, Label* miss) {
Variable var_intptr_key(this, MachineType::PointerRepresentation());
Label done(this, &var_intptr_key), key_is_smi(this);
GotoIf(WordIsSmi(key), &key_is_smi);
GotoIf(TaggedIsSmi(key), &key_is_smi);
// Try to convert a heap number to a Smi.
GotoUnless(WordEqual(LoadMap(key), HeapNumberMapConstant()), miss);
{
......@@ -4641,7 +4655,7 @@ void CodeStubAssembler::HandleLoadICHandlerCase(
ElementSupport support_elements) {
Comment("have_handler");
Label call_handler(this);
GotoUnless(WordIsSmi(handler), &call_handler);
GotoUnless(TaggedIsSmi(handler), &call_handler);
// |handler| is a Smi, encoding what to do. See handler-configuration.h
// for the encoding format.
......@@ -4866,7 +4880,7 @@ void CodeStubAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
if_property_dictionary(this), if_found_on_receiver(this);
Node* receiver = p->receiver;
GotoIf(WordIsSmi(receiver), &slow);
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
Node* instance_type = LoadMapInstanceType(receiver_map);
// Receivers requiring non-standard element accesses (interceptors, access
......@@ -5137,7 +5151,7 @@ Node* CodeStubAssembler::PrepareValueForWrite(Node* value,
if (representation.IsDouble()) {
Variable var_value(this, MachineRepresentation::kFloat64);
Label if_smi(this), if_heap_object(this), done(this);
Branch(WordIsSmi(value), &if_smi, &if_heap_object);
Branch(TaggedIsSmi(value), &if_smi, &if_heap_object);
Bind(&if_smi);
{
var_value.Bind(SmiToFloat64(value));
......@@ -5156,9 +5170,9 @@ Node* CodeStubAssembler::PrepareValueForWrite(Node* value,
} else if (representation.IsHeapObject()) {
// Field type is checked by the handler, here we only check if the value
// is a heap object.
GotoIf(WordIsSmi(value), bailout);
GotoIf(TaggedIsSmi(value), bailout);
} else if (representation.IsSmi()) {
GotoUnless(WordIsSmi(value), bailout);
GotoUnless(TaggedIsSmi(value), bailout);
} else {
DCHECK(representation.IsTagged());
}
......@@ -5240,7 +5254,7 @@ Node* CodeStubAssembler::EmitKeyedSloppyArguments(Node* receiver, Node* key,
bool is_load = value == nullptr;
GotoUnless(WordIsSmi(key), bailout);
GotoUnless(TaggedIsSmi(key), bailout);
key = SmiUntag(key);
GotoIf(IntPtrLessThan(key, IntPtrConstant(0)), bailout);
......@@ -5263,7 +5277,7 @@ Node* CodeStubAssembler::EmitKeyedSloppyArguments(Node* receiver, Node* key,
Bind(&if_mapped);
{
Assert(WordIsSmi(mapped_index));
Assert(TaggedIsSmi(mapped_index));
mapped_index = SmiUntag(mapped_index);
Node* the_context = LoadFixedArrayElement(elements, IntPtrConstant(0), 0,
INTPTR_PARAMETERS);
......@@ -5472,7 +5486,7 @@ void CodeStubAssembler::EmitElementStore(Node* object, Node* key, Node* value,
// a smi before manipulating the backing store. Otherwise the backing store
// may be left in an invalid state.
if (IsFastSmiElementsKind(elements_kind)) {
GotoUnless(WordIsSmi(value), bailout);
GotoUnless(TaggedIsSmi(value), bailout);
} else if (IsFastDoubleElementsKind(elements_kind)) {
value = PrepareValueForWrite(value, Representation::Double(), bailout);
}
......@@ -5914,13 +5928,13 @@ compiler::Node* CodeStubAssembler::RelationalComparison(
// Check if the {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(this), if_lhsisnotsmi(this);
Branch(WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
Branch(TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
Bind(&if_lhsissmi);
{
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
{
......@@ -5982,7 +5996,7 @@ compiler::Node* CodeStubAssembler::RelationalComparison(
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
{
......@@ -6223,7 +6237,7 @@ void GenerateEqual_Same(CodeStubAssembler* assembler, compiler::Node* value,
// Check if {value} is a Smi or a HeapObject.
Label if_valueissmi(assembler), if_valueisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(value), &if_valueissmi,
assembler->Branch(assembler->TaggedIsSmi(value), &if_valueissmi,
&if_valueisnotsmi);
assembler->Bind(&if_valueisnotsmi);
......@@ -6312,13 +6326,13 @@ compiler::Node* CodeStubAssembler::Equal(ResultMode mode, compiler::Node* lhs,
{
// Check if {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(this), if_lhsisnotsmi(this);
Branch(WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
Branch(TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
Bind(&if_lhsissmi);
{
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
// We have already checked for {lhs} and {rhs} being the same value, so
......@@ -6408,7 +6422,7 @@ compiler::Node* CodeStubAssembler::Equal(ResultMode mode, compiler::Node* lhs,
{
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
{
......@@ -6839,7 +6853,7 @@ compiler::Node* CodeStubAssembler::StrictEqual(ResultMode mode,
// Check if {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(this), if_lhsisnotsmi(this);
Branch(WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
Branch(TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
Bind(&if_lhsisnotsmi);
{
......@@ -6855,7 +6869,7 @@ compiler::Node* CodeStubAssembler::StrictEqual(ResultMode mode,
{
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
{
......@@ -6896,7 +6910,7 @@ compiler::Node* CodeStubAssembler::StrictEqual(ResultMode mode,
{
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
Goto(&if_notequal);
......@@ -6968,7 +6982,7 @@ compiler::Node* CodeStubAssembler::StrictEqual(ResultMode mode,
// Check if {rhs} is a Smi or a HeapObject.
Label if_rhsissmi(this), if_rhsisnotsmi(this);
Branch(WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Branch(TaggedIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
Bind(&if_rhsissmi);
Goto(&if_notequal);
......@@ -7107,7 +7121,7 @@ compiler::Node* CodeStubAssembler::Typeof(compiler::Node* value,
return_function(this), return_undefined(this), return_object(this),
return_string(this), return_result(this);
GotoIf(WordIsSmi(value), &return_number);
GotoIf(TaggedIsSmi(value), &return_number);
Node* map = LoadMap(value);
......@@ -7207,7 +7221,7 @@ compiler::Node* CodeStubAssembler::InstanceOf(compiler::Node* object,
&return_runtime);
// Check if {callable} is a valid receiver.
GotoIf(WordIsSmi(callable), &return_runtime);
GotoIf(TaggedIsSmi(callable), &return_runtime);
GotoIf(Word32Equal(Word32And(LoadMapBitField(LoadMap(callable)),
Int32Constant(1 << Map::kIsCallable)),
Int32Constant(0)),
......
......@@ -150,7 +150,7 @@ class CodeStubAssembler : public compiler::CodeAssembler {
void Assert(compiler::Node* condition);
// Check a value for smi-ness
compiler::Node* WordIsSmi(compiler::Node* a);
compiler::Node* TaggedIsSmi(compiler::Node* a);
// Check that the value is a non-negative smi.
compiler::Node* WordIsPositiveSmi(compiler::Node* a);
......
......@@ -680,13 +680,14 @@ compiler::Node* AddWithFeedbackStub::Generate(
// Check if the {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(assembler), if_lhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
assembler->Bind(&if_lhsissmi);
{
// Check if the {rhs} is also a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
{
......@@ -742,7 +743,8 @@ compiler::Node* AddWithFeedbackStub::Generate(
// Check if the {rhs} is Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
{
......@@ -768,7 +770,7 @@ compiler::Node* AddWithFeedbackStub::Generate(
assembler->Bind(&check_string);
{
// Check if the {rhs} is a smi, and exit the string check early if it is.
assembler->GotoIf(assembler->WordIsSmi(rhs), &call_add_stub);
assembler->GotoIf(assembler->TaggedIsSmi(rhs), &call_add_stub);
Node* lhs_instance_type = assembler->LoadMapInstanceType(lhs_map);
......@@ -838,13 +840,14 @@ compiler::Node* SubtractWithFeedbackStub::Generate(
// Check if the {lhs} is a Smi or a HeapObject.
Label if_lhsissmi(assembler), if_lhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(lhs), &if_lhsissmi, &if_lhsisnotsmi);
assembler->Bind(&if_lhsissmi);
{
// Check if the {rhs} is also a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
{
......@@ -900,7 +903,8 @@ compiler::Node* SubtractWithFeedbackStub::Generate(
// Check if the {rhs} is a Smi.
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
{
......@@ -947,7 +951,8 @@ compiler::Node* SubtractWithFeedbackStub::Generate(
assembler->GotoUnless(lhs_is_oddball, &call_with_any_feedback);
Label if_rhsissmi(assembler), if_rhsisnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &if_rhsissmi, &if_rhsisnotsmi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &if_rhsissmi,
&if_rhsisnotsmi);
assembler->Bind(&if_rhsissmi);
{
......@@ -1026,12 +1031,13 @@ compiler::Node* MultiplyWithFeedbackStub::Generate(
Node* number_map = assembler->HeapNumberMapConstant();
Label lhs_is_smi(assembler), lhs_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(lhs), &lhs_is_smi, &lhs_is_not_smi);
assembler->Branch(assembler->TaggedIsSmi(lhs), &lhs_is_smi, &lhs_is_not_smi);
assembler->Bind(&lhs_is_smi);
{
Label rhs_is_smi(assembler), rhs_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &rhs_is_smi, &rhs_is_not_smi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &rhs_is_smi,
&rhs_is_not_smi);
assembler->Bind(&rhs_is_smi);
{
......@@ -1039,7 +1045,7 @@ compiler::Node* MultiplyWithFeedbackStub::Generate(
// in case of overflow.
var_result.Bind(assembler->SmiMul(lhs, rhs));
var_type_feedback.Bind(assembler->Select(
assembler->WordIsSmi(var_result.value()),
assembler->TaggedIsSmi(var_result.value()),
assembler->Int32Constant(BinaryOperationFeedback::kSignedSmall),
assembler->Int32Constant(BinaryOperationFeedback::kNumber),
MachineRepresentation::kWord32));
......@@ -1071,7 +1077,8 @@ compiler::Node* MultiplyWithFeedbackStub::Generate(
// Check if {rhs} is a Smi.
Label rhs_is_smi(assembler), rhs_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(rhs), &rhs_is_smi, &rhs_is_not_smi);
assembler->Branch(assembler->TaggedIsSmi(rhs), &rhs_is_smi,
&rhs_is_not_smi);
assembler->Bind(&rhs_is_smi);
{
......@@ -1143,13 +1150,13 @@ compiler::Node* DivideWithFeedbackStub::Generate(
Node* number_map = assembler->HeapNumberMapConstant();
Label dividend_is_smi(assembler), dividend_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(dividend), &dividend_is_smi,
assembler->Branch(assembler->TaggedIsSmi(dividend), &dividend_is_smi,
&dividend_is_not_smi);
assembler->Bind(&dividend_is_smi);
{
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......@@ -1246,7 +1253,7 @@ compiler::Node* DivideWithFeedbackStub::Generate(
// Check if {divisor} is a Smi.
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......@@ -1319,20 +1326,20 @@ compiler::Node* ModulusWithFeedbackStub::Generate(
Node* number_map = assembler->HeapNumberMapConstant();
Label dividend_is_smi(assembler), dividend_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(dividend), &dividend_is_smi,
assembler->Branch(assembler->TaggedIsSmi(dividend), &dividend_is_smi,
&dividend_is_not_smi);
assembler->Bind(&dividend_is_smi);
{
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
{
var_result.Bind(assembler->SmiMod(dividend, divisor));
var_type_feedback.Bind(assembler->Select(
assembler->WordIsSmi(var_result.value()),
assembler->TaggedIsSmi(var_result.value()),
assembler->Int32Constant(BinaryOperationFeedback::kSignedSmall),
assembler->Int32Constant(BinaryOperationFeedback::kNumber)));
assembler->Goto(&end);
......@@ -1364,7 +1371,7 @@ compiler::Node* ModulusWithFeedbackStub::Generate(
// Check if {divisor} is a Smi.
Label divisor_is_smi(assembler), divisor_is_not_smi(assembler);
assembler->Branch(assembler->WordIsSmi(divisor), &divisor_is_smi,
assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi,
&divisor_is_not_smi);
assembler->Bind(&divisor_is_smi);
......@@ -1446,7 +1453,7 @@ compiler::Node* IncStub::Generate(CodeStubAssembler* assembler,
value = value_var.value();
Label if_issmi(assembler), if_isnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(value), &if_issmi, &if_isnotsmi);
assembler->Branch(assembler->TaggedIsSmi(value), &if_issmi, &if_isnotsmi);
assembler->Bind(&if_issmi);
{
......@@ -1556,7 +1563,7 @@ compiler::Node* DecStub::Generate(CodeStubAssembler* assembler,
value = value_var.value();
Label if_issmi(assembler), if_isnotsmi(assembler);
assembler->Branch(assembler->WordIsSmi(value), &if_issmi, &if_isnotsmi);
assembler->Branch(assembler->TaggedIsSmi(value), &if_issmi, &if_isnotsmi);
assembler->Bind(&if_issmi);
{
......@@ -1728,7 +1735,7 @@ void StoreGlobalStub::GenerateAssembly(CodeStubAssembler* assembler) const {
Node* weak_cell = assembler->HeapConstant(isolate()->factory()->NewWeakCell(
StoreGlobalStub::property_cell_placeholder(isolate())));
Node* cell = assembler->LoadWeakCellValue(weak_cell);
assembler->GotoIf(assembler->WordIsSmi(cell), &miss);
assembler->GotoIf(assembler->TaggedIsSmi(cell), &miss);
// Load the payload of the global parameter cell. A hole indicates that the
// cell has been invalidated and that the store must be handled by the
......@@ -1750,7 +1757,7 @@ void StoreGlobalStub::GenerateAssembly(CodeStubAssembler* assembler) const {
if (cell_type == PropertyCellType::kConstantType) {
switch (constant_type()) {
case PropertyCellConstantType::kSmi:
assembler->GotoUnless(assembler->WordIsSmi(value), &miss);
assembler->GotoUnless(assembler->TaggedIsSmi(value), &miss);
value_is_smi = true;
break;
case PropertyCellConstantType::kStableMap: {
......@@ -1759,8 +1766,8 @@ void StoreGlobalStub::GenerateAssembly(CodeStubAssembler* assembler) const {
// are the maps that were originally in the cell or not. If optimized
// code will deopt when a cell has a unstable map and if it has a
// dependency on a stable map, it will deopt if the map destabilizes.
assembler->GotoIf(assembler->WordIsSmi(value), &miss);
assembler->GotoIf(assembler->WordIsSmi(cell_contents), &miss);
assembler->GotoIf(assembler->TaggedIsSmi(value), &miss);
assembler->GotoIf(assembler->TaggedIsSmi(cell_contents), &miss);
Node* expected_map = assembler->LoadMap(cell_contents);
Node* map = assembler->LoadMap(value);
assembler->GotoIf(assembler->WordNotEqual(expected_map, map), &miss);
......@@ -2903,7 +2910,7 @@ void SingleArgumentConstructorCommon(CodeStubAssembler* assembler,
Label call_runtime(assembler, Label::kDeferred);
Node* size = assembler->Parameter(Descriptor::kArraySizeSmiParameter);
assembler->Branch(assembler->WordIsSmi(size), &smi_size, &call_runtime);
assembler->Branch(assembler->TaggedIsSmi(size), &smi_size, &call_runtime);
assembler->Bind(&smi_size);
......
......@@ -585,7 +585,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
{
// The compare above could have been a SMI/SMI comparison. Guard against
// this convincing us that we have a monomorphic JSFunction.
Node* is_smi = WordIsSmi(function);
Node* is_smi = TaggedIsSmi(function);
GotoIf(is_smi, &extra_checks);
// Increment the call count.
......@@ -649,7 +649,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
HeapConstant(TypeFeedbackVector::UninitializedSentinel(isolate())));
GotoUnless(is_uninitialized, &mark_megamorphic);
Node* is_smi = WordIsSmi(function);
Node* is_smi = TaggedIsSmi(function);
GotoIf(is_smi, &mark_megamorphic);
// Check if function is an object of JSFunction type
......@@ -774,7 +774,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
GotoIf(is_feedback_unavailable, &call_construct);
// Check that the constructor is not a smi.
Node* is_smi = WordIsSmi(constructor);
Node* is_smi = TaggedIsSmi(constructor);
GotoIf(is_smi, &call_construct);
// Check that constructor is a JSFunction.
......@@ -818,7 +818,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
// If the weak cell is cleared, we have a new chance to become
// monomorphic.
Comment("check if weak cell is cleared");
Node* is_smi = WordIsSmi(feedback_value);
Node* is_smi = TaggedIsSmi(feedback_value);
BranchIf(is_smi, &initialize, &mark_megamorphic);
}
......@@ -1161,7 +1161,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
// Check if the {value} is a Smi or a HeapObject.
Label if_valueissmi(this), if_valueisnotsmi(this);
Branch(WordIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Bind(&if_valueissmi);
{
......
......@@ -125,7 +125,7 @@ Node* IntrinsicsHelper::IsInstanceType(Node* input, int type) {
InterpreterAssembler::Label if_not_smi(assembler_), return_true(assembler_),
return_false(assembler_), end(assembler_);
Node* arg = __ LoadRegister(input);
__ GotoIf(__ WordIsSmi(arg), &return_false);
__ GotoIf(__ TaggedIsSmi(arg), &return_false);
Node* condition = CompareInstanceType(arg, type, kInstanceTypeEqual);
__ Branch(condition, &return_true, &return_false);
......@@ -154,7 +154,7 @@ Node* IntrinsicsHelper::IsJSReceiver(Node* input, Node* arg_count,
end(assembler_);
Node* arg = __ LoadRegister(input);
__ GotoIf(__ WordIsSmi(arg), &return_false);
__ GotoIf(__ TaggedIsSmi(arg), &return_false);
STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE);
Node* condition = CompareInstanceType(arg, FIRST_JS_RECEIVER_TYPE,
......@@ -202,7 +202,7 @@ Node* IntrinsicsHelper::IsSmi(Node* input, Node* arg_count, Node* context) {
Node* arg = __ LoadRegister(input);
__ Branch(__ WordIsSmi(arg), &if_smi, &if_not_smi);
__ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi);
__ Bind(&if_smi);
{
return_value.Bind(__ BooleanConstant(true));
......@@ -321,7 +321,7 @@ Node* IntrinsicsHelper::ValueOf(Node* args_reg, Node* arg_count,
return_value.Bind(object);
// If the object is a smi return the object.
__ GotoIf(__ WordIsSmi(object), &done);
__ GotoIf(__ TaggedIsSmi(object), &done);
// If the object is not a value type, return the object.
Node* condition =
......@@ -346,7 +346,7 @@ Node* IntrinsicsHelper::ClassOf(Node* args_reg, Node* arg_count,
Node* object = __ LoadRegister(args_reg);
// If the object is not a JSReceiver, we return null.
__ GotoIf(__ WordIsSmi(object), &null);
__ GotoIf(__ TaggedIsSmi(object), &null);
STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
Node* is_js_receiver = CompareInstanceType(object, FIRST_JS_RECEIVER_TYPE,
kInstanceTypeGreaterThanOrEqual);
......
......@@ -960,7 +960,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
Variable var_type_feedback(assembler, MachineRepresentation::kWord32);
Label lhs_is_smi(assembler), lhs_is_not_smi(assembler),
gather_rhs_type(assembler), do_compare(assembler);
__ Branch(__ WordIsSmi(lhs), &lhs_is_smi, &lhs_is_not_smi);
__ Branch(__ TaggedIsSmi(lhs), &lhs_is_smi, &lhs_is_not_smi);
__ Bind(&lhs_is_smi);
var_type_feedback.Bind(
......@@ -986,7 +986,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&gather_rhs_type);
{
Label rhs_is_smi(assembler);
__ GotoIf(__ WordIsSmi(rhs), &rhs_is_smi);
__ GotoIf(__ TaggedIsSmi(rhs), &rhs_is_smi);
Node* rhs_map = __ LoadMap(rhs);
Node* rhs_type =
......@@ -1131,13 +1131,13 @@ void Interpreter::DoBitwiseBinaryOp(Token::Value bitwise_op,
}
Node* result_type =
__ Select(__ WordIsSmi(result),
__ Select(__ TaggedIsSmi(result),
__ Int32Constant(BinaryOperationFeedback::kSignedSmall),
__ Int32Constant(BinaryOperationFeedback::kNumber));
if (FLAG_debug_code) {
Label ok(assembler);
__ GotoIf(__ WordIsSmi(result), &ok);
__ GotoIf(__ TaggedIsSmi(result), &ok);
Node* result_map = __ LoadMap(result);
__ AbortIfWordNotEqual(result_map, __ HeapNumberMapConstant(),
kExpectedHeapNumber);
......@@ -1222,7 +1222,7 @@ void Interpreter::DoAddSmi(InterpreterAssembler* assembler) {
// {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path.
__ BranchIf(__ WordIsSmi(left), &fastpath, &slowpath);
__ BranchIf(__ TaggedIsSmi(left), &fastpath, &slowpath);
__ Bind(&fastpath);
{
// Try fast Smi addition first.
......@@ -1275,7 +1275,7 @@ void Interpreter::DoSubSmi(InterpreterAssembler* assembler) {
// {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path.
__ BranchIf(__ WordIsSmi(left), &fastpath, &slowpath);
__ BranchIf(__ TaggedIsSmi(left), &fastpath, &slowpath);
__ Bind(&fastpath);
{
// Try fast Smi subtraction first.
......@@ -1329,7 +1329,7 @@ void Interpreter::DoBitwiseOrSmi(InterpreterAssembler* assembler) {
Node* value = __ Word32Or(lhs_value, rhs_value);
Node* result = __ ChangeInt32ToTagged(value);
Node* result_type =
__ Select(__ WordIsSmi(result),
__ Select(__ TaggedIsSmi(result),
__ Int32Constant(BinaryOperationFeedback::kSignedSmall),
__ Int32Constant(BinaryOperationFeedback::kNumber));
__ UpdateFeedback(__ Word32Or(result_type, var_lhs_type_feedback.value()),
......@@ -1357,7 +1357,7 @@ void Interpreter::DoBitwiseAndSmi(InterpreterAssembler* assembler) {
Node* value = __ Word32And(lhs_value, rhs_value);
Node* result = __ ChangeInt32ToTagged(value);
Node* result_type =
__ Select(__ WordIsSmi(result),
__ Select(__ TaggedIsSmi(result),
__ Int32Constant(BinaryOperationFeedback::kSignedSmall),
__ Int32Constant(BinaryOperationFeedback::kNumber));
__ UpdateFeedback(__ Word32Or(result_type, var_lhs_type_feedback.value()),
......@@ -1387,7 +1387,7 @@ void Interpreter::DoShiftLeftSmi(InterpreterAssembler* assembler) {
Node* value = __ Word32Shl(lhs_value, shift_count);
Node* result = __ ChangeInt32ToTagged(value);
Node* result_type =
__ Select(__ WordIsSmi(result),
__ Select(__ TaggedIsSmi(result),
__ Int32Constant(BinaryOperationFeedback::kSignedSmall),
__ Int32Constant(BinaryOperationFeedback::kNumber));
__ UpdateFeedback(__ Word32Or(result_type, var_lhs_type_feedback.value()),
......@@ -1417,7 +1417,7 @@ void Interpreter::DoShiftRightSmi(InterpreterAssembler* assembler) {
Node* value = __ Word32Sar(lhs_value, shift_count);
Node* result = __ ChangeInt32ToTagged(value);
Node* result_type =
__ Select(__ WordIsSmi(result),
__ Select(__ TaggedIsSmi(result),
__ Int32Constant(BinaryOperationFeedback::kSignedSmall),
__ Int32Constant(BinaryOperationFeedback::kNumber));
__ UpdateFeedback(__ Word32Or(result_type, var_lhs_type_feedback.value()),
......
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