Commit 930e31e6 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[csa] Enforce using BIND macro

This CL enforces passing an AssemblerDebugInfo object to Bind, most convently
acheived by the BIND macro.

Change-Id: I092714f10803f529d01d2fe716b96275b2bee806
Reviewed-on: https://chromium-review.googlesource.com/508729Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45433}
parent bd951778
...@@ -885,7 +885,7 @@ TF_BUILTIN(FastArrayPop, CodeStubAssembler) { ...@@ -885,7 +885,7 @@ TF_BUILTIN(FastArrayPop, CodeStubAssembler) {
} }
args.PopAndReturn(AllocateHeapNumberWithValue(value)); args.PopAndReturn(AllocateHeapNumberWithValue(value));
Bind(&fast_elements); BIND(&fast_elements);
{ {
Node* value = LoadFixedArrayElement(elements, new_length); Node* value = LoadFixedArrayElement(elements, new_length);
StoreFixedArrayElement(elements, new_length, TheHoleConstant()); StoreFixedArrayElement(elements, new_length, TheHoleConstant());
...@@ -1136,7 +1136,7 @@ TF_BUILTIN(FastArrayShift, CodeStubAssembler) { ...@@ -1136,7 +1136,7 @@ TF_BUILTIN(FastArrayShift, CodeStubAssembler) {
} }
args.PopAndReturn(AllocateHeapNumberWithValue(value)); args.PopAndReturn(AllocateHeapNumberWithValue(value));
Bind(&fast_elements_tagged); BIND(&fast_elements_tagged);
{ {
Node* value = LoadFixedArrayElement(elements, 0); Node* value = LoadFixedArrayElement(elements, 0);
BuildFastLoop(IntPtrConstant(0), new_length, BuildFastLoop(IntPtrConstant(0), new_length,
...@@ -1153,7 +1153,7 @@ TF_BUILTIN(FastArrayShift, CodeStubAssembler) { ...@@ -1153,7 +1153,7 @@ TF_BUILTIN(FastArrayShift, CodeStubAssembler) {
args.PopAndReturn(value); args.PopAndReturn(value);
} }
Bind(&fast_elements_untagged); BIND(&fast_elements_untagged);
{ {
Node* value = LoadFixedArrayElement(elements, 0); Node* value = LoadFixedArrayElement(elements, 0);
Node* memmove = Node* memmove =
......
...@@ -469,36 +469,36 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon( ...@@ -469,36 +469,36 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon(
Switch(instance_type, &other, case_values, case_labels, Switch(instance_type, &other, case_values, case_labels,
arraysize(case_labels)); arraysize(case_labels));
Bind(&i8); BIND(&i8);
Return(SmiFromWord32((this->*function)(MachineType::Int8(), backing_store, Return(SmiFromWord32((this->*function)(MachineType::Int8(), backing_store,
index_word, value_word32))); index_word, value_word32)));
Bind(&u8); BIND(&u8);
Return(SmiFromWord32((this->*function)(MachineType::Uint8(), backing_store, Return(SmiFromWord32((this->*function)(MachineType::Uint8(), backing_store,
index_word, value_word32))); index_word, value_word32)));
Bind(&i16); BIND(&i16);
Return( Return(
SmiFromWord32((this->*function)(MachineType::Int16(), backing_store, SmiFromWord32((this->*function)(MachineType::Int16(), backing_store,
WordShl(index_word, 1), value_word32))); WordShl(index_word, 1), value_word32)));
Bind(&u16); BIND(&u16);
Return( Return(
SmiFromWord32((this->*function)(MachineType::Uint16(), backing_store, SmiFromWord32((this->*function)(MachineType::Uint16(), backing_store,
WordShl(index_word, 1), value_word32))); WordShl(index_word, 1), value_word32)));
Bind(&i32); BIND(&i32);
Return(ChangeInt32ToTagged( Return(ChangeInt32ToTagged(
(this->*function)(MachineType::Int32(), backing_store, (this->*function)(MachineType::Int32(), backing_store,
WordShl(index_word, 2), value_word32))); WordShl(index_word, 2), value_word32)));
Bind(&u32); BIND(&u32);
Return(ChangeUint32ToTagged( Return(ChangeUint32ToTagged(
(this->*function)(MachineType::Uint32(), backing_store, (this->*function)(MachineType::Uint32(), backing_store,
WordShl(index_word, 2), value_word32))); WordShl(index_word, 2), value_word32)));
// This shouldn't happen, we've already validated the type. // This shouldn't happen, we've already validated the type.
Bind(&other); BIND(&other);
Unreachable(); Unreachable();
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X // || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
......
...@@ -597,12 +597,12 @@ Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor, ...@@ -597,12 +597,12 @@ Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor,
Branch(WordEqual(dividend, SmiConstant(0)), &dividend_is_zero, Branch(WordEqual(dividend, SmiConstant(0)), &dividend_is_zero,
&dividend_is_not_zero); &dividend_is_not_zero);
Bind(&dividend_is_zero); BIND(&dividend_is_zero);
{ {
GotoIf(SmiLessThan(divisor, SmiConstant(0)), bailout); GotoIf(SmiLessThan(divisor, SmiConstant(0)), bailout);
Goto(&dividend_is_not_zero); Goto(&dividend_is_not_zero);
} }
Bind(&dividend_is_not_zero); BIND(&dividend_is_not_zero);
Node* untagged_divisor = SmiToWord32(divisor); Node* untagged_divisor = SmiToWord32(divisor);
Node* untagged_dividend = SmiToWord32(dividend); Node* untagged_dividend = SmiToWord32(dividend);
...@@ -613,7 +613,7 @@ Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor, ...@@ -613,7 +613,7 @@ Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor,
Branch(Word32Equal(untagged_divisor, Int32Constant(-1)), Branch(Word32Equal(untagged_divisor, Int32Constant(-1)),
&divisor_is_minus_one, &divisor_is_not_minus_one); &divisor_is_minus_one, &divisor_is_not_minus_one);
Bind(&divisor_is_minus_one); BIND(&divisor_is_minus_one);
{ {
GotoIf(Word32Equal( GotoIf(Word32Equal(
untagged_dividend, untagged_dividend,
...@@ -621,7 +621,7 @@ Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor, ...@@ -621,7 +621,7 @@ Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor,
bailout); bailout);
Goto(&divisor_is_not_minus_one); Goto(&divisor_is_not_minus_one);
} }
Bind(&divisor_is_not_minus_one); BIND(&divisor_is_not_minus_one);
Node* untagged_result = Int32Div(untagged_dividend, untagged_divisor); Node* untagged_result = Int32Div(untagged_dividend, untagged_divisor);
Node* truncated = Int32Mul(untagged_result, untagged_divisor); Node* truncated = Int32Mul(untagged_result, untagged_divisor);
...@@ -661,6 +661,14 @@ Node* CodeStubAssembler::WordIsWordAligned(Node* word) { ...@@ -661,6 +661,14 @@ Node* CodeStubAssembler::WordIsWordAligned(Node* word) {
WordAnd(word, IntPtrConstant(kPointerSize - 1))); WordAnd(word, IntPtrConstant(kPointerSize - 1)));
} }
#if DEBUG
void CodeStubAssembler::Bind(Label* label, AssemblerDebugInfo debug_info) {
CodeAssembler::Bind(label, debug_info);
}
#else
void CodeStubAssembler::Bind(Label* label) { CodeAssembler::Bind(label); }
#endif // DEBUG
void CodeStubAssembler::BranchIfPrototypesHaveNoElements( void CodeStubAssembler::BranchIfPrototypesHaveNoElements(
Node* receiver_map, Label* definitely_no_elements, Node* receiver_map, Label* definitely_no_elements,
Label* possibly_elements) { Label* possibly_elements) {
...@@ -3503,61 +3511,54 @@ Node* CodeStubAssembler::StringFromCharCode(Node* code) { ...@@ -3503,61 +3511,54 @@ Node* CodeStubAssembler::StringFromCharCode(Node* code) {
return var_result.value(); return var_result.value();
} }
namespace {
// A wrapper around CopyStringCharacters which determines the correct string // A wrapper around CopyStringCharacters which determines the correct string
// encoding, allocates a corresponding sequential string, and then copies the // encoding, allocates a corresponding sequential string, and then copies the
// given character range using CopyStringCharacters. // given character range using CopyStringCharacters.
// |from_string| must be a sequential string. |from_index| and // |from_string| must be a sequential string. |from_index| and
// |character_count| must be Smis s.t. // |character_count| must be Smis s.t.
// 0 <= |from_index| <= |from_index| + |character_count| < from_string.length. // 0 <= |from_index| <= |from_index| + |character_count| < from_string.length.
Node* AllocAndCopyStringCharacters(CodeStubAssembler* a, Node* context, Node* CodeStubAssembler::AllocAndCopyStringCharacters(Node* context, Node* from,
Node* from, Node* from_instance_type, Node* from_instance_type,
Node* from_index, Node* character_count) { Node* from_index,
typedef CodeStubAssembler::Label Label; Node* character_count) {
typedef CodeStubAssembler::Variable Variable; Label end(this), one_byte_sequential(this), two_byte_sequential(this);
Variable var_result(this, MachineRepresentation::kTagged);
Label end(a), one_byte_sequential(a), two_byte_sequential(a);
Variable var_result(a, MachineRepresentation::kTagged);
Node* const smi_zero = a->SmiConstant(Smi::kZero); Node* const smi_zero = SmiConstant(Smi::kZero);
a->Branch(a->IsOneByteStringInstanceType(from_instance_type), Branch(IsOneByteStringInstanceType(from_instance_type), &one_byte_sequential,
&one_byte_sequential, &two_byte_sequential); &two_byte_sequential);
// The subject string is a sequential one-byte string. // The subject string is a sequential one-byte string.
a->BIND(&one_byte_sequential); BIND(&one_byte_sequential);
{ {
Node* result = Node* result =
a->AllocateSeqOneByteString(context, a->SmiToWord(character_count)); AllocateSeqOneByteString(context, SmiToWord(character_count));
a->CopyStringCharacters(from, result, from_index, smi_zero, character_count, CopyStringCharacters(from, result, from_index, smi_zero, character_count,
String::ONE_BYTE_ENCODING, String::ONE_BYTE_ENCODING, String::ONE_BYTE_ENCODING,
String::ONE_BYTE_ENCODING, CodeStubAssembler::SMI_PARAMETERS);
CodeStubAssembler::SMI_PARAMETERS);
var_result.Bind(result); var_result.Bind(result);
a->Goto(&end); Goto(&end);
} }
// The subject string is a sequential two-byte string. // The subject string is a sequential two-byte string.
a->BIND(&two_byte_sequential); BIND(&two_byte_sequential);
{ {
Node* result = Node* result =
a->AllocateSeqTwoByteString(context, a->SmiToWord(character_count)); AllocateSeqTwoByteString(context, SmiToWord(character_count));
a->CopyStringCharacters(from, result, from_index, smi_zero, character_count, CopyStringCharacters(from, result, from_index, smi_zero, character_count,
String::TWO_BYTE_ENCODING, String::TWO_BYTE_ENCODING, String::TWO_BYTE_ENCODING,
String::TWO_BYTE_ENCODING, CodeStubAssembler::SMI_PARAMETERS);
CodeStubAssembler::SMI_PARAMETERS);
var_result.Bind(result); var_result.Bind(result);
a->Goto(&end); Goto(&end);
} }
a->BIND(&end); BIND(&end);
return var_result.value(); return var_result.value();
} }
} // namespace
Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from, Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from,
Node* to, SubStringFlags flags) { Node* to, SubStringFlags flags) {
...@@ -3647,7 +3648,7 @@ Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from, ...@@ -3647,7 +3648,7 @@ Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from,
GotoIf(to_direct.is_external(), &external_string); GotoIf(to_direct.is_external(), &external_string);
var_result.Bind(AllocAndCopyStringCharacters( var_result.Bind(AllocAndCopyStringCharacters(
this, context, direct_string, instance_type, offset, substr_length)); context, direct_string, instance_type, offset, substr_length));
Counters* counters = isolate()->counters(); Counters* counters = isolate()->counters();
IncrementCounter(counters->sub_string_native(), 1); IncrementCounter(counters->sub_string_native(), 1);
...@@ -3660,9 +3661,8 @@ Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from, ...@@ -3660,9 +3661,8 @@ Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from,
{ {
Node* const fake_sequential_string = to_direct.PointerToString(&runtime); Node* const fake_sequential_string = to_direct.PointerToString(&runtime);
var_result.Bind( var_result.Bind(AllocAndCopyStringCharacters(
AllocAndCopyStringCharacters(this, context, fake_sequential_string, context, fake_sequential_string, instance_type, offset, substr_length));
instance_type, offset, substr_length));
Counters* counters = isolate()->counters(); Counters* counters = isolate()->counters();
IncrementCounter(counters->sub_string_native(), 1); IncrementCounter(counters->sub_string_native(), 1);
...@@ -7385,103 +7385,87 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode, ...@@ -7385,103 +7385,87 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
return result.value(); return result.value();
} }
namespace { Node* CodeStubAssembler::CollectFeedbackForString(Node* instance_type) {
Node* feedback = SelectSmiConstant(
Node* CollectFeedbackForString(CodeStubAssembler* assembler, Word32Equal(
Node* instance_type) { Word32And(instance_type, Int32Constant(kIsNotInternalizedMask)),
Node* feedback = assembler->SelectSmiConstant( Int32Constant(kInternalizedTag)),
assembler->Word32Equal(
assembler->Word32And(
instance_type, assembler->Int32Constant(kIsNotInternalizedMask)),
assembler->Int32Constant(kInternalizedTag)),
CompareOperationFeedback::kInternalizedString, CompareOperationFeedback::kInternalizedString,
CompareOperationFeedback::kString); CompareOperationFeedback::kString);
return feedback; return feedback;
} }
void GenerateEqual_Same( void CodeStubAssembler::GenerateEqual_Same(Node* value, Label* if_equal,
CodeStubAssembler* assembler, Node* value, Label* if_notequal,
CodeStubAssembler::Label* if_equal, CodeStubAssembler::Label* if_notequal, Variable* var_type_feedback) {
CodeStubAssembler::Variable* var_type_feedback = nullptr) {
// In case of abstract or strict equality checks, we need additional checks // In case of abstract or strict equality checks, we need additional checks
// for NaN values because they are not considered equal, even if both the // for NaN values because they are not considered equal, even if both the
// left and the right hand side reference exactly the same value. // left and the right hand side reference exactly the same value.
typedef CodeStubAssembler::Label Label;
// Check if {value} is a Smi or a HeapObject. // Check if {value} is a Smi or a HeapObject.
Label if_valueissmi(assembler), if_valueisnotsmi(assembler); Label if_valueissmi(this), if_valueisnotsmi(this);
assembler->Branch(assembler->TaggedIsSmi(value), &if_valueissmi, Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
&if_valueisnotsmi);
assembler->BIND(&if_valueisnotsmi); BIND(&if_valueisnotsmi);
{ {
// Load the map of {value}. // Load the map of {value}.
Node* value_map = assembler->LoadMap(value); Node* value_map = LoadMap(value);
// Check if {value} (and therefore {rhs}) is a HeapNumber. // Check if {value} (and therefore {rhs}) is a HeapNumber.
Label if_valueisnumber(assembler), if_valueisnotnumber(assembler); Label if_valueisnumber(this), if_valueisnotnumber(this);
assembler->Branch(assembler->IsHeapNumberMap(value_map), &if_valueisnumber, Branch(IsHeapNumberMap(value_map), &if_valueisnumber, &if_valueisnotnumber);
&if_valueisnotnumber);
assembler->BIND(&if_valueisnumber); BIND(&if_valueisnumber);
{ {
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
assembler->CombineFeedback( CombineFeedback(var_type_feedback,
var_type_feedback, SmiConstant(CompareOperationFeedback::kNumber));
assembler->SmiConstant(CompareOperationFeedback::kNumber));
} }
// Convert {value} (and therefore {rhs}) to floating point value. // Convert {value} (and therefore {rhs}) to floating point value.
Node* value_value = assembler->LoadHeapNumberValue(value); Node* value_value = LoadHeapNumberValue(value);
// Check if the HeapNumber value is a NaN. // Check if the HeapNumber value is a NaN.
assembler->BranchIfFloat64IsNaN(value_value, if_notequal, if_equal); BranchIfFloat64IsNaN(value_value, if_notequal, if_equal);
} }
assembler->BIND(&if_valueisnotnumber); BIND(&if_valueisnotnumber);
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
// Collect type feedback. // Collect type feedback.
Node* instance_type = assembler->LoadMapInstanceType(value_map); Node* instance_type = LoadMapInstanceType(value_map);
Label if_valueisstring(assembler), if_valueisnotstring(assembler); Label if_valueisstring(this), if_valueisnotstring(this);
assembler->Branch(assembler->IsStringInstanceType(instance_type), Branch(IsStringInstanceType(instance_type), &if_valueisstring,
&if_valueisstring, &if_valueisnotstring); &if_valueisnotstring);
assembler->BIND(&if_valueisstring); BIND(&if_valueisstring);
{ {
assembler->CombineFeedback( CombineFeedback(var_type_feedback,
var_type_feedback, CollectFeedbackForString(instance_type));
CollectFeedbackForString(assembler, instance_type)); Goto(if_equal);
assembler->Goto(if_equal);
} }
assembler->Bind(&if_valueisnotstring); BIND(&if_valueisnotstring);
{ {
var_type_feedback->Bind( var_type_feedback->Bind(SmiConstant(CompareOperationFeedback::kAny));
assembler->SmiConstant(CompareOperationFeedback::kAny)); GotoIfNot(IsJSReceiverInstanceType(instance_type), if_equal);
assembler->GotoIfNot(assembler->IsJSReceiverInstanceType(instance_type),
if_equal); CombineFeedback(var_type_feedback,
SmiConstant(CompareOperationFeedback::kReceiver));
assembler->CombineFeedback( Goto(if_equal);
var_type_feedback,
assembler->SmiConstant(CompareOperationFeedback::kReceiver));
assembler->Goto(if_equal);
} }
} else { } else {
assembler->Goto(if_equal); Goto(if_equal);
} }
} }
assembler->BIND(&if_valueissmi); BIND(&if_valueissmi);
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
assembler->CombineFeedback( CombineFeedback(var_type_feedback,
var_type_feedback, SmiConstant(CompareOperationFeedback::kSignedSmall));
assembler->SmiConstant(CompareOperationFeedback::kSignedSmall));
} }
assembler->Goto(if_equal); Goto(if_equal);
} }
} // namespace
// ES6 section 7.2.12 Abstract Equality Comparison // ES6 section 7.2.12 Abstract Equality Comparison
Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context, Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context,
...@@ -7527,7 +7511,7 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context, ...@@ -7527,7 +7511,7 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context,
{ {
// The {lhs} and {rhs} reference the exact same value, yet we need special // The {lhs} and {rhs} reference the exact same value, yet we need special
// treatment for HeapNumber, as NaN is not equal to NaN. // treatment for HeapNumber, as NaN is not equal to NaN.
GenerateEqual_Same(this, lhs, &if_equal, &if_notequal, var_type_feedback); GenerateEqual_Same(lhs, &if_equal, &if_notequal, var_type_feedback);
} }
BIND(&if_notsame); BIND(&if_notsame);
...@@ -7687,7 +7671,7 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context, ...@@ -7687,7 +7671,7 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context,
Switch(lhs_instance_type, &if_lhsisreceiver, case_values, case_labels, Switch(lhs_instance_type, &if_lhsisreceiver, case_values, case_labels,
arraysize(case_values)); arraysize(case_values));
for (int32_t i = 0; i < FIRST_NONSTRING_TYPE; ++i) { for (int32_t i = 0; i < FIRST_NONSTRING_TYPE; ++i) {
Bind(case_labels[i]); BIND(case_labels[i]);
Goto(&if_lhsisstring); Goto(&if_lhsisstring);
delete case_labels[i]; delete case_labels[i];
} }
...@@ -7708,9 +7692,9 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context, ...@@ -7708,9 +7692,9 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context,
result.Bind(CallStub(callable, context, lhs, rhs)); result.Bind(CallStub(callable, context, lhs, rhs));
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
Node* lhs_feedback = Node* lhs_feedback =
CollectFeedbackForString(this, lhs_instance_type); CollectFeedbackForString(lhs_instance_type);
Node* rhs_feedback = Node* rhs_feedback =
CollectFeedbackForString(this, rhs_instance_type); CollectFeedbackForString(rhs_instance_type);
CombineFeedback(var_type_feedback, CombineFeedback(var_type_feedback,
SmiOr(lhs_feedback, rhs_feedback)); SmiOr(lhs_feedback, rhs_feedback));
} }
...@@ -8058,7 +8042,7 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs, ...@@ -8058,7 +8042,7 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs,
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
var_type_feedback->Bind(SmiConstant(CompareOperationFeedback::kNone)); var_type_feedback->Bind(SmiConstant(CompareOperationFeedback::kNone));
} }
GenerateEqual_Same(this, lhs, &if_equal, &if_notequal, var_type_feedback); GenerateEqual_Same(lhs, &if_equal, &if_notequal, var_type_feedback);
} }
BIND(&if_notsame); BIND(&if_notsame);
...@@ -8168,9 +8152,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs, ...@@ -8168,9 +8152,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs,
Callable callable = CodeFactory::StringEqual(isolate()); Callable callable = CodeFactory::StringEqual(isolate());
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
Node* lhs_feedback = Node* lhs_feedback =
CollectFeedbackForString(this, lhs_instance_type); CollectFeedbackForString(lhs_instance_type);
Node* rhs_feedback = Node* rhs_feedback =
CollectFeedbackForString(this, rhs_instance_type); CollectFeedbackForString(rhs_instance_type);
var_type_feedback->Bind(SmiOr(lhs_feedback, rhs_feedback)); var_type_feedback->Bind(SmiOr(lhs_feedback, rhs_feedback));
} }
result.Bind(CallStub(callable, NoContextConstant(), lhs, rhs)); result.Bind(CallStub(callable, NoContextConstant(), lhs, rhs));
...@@ -8998,8 +8982,8 @@ CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc, ...@@ -8998,8 +8982,8 @@ CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc,
argc_mode_(mode), argc_mode_(mode),
argc_(argc), argc_(argc),
arguments_(nullptr), arguments_(nullptr),
fp_(fp != nullptr ? fp : assembler->LoadFramePointer()) { fp_(fp != nullptr ? fp : assembler_->LoadFramePointer()) {
Node* offset = assembler->ElementOffsetFromIndex( Node* offset = assembler_->ElementOffsetFromIndex(
argc_, FAST_ELEMENTS, mode, argc_, FAST_ELEMENTS, mode,
(StandardFrameConstants::kFixedSlotCountAboveFp - 1) * kPointerSize); (StandardFrameConstants::kFixedSlotCountAboveFp - 1) * kPointerSize);
arguments_ = assembler_->IntPtrAdd(fp_, offset); arguments_ = assembler_->IntPtrAdd(fp_, offset);
......
...@@ -77,7 +77,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -77,7 +77,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
typedef base::Flags<AllocationFlag> AllocationFlags; typedef base::Flags<AllocationFlag> AllocationFlags;
enum ParameterMode { SMI_PARAMETERS, INTPTR_PARAMETERS }; enum ParameterMode { SMI_PARAMETERS, INTPTR_PARAMETERS };
// On 32-bit platforms, there is a slight performance advantage to doing all // On 32-bit platforms, there is a slight performance advantage to doing all
// of the array offset/index arithmetic with SMIs, since it's possible // of the array offset/index arithmetic with SMIs, since it's possible
// to save a few tag/untag operations without paying an extra expense when // to save a few tag/untag operations without paying an extra expense when
...@@ -302,6 +301,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -302,6 +301,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* WordIsWordAligned(Node* word); Node* WordIsWordAligned(Node* word);
Node* WordIsPowerOfTwo(Node* value); Node* WordIsPowerOfTwo(Node* value);
#if DEBUG
void Bind(Label* label, AssemblerDebugInfo debug_info);
#else
void Bind(Label* label);
#endif // DEBUG
void BranchIfSmiEqual(Node* a, Node* b, Label* if_true, Label* if_false) { void BranchIfSmiEqual(Node* a, Node* b, Label* if_true, Label* if_false) {
Branch(SmiEqual(a, b), if_true, if_false); Branch(SmiEqual(a, b), if_true, if_false);
} }
...@@ -1498,6 +1503,13 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -1498,6 +1503,13 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Implements DescriptorArray::GetKey. // Implements DescriptorArray::GetKey.
Node* DescriptorArrayGetKey(Node* descriptors, Node* descriptor_number); Node* DescriptorArrayGetKey(Node* descriptors, Node* descriptor_number);
Node* CollectFeedbackForString(Node* instance_type);
void GenerateEqual_Same(Node* value, Label* if_equal, Label* if_notequal,
Variable* var_type_feedback = nullptr);
Node* AllocAndCopyStringCharacters(Node* context, Node* from,
Node* from_instance_type, Node* from_index,
Node* character_count);
static const int kElementLoopUnrollThreshold = 8; static const int kElementLoopUnrollThreshold = 8;
}; };
...@@ -1622,13 +1634,16 @@ class ToDirectStringAssembler : public CodeStubAssembler { ...@@ -1622,13 +1634,16 @@ class ToDirectStringAssembler : public CodeStubAssembler {
#define CSA_ASSERT_JS_ARGC_EQ(csa, expected) \ #define CSA_ASSERT_JS_ARGC_EQ(csa, expected) \
CSA_ASSERT_JS_ARGC_OP(csa, Word32Equal, ==, expected) CSA_ASSERT_JS_ARGC_OP(csa, Word32Equal, ==, expected)
#define BIND(label) Bind(label, {#label, __FILE__, __LINE__}) #define CSA_DEBUG_INFO(name) \
, { #name, __FILE__, __LINE__ }
#define BIND(label) Bind(label CSA_DEBUG_INFO(label))
#define VARIABLE(name, ...) \ #define VARIABLE(name, ...) \
Variable name(this, {#name, __FILE__, __LINE__}, __VA_ARGS__); Variable name(this CSA_DEBUG_INFO(name), __VA_ARGS__);
#else // DEBUG #else // DEBUG
#define CSA_ASSERT(csa, x) ((void)0) #define CSA_ASSERT(csa, x) ((void)0)
#define CSA_ASSERT_JS_ARGC_EQ(csa, expected) ((void)0) #define CSA_ASSERT_JS_ARGC_EQ(csa, expected) ((void)0)
#define CSA_DEBUG_INFO(name)
#define BIND(label) Bind(label); #define BIND(label) Bind(label);
#define VARIABLE(name, ...) Variable name(this, __VA_ARGS__); #define VARIABLE(name, ...) Variable name(this, __VA_ARGS__);
#endif // DEBUG #endif // DEBUG
......
...@@ -119,7 +119,7 @@ Node* InterpreterAssembler::GetContextAtDepth(Node* context, Node* depth) { ...@@ -119,7 +119,7 @@ Node* InterpreterAssembler::GetContextAtDepth(Node* context, Node* depth) {
Branch(Word32Equal(depth, Int32Constant(0)), &context_found, &context_search); Branch(Word32Equal(depth, Int32Constant(0)), &context_found, &context_search);
// Loop until the depth is 0. // Loop until the depth is 0.
Bind(&context_search); BIND(&context_search);
{ {
cur_depth.Bind(Int32Sub(cur_depth.value(), Int32Constant(1))); cur_depth.Bind(Int32Sub(cur_depth.value(), Int32Constant(1)));
cur_context.Bind( cur_context.Bind(
...@@ -129,7 +129,7 @@ Node* InterpreterAssembler::GetContextAtDepth(Node* context, Node* depth) { ...@@ -129,7 +129,7 @@ Node* InterpreterAssembler::GetContextAtDepth(Node* context, Node* depth) {
&context_search); &context_search);
} }
Bind(&context_found); BIND(&context_found);
return cur_context.value(); return cur_context.value();
} }
...@@ -147,7 +147,7 @@ void InterpreterAssembler::GotoIfHasContextExtensionUpToDepth(Node* context, ...@@ -147,7 +147,7 @@ void InterpreterAssembler::GotoIfHasContextExtensionUpToDepth(Node* context,
// Loop until the depth is 0. // Loop until the depth is 0.
Goto(&context_search); Goto(&context_search);
Bind(&context_search); BIND(&context_search);
{ {
// TODO(leszeks): We only need to do this check if the context had a sloppy // TODO(leszeks): We only need to do this check if the context had a sloppy
// eval, we could pass in a context chain bitmask to figure out which // eval, we could pass in a context chain bitmask to figure out which
...@@ -598,7 +598,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -598,7 +598,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Node* is_smi = TaggedIsSmi(function); Node* is_smi = TaggedIsSmi(function);
Branch(is_smi, &extra_checks, &call_function); Branch(is_smi, &extra_checks, &call_function);
Bind(&call_function); BIND(&call_function);
{ {
// Increment the call count. // Increment the call count.
IncrementCallCount(feedback_vector, slot_id); IncrementCallCount(feedback_vector, slot_id);
...@@ -614,7 +614,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -614,7 +614,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Goto(&end); Goto(&end);
} }
Bind(&extra_checks); BIND(&extra_checks);
{ {
Label check_initialized(this), mark_megamorphic(this), Label check_initialized(this), mark_megamorphic(this),
create_allocation_site(this); create_allocation_site(this);
...@@ -658,7 +658,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -658,7 +658,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Goto(&mark_megamorphic); Goto(&mark_megamorphic);
} }
Bind(&check_initialized); BIND(&check_initialized);
{ {
Comment("check if uninitialized"); Comment("check if uninitialized");
// Check if it is uninitialized target first. // Check if it is uninitialized target first.
...@@ -698,7 +698,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -698,7 +698,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Goto(&call_function); Goto(&call_function);
} }
Bind(&create_allocation_site); BIND(&create_allocation_site);
{ {
CreateAllocationSiteInFeedbackVector(feedback_vector, SmiTag(slot_id)); CreateAllocationSiteInFeedbackVector(feedback_vector, SmiTag(slot_id));
...@@ -708,7 +708,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -708,7 +708,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Goto(&call_function); Goto(&call_function);
} }
Bind(&mark_megamorphic); BIND(&mark_megamorphic);
{ {
// Mark it as a megamorphic. // Mark it as a megamorphic.
// MegamorphicSentinel is created as a part of Heap::InitialObjects // MegamorphicSentinel is created as a part of Heap::InitialObjects
...@@ -722,7 +722,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -722,7 +722,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
} }
} }
Bind(&call); BIND(&call);
{ {
Comment("Increment call count and call using Call builtin"); Comment("Increment call count and call using Call builtin");
// Increment the call count. // Increment the call count.
...@@ -739,7 +739,7 @@ Node* InterpreterAssembler::CallJSWithFeedback( ...@@ -739,7 +739,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
return return_value.value(); return return_value.value();
} }
...@@ -805,7 +805,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -805,7 +805,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
allocation_feedback.Bind(UndefinedConstant()); allocation_feedback.Bind(UndefinedConstant());
Branch(is_monomorphic, &call_construct_function, &extra_checks); Branch(is_monomorphic, &call_construct_function, &extra_checks);
Bind(&call_construct_function); BIND(&call_construct_function);
{ {
Comment("call using ConstructFunction"); Comment("call using ConstructFunction");
IncrementCallCount(feedback_vector, slot_id); IncrementCallCount(feedback_vector, slot_id);
...@@ -818,7 +818,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -818,7 +818,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Goto(&end); Goto(&end);
} }
Bind(&extra_checks); BIND(&extra_checks);
{ {
Label check_allocation_site(this), check_initialized(this), Label check_allocation_site(this), check_initialized(this),
initialize(this), mark_megamorphic(this); initialize(this), mark_megamorphic(this);
...@@ -841,7 +841,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -841,7 +841,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Node* is_smi = TaggedIsSmi(feedback_value); Node* is_smi = TaggedIsSmi(feedback_value);
Branch(is_smi, &initialize, &mark_megamorphic); Branch(is_smi, &initialize, &mark_megamorphic);
Bind(&check_allocation_site); BIND(&check_allocation_site);
{ {
Comment("check if it is an allocation site"); Comment("check if it is an allocation site");
Node* is_allocation_site = Node* is_allocation_site =
...@@ -859,7 +859,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -859,7 +859,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Goto(&call_construct_function); Goto(&call_construct_function);
} }
Bind(&check_initialized); BIND(&check_initialized);
{ {
// Check if it is uninitialized. // Check if it is uninitialized.
Comment("check if uninitialized"); Comment("check if uninitialized");
...@@ -868,7 +868,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -868,7 +868,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Branch(is_uninitialized, &initialize, &mark_megamorphic); Branch(is_uninitialized, &initialize, &mark_megamorphic);
} }
Bind(&initialize); BIND(&initialize);
{ {
Label create_allocation_site(this), create_weak_cell(this); Label create_allocation_site(this), create_weak_cell(this);
Comment("initialize the feedback element"); Comment("initialize the feedback element");
...@@ -879,7 +879,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -879,7 +879,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Node* is_array_function = WordEqual(context_slot, constructor); Node* is_array_function = WordEqual(context_slot, constructor);
Branch(is_array_function, &create_allocation_site, &create_weak_cell); Branch(is_array_function, &create_allocation_site, &create_weak_cell);
Bind(&create_allocation_site); BIND(&create_allocation_site);
{ {
Node* site = CreateAllocationSiteInFeedbackVector(feedback_vector, Node* site = CreateAllocationSiteInFeedbackVector(feedback_vector,
SmiTag(slot_id)); SmiTag(slot_id));
...@@ -887,7 +887,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -887,7 +887,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Goto(&call_construct_function); Goto(&call_construct_function);
} }
Bind(&create_weak_cell); BIND(&create_weak_cell);
{ {
CreateWeakCellInFeedbackVector(feedback_vector, SmiTag(slot_id), CreateWeakCellInFeedbackVector(feedback_vector, SmiTag(slot_id),
constructor); constructor);
...@@ -895,7 +895,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -895,7 +895,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
} }
} }
Bind(&mark_megamorphic); BIND(&mark_megamorphic);
{ {
// MegamorphicSentinel is an immortal immovable object so // MegamorphicSentinel is an immortal immovable object so
// write-barrier is not needed. // write-barrier is not needed.
...@@ -909,7 +909,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -909,7 +909,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
} }
} }
Bind(&call_construct); BIND(&call_construct);
{ {
Comment("call using Construct builtin"); Comment("call using Construct builtin");
Callable callable = CodeFactory::InterpreterPushArgsThenConstruct( Callable callable = CodeFactory::InterpreterPushArgsThenConstruct(
...@@ -921,7 +921,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context, ...@@ -921,7 +921,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
return return_value.value(); return return_value.value();
} }
...@@ -991,7 +991,7 @@ void InterpreterAssembler::UpdateInterruptBudget(Node* weight, bool backward) { ...@@ -991,7 +991,7 @@ void InterpreterAssembler::UpdateInterruptBudget(Node* weight, bool backward) {
Branch(condition, &ok, &interrupt_check); Branch(condition, &ok, &interrupt_check);
// Perform interrupt and reset budget. // Perform interrupt and reset budget.
Bind(&interrupt_check); BIND(&interrupt_check);
{ {
CallRuntime(Runtime::kInterrupt, GetContext()); CallRuntime(Runtime::kInterrupt, GetContext());
new_budget.Bind(Int32Constant(Interpreter::InterruptBudget())); new_budget.Bind(Int32Constant(Interpreter::InterruptBudget()));
...@@ -999,7 +999,7 @@ void InterpreterAssembler::UpdateInterruptBudget(Node* weight, bool backward) { ...@@ -999,7 +999,7 @@ void InterpreterAssembler::UpdateInterruptBudget(Node* weight, bool backward) {
} }
// Update budget. // Update budget.
Bind(&ok); BIND(&ok);
StoreNoWriteBarrier(MachineRepresentation::kWord32, StoreNoWriteBarrier(MachineRepresentation::kWord32,
BytecodeArrayTaggedPointer(), budget_offset, BytecodeArrayTaggedPointer(), budget_offset,
new_budget.value()); new_budget.value());
...@@ -1040,9 +1040,9 @@ void InterpreterAssembler::JumpConditional(Node* condition, Node* delta) { ...@@ -1040,9 +1040,9 @@ void InterpreterAssembler::JumpConditional(Node* condition, Node* delta) {
Label match(this), no_match(this); Label match(this), no_match(this);
Branch(condition, &match, &no_match); Branch(condition, &match, &no_match);
Bind(&match); BIND(&match);
Jump(delta); Jump(delta);
Bind(&no_match); BIND(&no_match);
Dispatch(); Dispatch();
} }
...@@ -1071,13 +1071,13 @@ Node* InterpreterAssembler::StarDispatchLookahead(Node* target_bytecode) { ...@@ -1071,13 +1071,13 @@ Node* InterpreterAssembler::StarDispatchLookahead(Node* target_bytecode) {
Node* is_star = WordEqual(target_bytecode, star_bytecode); Node* is_star = WordEqual(target_bytecode, star_bytecode);
Branch(is_star, &do_inline_star, &done); Branch(is_star, &do_inline_star, &done);
Bind(&do_inline_star); BIND(&do_inline_star);
{ {
InlineStar(); InlineStar();
var_bytecode.Bind(LoadBytecode(BytecodeOffset())); var_bytecode.Bind(LoadBytecode(BytecodeOffset()));
Goto(&done); Goto(&done);
} }
Bind(&done); BIND(&done);
return var_bytecode.value(); return var_bytecode.value();
} }
...@@ -1188,7 +1188,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1188,7 +1188,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
var_value.Bind(value); var_value.Bind(value);
var_type_feedback->Bind(SmiConstant(BinaryOperationFeedback::kNone)); var_type_feedback->Bind(SmiConstant(BinaryOperationFeedback::kNone));
Goto(&loop); Goto(&loop);
Bind(&loop); BIND(&loop);
{ {
// Load the current {value}. // Load the current {value}.
value = var_value.value(); value = var_value.value();
...@@ -1197,7 +1197,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1197,7 +1197,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Label if_valueissmi(this), if_valueisnotsmi(this); Label if_valueissmi(this), if_valueisnotsmi(this);
Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi); Branch(TaggedIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
Bind(&if_valueissmi); BIND(&if_valueissmi);
{ {
// Convert the Smi {value}. // Convert the Smi {value}.
var_result.Bind(SmiToWord32(value)); var_result.Bind(SmiToWord32(value));
...@@ -1207,7 +1207,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1207,7 +1207,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Goto(&done_loop); Goto(&done_loop);
} }
Bind(&if_valueisnotsmi); BIND(&if_valueisnotsmi);
{ {
// Check if {value} is a HeapNumber. // Check if {value} is a HeapNumber.
Label if_valueisheapnumber(this), Label if_valueisheapnumber(this),
...@@ -1216,7 +1216,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1216,7 +1216,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Branch(IsHeapNumberMap(value_map), &if_valueisheapnumber, Branch(IsHeapNumberMap(value_map), &if_valueisheapnumber,
&if_valueisnotheapnumber); &if_valueisnotheapnumber);
Bind(&if_valueisheapnumber); BIND(&if_valueisheapnumber);
{ {
// Truncate the floating point value. // Truncate the floating point value.
var_result.Bind(TruncateHeapNumberValueToWord32(value)); var_result.Bind(TruncateHeapNumberValueToWord32(value));
...@@ -1226,7 +1226,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1226,7 +1226,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Goto(&done_loop); Goto(&done_loop);
} }
Bind(&if_valueisnotheapnumber); BIND(&if_valueisnotheapnumber);
{ {
// We do not require an Or with earlier feedback here because once we // We do not require an Or with earlier feedback here because once we
// convert the value to a number, we cannot reach this path. We can // convert the value to a number, we cannot reach this path. We can
...@@ -1240,7 +1240,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1240,7 +1240,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Int32Constant(ODDBALL_TYPE)); Int32Constant(ODDBALL_TYPE));
Branch(is_oddball, &if_valueisoddball, &if_valueisnotoddball); Branch(is_oddball, &if_valueisoddball, &if_valueisnotoddball);
Bind(&if_valueisoddball); BIND(&if_valueisoddball);
{ {
// Convert Oddball to a Number and perform checks again. // Convert Oddball to a Number and perform checks again.
var_value.Bind(LoadObjectField(value, Oddball::kToNumberOffset)); var_value.Bind(LoadObjectField(value, Oddball::kToNumberOffset));
...@@ -1249,7 +1249,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1249,7 +1249,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
Goto(&loop); Goto(&loop);
} }
Bind(&if_valueisnotoddball); BIND(&if_valueisnotoddball);
{ {
// Convert the {value} to a Number first. // Convert the {value} to a Number first.
Callable callable = CodeFactory::NonNumberToNumber(isolate()); Callable callable = CodeFactory::NonNumberToNumber(isolate());
...@@ -1260,7 +1260,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback( ...@@ -1260,7 +1260,7 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
} }
} }
} }
Bind(&done_loop); BIND(&done_loop);
return var_result.value(); return var_result.value();
} }
...@@ -1315,11 +1315,11 @@ void InterpreterAssembler::AbortIfWordNotEqual(Node* lhs, Node* rhs, ...@@ -1315,11 +1315,11 @@ void InterpreterAssembler::AbortIfWordNotEqual(Node* lhs, Node* rhs,
Label ok(this), abort(this, Label::kDeferred); Label ok(this), abort(this, Label::kDeferred);
Branch(WordEqual(lhs, rhs), &ok, &abort); Branch(WordEqual(lhs, rhs), &ok, &abort);
Bind(&abort); BIND(&abort);
Abort(bailout_reason); Abort(bailout_reason);
Goto(&ok); Goto(&ok);
Bind(&ok); BIND(&ok);
} }
void InterpreterAssembler::MaybeDropFrames(Node* context) { void InterpreterAssembler::MaybeDropFrames(Node* context) {
...@@ -1332,14 +1332,14 @@ void InterpreterAssembler::MaybeDropFrames(Node* context) { ...@@ -1332,14 +1332,14 @@ void InterpreterAssembler::MaybeDropFrames(Node* context) {
Label ok(this), drop_frames(this); Label ok(this), drop_frames(this);
Branch(IntPtrEqual(restart_fp, null), &ok, &drop_frames); Branch(IntPtrEqual(restart_fp, null), &ok, &drop_frames);
Bind(&drop_frames); BIND(&drop_frames);
// We don't expect this call to return since the frame dropper tears down // We don't expect this call to return since the frame dropper tears down
// the stack and jumps into the function on the target frame to restart it. // the stack and jumps into the function on the target frame to restart it.
CallStub(CodeFactory::FrameDropperTrampoline(isolate()), context, restart_fp); CallStub(CodeFactory::FrameDropperTrampoline(isolate()), context, restart_fp);
Abort(kUnexpectedReturnFromFrameDropper); Abort(kUnexpectedReturnFromFrameDropper);
Goto(&ok); Goto(&ok);
Bind(&ok); BIND(&ok);
} }
void InterpreterAssembler::TraceBytecode(Runtime::FunctionId function_id) { void InterpreterAssembler::TraceBytecode(Runtime::FunctionId function_id) {
...@@ -1364,7 +1364,7 @@ void InterpreterAssembler::TraceBytecodeDispatch(Node* target_bytecode) { ...@@ -1364,7 +1364,7 @@ void InterpreterAssembler::TraceBytecodeDispatch(Node* target_bytecode) {
old_counter, IntPtrConstant(std::numeric_limits<uintptr_t>::max())); old_counter, IntPtrConstant(std::numeric_limits<uintptr_t>::max()));
Branch(counter_reached_max, &counter_saturated, &counter_ok); Branch(counter_reached_max, &counter_saturated, &counter_ok);
Bind(&counter_ok); BIND(&counter_ok);
{ {
Node* new_counter = IntPtrAdd(old_counter, IntPtrConstant(1)); Node* new_counter = IntPtrAdd(old_counter, IntPtrConstant(1));
StoreNoWriteBarrier(MachineType::PointerRepresentation(), counters_table, StoreNoWriteBarrier(MachineType::PointerRepresentation(), counters_table,
...@@ -1372,7 +1372,7 @@ void InterpreterAssembler::TraceBytecodeDispatch(Node* target_bytecode) { ...@@ -1372,7 +1372,7 @@ void InterpreterAssembler::TraceBytecodeDispatch(Node* target_bytecode) {
Goto(&counter_saturated); Goto(&counter_saturated);
} }
Bind(&counter_saturated); BIND(&counter_saturated);
} }
// static // static
...@@ -1412,7 +1412,7 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) { ...@@ -1412,7 +1412,7 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
// BytecodeGraphBuilder::VisitResumeGenerator. // BytecodeGraphBuilder::VisitResumeGenerator.
Label loop(this, &var_index), done_loop(this); Label loop(this, &var_index), done_loop(this);
Goto(&loop); Goto(&loop);
Bind(&loop); BIND(&loop);
{ {
Node* index = var_index.value(); Node* index = var_index.value();
GotoIfNot(UintPtrLessThan(index, register_count), &done_loop); GotoIfNot(UintPtrLessThan(index, register_count), &done_loop);
...@@ -1425,7 +1425,7 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) { ...@@ -1425,7 +1425,7 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
var_index.Bind(IntPtrAdd(index, IntPtrConstant(1))); var_index.Bind(IntPtrAdd(index, IntPtrConstant(1)));
Goto(&loop); Goto(&loop);
} }
Bind(&done_loop); BIND(&done_loop);
return array; return array;
} }
...@@ -1445,7 +1445,7 @@ Node* InterpreterAssembler::ImportRegisterFile(Node* array) { ...@@ -1445,7 +1445,7 @@ Node* InterpreterAssembler::ImportRegisterFile(Node* array) {
// array contents to not keep them alive artificially. // array contents to not keep them alive artificially.
Label loop(this, &var_index), done_loop(this); Label loop(this, &var_index), done_loop(this);
Goto(&loop); Goto(&loop);
Bind(&loop); BIND(&loop);
{ {
Node* index = var_index.value(); Node* index = var_index.value();
GotoIfNot(UintPtrLessThan(index, register_count), &done_loop); GotoIfNot(UintPtrLessThan(index, register_count), &done_loop);
...@@ -1460,7 +1460,7 @@ Node* InterpreterAssembler::ImportRegisterFile(Node* array) { ...@@ -1460,7 +1460,7 @@ Node* InterpreterAssembler::ImportRegisterFile(Node* array) {
var_index.Bind(IntPtrAdd(index, IntPtrConstant(1))); var_index.Bind(IntPtrAdd(index, IntPtrConstant(1)));
Goto(&loop); Goto(&loop);
} }
Bind(&done_loop); BIND(&done_loop);
return array; return array;
} }
......
...@@ -179,7 +179,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -179,7 +179,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
feedback_vector, feedback_slot, &exit_point, &try_handler, &miss, feedback_vector, feedback_slot, &exit_point, &try_handler, &miss,
CodeStubAssembler::INTPTR_PARAMETERS); CodeStubAssembler::INTPTR_PARAMETERS);
Bind(&done); BIND(&done);
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
} }
...@@ -190,7 +190,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -190,7 +190,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
Variable var_result(this, MachineRepresentation::kTagged); Variable var_result(this, MachineRepresentation::kTagged);
ExitPoint exit_point(this, &done, &var_result); ExitPoint exit_point(this, &done, &var_result);
Bind(&try_handler); BIND(&try_handler);
{ {
Node* context = GetContext(); Node* context = GetContext();
Node* smi_slot = SmiTag(feedback_slot); Node* smi_slot = SmiTag(feedback_slot);
...@@ -203,7 +203,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -203,7 +203,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
&exit_point, &miss); &exit_point, &miss);
} }
Bind(&miss); BIND(&miss);
{ {
Node* context = GetContext(); Node* context = GetContext();
Node* smi_slot = SmiTag(feedback_slot); Node* smi_slot = SmiTag(feedback_slot);
...@@ -215,7 +215,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -215,7 +215,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
accessor_asm.LoadGlobalIC_MissCase(&params, &exit_point); accessor_asm.LoadGlobalIC_MissCase(&params, &exit_point);
} }
Bind(&done); BIND(&done);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -414,7 +414,7 @@ class InterpreterLookupContextSlotAssembler : public InterpreterAssembler { ...@@ -414,7 +414,7 @@ class InterpreterLookupContextSlotAssembler : public InterpreterAssembler {
} }
// Slow path when we have to call out to the runtime. // Slow path when we have to call out to the runtime.
Bind(&slowpath); BIND(&slowpath);
{ {
Node* name = LoadConstantPoolEntry(name_index); Node* name = LoadConstantPoolEntry(name_index);
Node* result = CallRuntime(function_id, context, name); Node* result = CallRuntime(function_id, context, name);
...@@ -470,7 +470,7 @@ class InterpreterLookupGlobalAssembler : public InterpreterLoadGlobalAssembler { ...@@ -470,7 +470,7 @@ class InterpreterLookupGlobalAssembler : public InterpreterLoadGlobalAssembler {
} }
// Slow path when we have to call out to the runtime // Slow path when we have to call out to the runtime
Bind(&slowpath); BIND(&slowpath);
{ {
Node* name_index = BytecodeOperandIdx(0); Node* name_index = BytecodeOperandIdx(0);
Node* name = LoadConstantPoolEntry(name_index); Node* name = LoadConstantPoolEntry(name_index);
...@@ -557,7 +557,7 @@ IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) { ...@@ -557,7 +557,7 @@ IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) {
AccessorAssembler accessor_asm(state()); AccessorAssembler accessor_asm(state());
accessor_asm.LoadIC_BytecodeHandler(&params, &exit_point); accessor_asm.LoadIC_BytecodeHandler(&params, &exit_point);
Bind(&done); BIND(&done);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -735,7 +735,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { ...@@ -735,7 +735,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) {
Branch(IntPtrGreaterThan(cell_index, IntPtrConstant(0)), &if_export, Branch(IntPtrGreaterThan(cell_index, IntPtrConstant(0)), &if_export,
&if_import); &if_import);
Bind(&if_export); BIND(&if_export);
{ {
Node* regular_exports = Node* regular_exports =
LoadObjectField(module, Module::kRegularExportsOffset); LoadObjectField(module, Module::kRegularExportsOffset);
...@@ -746,7 +746,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { ...@@ -746,7 +746,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&if_import); BIND(&if_import);
{ {
Node* regular_imports = Node* regular_imports =
LoadObjectField(module, Module::kRegularImportsOffset); LoadObjectField(module, Module::kRegularImportsOffset);
...@@ -757,7 +757,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { ...@@ -757,7 +757,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
Dispatch(); Dispatch();
} }
...@@ -777,7 +777,7 @@ IGNITION_HANDLER(StaModuleVariable, InterpreterAssembler) { ...@@ -777,7 +777,7 @@ IGNITION_HANDLER(StaModuleVariable, InterpreterAssembler) {
Branch(IntPtrGreaterThan(cell_index, IntPtrConstant(0)), &if_export, Branch(IntPtrGreaterThan(cell_index, IntPtrConstant(0)), &if_export,
&if_import); &if_import);
Bind(&if_export); BIND(&if_export);
{ {
Node* regular_exports = Node* regular_exports =
LoadObjectField(module, Module::kRegularExportsOffset); LoadObjectField(module, Module::kRegularExportsOffset);
...@@ -788,14 +788,14 @@ IGNITION_HANDLER(StaModuleVariable, InterpreterAssembler) { ...@@ -788,14 +788,14 @@ IGNITION_HANDLER(StaModuleVariable, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&if_import); BIND(&if_import);
{ {
// Not supported (probably never). // Not supported (probably never).
Abort(kUnsupportedModuleOperation); Abort(kUnsupportedModuleOperation);
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
Dispatch(); Dispatch();
} }
...@@ -899,7 +899,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) { ...@@ -899,7 +899,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) {
// {right} is known to be a Smi. // {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path. // Check if the {left} is a Smi take the fast path.
Branch(TaggedIsSmi(left), &fastpath, &slowpath); Branch(TaggedIsSmi(left), &fastpath, &slowpath);
Bind(&fastpath); BIND(&fastpath);
{ {
// Try fast Smi addition first. // Try fast Smi addition first.
Node* pair = IntPtrAddWithOverflow(BitcastTaggedToWord(left), Node* pair = IntPtrAddWithOverflow(BitcastTaggedToWord(left),
...@@ -909,7 +909,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) { ...@@ -909,7 +909,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) {
// Check if the Smi additon overflowed. // Check if the Smi additon overflowed.
Label if_notoverflow(this); Label if_notoverflow(this);
Branch(overflow, &slowpath, &if_notoverflow); Branch(overflow, &slowpath, &if_notoverflow);
Bind(&if_notoverflow); BIND(&if_notoverflow);
{ {
UpdateFeedback(SmiConstant(BinaryOperationFeedback::kSignedSmall), UpdateFeedback(SmiConstant(BinaryOperationFeedback::kSignedSmall),
feedback_vector, slot_index); feedback_vector, slot_index);
...@@ -917,7 +917,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) { ...@@ -917,7 +917,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
} }
Bind(&slowpath); BIND(&slowpath);
{ {
Node* context = GetContext(); Node* context = GetContext();
// TODO(ishell): pass slot as word-size value. // TODO(ishell): pass slot as word-size value.
...@@ -926,7 +926,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) { ...@@ -926,7 +926,7 @@ IGNITION_HANDLER(AddSmi, InterpreterAssembler) {
feedback_vector)); feedback_vector));
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -948,7 +948,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) { ...@@ -948,7 +948,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) {
// {right} is known to be a Smi. // {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path. // Check if the {left} is a Smi take the fast path.
Branch(TaggedIsSmi(left), &fastpath, &slowpath); Branch(TaggedIsSmi(left), &fastpath, &slowpath);
Bind(&fastpath); BIND(&fastpath);
{ {
// Try fast Smi subtraction first. // Try fast Smi subtraction first.
Node* pair = IntPtrSubWithOverflow(BitcastTaggedToWord(left), Node* pair = IntPtrSubWithOverflow(BitcastTaggedToWord(left),
...@@ -958,7 +958,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) { ...@@ -958,7 +958,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) {
// Check if the Smi subtraction overflowed. // Check if the Smi subtraction overflowed.
Label if_notoverflow(this); Label if_notoverflow(this);
Branch(overflow, &slowpath, &if_notoverflow); Branch(overflow, &slowpath, &if_notoverflow);
Bind(&if_notoverflow); BIND(&if_notoverflow);
{ {
UpdateFeedback(SmiConstant(BinaryOperationFeedback::kSignedSmall), UpdateFeedback(SmiConstant(BinaryOperationFeedback::kSignedSmall),
feedback_vector, slot_index); feedback_vector, slot_index);
...@@ -966,7 +966,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) { ...@@ -966,7 +966,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
} }
Bind(&slowpath); BIND(&slowpath);
{ {
Node* context = GetContext(); Node* context = GetContext();
// TODO(ishell): pass slot as word-size value. // TODO(ishell): pass slot as word-size value.
...@@ -975,7 +975,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) { ...@@ -975,7 +975,7 @@ IGNITION_HANDLER(SubSmi, InterpreterAssembler) {
feedback_vector)); feedback_vector));
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -997,7 +997,7 @@ IGNITION_HANDLER(MulSmi, InterpreterAssembler) { ...@@ -997,7 +997,7 @@ IGNITION_HANDLER(MulSmi, InterpreterAssembler) {
// {right} is known to be a Smi. // {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path. // Check if the {left} is a Smi take the fast path.
Branch(TaggedIsSmi(left), &fastpath, &slowpath); Branch(TaggedIsSmi(left), &fastpath, &slowpath);
Bind(&fastpath); BIND(&fastpath);
{ {
// Both {lhs} and {rhs} are Smis. The result is not necessarily a smi, // Both {lhs} and {rhs} are Smis. The result is not necessarily a smi,
// in case of overflow. // in case of overflow.
...@@ -1008,7 +1008,7 @@ IGNITION_HANDLER(MulSmi, InterpreterAssembler) { ...@@ -1008,7 +1008,7 @@ IGNITION_HANDLER(MulSmi, InterpreterAssembler) {
UpdateFeedback(feedback, feedback_vector, slot_index); UpdateFeedback(feedback, feedback_vector, slot_index);
Goto(&end); Goto(&end);
} }
Bind(&slowpath); BIND(&slowpath);
{ {
Node* context = GetContext(); Node* context = GetContext();
// TODO(ishell): pass slot as word-size value. // TODO(ishell): pass slot as word-size value.
...@@ -1018,7 +1018,7 @@ IGNITION_HANDLER(MulSmi, InterpreterAssembler) { ...@@ -1018,7 +1018,7 @@ IGNITION_HANDLER(MulSmi, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -1040,14 +1040,14 @@ IGNITION_HANDLER(DivSmi, InterpreterAssembler) { ...@@ -1040,14 +1040,14 @@ IGNITION_HANDLER(DivSmi, InterpreterAssembler) {
// {right} is known to be a Smi. // {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path. // Check if the {left} is a Smi take the fast path.
Branch(TaggedIsSmi(left), &fastpath, &slowpath); Branch(TaggedIsSmi(left), &fastpath, &slowpath);
Bind(&fastpath); BIND(&fastpath);
{ {
var_result.Bind(TrySmiDiv(left, right, &slowpath)); var_result.Bind(TrySmiDiv(left, right, &slowpath));
UpdateFeedback(SmiConstant(BinaryOperationFeedback::kSignedSmall), UpdateFeedback(SmiConstant(BinaryOperationFeedback::kSignedSmall),
feedback_vector, slot_index); feedback_vector, slot_index);
Goto(&end); Goto(&end);
} }
Bind(&slowpath); BIND(&slowpath);
{ {
Node* context = GetContext(); Node* context = GetContext();
// TODO(ishell): pass slot as word-size value. // TODO(ishell): pass slot as word-size value.
...@@ -1057,7 +1057,7 @@ IGNITION_HANDLER(DivSmi, InterpreterAssembler) { ...@@ -1057,7 +1057,7 @@ IGNITION_HANDLER(DivSmi, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -1079,7 +1079,7 @@ IGNITION_HANDLER(ModSmi, InterpreterAssembler) { ...@@ -1079,7 +1079,7 @@ IGNITION_HANDLER(ModSmi, InterpreterAssembler) {
// {right} is known to be a Smi. // {right} is known to be a Smi.
// Check if the {left} is a Smi take the fast path. // Check if the {left} is a Smi take the fast path.
Branch(TaggedIsSmi(left), &fastpath, &slowpath); Branch(TaggedIsSmi(left), &fastpath, &slowpath);
Bind(&fastpath); BIND(&fastpath);
{ {
// Both {lhs} and {rhs} are Smis. The result is not necessarily a smi. // Both {lhs} and {rhs} are Smis. The result is not necessarily a smi.
var_result.Bind(SmiMod(left, right)); var_result.Bind(SmiMod(left, right));
...@@ -1089,7 +1089,7 @@ IGNITION_HANDLER(ModSmi, InterpreterAssembler) { ...@@ -1089,7 +1089,7 @@ IGNITION_HANDLER(ModSmi, InterpreterAssembler) {
UpdateFeedback(feedback, feedback_vector, slot_index); UpdateFeedback(feedback, feedback_vector, slot_index);
Goto(&end); Goto(&end);
} }
Bind(&slowpath); BIND(&slowpath);
{ {
Node* context = GetContext(); Node* context = GetContext();
// TODO(ishell): pass slot as word-size value. // TODO(ishell): pass slot as word-size value.
...@@ -1099,7 +1099,7 @@ IGNITION_HANDLER(ModSmi, InterpreterAssembler) { ...@@ -1099,7 +1099,7 @@ IGNITION_HANDLER(ModSmi, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
{ {
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
Dispatch(); Dispatch();
...@@ -1172,7 +1172,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler { ...@@ -1172,7 +1172,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler {
AbortIfWordNotEqual(result_map, HeapNumberMapConstant(), AbortIfWordNotEqual(result_map, HeapNumberMapConstant(),
kExpectedHeapNumber); kExpectedHeapNumber);
Goto(&ok); Goto(&ok);
Bind(&ok); BIND(&ok);
} }
Node* input_feedback = Node* input_feedback =
...@@ -1422,21 +1422,21 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) { ...@@ -1422,21 +1422,21 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) {
Node* object_map = LoadMap(object); Node* object_map = LoadMap(object);
Branch(IsHeapNumberMap(object_map), &if_objectisnumber, &if_objectisother); Branch(IsHeapNumberMap(object_map), &if_objectisnumber, &if_objectisother);
Bind(&if_objectissmi); BIND(&if_objectissmi);
{ {
var_result.Bind(object); var_result.Bind(object);
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kSignedSmall)); var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kSignedSmall));
Goto(&if_done); Goto(&if_done);
} }
Bind(&if_objectisnumber); BIND(&if_objectisnumber);
{ {
var_result.Bind(object); var_result.Bind(object);
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kNumber)); var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kNumber));
Goto(&if_done); Goto(&if_done);
} }
Bind(&if_objectisother); BIND(&if_objectisother);
{ {
// Convert the {object} to a Number. // Convert the {object} to a Number.
Callable callable = CodeFactory::NonNumberToNumber(isolate()); Callable callable = CodeFactory::NonNumberToNumber(isolate());
...@@ -1445,7 +1445,7 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) { ...@@ -1445,7 +1445,7 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) {
Goto(&if_done); Goto(&if_done);
} }
Bind(&if_done); BIND(&if_done);
StoreRegister(var_result.value(), BytecodeOperandReg(0)); StoreRegister(var_result.value(), BytecodeOperandReg(0));
// Record the type feedback collected for {object}. // Record the type feedback collected for {object}.
...@@ -1495,14 +1495,14 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) { ...@@ -1495,14 +1495,14 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
value_var.Bind(value); value_var.Bind(value);
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kNone)); var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kNone));
Goto(&start); Goto(&start);
Bind(&start); BIND(&start);
{ {
value = value_var.value(); value = value_var.value();
Label if_issmi(this), if_isnotsmi(this); Label if_issmi(this), if_isnotsmi(this);
Branch(TaggedIsSmi(value), &if_issmi, &if_isnotsmi); Branch(TaggedIsSmi(value), &if_issmi, &if_isnotsmi);
Bind(&if_issmi); BIND(&if_issmi);
{ {
// Try fast Smi addition first. // Try fast Smi addition first.
Node* one = SmiConstant(Smi::FromInt(1)); Node* one = SmiConstant(Smi::FromInt(1));
...@@ -1514,35 +1514,35 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) { ...@@ -1514,35 +1514,35 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
Label if_overflow(this), if_notoverflow(this); Label if_overflow(this), if_notoverflow(this);
Branch(overflow, &if_overflow, &if_notoverflow); Branch(overflow, &if_overflow, &if_notoverflow);
Bind(&if_notoverflow); BIND(&if_notoverflow);
var_type_feedback.Bind( var_type_feedback.Bind(
SmiOr(var_type_feedback.value(), SmiOr(var_type_feedback.value(),
SmiConstant(BinaryOperationFeedback::kSignedSmall))); SmiConstant(BinaryOperationFeedback::kSignedSmall)));
result_var.Bind(BitcastWordToTaggedSigned(Projection(0, pair))); result_var.Bind(BitcastWordToTaggedSigned(Projection(0, pair)));
Goto(&end); Goto(&end);
Bind(&if_overflow); BIND(&if_overflow);
{ {
var_finc_value.Bind(SmiToFloat64(value)); var_finc_value.Bind(SmiToFloat64(value));
Goto(&do_finc); Goto(&do_finc);
} }
} }
Bind(&if_isnotsmi); BIND(&if_isnotsmi);
{ {
// Check if the value is a HeapNumber. // Check if the value is a HeapNumber.
Label if_valueisnumber(this), if_valuenotnumber(this, Label::kDeferred); Label if_valueisnumber(this), if_valuenotnumber(this, Label::kDeferred);
Node* value_map = LoadMap(value); Node* value_map = LoadMap(value);
Branch(IsHeapNumberMap(value_map), &if_valueisnumber, &if_valuenotnumber); Branch(IsHeapNumberMap(value_map), &if_valueisnumber, &if_valuenotnumber);
Bind(&if_valueisnumber); BIND(&if_valueisnumber);
{ {
// Load the HeapNumber value. // Load the HeapNumber value.
var_finc_value.Bind(LoadHeapNumberValue(value)); var_finc_value.Bind(LoadHeapNumberValue(value));
Goto(&do_finc); Goto(&do_finc);
} }
Bind(&if_valuenotnumber); BIND(&if_valuenotnumber);
{ {
// We do not require an Or with earlier feedback here because once we // We do not require an Or with earlier feedback here because once we
// convert the value to a number, we cannot reach this path. We can // convert the value to a number, we cannot reach this path. We can
...@@ -1556,7 +1556,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) { ...@@ -1556,7 +1556,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
Word32Equal(instance_type, Int32Constant(ODDBALL_TYPE)); Word32Equal(instance_type, Int32Constant(ODDBALL_TYPE));
Branch(is_oddball, &if_valueisoddball, &if_valuenotoddball); Branch(is_oddball, &if_valueisoddball, &if_valuenotoddball);
Bind(&if_valueisoddball); BIND(&if_valueisoddball);
{ {
// Convert Oddball to Number and check again. // Convert Oddball to Number and check again.
value_var.Bind(LoadObjectField(value, Oddball::kToNumberOffset)); value_var.Bind(LoadObjectField(value, Oddball::kToNumberOffset));
...@@ -1565,7 +1565,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) { ...@@ -1565,7 +1565,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
Goto(&start); Goto(&start);
} }
Bind(&if_valuenotoddball); BIND(&if_valuenotoddball);
{ {
// Convert to a Number first and try again. // Convert to a Number first and try again.
Callable callable = CodeFactory::NonNumberToNumber(isolate()); Callable callable = CodeFactory::NonNumberToNumber(isolate());
...@@ -1577,7 +1577,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) { ...@@ -1577,7 +1577,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
} }
} }
Bind(&do_finc); BIND(&do_finc);
{ {
Node* finc_value = var_finc_value.value(); Node* finc_value = var_finc_value.value();
Node* one = Float64Constant(1.0); Node* one = Float64Constant(1.0);
...@@ -1589,7 +1589,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) { ...@@ -1589,7 +1589,7 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
UpdateFeedback(var_type_feedback.value(), feedback_vector, slot_index); UpdateFeedback(var_type_feedback.value(), feedback_vector, slot_index);
SetAccumulator(result_var.value()); SetAccumulator(result_var.value());
...@@ -1622,14 +1622,14 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) { ...@@ -1622,14 +1622,14 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kNone)); var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kNone));
value_var.Bind(value); value_var.Bind(value);
Goto(&start); Goto(&start);
Bind(&start); BIND(&start);
{ {
value = value_var.value(); value = value_var.value();
Label if_issmi(this), if_isnotsmi(this); Label if_issmi(this), if_isnotsmi(this);
Branch(TaggedIsSmi(value), &if_issmi, &if_isnotsmi); Branch(TaggedIsSmi(value), &if_issmi, &if_isnotsmi);
Bind(&if_issmi); BIND(&if_issmi);
{ {
// Try fast Smi subtraction first. // Try fast Smi subtraction first.
Node* one = SmiConstant(Smi::FromInt(1)); Node* one = SmiConstant(Smi::FromInt(1));
...@@ -1641,35 +1641,35 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) { ...@@ -1641,35 +1641,35 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
Label if_overflow(this), if_notoverflow(this); Label if_overflow(this), if_notoverflow(this);
Branch(overflow, &if_overflow, &if_notoverflow); Branch(overflow, &if_overflow, &if_notoverflow);
Bind(&if_notoverflow); BIND(&if_notoverflow);
var_type_feedback.Bind( var_type_feedback.Bind(
SmiOr(var_type_feedback.value(), SmiOr(var_type_feedback.value(),
SmiConstant(BinaryOperationFeedback::kSignedSmall))); SmiConstant(BinaryOperationFeedback::kSignedSmall)));
result_var.Bind(BitcastWordToTaggedSigned(Projection(0, pair))); result_var.Bind(BitcastWordToTaggedSigned(Projection(0, pair)));
Goto(&end); Goto(&end);
Bind(&if_overflow); BIND(&if_overflow);
{ {
var_fdec_value.Bind(SmiToFloat64(value)); var_fdec_value.Bind(SmiToFloat64(value));
Goto(&do_fdec); Goto(&do_fdec);
} }
} }
Bind(&if_isnotsmi); BIND(&if_isnotsmi);
{ {
// Check if the value is a HeapNumber. // Check if the value is a HeapNumber.
Label if_valueisnumber(this), if_valuenotnumber(this, Label::kDeferred); Label if_valueisnumber(this), if_valuenotnumber(this, Label::kDeferred);
Node* value_map = LoadMap(value); Node* value_map = LoadMap(value);
Branch(IsHeapNumberMap(value_map), &if_valueisnumber, &if_valuenotnumber); Branch(IsHeapNumberMap(value_map), &if_valueisnumber, &if_valuenotnumber);
Bind(&if_valueisnumber); BIND(&if_valueisnumber);
{ {
// Load the HeapNumber value. // Load the HeapNumber value.
var_fdec_value.Bind(LoadHeapNumberValue(value)); var_fdec_value.Bind(LoadHeapNumberValue(value));
Goto(&do_fdec); Goto(&do_fdec);
} }
Bind(&if_valuenotnumber); BIND(&if_valuenotnumber);
{ {
// We do not require an Or with earlier feedback here because once we // We do not require an Or with earlier feedback here because once we
// convert the value to a number, we cannot reach this path. We can // convert the value to a number, we cannot reach this path. We can
...@@ -1683,7 +1683,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) { ...@@ -1683,7 +1683,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
Word32Equal(instance_type, Int32Constant(ODDBALL_TYPE)); Word32Equal(instance_type, Int32Constant(ODDBALL_TYPE));
Branch(is_oddball, &if_valueisoddball, &if_valuenotoddball); Branch(is_oddball, &if_valueisoddball, &if_valuenotoddball);
Bind(&if_valueisoddball); BIND(&if_valueisoddball);
{ {
// Convert Oddball to Number and check again. // Convert Oddball to Number and check again.
value_var.Bind(LoadObjectField(value, Oddball::kToNumberOffset)); value_var.Bind(LoadObjectField(value, Oddball::kToNumberOffset));
...@@ -1692,7 +1692,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) { ...@@ -1692,7 +1692,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
Goto(&start); Goto(&start);
} }
Bind(&if_valuenotoddball); BIND(&if_valuenotoddball);
{ {
// Convert to a Number first and try again. // Convert to a Number first and try again.
Callable callable = CodeFactory::NonNumberToNumber(isolate()); Callable callable = CodeFactory::NonNumberToNumber(isolate());
...@@ -1704,7 +1704,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) { ...@@ -1704,7 +1704,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
} }
} }
Bind(&do_fdec); BIND(&do_fdec);
{ {
Node* fdec_value = var_fdec_value.value(); Node* fdec_value = var_fdec_value.value();
Node* one = Float64Constant(1.0); Node* one = Float64Constant(1.0);
...@@ -1716,7 +1716,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) { ...@@ -1716,7 +1716,7 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
UpdateFeedback(var_type_feedback.value(), feedback_vector, slot_index); UpdateFeedback(var_type_feedback.value(), feedback_vector, slot_index);
SetAccumulator(result_var.value()); SetAccumulator(result_var.value());
...@@ -1735,17 +1735,17 @@ IGNITION_HANDLER(ToBooleanLogicalNot, InterpreterAssembler) { ...@@ -1735,17 +1735,17 @@ IGNITION_HANDLER(ToBooleanLogicalNot, InterpreterAssembler) {
Node* true_value = BooleanConstant(true); Node* true_value = BooleanConstant(true);
Node* false_value = BooleanConstant(false); Node* false_value = BooleanConstant(false);
BranchIfToBooleanIsTrue(value, &if_true, &if_false); BranchIfToBooleanIsTrue(value, &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
{ {
result.Bind(false_value); result.Bind(false_value);
Goto(&end); Goto(&end);
} }
Bind(&if_false); BIND(&if_false);
{ {
result.Bind(true_value); result.Bind(true_value);
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
SetAccumulator(result.value()); SetAccumulator(result.value());
Dispatch(); Dispatch();
} }
...@@ -1761,12 +1761,12 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) { ...@@ -1761,12 +1761,12 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) {
Node* true_value = BooleanConstant(true); Node* true_value = BooleanConstant(true);
Node* false_value = BooleanConstant(false); Node* false_value = BooleanConstant(false);
Branch(WordEqual(value, true_value), &if_true, &if_false); Branch(WordEqual(value, true_value), &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
{ {
result.Bind(false_value); result.Bind(false_value);
Goto(&end); Goto(&end);
} }
Bind(&if_false); BIND(&if_false);
{ {
if (FLAG_debug_code) { if (FLAG_debug_code) {
AbortIfWordNotEqual(value, false_value, AbortIfWordNotEqual(value, false_value,
...@@ -1775,7 +1775,7 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) { ...@@ -1775,7 +1775,7 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) {
result.Bind(true_value); result.Bind(true_value);
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
SetAccumulator(result.value()); SetAccumulator(result.value());
Dispatch(); Dispatch();
} }
...@@ -2271,7 +2271,7 @@ IGNITION_HANDLER(TestUndetectable, InterpreterAssembler) { ...@@ -2271,7 +2271,7 @@ IGNITION_HANDLER(TestUndetectable, InterpreterAssembler) {
SetAccumulator(result); SetAccumulator(result);
Goto(&end); Goto(&end);
Bind(&end); BIND(&end);
Dispatch(); Dispatch();
} }
...@@ -2322,37 +2322,37 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { ...@@ -2322,37 +2322,37 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) {
Switch(literal_flag, &abort, cases, labels, arraysize(cases)); Switch(literal_flag, &abort, cases, labels, arraysize(cases));
Bind(&abort); BIND(&abort);
{ {
Comment("Abort"); Comment("Abort");
Abort(BailoutReason::kUnexpectedTestTypeofLiteralFlag); Abort(BailoutReason::kUnexpectedTestTypeofLiteralFlag);
Goto(&if_false); Goto(&if_false);
} }
Bind(&if_number); BIND(&if_number);
{ {
Comment("IfNumber"); Comment("IfNumber");
GotoIfNumber(object, &if_true); GotoIfNumber(object, &if_true);
Goto(&if_false); Goto(&if_false);
} }
Bind(&if_string); BIND(&if_string);
{ {
Comment("IfString"); Comment("IfString");
GotoIf(TaggedIsSmi(object), &if_false); GotoIf(TaggedIsSmi(object), &if_false);
Branch(IsString(object), &if_true, &if_false); Branch(IsString(object), &if_true, &if_false);
} }
Bind(&if_symbol); BIND(&if_symbol);
{ {
Comment("IfSymbol"); Comment("IfSymbol");
GotoIf(TaggedIsSmi(object), &if_false); GotoIf(TaggedIsSmi(object), &if_false);
Branch(IsSymbol(object), &if_true, &if_false); Branch(IsSymbol(object), &if_true, &if_false);
} }
Bind(&if_boolean); BIND(&if_boolean);
{ {
Comment("IfBoolean"); Comment("IfBoolean");
GotoIf(WordEqual(object, BooleanConstant(true)), &if_true); GotoIf(WordEqual(object, BooleanConstant(true)), &if_true);
Branch(WordEqual(object, BooleanConstant(false)), &if_true, &if_false); Branch(WordEqual(object, BooleanConstant(false)), &if_true, &if_false);
} }
Bind(&if_undefined); BIND(&if_undefined);
{ {
Comment("IfUndefined"); Comment("IfUndefined");
GotoIf(TaggedIsSmi(object), &if_false); GotoIf(TaggedIsSmi(object), &if_false);
...@@ -2364,7 +2364,7 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { ...@@ -2364,7 +2364,7 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) {
Branch(Word32Equal(undetectable_bit, Int32Constant(0)), &if_false, Branch(Word32Equal(undetectable_bit, Int32Constant(0)), &if_false,
&if_true); &if_true);
} }
Bind(&if_function); BIND(&if_function);
{ {
Comment("IfFunction"); Comment("IfFunction");
GotoIf(TaggedIsSmi(object), &if_false); GotoIf(TaggedIsSmi(object), &if_false);
...@@ -2377,7 +2377,7 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { ...@@ -2377,7 +2377,7 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) {
Int32Constant(1 << Map::kIsCallable)), Int32Constant(1 << Map::kIsCallable)),
&if_true, &if_false); &if_true, &if_false);
} }
Bind(&if_object); BIND(&if_object);
{ {
Comment("IfObject"); Comment("IfObject");
GotoIf(TaggedIsSmi(object), &if_false); GotoIf(TaggedIsSmi(object), &if_false);
...@@ -2395,23 +2395,23 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { ...@@ -2395,23 +2395,23 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) {
Branch(Word32Equal(callable_undetectable, Int32Constant(0)), &if_true, Branch(Word32Equal(callable_undetectable, Int32Constant(0)), &if_true,
&if_false); &if_false);
} }
Bind(&if_other); BIND(&if_other);
{ {
// Typeof doesn't return any other string value. // Typeof doesn't return any other string value.
Goto(&if_false); Goto(&if_false);
} }
Bind(&if_false); BIND(&if_false);
{ {
SetAccumulator(BooleanConstant(false)); SetAccumulator(BooleanConstant(false));
Goto(&end); Goto(&end);
} }
Bind(&if_true); BIND(&if_true);
{ {
SetAccumulator(BooleanConstant(true)); SetAccumulator(BooleanConstant(true));
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
Dispatch(); Dispatch();
} }
...@@ -2500,9 +2500,9 @@ IGNITION_HANDLER(JumpIfToBooleanTrue, InterpreterAssembler) { ...@@ -2500,9 +2500,9 @@ IGNITION_HANDLER(JumpIfToBooleanTrue, InterpreterAssembler) {
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
Label if_true(this), if_false(this); Label if_true(this), if_false(this);
BranchIfToBooleanIsTrue(value, &if_true, &if_false); BranchIfToBooleanIsTrue(value, &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
Jump(relative_jump); Jump(relative_jump);
Bind(&if_false); BIND(&if_false);
Dispatch(); Dispatch();
} }
...@@ -2517,9 +2517,9 @@ IGNITION_HANDLER(JumpIfToBooleanTrueConstant, InterpreterAssembler) { ...@@ -2517,9 +2517,9 @@ IGNITION_HANDLER(JumpIfToBooleanTrueConstant, InterpreterAssembler) {
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
Label if_true(this), if_false(this); Label if_true(this), if_false(this);
BranchIfToBooleanIsTrue(value, &if_true, &if_false); BranchIfToBooleanIsTrue(value, &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
Jump(relative_jump); Jump(relative_jump);
Bind(&if_false); BIND(&if_false);
Dispatch(); Dispatch();
} }
...@@ -2532,9 +2532,9 @@ IGNITION_HANDLER(JumpIfToBooleanFalse, InterpreterAssembler) { ...@@ -2532,9 +2532,9 @@ IGNITION_HANDLER(JumpIfToBooleanFalse, InterpreterAssembler) {
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
Label if_true(this), if_false(this); Label if_true(this), if_false(this);
BranchIfToBooleanIsTrue(value, &if_true, &if_false); BranchIfToBooleanIsTrue(value, &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
Dispatch(); Dispatch();
Bind(&if_false); BIND(&if_false);
Jump(relative_jump); Jump(relative_jump);
} }
...@@ -2549,9 +2549,9 @@ IGNITION_HANDLER(JumpIfToBooleanFalseConstant, InterpreterAssembler) { ...@@ -2549,9 +2549,9 @@ IGNITION_HANDLER(JumpIfToBooleanFalseConstant, InterpreterAssembler) {
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
Label if_true(this), if_false(this); Label if_true(this), if_false(this);
BranchIfToBooleanIsTrue(value, &if_true, &if_false); BranchIfToBooleanIsTrue(value, &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
Dispatch(); Dispatch();
Bind(&if_false); BIND(&if_false);
Jump(relative_jump); Jump(relative_jump);
} }
...@@ -2659,12 +2659,12 @@ IGNITION_HANDLER(JumpIfJSReceiver, InterpreterAssembler) { ...@@ -2659,12 +2659,12 @@ IGNITION_HANDLER(JumpIfJSReceiver, InterpreterAssembler) {
Label if_object(this), if_notobject(this, Label::kDeferred), if_notsmi(this); Label if_object(this), if_notobject(this, Label::kDeferred), if_notsmi(this);
Branch(TaggedIsSmi(accumulator), &if_notobject, &if_notsmi); Branch(TaggedIsSmi(accumulator), &if_notobject, &if_notsmi);
Bind(&if_notsmi); BIND(&if_notsmi);
Branch(IsJSReceiver(accumulator), &if_object, &if_notobject); Branch(IsJSReceiver(accumulator), &if_object, &if_notobject);
Bind(&if_object); BIND(&if_object);
Jump(relative_jump); Jump(relative_jump);
Bind(&if_notobject); BIND(&if_notobject);
Dispatch(); Dispatch();
} }
...@@ -2680,13 +2680,13 @@ IGNITION_HANDLER(JumpIfJSReceiverConstant, InterpreterAssembler) { ...@@ -2680,13 +2680,13 @@ IGNITION_HANDLER(JumpIfJSReceiverConstant, InterpreterAssembler) {
Label if_object(this), if_notobject(this), if_notsmi(this); Label if_object(this), if_notobject(this), if_notsmi(this);
Branch(TaggedIsSmi(accumulator), &if_notobject, &if_notsmi); Branch(TaggedIsSmi(accumulator), &if_notobject, &if_notsmi);
Bind(&if_notsmi); BIND(&if_notsmi);
Branch(IsJSReceiver(accumulator), &if_object, &if_notobject); Branch(IsJSReceiver(accumulator), &if_object, &if_notobject);
Bind(&if_object); BIND(&if_object);
Jump(relative_jump); Jump(relative_jump);
Bind(&if_notobject); BIND(&if_notobject);
Dispatch(); Dispatch();
} }
...@@ -2729,10 +2729,10 @@ IGNITION_HANDLER(JumpLoop, InterpreterAssembler) { ...@@ -2729,10 +2729,10 @@ IGNITION_HANDLER(JumpLoop, InterpreterAssembler) {
Node* condition = Int32GreaterThanOrEqual(loop_depth, osr_level); Node* condition = Int32GreaterThanOrEqual(loop_depth, osr_level);
Branch(condition, &ok, &osr_armed); Branch(condition, &ok, &osr_armed);
Bind(&ok); BIND(&ok);
JumpBackward(relative_jump); JumpBackward(relative_jump);
Bind(&osr_armed); BIND(&osr_armed);
{ {
Callable callable = CodeFactory::InterpreterOnStackReplacement(isolate()); Callable callable = CodeFactory::InterpreterOnStackReplacement(isolate());
Node* target = HeapConstant(callable.code()); Node* target = HeapConstant(callable.code());
...@@ -2769,7 +2769,7 @@ IGNITION_HANDLER(SwitchOnSmiNoFeedback, InterpreterAssembler) { ...@@ -2769,7 +2769,7 @@ IGNITION_HANDLER(SwitchOnSmiNoFeedback, InterpreterAssembler) {
Node* relative_jump = LoadAndUntagConstantPoolEntry(entry); Node* relative_jump = LoadAndUntagConstantPoolEntry(entry);
Jump(relative_jump); Jump(relative_jump);
Bind(&fall_through); BIND(&fall_through);
Dispatch(); Dispatch();
} }
...@@ -2806,7 +2806,7 @@ IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) { ...@@ -2806,7 +2806,7 @@ IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) {
IsSetWord32<CreateArrayLiteralFlags::FastShallowCloneBit>(bytecode_flags), IsSetWord32<CreateArrayLiteralFlags::FastShallowCloneBit>(bytecode_flags),
&fast_shallow_clone, &call_runtime); &fast_shallow_clone, &call_runtime);
Bind(&fast_shallow_clone); BIND(&fast_shallow_clone);
{ {
ConstructorBuiltinsAssembler constructor_assembler(state()); ConstructorBuiltinsAssembler constructor_assembler(state());
Node* result = constructor_assembler.EmitFastCloneShallowArray( Node* result = constructor_assembler.EmitFastCloneShallowArray(
...@@ -2815,7 +2815,7 @@ IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) { ...@@ -2815,7 +2815,7 @@ IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) {
Dispatch(); Dispatch();
} }
Bind(&call_runtime); BIND(&call_runtime);
{ {
Node* flags_raw = DecodeWordFromWord32<CreateArrayLiteralFlags::FlagsBits>( Node* flags_raw = DecodeWordFromWord32<CreateArrayLiteralFlags::FlagsBits>(
bytecode_flags); bytecode_flags);
...@@ -2844,7 +2844,7 @@ IGNITION_HANDLER(CreateObjectLiteral, InterpreterAssembler) { ...@@ -2844,7 +2844,7 @@ IGNITION_HANDLER(CreateObjectLiteral, InterpreterAssembler) {
bytecode_flags), bytecode_flags),
&if_fast_clone, &if_not_fast_clone); &if_fast_clone, &if_not_fast_clone);
Bind(&if_fast_clone); BIND(&if_fast_clone);
{ {
// If we can do a fast clone do the fast-path in FastCloneShallowObjectStub. // If we can do a fast clone do the fast-path in FastCloneShallowObjectStub.
ConstructorBuiltinsAssembler constructor_assembler(state()); ConstructorBuiltinsAssembler constructor_assembler(state());
...@@ -2854,7 +2854,7 @@ IGNITION_HANDLER(CreateObjectLiteral, InterpreterAssembler) { ...@@ -2854,7 +2854,7 @@ IGNITION_HANDLER(CreateObjectLiteral, InterpreterAssembler) {
Dispatch(); Dispatch();
} }
Bind(&if_not_fast_clone); BIND(&if_not_fast_clone);
{ {
// If we can't do a fast clone, call into the runtime. // If we can't do a fast clone, call into the runtime.
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
...@@ -2894,7 +2894,7 @@ IGNITION_HANDLER(CreateClosure, InterpreterAssembler) { ...@@ -2894,7 +2894,7 @@ IGNITION_HANDLER(CreateClosure, InterpreterAssembler) {
shared, feedback_vector, vector_index, context)); shared, feedback_vector, vector_index, context));
Dispatch(); Dispatch();
Bind(&call_runtime); BIND(&call_runtime);
{ {
Node* tenured_raw = Node* tenured_raw =
DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags);
...@@ -3008,7 +3008,7 @@ IGNITION_HANDLER(CreateMappedArguments, InterpreterAssembler) { ...@@ -3008,7 +3008,7 @@ IGNITION_HANDLER(CreateMappedArguments, InterpreterAssembler) {
Node* compare = Word32And(compiler_hints, duplicate_parameters_bit); Node* compare = Word32And(compiler_hints, duplicate_parameters_bit);
Branch(compare, &if_duplicate_parameters, &if_not_duplicate_parameters); Branch(compare, &if_duplicate_parameters, &if_not_duplicate_parameters);
Bind(&if_not_duplicate_parameters); BIND(&if_not_duplicate_parameters);
{ {
ArgumentsBuiltinsAssembler constructor_assembler(state()); ArgumentsBuiltinsAssembler constructor_assembler(state());
Node* result = Node* result =
...@@ -3017,7 +3017,7 @@ IGNITION_HANDLER(CreateMappedArguments, InterpreterAssembler) { ...@@ -3017,7 +3017,7 @@ IGNITION_HANDLER(CreateMappedArguments, InterpreterAssembler) {
Dispatch(); Dispatch();
} }
Bind(&if_duplicate_parameters); BIND(&if_duplicate_parameters);
{ {
Node* result = Node* result =
CallRuntime(Runtime::kNewSloppyArguments_Generic, context, closure); CallRuntime(Runtime::kNewSloppyArguments_Generic, context, closure);
...@@ -3060,10 +3060,10 @@ IGNITION_HANDLER(StackCheck, InterpreterAssembler) { ...@@ -3060,10 +3060,10 @@ IGNITION_HANDLER(StackCheck, InterpreterAssembler) {
Node* interrupt = StackCheckTriggeredInterrupt(); Node* interrupt = StackCheckTriggeredInterrupt();
Branch(interrupt, &stack_check_interrupt, &ok); Branch(interrupt, &stack_check_interrupt, &ok);
Bind(&ok); BIND(&ok);
Dispatch(); Dispatch();
Bind(&stack_check_interrupt); BIND(&stack_check_interrupt);
{ {
Node* context = GetContext(); Node* context = GetContext();
CallRuntime(Runtime::kStackGuard, context); CallRuntime(Runtime::kStackGuard, context);
...@@ -3186,7 +3186,7 @@ IGNITION_HANDLER(ForInPrepare, InterpreterForInPrepareAssembler) { ...@@ -3186,7 +3186,7 @@ IGNITION_HANDLER(ForInPrepare, InterpreterForInPrepareAssembler) {
cache_length); cache_length);
Dispatch(); Dispatch();
Bind(&call_runtime); BIND(&call_runtime);
{ {
Node* result_triple = Node* result_triple =
CallRuntime(Runtime::kForInPrepare, context, receiver); CallRuntime(Runtime::kForInPrepare, context, receiver);
...@@ -3197,7 +3197,7 @@ IGNITION_HANDLER(ForInPrepare, InterpreterForInPrepareAssembler) { ...@@ -3197,7 +3197,7 @@ IGNITION_HANDLER(ForInPrepare, InterpreterForInPrepareAssembler) {
cache_length); cache_length);
Dispatch(); Dispatch();
} }
Bind(&nothing_to_iterate); BIND(&nothing_to_iterate);
{ {
// Receiver is null or undefined or descriptors are zero length. // Receiver is null or undefined or descriptors are zero length.
Node* zero = SmiConstant(0); Node* zero = SmiConstant(0);
...@@ -3227,13 +3227,13 @@ IGNITION_HANDLER(ForInNext, InterpreterAssembler) { ...@@ -3227,13 +3227,13 @@ IGNITION_HANDLER(ForInNext, InterpreterAssembler) {
Label if_fast(this), if_slow(this, Label::kDeferred); Label if_fast(this), if_slow(this, Label::kDeferred);
Node* receiver_map = LoadMap(receiver); Node* receiver_map = LoadMap(receiver);
Branch(WordEqual(receiver_map, cache_type), &if_fast, &if_slow); Branch(WordEqual(receiver_map, cache_type), &if_fast, &if_slow);
Bind(&if_fast); BIND(&if_fast);
{ {
// Enum cache in use for {receiver}, the {key} is definitely valid. // Enum cache in use for {receiver}, the {key} is definitely valid.
SetAccumulator(key); SetAccumulator(key);
Dispatch(); Dispatch();
} }
Bind(&if_slow); BIND(&if_slow);
{ {
// Record the fact that we hit the for-in slow path. // Record the fact that we hit the for-in slow path.
Node* vector_index = BytecodeOperandIdx(3); Node* vector_index = BytecodeOperandIdx(3);
...@@ -3264,17 +3264,17 @@ IGNITION_HANDLER(ForInContinue, InterpreterAssembler) { ...@@ -3264,17 +3264,17 @@ IGNITION_HANDLER(ForInContinue, InterpreterAssembler) {
// Check if {index} is at {cache_length} already. // Check if {index} is at {cache_length} already.
Label if_true(this), if_false(this), end(this); Label if_true(this), if_false(this), end(this);
Branch(WordEqual(index, cache_length), &if_true, &if_false); Branch(WordEqual(index, cache_length), &if_true, &if_false);
Bind(&if_true); BIND(&if_true);
{ {
SetAccumulator(BooleanConstant(false)); SetAccumulator(BooleanConstant(false));
Goto(&end); Goto(&end);
} }
Bind(&if_false); BIND(&if_false);
{ {
SetAccumulator(BooleanConstant(true)); SetAccumulator(BooleanConstant(true));
Goto(&end); Goto(&end);
} }
Bind(&end); BIND(&end);
Dispatch(); Dispatch();
} }
...@@ -3333,7 +3333,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { ...@@ -3333,7 +3333,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
STATIC_ASSERT(LastStepAction == StepIn); STATIC_ASSERT(LastStepAction == StepIn);
Node* step_next = Int32Constant(StepNext); Node* step_next = Int32Constant(StepNext);
Branch(Int32LessThanOrEqual(step_next, step_action), &if_stepping, &ok); Branch(Int32LessThanOrEqual(step_next, step_action), &if_stepping, &ok);
Bind(&ok); BIND(&ok);
Node* array = Node* array =
LoadObjectField(generator, JSGeneratorObject::kRegisterFileOffset); LoadObjectField(generator, JSGeneratorObject::kRegisterFileOffset);
...@@ -3357,7 +3357,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { ...@@ -3357,7 +3357,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
static_cast<int>(SuspendFlags::kAsyncGeneratorAwait))), static_cast<int>(SuspendFlags::kAsyncGeneratorAwait))),
&if_asyncgeneratorawait, &if_notasyncgeneratorawait); &if_asyncgeneratorawait, &if_notasyncgeneratorawait);
Bind(&if_notasyncgeneratorawait); BIND(&if_notasyncgeneratorawait);
{ {
// For ordinary yields (and for AwaitExpressions in Async Functions, which // For ordinary yields (and for AwaitExpressions in Async Functions, which
// are implemented as ordinary yields), it is safe to write over the // are implemented as ordinary yields), it is safe to write over the
...@@ -3367,7 +3367,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { ...@@ -3367,7 +3367,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Goto(&merge); Goto(&merge);
} }
Bind(&if_asyncgeneratorawait); BIND(&if_asyncgeneratorawait);
{ {
// An AwaitExpression in an Async Generator requires writing to the // An AwaitExpression in an Async Generator requires writing to the
// [await_input_or_debug_pos] field. // [await_input_or_debug_pos] field.
...@@ -3378,10 +3378,10 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { ...@@ -3378,10 +3378,10 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Goto(&merge); Goto(&merge);
} }
Bind(&merge); BIND(&merge);
Dispatch(); Dispatch();
Bind(&if_stepping); BIND(&if_stepping);
{ {
Node* context = GetContext(); Node* context = GetContext();
CallRuntime(Runtime::kDebugRecordGenerator, context, generator); CallRuntime(Runtime::kDebugRecordGenerator, context, generator);
......
...@@ -89,7 +89,7 @@ Node* IntrinsicsGenerator::InvokeIntrinsic(Node* function_id, Node* context, ...@@ -89,7 +89,7 @@ Node* IntrinsicsGenerator::InvokeIntrinsic(Node* function_id, Node* context,
__ Switch(function_id, &abort, cases, labels, arraysize(cases)); __ Switch(function_id, &abort, cases, labels, arraysize(cases));
#define HANDLE_CASE(name, lower_case, expected_arg_count) \ #define HANDLE_CASE(name, lower_case, expected_arg_count) \
__ Bind(&lower_case); \ __ BIND(&lower_case); \
if (FLAG_debug_code && expected_arg_count >= 0) { \ if (FLAG_debug_code && expected_arg_count >= 0) { \
AbortIfArgCountMismatch(expected_arg_count, arg_count); \ AbortIfArgCountMismatch(expected_arg_count, arg_count); \
} \ } \
...@@ -98,14 +98,14 @@ Node* IntrinsicsGenerator::InvokeIntrinsic(Node* function_id, Node* context, ...@@ -98,14 +98,14 @@ Node* IntrinsicsGenerator::InvokeIntrinsic(Node* function_id, Node* context,
INTRINSICS_LIST(HANDLE_CASE) INTRINSICS_LIST(HANDLE_CASE)
#undef HANDLE_CASE #undef HANDLE_CASE
__ Bind(&abort); __ BIND(&abort);
{ {
__ Abort(BailoutReason::kUnexpectedFunctionIDForInvokeIntrinsic); __ Abort(BailoutReason::kUnexpectedFunctionIDForInvokeIntrinsic);
result.Bind(__ UndefinedConstant()); result.Bind(__ UndefinedConstant());
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&end); __ BIND(&end);
return result.value(); return result.value();
} }
...@@ -133,19 +133,19 @@ Node* IntrinsicsGenerator::IsInstanceType(Node* input, int type) { ...@@ -133,19 +133,19 @@ Node* IntrinsicsGenerator::IsInstanceType(Node* input, int type) {
Node* condition = CompareInstanceType(arg, type, kInstanceTypeEqual); Node* condition = CompareInstanceType(arg, type, kInstanceTypeEqual);
__ Branch(condition, &return_true, &return_false); __ Branch(condition, &return_true, &return_false);
__ Bind(&return_true); __ BIND(&return_true);
{ {
return_value.Bind(__ BooleanConstant(true)); return_value.Bind(__ BooleanConstant(true));
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&return_false); __ BIND(&return_false);
{ {
return_value.Bind(__ BooleanConstant(false)); return_value.Bind(__ BooleanConstant(false));
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&end); __ BIND(&end);
return return_value.value(); return return_value.value();
} }
...@@ -166,19 +166,19 @@ Node* IntrinsicsGenerator::IsJSReceiver(Node* input, Node* arg_count, ...@@ -166,19 +166,19 @@ Node* IntrinsicsGenerator::IsJSReceiver(Node* input, Node* arg_count,
kInstanceTypeGreaterThanOrEqual); kInstanceTypeGreaterThanOrEqual);
__ Branch(condition, &return_true, &return_false); __ Branch(condition, &return_true, &return_false);
__ Bind(&return_true); __ BIND(&return_true);
{ {
return_value.Bind(__ BooleanConstant(true)); return_value.Bind(__ BooleanConstant(true));
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&return_false); __ BIND(&return_false);
{ {
return_value.Bind(__ BooleanConstant(false)); return_value.Bind(__ BooleanConstant(false));
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&end); __ BIND(&end);
return return_value.value(); return return_value.value();
} }
...@@ -237,19 +237,19 @@ Node* IntrinsicsGenerator::IsSmi(Node* input, Node* arg_count, Node* context) { ...@@ -237,19 +237,19 @@ Node* IntrinsicsGenerator::IsSmi(Node* input, Node* arg_count, Node* context) {
Node* arg = __ LoadRegister(input); Node* arg = __ LoadRegister(input);
__ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi); __ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi);
__ Bind(&if_smi); __ BIND(&if_smi);
{ {
return_value.Bind(__ BooleanConstant(true)); return_value.Bind(__ BooleanConstant(true));
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&if_not_smi); __ BIND(&if_not_smi);
{ {
return_value.Bind(__ BooleanConstant(false)); return_value.Bind(__ BooleanConstant(false));
__ Goto(&end); __ Goto(&end);
} }
__ Bind(&end); __ BIND(&end);
return return_value.value(); return return_value.value();
} }
...@@ -335,7 +335,7 @@ Node* IntrinsicsGenerator::Call(Node* args_reg, Node* arg_count, ...@@ -335,7 +335,7 @@ Node* IntrinsicsGenerator::Call(Node* args_reg, Node* arg_count,
__ GotoIfNot(comparison, &arg_count_positive); __ GotoIfNot(comparison, &arg_count_positive);
__ Abort(kWrongArgumentCountForInvokeIntrinsic); __ Abort(kWrongArgumentCountForInvokeIntrinsic);
__ Goto(&arg_count_positive); __ Goto(&arg_count_positive);
__ Bind(&arg_count_positive); __ BIND(&arg_count_positive);
} }
Node* result = __ CallJS(function, context, receiver_arg, target_args_count, Node* result = __ CallJS(function, context, receiver_arg, target_args_count,
...@@ -374,7 +374,7 @@ Node* IntrinsicsGenerator::CreateAsyncFromSyncIterator(Node* args_reg, ...@@ -374,7 +374,7 @@ Node* IntrinsicsGenerator::CreateAsyncFromSyncIterator(Node* args_reg,
return_value.Bind(iterator); return_value.Bind(iterator);
__ Goto(&done); __ Goto(&done);
__ Bind(&not_receiver); __ BIND(&not_receiver);
{ {
return_value.Bind( return_value.Bind(
__ CallRuntime(Runtime::kThrowSymbolIteratorInvalid, context)); __ CallRuntime(Runtime::kThrowSymbolIteratorInvalid, context));
...@@ -383,7 +383,7 @@ Node* IntrinsicsGenerator::CreateAsyncFromSyncIterator(Node* args_reg, ...@@ -383,7 +383,7 @@ Node* IntrinsicsGenerator::CreateAsyncFromSyncIterator(Node* args_reg,
__ Goto(&done); __ Goto(&done);
} }
__ Bind(&done); __ BIND(&done);
return return_value.value(); return return_value.value();
} }
...@@ -452,7 +452,7 @@ void IntrinsicsGenerator::AbortIfArgCountMismatch(int expected, Node* actual) { ...@@ -452,7 +452,7 @@ void IntrinsicsGenerator::AbortIfArgCountMismatch(int expected, Node* actual) {
__ GotoIf(comparison, &match); __ GotoIf(comparison, &match);
__ Abort(kWrongArgumentCountForInvokeIntrinsic); __ Abort(kWrongArgumentCountForInvokeIntrinsic);
__ Goto(&match); __ Goto(&match);
__ Bind(&match); __ BIND(&match);
} }
} // namespace interpreter } // namespace interpreter
......
...@@ -140,18 +140,18 @@ TEST(TryProbeStubCache) { ...@@ -140,18 +140,18 @@ TEST(TryProbeStubCache) {
m.TryProbeStubCache(&stub_cache, receiver, name, &if_handler, &var_handler, m.TryProbeStubCache(&stub_cache, receiver, name, &if_handler, &var_handler,
&if_miss); &if_miss);
m.Bind(&if_handler); m.BIND(&if_handler);
m.Branch(m.WordEqual(expected_handler, var_handler.value()), &passed, m.Branch(m.WordEqual(expected_handler, var_handler.value()), &passed,
&failed); &failed);
m.Bind(&if_miss); m.BIND(&if_miss);
m.Branch(m.WordEqual(expected_handler, m.IntPtrConstant(0)), &passed, m.Branch(m.WordEqual(expected_handler, m.IntPtrConstant(0)), &passed,
&failed); &failed);
m.Bind(&passed); m.BIND(&passed);
m.Return(m.BooleanConstant(true)); m.Return(m.BooleanConstant(true));
m.Bind(&failed); m.BIND(&failed);
m.Return(m.BooleanConstant(false)); m.Return(m.BooleanConstant(false));
} }
......
...@@ -351,29 +351,29 @@ TEST(TryToName) { ...@@ -351,29 +351,29 @@ TEST(TryToName) {
m.TryToName(key, &if_keyisindex, &var_index, &if_keyisunique, &var_unique, m.TryToName(key, &if_keyisindex, &var_index, &if_keyisunique, &var_unique,
&if_bailout); &if_bailout);
m.Bind(&if_keyisindex); m.BIND(&if_keyisindex);
m.GotoIfNot(m.WordEqual(expected_result, m.GotoIfNot(m.WordEqual(expected_result,
m.SmiConstant(Smi::FromInt(kKeyIsIndex))), m.SmiConstant(Smi::FromInt(kKeyIsIndex))),
&failed); &failed);
m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_index.value()), m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_index.value()),
&passed, &failed); &passed, &failed);
m.Bind(&if_keyisunique); m.BIND(&if_keyisunique);
m.GotoIfNot(m.WordEqual(expected_result, m.GotoIfNot(m.WordEqual(expected_result,
m.SmiConstant(Smi::FromInt(kKeyIsUnique))), m.SmiConstant(Smi::FromInt(kKeyIsUnique))),
&failed); &failed);
m.Branch(m.WordEqual(expected_arg, var_unique.value()), &passed, &failed); m.Branch(m.WordEqual(expected_arg, var_unique.value()), &passed, &failed);
} }
m.Bind(&if_bailout); m.BIND(&if_bailout);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kBailout))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kBailout))),
&passed, &failed); &passed, &failed);
m.Bind(&passed); m.BIND(&passed);
m.Return(m.BooleanConstant(true)); m.Return(m.BooleanConstant(true));
m.Bind(&failed); m.BIND(&failed);
m.Return(m.BooleanConstant(false)); m.Return(m.BooleanConstant(false));
} }
...@@ -535,22 +535,22 @@ void TestNameDictionaryLookup() { ...@@ -535,22 +535,22 @@ void TestNameDictionaryLookup() {
m.NameDictionaryLookup<Dictionary>(dictionary, unique_name, &if_found, m.NameDictionaryLookup<Dictionary>(dictionary, unique_name, &if_found,
&var_name_index, &if_not_found); &var_name_index, &if_not_found);
m.Bind(&if_found); m.BIND(&if_found);
m.GotoIfNot( m.GotoIfNot(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))),
&failed); &failed);
m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_name_index.value()), m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_name_index.value()),
&passed, &failed); &passed, &failed);
m.Bind(&if_not_found); m.BIND(&if_not_found);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))),
&passed, &failed); &passed, &failed);
m.Bind(&passed); m.BIND(&passed);
m.Return(m.BooleanConstant(true)); m.Return(m.BooleanConstant(true));
m.Bind(&failed); m.BIND(&failed);
m.Return(m.BooleanConstant(false)); m.Return(m.BooleanConstant(false));
} }
...@@ -642,22 +642,22 @@ void TestNumberDictionaryLookup() { ...@@ -642,22 +642,22 @@ void TestNumberDictionaryLookup() {
m.NumberDictionaryLookup<Dictionary>(dictionary, key, &if_found, &var_entry, m.NumberDictionaryLookup<Dictionary>(dictionary, key, &if_found, &var_entry,
&if_not_found); &if_not_found);
m.Bind(&if_found); m.BIND(&if_found);
m.GotoIfNot( m.GotoIfNot(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))),
&failed); &failed);
m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_entry.value()), &passed, m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_entry.value()), &passed,
&failed); &failed);
m.Bind(&if_not_found); m.BIND(&if_not_found);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))),
&passed, &failed); &passed, &failed);
m.Bind(&passed); m.BIND(&passed);
m.Return(m.BooleanConstant(true)); m.Return(m.BooleanConstant(true));
m.Bind(&failed); m.BIND(&failed);
m.Return(m.BooleanConstant(false)); m.Return(m.BooleanConstant(false));
} }
...@@ -782,24 +782,24 @@ TEST(TryHasOwnProperty) { ...@@ -782,24 +782,24 @@ TEST(TryHasOwnProperty) {
m.TryHasOwnProperty(object, map, instance_type, unique_name, &if_found, m.TryHasOwnProperty(object, map, instance_type, unique_name, &if_found,
&if_not_found, &if_bailout); &if_not_found, &if_bailout);
m.Bind(&if_found); m.BIND(&if_found);
m.Branch(m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))), m.Branch(m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))),
&passed, &failed); &passed, &failed);
m.Bind(&if_not_found); m.BIND(&if_not_found);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))),
&passed, &failed); &passed, &failed);
m.Bind(&if_bailout); m.BIND(&if_bailout);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kBailout))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kBailout))),
&passed, &failed); &passed, &failed);
m.Bind(&passed); m.BIND(&passed);
m.Return(m.BooleanConstant(true)); m.Return(m.BooleanConstant(true));
m.Bind(&failed); m.BIND(&failed);
m.Return(m.BooleanConstant(false)); m.Return(m.BooleanConstant(false));
} }
...@@ -971,13 +971,13 @@ TEST(TryGetOwnProperty) { ...@@ -971,13 +971,13 @@ TEST(TryGetOwnProperty) {
unique_name, &if_found, &var_value, &if_not_found, unique_name, &if_found, &var_value, &if_not_found,
&if_bailout); &if_bailout);
m.Bind(&if_found); m.BIND(&if_found);
m.Return(var_value.value()); m.Return(var_value.value());
m.Bind(&if_not_found); m.BIND(&if_not_found);
m.Return(m.HeapConstant(not_found_symbol)); m.Return(m.HeapConstant(not_found_symbol));
m.Bind(&if_bailout); m.BIND(&if_bailout);
m.Return(m.HeapConstant(bailout_symbol)); m.Return(m.HeapConstant(bailout_symbol));
} }
...@@ -1186,28 +1186,28 @@ TEST(TryLookupElement) { ...@@ -1186,28 +1186,28 @@ TEST(TryLookupElement) {
m.TryLookupElement(object, map, instance_type, index, &if_found, &if_absent, m.TryLookupElement(object, map, instance_type, index, &if_found, &if_absent,
&if_not_found, &if_bailout); &if_not_found, &if_bailout);
m.Bind(&if_found); m.BIND(&if_found);
m.Branch(m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))), m.Branch(m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))),
&passed, &failed); &passed, &failed);
m.Bind(&if_absent); m.BIND(&if_absent);
m.Branch(m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kAbsent))), m.Branch(m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kAbsent))),
&passed, &failed); &passed, &failed);
m.Bind(&if_not_found); m.BIND(&if_not_found);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kNotFound))),
&passed, &failed); &passed, &failed);
m.Bind(&if_bailout); m.BIND(&if_bailout);
m.Branch( m.Branch(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kBailout))), m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kBailout))),
&passed, &failed); &passed, &failed);
m.Bind(&passed); m.BIND(&passed);
m.Return(m.BooleanConstant(true)); m.Return(m.BooleanConstant(true));
m.Bind(&failed); m.BIND(&failed);
m.Return(m.BooleanConstant(false)); m.Return(m.BooleanConstant(false));
} }
...@@ -1757,9 +1757,9 @@ TEST(IsDebugActive) { ...@@ -1757,9 +1757,9 @@ TEST(IsDebugActive) {
CodeAssemblerLabel if_active(&m), if_not_active(&m); CodeAssemblerLabel if_active(&m), if_not_active(&m);
m.Branch(m.IsDebugActive(), &if_active, &if_not_active); m.Branch(m.IsDebugActive(), &if_active, &if_not_active);
m.Bind(&if_active); m.BIND(&if_active);
m.Return(m.TrueConstant()); m.Return(m.TrueConstant());
m.Bind(&if_not_active); m.BIND(&if_not_active);
m.Return(m.FalseConstant()); m.Return(m.FalseConstant());
Handle<Code> code = data.GenerateCode(); Handle<Code> code = data.GenerateCode();
...@@ -1811,7 +1811,7 @@ class AppendJSArrayCodeStubAssembler : public CodeStubAssembler { ...@@ -1811,7 +1811,7 @@ class AppendJSArrayCodeStubAssembler : public CodeStubAssembler {
arg_index, &bailout); arg_index, &bailout);
Return(length); Return(length);
Bind(&bailout); BIND(&bailout);
Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2)))); Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2))));
Handle<Code> code = tester->GenerateCode(); Handle<Code> code = tester->GenerateCode();
...@@ -2486,7 +2486,7 @@ TEST(DirectMemoryTest8BitWord32Immediate) { ...@@ -2486,7 +2486,7 @@ TEST(DirectMemoryTest8BitWord32Immediate) {
m.Return(m.SmiConstant(1)); m.Return(m.SmiConstant(1));
m.Bind(&bad); m.BIND(&bad);
m.Return(m.SmiConstant(0)); m.Return(m.SmiConstant(0));
Handle<Code> code = data.GenerateCode(); Handle<Code> code = data.GenerateCode();
...@@ -2523,7 +2523,7 @@ TEST(DirectMemoryTest16BitWord32Immediate) { ...@@ -2523,7 +2523,7 @@ TEST(DirectMemoryTest16BitWord32Immediate) {
m.Return(m.SmiConstant(1)); m.Return(m.SmiConstant(1));
m.Bind(&bad); m.BIND(&bad);
m.Return(m.SmiConstant(0)); m.Return(m.SmiConstant(0));
Handle<Code> code = data.GenerateCode(); Handle<Code> code = data.GenerateCode();
...@@ -2572,7 +2572,7 @@ TEST(DirectMemoryTest8BitWord32) { ...@@ -2572,7 +2572,7 @@ TEST(DirectMemoryTest8BitWord32) {
m.Return(m.SmiConstant(1)); m.Return(m.SmiConstant(1));
m.Bind(&bad); m.BIND(&bad);
m.Return(m.SmiConstant(0)); m.Return(m.SmiConstant(0));
Handle<Code> code = data.GenerateCode(); Handle<Code> code = data.GenerateCode();
...@@ -2635,7 +2635,7 @@ TEST(DirectMemoryTest16BitWord32) { ...@@ -2635,7 +2635,7 @@ TEST(DirectMemoryTest16BitWord32) {
m.Return(m.SmiConstant(1)); m.Return(m.SmiConstant(1));
m.Bind(&bad); m.BIND(&bad);
m.Return(m.SmiConstant(0)); m.Return(m.SmiConstant(0));
Handle<Code> code = data.GenerateCode(); Handle<Code> code = data.GenerateCode();
......
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