Commit 76c65af8 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[csa] Rename GotoUnless to GotoIfNot.

BUG=

Change-Id: Ifc441739ef730a0b2278be0b662413c223631a72
Reviewed-on: https://chromium-review.googlesource.com/444190Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43288}
parent b41ed490
This diff is collapsed.
......@@ -52,11 +52,11 @@ Node* AsyncBuiltinsAssembler::Await(
PromiseSetHasHandler(throwaway_promise);
Label do_perform_promise_then(this);
GotoUnless(IsDebugActive(), &do_perform_promise_then);
GotoIfNot(IsDebugActive(), &do_perform_promise_then);
{
Label common(this);
GotoIf(TaggedIsSmi(value), &common);
GotoUnless(HasInstanceType(value, JS_PROMISE_TYPE), &common);
GotoIfNot(HasInstanceType(value, JS_PROMISE_TYPE), &common);
{
// Mark the reject handler callback to be a forwarding edge, rather
// than a meaningful catch handler
......
......@@ -47,7 +47,7 @@ Node* ConstructorBuiltinsAssembler::EmitFastNewClosure(Node* shared_info,
Node* is_not_normal =
Word32And(compiler_hints,
Int32Constant(SharedFunctionInfo::kAllFunctionKindBitsMask));
GotoUnless(is_not_normal, &if_normal);
GotoIfNot(is_not_normal, &if_normal);
Node* is_generator = Word32And(
compiler_hints, Int32Constant(FunctionKind::kGeneratorFunction
......@@ -681,7 +681,7 @@ Node* ConstructorBuiltinsAssembler::EmitFastCloneShallowObject(
Node* boilerplate_map = LoadMap(boilerplate);
Node* instance_size = LoadMapInstanceSize(boilerplate_map);
Node* size_in_words = WordShr(object_size, kPointerSizeLog2);
GotoUnless(WordEqual(instance_size, size_in_words), call_runtime);
GotoIfNot(WordEqual(instance_size, size_in_words), call_runtime);
Node* copy = Allocate(allocation_size);
......@@ -705,8 +705,7 @@ Node* ConstructorBuiltinsAssembler::EmitFastCloneShallowObject(
Bind(&loop_check);
{
offset.Bind(IntPtrAdd(offset.value(), IntPtrConstant(kPointerSize)));
GotoUnless(IntPtrGreaterThanOrEqual(offset.value(), end_offset),
&loop_body);
GotoIfNot(IntPtrGreaterThanOrEqual(offset.value(), end_offset), &loop_body);
}
if (FLAG_allocation_site_pretenuring) {
......
......@@ -180,16 +180,15 @@ void Builtins::Generate_ToString(compiler::CodeAssemblerState* state) {
Node* input_instance_type = assembler.LoadMapInstanceType(input_map);
Label not_string(&assembler);
assembler.GotoUnless(assembler.IsStringInstanceType(input_instance_type),
&not_string);
assembler.GotoIfNot(assembler.IsStringInstanceType(input_instance_type),
&not_string);
assembler.Return(input);
Label not_heap_number(&assembler);
assembler.Bind(&not_string);
{
assembler.GotoUnless(assembler.IsHeapNumberMap(input_map),
&not_heap_number);
assembler.GotoIfNot(assembler.IsHeapNumberMap(input_map), &not_heap_number);
assembler.Goto(&is_number);
}
......@@ -367,9 +366,9 @@ void Builtins::Generate_ToLength(compiler::CodeAssemblerState* state) {
Node* len_value = assembler.LoadHeapNumberValue(len);
// Check if {len} is not greater than zero.
assembler.GotoUnless(assembler.Float64GreaterThan(
len_value, assembler.Float64Constant(0.0)),
&return_zero);
assembler.GotoIfNot(assembler.Float64GreaterThan(
len_value, assembler.Float64Constant(0.0)),
&return_zero);
// Check if {len} is greater than or equal to 2^53-1.
assembler.GotoIf(
......
......@@ -1099,7 +1099,7 @@ void Builtins::Generate_DatePrototypeToPrimitive(
// Check if the {receiver} is actually a JSReceiver.
Label receiver_is_invalid(&assembler, Label::kDeferred);
assembler.GotoIf(assembler.TaggedIsSmi(receiver), &receiver_is_invalid);
assembler.GotoUnless(assembler.IsJSReceiver(receiver), &receiver_is_invalid);
assembler.GotoIfNot(assembler.IsJSReceiver(receiver), &receiver_is_invalid);
// Dispatch to the appropriate OrdinaryToPrimitive builtin.
Label hint_is_number(&assembler), hint_is_string(&assembler),
......@@ -1116,7 +1116,7 @@ void Builtins::Generate_DatePrototypeToPrimitive(
// Slow-case with actual string comparisons.
Callable string_equal = CodeFactory::StringEqual(assembler.isolate());
assembler.GotoIf(assembler.TaggedIsSmi(hint), &hint_is_invalid);
assembler.GotoUnless(assembler.IsString(hint), &hint_is_invalid);
assembler.GotoIfNot(assembler.IsString(hint), &hint_is_invalid);
assembler.GotoIf(assembler.WordEqual(assembler.CallStub(string_equal, context,
hint, number_string),
assembler.TrueConstant()),
......
......@@ -325,7 +325,7 @@ void Builtins::Generate_FastFunctionPrototypeBind(
descriptors, DescriptorArray::ToValueIndex(length_index));
assembler.GotoIf(assembler.TaggedIsSmi(maybe_length_accessor), &slow);
Node* length_value_map = assembler.LoadMap(maybe_length_accessor);
assembler.GotoUnless(assembler.IsAccessorInfoMap(length_value_map), &slow);
assembler.GotoIfNot(assembler.IsAccessorInfoMap(length_value_map), &slow);
const int name_index = JSFunction::kNameDescriptorIndex;
Node* maybe_name = assembler.LoadFixedArrayElement(
......@@ -339,7 +339,7 @@ void Builtins::Generate_FastFunctionPrototypeBind(
descriptors, DescriptorArray::ToValueIndex(name_index));
assembler.GotoIf(assembler.TaggedIsSmi(maybe_name_accessor), &slow);
Node* name_value_map = assembler.LoadMap(maybe_name_accessor);
assembler.GotoUnless(assembler.IsAccessorInfoMap(name_value_map), &slow);
assembler.GotoIfNot(assembler.IsAccessorInfoMap(name_value_map), &slow);
// Choose the right bound function map based on whether the target is
// constructable.
......
......@@ -34,9 +34,9 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume(
Label if_receiverisincompatible(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &if_receiverisincompatible);
Node* receiver_instance_type = LoadInstanceType(receiver);
GotoUnless(Word32Equal(receiver_instance_type,
Int32Constant(JS_GENERATOR_OBJECT_TYPE)),
&if_receiverisincompatible);
GotoIfNot(Word32Equal(receiver_instance_type,
Int32Constant(JS_GENERATOR_OBJECT_TYPE)),
&if_receiverisincompatible);
// Check if the {receiver} is running or already closed.
Node* receiver_continuation =
......
......@@ -142,7 +142,7 @@ TF_BUILTIN(LoadIC_FunctionPrototype, CodeStubAssembler) {
Variable var_result(this, MachineRepresentation::kTagged, proto_or_map);
Label done(this, &var_result);
GotoUnless(IsMap(proto_or_map), &done);
GotoIfNot(IsMap(proto_or_map), &done);
var_result.Bind(LoadMapPrototype(proto_or_map));
Goto(&done);
......
......@@ -247,7 +247,7 @@ void Builtins::Generate_NewUnmappedArgumentsElements(
assembler.Load(MachineType::AnyTagged(), parent_frame,
assembler.IntPtrConstant(
CommonFrameConstants::kContextOrFrameTypeOffset));
assembler.GotoUnless(
assembler.GotoIfNot(
assembler.WordEqual(
parent_frame_type,
assembler.SmiConstant(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))),
......@@ -289,7 +289,7 @@ void Builtins::Generate_NewRestParameterElements(
assembler.Load(MachineType::AnyTagged(), frame,
assembler.IntPtrConstant(
CommonFrameConstants::kContextOrFrameTypeOffset));
assembler.GotoUnless(
assembler.GotoIfNot(
assembler.WordEqual(frame_type, assembler.SmiConstant(Smi::FromInt(
StackFrame::ARGUMENTS_ADAPTOR))),
&if_empty);
......
......@@ -60,7 +60,7 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber.
GotoUnless(IsHeapNumberMap(LoadMap(number)), &return_false);
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false);
// Check if {number} contains a finite, non-NaN value.
Node* number_value = LoadHeapNumberValue(number);
......@@ -84,7 +84,7 @@ TF_BUILTIN(NumberIsInteger, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber.
GotoUnless(IsHeapNumberMap(LoadMap(number)), &return_false);
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false);
// Load the actual value of {number}.
Node* number_value = LoadHeapNumberValue(number);
......@@ -113,7 +113,7 @@ TF_BUILTIN(NumberIsNaN, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_false);
// Check if {number} is a HeapNumber.
GotoUnless(IsHeapNumberMap(LoadMap(number)), &return_false);
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false);
// Check if {number} contains a NaN value.
Node* number_value = LoadHeapNumberValue(number);
......@@ -136,7 +136,7 @@ TF_BUILTIN(NumberIsSafeInteger, CodeStubAssembler) {
GotoIf(TaggedIsSmi(number), &return_true);
// Check if {number} is a HeapNumber.
GotoUnless(IsHeapNumberMap(LoadMap(number)), &return_false);
GotoIfNot(IsHeapNumberMap(LoadMap(number)), &return_false);
// Load the actual value of {number}.
Node* number_value = LoadHeapNumberValue(number);
......@@ -145,7 +145,7 @@ TF_BUILTIN(NumberIsSafeInteger, CodeStubAssembler) {
Node* integer = Float64Trunc(number_value);
// Check if {number}s value matches the integer (ruling out the infinities).
GotoUnless(
GotoIfNot(
Float64Equal(Float64Sub(number_value, integer), Float64Constant(0.0)),
&return_false);
......@@ -299,8 +299,8 @@ TF_BUILTIN(NumberParseInt, CodeStubAssembler) {
// Check if the absolute {input} value is in the ]0.01,1e9[ range.
Node* input_value_abs = Float64Abs(input_value);
GotoUnless(Float64LessThan(input_value_abs, Float64Constant(1e9)),
&if_generic);
GotoIfNot(Float64LessThan(input_value_abs, Float64Constant(1e9)),
&if_generic);
Branch(Float64LessThan(Float64Constant(0.01), input_value_abs),
&if_inputissigned32, &if_generic);
......
......@@ -329,9 +329,9 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
Node* properties_map = LoadMap(properties);
GotoIf(IsSpecialReceiverMap(properties_map), &call_runtime);
// Stay on the fast path only if there are no elements.
GotoUnless(WordEqual(LoadElements(properties),
LoadRoot(Heap::kEmptyFixedArrayRootIndex)),
&call_runtime);
GotoIfNot(WordEqual(LoadElements(properties),
LoadRoot(Heap::kEmptyFixedArrayRootIndex)),
&call_runtime);
// Handle dictionary objects or fast objects with properties in runtime.
Node* bit_field3 = LoadMapBitField3(properties_map);
GotoIf(IsSetWord32<Map::DictionaryMap>(bit_field3), &call_runtime);
......@@ -934,7 +934,7 @@ TF_BUILTIN(ForInNext, ObjectBuiltinsAssembler) {
Node* key = LoadFixedArrayElement(cache_array, SmiUntag(index));
Node* map = LoadMap(object);
GotoUnless(WordEqual(map, cache_type), &filter);
GotoIfNot(WordEqual(map, cache_type), &filter);
Return(key);
Bind(&filter);
Return(ForInFilter(key, object, context));
......
This diff is collapsed.
......@@ -278,9 +278,9 @@ Node* RegExpBuiltinsAssembler::RegExpPrototypeExecBodyWithoutResult(
Node* const lastindex = var_lastindex.value();
Label if_isoob(this, Label::kDeferred);
GotoUnless(TaggedIsSmi(lastindex), &if_isoob);
GotoIfNot(TaggedIsSmi(lastindex), &if_isoob);
Node* const string_length = LoadStringLength(string);
GotoUnless(SmiLessThanOrEqual(lastindex, string_length), &if_isoob);
GotoIfNot(SmiLessThanOrEqual(lastindex, string_length), &if_isoob);
Goto(&run_exec);
Bind(&if_isoob);
......@@ -315,9 +315,9 @@ Node* RegExpBuiltinsAssembler::RegExpPrototypeExecBodyWithoutResult(
// {match_indices} is either null or the RegExpMatchInfo array.
// Return early if exec failed, possibly updating last index.
GotoUnless(WordEqual(match_indices, null), &successful_match);
GotoIfNot(WordEqual(match_indices, null), &successful_match);
GotoUnless(should_update_last_index, if_didnotmatch);
GotoIfNot(should_update_last_index, if_didnotmatch);
StoreLastIndex(context, regexp, smi_zero, is_fastpath);
Goto(if_didnotmatch);
......@@ -325,7 +325,7 @@ Node* RegExpBuiltinsAssembler::RegExpPrototypeExecBodyWithoutResult(
Bind(&successful_match);
{
GotoUnless(should_update_last_index, &out);
GotoIfNot(should_update_last_index, &out);
// Update the new last index from {match_indices}.
Node* const new_lastindex = LoadFixedArrayElement(
......@@ -432,7 +432,7 @@ void RegExpBuiltinsAssembler::BranchIfFastRegExp(Node* const context,
LoadObjectField(regexp_fun, JSFunction::kPrototypeOrInitialMapOffset);
Node* const has_initialmap = WordEqual(map, initial_map);
GotoUnless(has_initialmap, if_ismodified);
GotoIfNot(has_initialmap, if_ismodified);
Node* const initial_proto_initial_map =
LoadContextElement(native_context, Context::REGEXP_PROTOTYPE_MAP_INDEX);
......@@ -532,7 +532,7 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
#define CASE_FOR_FLAG(FLAG) \
do { \
Label next(this); \
GotoUnless(IsSetWord(flags_intptr, FLAG), &next); \
GotoIfNot(IsSetWord(flags_intptr, FLAG), &next); \
var_length.Bind(IntPtrAdd(var_length.value(), int_one)); \
Goto(&next); \
Bind(&next); \
......@@ -589,7 +589,7 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
#define CASE_FOR_FLAG(FLAG, CHAR) \
do { \
Label next(this); \
GotoUnless(IsSetWord(flags_intptr, FLAG), &next); \
GotoIfNot(IsSetWord(flags_intptr, FLAG), &next); \
Node* const value = Int32Constant(CHAR); \
StoreNoWriteBarrier(MachineRepresentation::kWord8, result, \
var_offset.value(), value); \
......@@ -617,7 +617,7 @@ Node* RegExpBuiltinsAssembler::IsRegExp(Node* const context,
Variable var_result(this, MachineRepresentation::kWord32, Int32Constant(0));
GotoIf(TaggedIsSmi(maybe_receiver), &out);
GotoUnless(IsJSReceiver(maybe_receiver), &out);
GotoIfNot(IsJSReceiver(maybe_receiver), &out);
Node* const receiver = maybe_receiver;
......@@ -711,17 +711,17 @@ TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
{
Label next(this);
GotoUnless(IsUndefined(new_target), &next);
GotoIfNot(IsUndefined(new_target), &next);
var_new_target.Bind(regexp_function);
GotoUnless(pattern_is_regexp, &next);
GotoUnless(IsUndefined(flags), &next);
GotoIfNot(pattern_is_regexp, &next);
GotoIfNot(IsUndefined(flags), &next);
Callable getproperty_callable = CodeFactory::GetProperty(isolate);
Node* const name = HeapConstant(isolate->factory()->constructor_string());
Node* const value = CallStub(getproperty_callable, context, pattern, name);
GotoUnless(WordEqual(value, regexp_function), &next);
GotoIfNot(WordEqual(value, regexp_function), &next);
Return(pattern);
Bind(&next);
......@@ -743,7 +743,7 @@ TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
{
Label inner_next(this);
GotoUnless(IsUndefined(flags), &inner_next);
GotoIfNot(IsUndefined(flags), &inner_next);
Node* const value = FlagsGetter(context, pattern, true);
var_flags.Bind(value);
......@@ -768,7 +768,7 @@ TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
{
Label inner_next(this);
GotoUnless(IsUndefined(flags), &inner_next);
GotoIfNot(IsUndefined(flags), &inner_next);
Node* const name = HeapConstant(isolate->factory()->flags_string());
Node* const value =
......@@ -840,7 +840,7 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
Label next(this);
GotoIf(TaggedIsSmi(maybe_pattern), &next);
GotoUnless(HasInstanceType(maybe_pattern, JS_REGEXP_TYPE), &next);
GotoIfNot(HasInstanceType(maybe_pattern, JS_REGEXP_TYPE), &next);
Node* const pattern = maybe_pattern;
......@@ -1331,17 +1331,17 @@ Node* RegExpBuiltinsAssembler::AdvanceStringIndex(Node* const string,
Bind(&if_isunicode);
{
Node* const string_length = LoadStringLength(string);
GotoUnless(SmiLessThan(index_plus_one, string_length), &out);
GotoIfNot(SmiLessThan(index_plus_one, string_length), &out);
Node* const lead = StringCharCodeAt(string, index);
GotoUnless(Word32Equal(Word32And(lead, Int32Constant(0xFC00)),
Int32Constant(0xD800)),
&out);
GotoIfNot(Word32Equal(Word32And(lead, Int32Constant(0xFC00)),
Int32Constant(0xD800)),
&out);
Node* const trail = StringCharCodeAt(string, index_plus_one);
GotoUnless(Word32Equal(Word32And(trail, Int32Constant(0xFC00)),
Int32Constant(0xDC00)),
&out);
GotoIfNot(Word32Equal(Word32And(trail, Int32Constant(0xFC00)),
Int32Constant(0xDC00)),
&out);
// At a surrogate pair, return index + 2.
Node* const index_plus_two = SmiAdd(index, SmiConstant(2));
......@@ -1610,7 +1610,7 @@ void RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(Node* const context,
Bind(&if_didnotmatch);
{
// Return null if there were no matches, otherwise just exit the loop.
GotoUnless(IntPtrEqual(array.length(), int_zero), &out);
GotoIfNot(IntPtrEqual(array.length(), int_zero), &out);
Return(null);
}
......@@ -1625,7 +1625,7 @@ void RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(Node* const context,
// Advance last index if the match is the empty string.
Node* const match_length = LoadStringLength(match);
GotoUnless(SmiEqual(match_length, smi_zero), &loop);
GotoIfNot(SmiEqual(match_length, smi_zero), &loop);
Node* last_index = LoadLastIndex(context, regexp, is_fastpath);
......@@ -1747,7 +1747,7 @@ void RegExpBuiltinsAssembler::RegExpPrototypeSearchBodySlow(
// Return -1 if no match was found.
{
Label next(this);
GotoUnless(WordEqual(exec_result, NullConstant()), &next);
GotoIfNot(WordEqual(exec_result, NullConstant()), &next);
Return(SmiConstant(-1));
Bind(&next);
}
......@@ -1932,8 +1932,8 @@ void RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(Node* const context,
{
Label next(this);
GotoUnless(SmiEqual(match_to, next_search_from), &next);
GotoUnless(SmiEqual(match_to, last_matched_until), &next);
GotoIfNot(SmiEqual(match_to, next_search_from), &next);
GotoIfNot(SmiEqual(match_to, last_matched_until), &next);
Node* const is_unicode = FastFlagGetter(regexp, JSRegExp::kUnicode);
Node* const new_next_search_from =
......@@ -2072,7 +2072,7 @@ TF_BUILTIN(RegExpSplit, RegExpBuiltinsAssembler) {
{
Node* const limit = ToUint32(context, maybe_limit);
GotoUnless(TaggedIsSmi(limit), &if_limitissmimax);
GotoIfNot(TaggedIsSmi(limit), &if_limitissmimax);
var_limit.Bind(limit);
Goto(&limit_done);
......@@ -2208,7 +2208,7 @@ Node* RegExpBuiltinsAssembler::ReplaceGlobalCallableFastPath(
Bind(&loop);
{
Node* const i = var_i.value();
GotoUnless(IntPtrLessThan(i, end), &create_result);
GotoIfNot(IntPtrLessThan(i, end), &create_result);
Node* const elem = LoadFixedArrayElement(res_elems, i);
......@@ -2460,7 +2460,7 @@ TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) {
isolate()->factory()->LookupSingleCharacterStringFromCode('$'));
Node* const dollar_ix = CallStub(indexof_callable, context, replace_string,
dollar_string, SmiConstant(0));
GotoUnless(SmiEqual(dollar_ix, SmiConstant(-1)), &runtime);
GotoIfNot(SmiEqual(dollar_ix, SmiConstant(-1)), &runtime);
Return(
ReplaceSimpleStringFastPath(context, regexp, string, replace_string));
......
......@@ -696,7 +696,7 @@ TF_BUILTIN(StringPrototypeCharAt, CodeStubAssembler) {
Label return_emptystring(this, Label::kDeferred);
position =
ToInteger(context, position, CodeStubAssembler::kTruncateMinusZero);
GotoUnless(TaggedIsSmi(position), &return_emptystring);
GotoIfNot(TaggedIsSmi(position), &return_emptystring);
// Determine the actual length of the {receiver} String.
Node* receiver_length = LoadObjectField(receiver, String::kLengthOffset);
......@@ -735,7 +735,7 @@ TF_BUILTIN(StringPrototypeCharCodeAt, CodeStubAssembler) {
Label return_nan(this, Label::kDeferred);
position =
ToInteger(context, position, CodeStubAssembler::kTruncateMinusZero);
GotoUnless(TaggedIsSmi(position), &return_nan);
GotoIfNot(TaggedIsSmi(position), &return_nan);
// Determine the actual length of the {receiver} String.
Node* receiver_length = LoadObjectField(receiver, String::kLengthOffset);
......@@ -873,9 +873,9 @@ void StringBuiltinsAssembler::StringIndexOf(
GotoIf(IntPtrEqual(IntPtrConstant(0), needle_length), &zero_length_needle);
// Check that the needle fits in the start position.
GotoUnless(IntPtrLessThanOrEqual(needle_length,
IntPtrSub(string_length, start_position)),
&return_minus_1);
GotoIfNot(IntPtrLessThanOrEqual(needle_length,
IntPtrSub(string_length, start_position)),
&return_minus_1);
// Only support one-byte strings on the fast path.
BranchIfSimpleOneByteStringInstanceType(instance_type, &check_search_string,
&call_runtime_unchecked);
......@@ -976,7 +976,7 @@ TF_BUILTIN(StringPrototypeIndexOf, StringBuiltinsAssembler) {
Comment("2 Argument case");
search_string.Bind(arguments.AtIndex(0));
position.Bind(arguments.AtIndex(1));
GotoUnless(TaggedIsSmi(position.value()), &call_runtime);
GotoIfNot(TaggedIsSmi(position.value()), &call_runtime);
Goto(&fast_path);
}
......@@ -988,10 +988,10 @@ TF_BUILTIN(StringPrototypeIndexOf, StringBuiltinsAssembler) {
GotoIf(TaggedIsSmi(needle), &call_runtime);
Node* instance_type = LoadInstanceType(receiver);
GotoUnless(IsStringInstanceType(instance_type), &call_runtime);
GotoIfNot(IsStringInstanceType(instance_type), &call_runtime);
Node* needle_instance_type = LoadInstanceType(needle);
GotoUnless(IsStringInstanceType(needle_instance_type), &call_runtime);
GotoIfNot(IsStringInstanceType(needle_instance_type), &call_runtime);
StringIndexOf(
receiver, instance_type, needle, needle_instance_type, position.value(),
......@@ -1133,7 +1133,7 @@ void StringBuiltinsAssembler::MaybeCallFunctionAtSymbol(
{
Label next(this);
GotoUnless(IsStringInstanceType(LoadMapInstanceType(object_map)), &next);
GotoIfNot(IsStringInstanceType(LoadMapInstanceType(object_map)), &next);
Node* const native_context = LoadNativeContext(context);
Node* const initial_proto_initial_map = LoadContextElement(
......@@ -1229,16 +1229,16 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
{
Label next(this);
GotoUnless(SmiEqual(search_length, SmiConstant(1)), &next);
GotoUnless(SmiGreaterThan(subject_length, SmiConstant(0xFF)), &next);
GotoIfNot(SmiEqual(search_length, SmiConstant(1)), &next);
GotoIfNot(SmiGreaterThan(subject_length, SmiConstant(0xFF)), &next);
GotoIf(TaggedIsSmi(replace), &next);
GotoUnless(IsString(replace), &next);
GotoIfNot(IsString(replace), &next);
Node* const dollar_string = HeapConstant(
isolate()->factory()->LookupSingleCharacterStringFromCode('$'));
Node* const dollar_ix =
CallStub(indexof_callable, context, replace, dollar_string, smi_zero);
GotoUnless(SmiIsNegative(dollar_ix), &next);
GotoIfNot(SmiIsNegative(dollar_ix), &next);
// Searching by traversing a cons string tree and replace with cons of
// slices works only when the replaced string is a single character, being
......@@ -1263,7 +1263,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
{
Label next(this), return_subject(this);
GotoUnless(SmiIsNegative(match_start_index), &next);
GotoIfNot(SmiIsNegative(match_start_index), &next);
// The spec requires to perform ToString(replace) if the {replace} is not
// callable even if we are going to exit here.
......@@ -1398,7 +1398,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
// Shortcut for {limit} == 0.
{
Label next(this);
GotoUnless(SmiEqual(limit_number, smi_zero), &next);
GotoIfNot(SmiEqual(limit_number, smi_zero), &next);
const ElementsKind kind = FAST_ELEMENTS;
Node* const native_context = LoadNativeContext(context);
......@@ -1417,7 +1417,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
// be an array of size 1 containing the entire string.
{
Label next(this);
GotoUnless(IsUndefined(separator), &next);
GotoIfNot(IsUndefined(separator), &next);
const ElementsKind kind = FAST_ELEMENTS;
Node* const native_context = LoadNativeContext(context);
......@@ -1438,7 +1438,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
// If the separator string is empty then return the elements in the subject.
{
Label next(this);
GotoUnless(SmiEqual(LoadStringLength(separator_string), smi_zero), &next);
GotoIfNot(SmiEqual(LoadStringLength(separator_string), smi_zero), &next);
Node* const result = CallRuntime(Runtime::kStringToArray, context,
subject_string, limit_number);
......@@ -1535,7 +1535,7 @@ TF_BUILTIN(StringPrototypeSubstr, CodeStubAssembler) {
Node* const minimal_length = SmiSub(string_length, var_start.value());
var_length.Bind(SmiMin(positive_length, minimal_length));
GotoUnless(SmiLessThanOrEqual(var_length.value(), zero), &out);
GotoIfNot(SmiLessThanOrEqual(var_length.value(), zero), &out);
Return(EmptyStringConstant());
}
......@@ -1559,7 +1559,7 @@ TF_BUILTIN(StringPrototypeSubstr, CodeStubAssembler) {
Bind(&if_ispositive);
{
var_length.Bind(SmiSub(string_length, var_start.value()));
GotoUnless(SmiLessThanOrEqual(var_length.value(), zero), &out);
GotoIfNot(SmiLessThanOrEqual(var_length.value(), zero), &out);
Return(EmptyStringConstant());
}
}
......@@ -1799,7 +1799,7 @@ compiler::Node* StringBuiltinsAssembler::LoadSurrogatePairAt(
&return_result);
Node* next_index = SmiAdd(index, SmiConstant(Smi::FromInt(1)));
GotoUnless(SmiLessThan(next_index, length), &return_result);
GotoIfNot(SmiLessThan(next_index, length), &return_result);
var_trail.Bind(StringCharCodeAt(string, next_index));
Branch(Word32Equal(Word32And(var_trail.value(), Int32Constant(0xFC00)),
Int32Constant(0xDC00)),
......@@ -1861,9 +1861,9 @@ TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) {
Node* context = Parameter(3);
GotoIf(TaggedIsSmi(iterator), &throw_bad_receiver);
GotoUnless(Word32Equal(LoadInstanceType(iterator),
Int32Constant(JS_STRING_ITERATOR_TYPE)),
&throw_bad_receiver);
GotoIfNot(Word32Equal(LoadInstanceType(iterator),
Int32Constant(JS_STRING_ITERATOR_TYPE)),
&throw_bad_receiver);
Node* string = LoadObjectField(iterator, JSStringIterator::kStringOffset);
Node* position =
......
......@@ -35,7 +35,7 @@ void Generate_TypedArrayPrototypeGetter(compiler::CodeAssemblerState* state,
Label if_receiverisincompatible(&assembler, Label::kDeferred);
assembler.GotoIf(assembler.TaggedIsSmi(receiver), &if_receiverisincompatible);
Node* receiver_instance_type = assembler.LoadInstanceType(receiver);
assembler.GotoUnless(
assembler.GotoIfNot(
assembler.Word32Equal(receiver_instance_type,
assembler.Int32Constant(JS_TYPED_ARRAY_TYPE)),
&if_receiverisincompatible);
......
This diff is collapsed.
This diff is collapsed.
......@@ -651,7 +651,7 @@ void CodeAssembler::GotoIf(Node* condition, Label* true_label) {
Bind(&false_label);
}
void CodeAssembler::GotoUnless(Node* condition, Label* false_label) {
void CodeAssembler::GotoIfNot(Node* condition, Label* false_label) {
Label true_label(this);
Branch(condition, &true_label, false_label);
Bind(&true_label);
......
......@@ -239,7 +239,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void Bind(Label* label);
void Goto(Label* label);
void GotoIf(Node* condition, Label* true_label);
void GotoUnless(Node* condition, Label* false_label);
void GotoIfNot(Node* condition, Label* false_label);
void Branch(Node* condition, Label* true_label, Label* false_label);
void Switch(Node* index, Label* default_label, const int32_t* case_values,
......
......@@ -213,7 +213,7 @@ void FastAccessorAssembler::CheckIsJSObjectOrJump(ValueId value_id,
&is_jsobject);
// JSApiObject?.
assembler_->GotoUnless(
assembler_->GotoIfNot(
assembler_->Word32Equal(instance_type, assembler_->Int32Constant(
Internals::kJSApiObjectType)),
FromId(label_id));
......
This diff is collapsed.
......@@ -273,7 +273,7 @@ void KeyedStoreGenericAssembler::StoreElementWithCapacity(
// can always be stored.
{
Label non_smi_value(this);
GotoUnless(TaggedIsSmi(value), &non_smi_value);
GotoIfNot(TaggedIsSmi(value), &non_smi_value);
// If we're about to introduce holes, ensure holey elements.
if (update_length == kBumpLengthWithGap) {
TryChangeToHoleyMapMulti(receiver, receiver_map, elements_kind, context,
......@@ -848,7 +848,7 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore(
Node* setter_map = LoadMap(setter);
// FunctionTemplateInfo setters are not supported yet.
GotoIf(IsFunctionTemplateInfoMap(setter_map), slow);
GotoUnless(IsCallableMap(setter_map), &not_callable);
GotoIfNot(IsCallableMap(setter_map), &not_callable);
Callable callable = CodeFactory::Call(isolate());
CallJS(callable, p->context, setter, receiver, p->value);
......
......@@ -581,7 +581,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Node* feedback_element = LoadFixedArrayElement(feedback_vector, slot_id);
Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element);
Node* is_monomorphic = WordEqual(function, feedback_value);
GotoUnless(is_monomorphic, &extra_checks);
GotoIfNot(is_monomorphic, &extra_checks);
// The compare above could have been a SMI/SMI comparison. Guard against
// this convincing us that we have a monomorphic JSFunction.
......@@ -616,14 +616,14 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
GotoIf(is_megamorphic, &call);
Comment("check if it is an allocation site");
GotoUnless(IsAllocationSiteMap(LoadMap(feedback_element)),
&check_initialized);
GotoIfNot(IsAllocationSiteMap(LoadMap(feedback_element)),
&check_initialized);
// If it is not the Array() function, mark megamorphic.
Node* context_slot = LoadContextElement(LoadNativeContext(context),
Context::ARRAY_FUNCTION_INDEX);
Node* is_array_function = WordEqual(context_slot, function);
GotoUnless(is_array_function, &mark_megamorphic);
GotoIfNot(is_array_function, &mark_megamorphic);
// It is a monomorphic Array function. Increment the call count.
IncrementCallCount(feedback_vector, slot_id);
......@@ -645,7 +645,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Node* is_uninitialized = WordEqual(
feedback_element,
HeapConstant(FeedbackVector::UninitializedSentinel(isolate())));
GotoUnless(is_uninitialized, &mark_megamorphic);
GotoIfNot(is_uninitialized, &mark_megamorphic);
Comment("handle_unitinitialized");
// If it is not a JSFunction mark it as megamorphic.
......@@ -656,7 +656,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Node* instance_type = LoadInstanceType(function);
Node* is_js_function =
Word32Equal(instance_type, Int32Constant(JS_FUNCTION_TYPE));
GotoUnless(is_js_function, &mark_megamorphic);
GotoIfNot(is_js_function, &mark_megamorphic);
// Check if it is the Array() function.
Node* context_slot = LoadContextElement(LoadNativeContext(context),
......@@ -669,7 +669,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
LoadObjectField(function, JSFunction::kContextOffset));
Node* is_same_native_context =
WordEqual(native_context, LoadNativeContext(context));
GotoUnless(is_same_native_context, &mark_megamorphic);
GotoIfNot(is_same_native_context, &mark_megamorphic);
CreateWeakCellInFeedbackVector(feedback_vector, SmiTag(slot_id),
function);
......@@ -770,7 +770,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Node* instance_type = LoadInstanceType(constructor);
Node* is_js_function =
Word32Equal(instance_type, Int32Constant(JS_FUNCTION_TYPE));
GotoUnless(is_js_function, &call_construct);
GotoIfNot(is_js_function, &call_construct);
// Check if it is a monomorphic constructor.
Node* feedback_element = LoadFixedArrayElement(feedback_vector, slot_id);
......@@ -807,7 +807,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Comment("check if weak cell");
Node* is_weak_cell = WordEqual(LoadMap(feedback_element),
LoadRoot(Heap::kWeakCellMapRootIndex));
GotoUnless(is_weak_cell, &check_allocation_site);
GotoIfNot(is_weak_cell, &check_allocation_site);
// If the weak cell is cleared, we have a new chance to become
// monomorphic.
......@@ -821,13 +821,13 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Node* is_allocation_site =
WordEqual(LoadObjectField(feedback_element, 0),
LoadRoot(Heap::kAllocationSiteMapRootIndex));
GotoUnless(is_allocation_site, &check_initialized);
GotoIfNot(is_allocation_site, &check_initialized);
// Make sure the function is the Array() function.
Node* context_slot = LoadContextElement(LoadNativeContext(context),
Context::ARRAY_FUNCTION_INDEX);
Node* is_array_function = WordEqual(context_slot, constructor);
GotoUnless(is_array_function, &mark_megamorphic);
GotoIfNot(is_array_function, &mark_megamorphic);
allocation_feedback.Bind(feedback_element);
Goto(&call_construct_function);
......@@ -1372,7 +1372,7 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
Bind(&loop);
{
Node* index = var_index.value();
GotoUnless(UintPtrLessThan(index, register_count), &done_loop);
GotoIfNot(UintPtrLessThan(index, register_count), &done_loop);
Node* reg_index = IntPtrSub(IntPtrConstant(Register(0).ToOperand()), index);
Node* value = LoadRegister(reg_index);
......@@ -1405,7 +1405,7 @@ Node* InterpreterAssembler::ImportRegisterFile(Node* array) {
Bind(&loop);
{
Node* index = var_index.value();
GotoUnless(UintPtrLessThan(index, register_count), &done_loop);
GotoIfNot(UintPtrLessThan(index, register_count), &done_loop);
Node* value = LoadFixedArrayElement(array, index);
......
......@@ -281,7 +281,7 @@ Node* IntrinsicsHelper::Call(Node* args_reg, Node* arg_count, Node* context) {
if (FLAG_debug_code) {
InterpreterAssembler::Label arg_count_positive(assembler_);
Node* comparison = __ Int32LessThan(target_args_count, __ Int32Constant(0));
__ GotoUnless(comparison, &arg_count_positive);
__ GotoIfNot(comparison, &arg_count_positive);
__ Abort(kWrongArgumentCountForInvokeIntrinsic);
__ Goto(&arg_count_positive);
__ Bind(&arg_count_positive);
......
......@@ -1145,7 +1145,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
lhs_is_not_string(assembler), gather_rhs_type(assembler),
update_feedback(assembler);
__ GotoUnless(__ TaggedIsSmi(lhs), &lhs_is_not_smi);
__ GotoIfNot(__ TaggedIsSmi(lhs), &lhs_is_not_smi);
var_type_feedback.Bind(
__ SmiConstant(CompareOperationFeedback::kSignedSmall));
......@@ -1154,7 +1154,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&lhs_is_not_smi);
{
Node* lhs_map = __ LoadMap(lhs);
__ GotoUnless(__ IsHeapNumberMap(lhs_map), &lhs_is_not_number);
__ GotoIfNot(__ IsHeapNumberMap(lhs_map), &lhs_is_not_number);
var_type_feedback.Bind(__ SmiConstant(CompareOperationFeedback::kNumber));
__ Goto(&gather_rhs_type);
......@@ -1164,7 +1164,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
Node* lhs_instance_type = __ LoadInstanceType(lhs);
if (Token::IsOrderedRelationalCompareOp(compare_op)) {
Label lhs_is_not_oddball(assembler);
__ GotoUnless(
__ GotoIfNot(
__ Word32Equal(lhs_instance_type, __ Int32Constant(ODDBALL_TYPE)),
&lhs_is_not_oddball);
......@@ -1176,8 +1176,8 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
}
Label lhs_is_not_string(assembler);
__ GotoUnless(__ IsStringInstanceType(lhs_instance_type),
&lhs_is_not_string);
__ GotoIfNot(__ IsStringInstanceType(lhs_instance_type),
&lhs_is_not_string);
if (Token::IsOrderedRelationalCompareOp(compare_op)) {
var_type_feedback.Bind(
......@@ -1211,7 +1211,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
{
Label rhs_is_not_smi(assembler), rhs_is_not_number(assembler);
__ GotoUnless(__ TaggedIsSmi(rhs), &rhs_is_not_smi);
__ GotoIfNot(__ TaggedIsSmi(rhs), &rhs_is_not_smi);
var_type_feedback.Bind(
__ SmiOr(var_type_feedback.value(),
......@@ -1221,7 +1221,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
__ Bind(&rhs_is_not_smi);
{
Node* rhs_map = __ LoadMap(rhs);
__ GotoUnless(__ IsHeapNumberMap(rhs_map), &rhs_is_not_number);
__ GotoIfNot(__ IsHeapNumberMap(rhs_map), &rhs_is_not_number);
var_type_feedback.Bind(
__ SmiOr(var_type_feedback.value(),
......@@ -1233,9 +1233,9 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
Node* rhs_instance_type = __ LoadInstanceType(rhs);
if (Token::IsOrderedRelationalCompareOp(compare_op)) {
Label rhs_is_not_oddball(assembler);
__ GotoUnless(__ Word32Equal(rhs_instance_type,
__ Int32Constant(ODDBALL_TYPE)),
&rhs_is_not_oddball);
__ GotoIfNot(__ Word32Equal(rhs_instance_type,
__ Int32Constant(ODDBALL_TYPE)),
&rhs_is_not_oddball);
var_type_feedback.Bind(__ SmiOr(
var_type_feedback.value(),
......@@ -1246,8 +1246,8 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
}
Label rhs_is_not_string(assembler);
__ GotoUnless(__ IsStringInstanceType(rhs_instance_type),
&rhs_is_not_string);
__ GotoIfNot(__ IsStringInstanceType(rhs_instance_type),
&rhs_is_not_string);
if (Token::IsOrderedRelationalCompareOp(compare_op)) {
var_type_feedback.Bind(
......@@ -2888,8 +2888,8 @@ void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
Node* context = __ GetContext();
Label call_runtime(assembler, Label::kDeferred);
__ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags),
&call_runtime);
__ GotoIfNot(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags),
&call_runtime);
ConstructorBuiltinsAssembler constructor_assembler(assembler->state());
Node* vector_index = __ BytecodeOperandIdx(1);
vector_index = __ SmiTag(vector_index);
......
......@@ -205,16 +205,16 @@ TEST(TryToName) {
&if_bailout);
m.Bind(&if_keyisindex);
m.GotoUnless(m.WordEqual(expected_result,
m.SmiConstant(Smi::FromInt(kKeyIsIndex))),
&failed);
m.GotoIfNot(m.WordEqual(expected_result,
m.SmiConstant(Smi::FromInt(kKeyIsIndex))),
&failed);
m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_index.value()),
&passed, &failed);
m.Bind(&if_keyisunique);
m.GotoUnless(m.WordEqual(expected_result,
m.SmiConstant(Smi::FromInt(kKeyIsUnique))),
&failed);
m.GotoIfNot(m.WordEqual(expected_result,
m.SmiConstant(Smi::FromInt(kKeyIsUnique))),
&failed);
m.Branch(m.WordEqual(expected_arg, var_unique.value()), &passed, &failed);
}
......@@ -389,7 +389,7 @@ void TestNameDictionaryLookup() {
m.NameDictionaryLookup<Dictionary>(dictionary, unique_name, &if_found,
&var_name_index, &if_not_found);
m.Bind(&if_found);
m.GotoUnless(
m.GotoIfNot(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))),
&failed);
m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_name_index.value()),
......@@ -496,7 +496,7 @@ void TestNumberDictionaryLookup() {
m.NumberDictionaryLookup<Dictionary>(dictionary, key, &if_found, &var_entry,
&if_not_found);
m.Bind(&if_found);
m.GotoUnless(
m.GotoIfNot(
m.WordEqual(expected_result, m.SmiConstant(Smi::FromInt(kFound))),
&failed);
m.Branch(m.WordEqual(m.SmiUntag(expected_arg), var_entry.value()), &passed,
......
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