Commit bf4b542a authored by Marja Hölttä's avatar Marja Hölttä Committed by V8 LUCI CQ

[cleanup] Make builtins Wshadow compatible

Bug: v8:12244, v8:12245
Change-Id: Icd54ac767542ec2344c34b8dde674b41079180af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3181525Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77036}
parent c5c5b6cb
...@@ -369,8 +369,8 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) { ...@@ -369,8 +369,8 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
Increment(&arg_index); Increment(&arg_index);
// The runtime SetProperty call could have converted the array to dictionary // The runtime SetProperty call could have converted the array to dictionary
// mode, which must be detected to abort the fast-path. // mode, which must be detected to abort the fast-path.
TNode<Int32T> kind = LoadElementsKind(array_receiver); TNode<Int32T> elements_kind = LoadElementsKind(array_receiver);
GotoIf(Word32Equal(kind, Int32Constant(DICTIONARY_ELEMENTS)), GotoIf(Word32Equal(elements_kind, Int32Constant(DICTIONARY_ELEMENTS)),
&default_label); &default_label);
GotoIfNotNumber(arg, &object_push); GotoIfNotNumber(arg, &object_push);
...@@ -413,8 +413,8 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) { ...@@ -413,8 +413,8 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
Increment(&arg_index); Increment(&arg_index);
// The runtime SetProperty call could have converted the array to dictionary // The runtime SetProperty call could have converted the array to dictionary
// mode, which must be detected to abort the fast-path. // mode, which must be detected to abort the fast-path.
TNode<Int32T> kind = LoadElementsKind(array_receiver); TNode<Int32T> elements_kind = LoadElementsKind(array_receiver);
GotoIf(Word32Equal(kind, Int32Constant(DICTIONARY_ELEMENTS)), GotoIf(Word32Equal(elements_kind, Int32Constant(DICTIONARY_ELEMENTS)),
&default_label); &default_label);
Goto(&object_push); Goto(&object_push);
} }
...@@ -806,16 +806,16 @@ void ArrayIncludesIndexofAssembler::GenerateSmiOrObject( ...@@ -806,16 +806,16 @@ void ArrayIncludesIndexofAssembler::GenerateSmiOrObject(
BIND(&not_nan_loop); BIND(&not_nan_loop);
{ {
Label continue_loop(this), not_smi(this); Label continue_loop(this), element_k_not_smi(this);
GotoIfNot(UintPtrLessThan(index_var.value(), array_length_untagged), GotoIfNot(UintPtrLessThan(index_var.value(), array_length_untagged),
&return_not_found); &return_not_found);
TNode<Object> element_k = TNode<Object> element_k =
UnsafeLoadFixedArrayElement(elements, index_var.value()); UnsafeLoadFixedArrayElement(elements, index_var.value());
GotoIfNot(TaggedIsSmi(element_k), &not_smi); GotoIfNot(TaggedIsSmi(element_k), &element_k_not_smi);
Branch(Float64Equal(search_num.value(), SmiToFloat64(CAST(element_k))), Branch(Float64Equal(search_num.value(), SmiToFloat64(CAST(element_k))),
&return_found, &continue_loop); &return_found, &continue_loop);
BIND(&not_smi); BIND(&element_k_not_smi);
GotoIfNot(IsHeapNumber(CAST(element_k)), &continue_loop); GotoIfNot(IsHeapNumber(CAST(element_k)), &continue_loop);
Branch(Float64Equal(search_num.value(), Branch(Float64Equal(search_num.value(),
LoadHeapNumberValue(CAST(element_k))), LoadHeapNumberValue(CAST(element_k))),
......
...@@ -1338,8 +1338,8 @@ Object Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species, ...@@ -1338,8 +1338,8 @@ Object Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species,
if (length == 0) break; if (length == 0) break;
FixedDoubleArray elements = FixedDoubleArray elements =
FixedDoubleArray::cast(array.elements()); FixedDoubleArray::cast(array.elements());
for (uint32_t i = 0; i < length; i++) { for (uint32_t k = 0; k < length; k++) {
if (elements.is_the_hole(i)) { if (elements.is_the_hole(k)) {
// TODO(jkummerow/verwaest): We could be a bit more clever // TODO(jkummerow/verwaest): We could be a bit more clever
// here: Check if there are no elements/getters on the // here: Check if there are no elements/getters on the
// prototype chain, and if so, allow creation of a holey // prototype chain, and if so, allow creation of a holey
...@@ -1348,7 +1348,7 @@ Object Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species, ...@@ -1348,7 +1348,7 @@ Object Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species,
failure = true; failure = true;
break; break;
} }
double double_value = elements.get_scalar(i); double double_value = elements.get_scalar(k);
double_storage->set(j, double_value); double_storage->set(j, double_value);
j++; j++;
} }
...@@ -1358,8 +1358,8 @@ Object Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species, ...@@ -1358,8 +1358,8 @@ Object Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species,
case PACKED_SMI_ELEMENTS: { case PACKED_SMI_ELEMENTS: {
Object the_hole = ReadOnlyRoots(isolate).the_hole_value(); Object the_hole = ReadOnlyRoots(isolate).the_hole_value();
FixedArray elements(FixedArray::cast(array.elements())); FixedArray elements(FixedArray::cast(array.elements()));
for (uint32_t i = 0; i < length; i++) { for (uint32_t k = 0; k < length; k++) {
Object element = elements.get(i); Object element = elements.get(k);
if (element == the_hole) { if (element == the_hole) {
failure = true; failure = true;
break; break;
......
...@@ -228,16 +228,16 @@ AsyncFromSyncBuiltinsAssembler::LoadIteratorResult( ...@@ -228,16 +228,16 @@ AsyncFromSyncBuiltinsAssembler::LoadIteratorResult(
// Let nextDone be IteratorComplete(nextResult). // Let nextDone be IteratorComplete(nextResult).
// IfAbruptRejectPromise(nextDone, promiseCapability). // IfAbruptRejectPromise(nextDone, promiseCapability).
const TNode<Object> done = const TNode<Object> iter_result_done =
GetProperty(context, iter_result, factory()->done_string()); GetProperty(context, iter_result, factory()->done_string());
// Let nextValue be IteratorValue(nextResult). // Let nextValue be IteratorValue(nextResult).
// IfAbruptRejectPromise(nextValue, promiseCapability). // IfAbruptRejectPromise(nextValue, promiseCapability).
const TNode<Object> value = const TNode<Object> iter_result_value =
GetProperty(context, iter_result, factory()->value_string()); GetProperty(context, iter_result, factory()->value_string());
var_value = value; var_value = iter_result_value;
var_done = done; var_done = iter_result_done;
Goto(&merge); Goto(&merge);
} }
......
...@@ -1481,17 +1481,17 @@ CollectionsBuiltinsAssembler::Transition( ...@@ -1481,17 +1481,17 @@ CollectionsBuiltinsAssembler::Transition(
Goto(&loop); Goto(&loop);
BIND(&loop); BIND(&loop);
{ {
TNode<TableType> table = var_table.value(); TNode<TableType> current_table = var_table.value();
TNode<IntPtrT> index = var_index.value(); TNode<IntPtrT> current_index = var_index.value();
TNode<Object> next_table = TNode<Object> next_table =
LoadObjectField(table, TableType::NextTableOffset()); LoadObjectField(current_table, TableType::NextTableOffset());
GotoIf(TaggedIsSmi(next_table), &done_loop); GotoIf(TaggedIsSmi(next_table), &done_loop);
var_table = CAST(next_table); var_table = CAST(next_table);
var_index = SmiUntag( var_index = SmiUntag(CAST(CallBuiltin(Builtin::kOrderedHashTableHealIndex,
CAST(CallBuiltin(Builtin::kOrderedHashTableHealIndex, NoContextConstant(), current_table,
NoContextConstant(), table, SmiTag(index)))); SmiTag(current_index))));
Goto(&loop); Goto(&loop);
} }
BIND(&done_loop); BIND(&done_loop);
......
...@@ -315,31 +315,33 @@ BUILTIN(DatePrototypeSetFullYear) { ...@@ -315,31 +315,33 @@ BUILTIN(DatePrototypeSetFullYear) {
Handle<Object> year = args.atOrUndefined(isolate, 1); Handle<Object> year = args.atOrUndefined(isolate, 1);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, year, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, year,
Object::ToNumber(isolate, year)); Object::ToNumber(isolate, year));
double y = year->Number(), m = 0.0, dt = 1.0; double year_double = year->Number(), month_double = 0.0, day_double = 1.0;
int time_within_day = 0; int time_within_day = 0;
if (!std::isnan(date->value().Number())) { if (!std::isnan(date->value().Number())) {
int64_t const time_ms = static_cast<int64_t>(date->value().Number()); int64_t const time_ms = static_cast<int64_t>(date->value().Number());
int64_t local_time_ms = isolate->date_cache()->ToLocal(time_ms); int64_t local_time_ms = isolate->date_cache()->ToLocal(time_ms);
int const days = isolate->date_cache()->DaysFromTime(local_time_ms); int const days = isolate->date_cache()->DaysFromTime(local_time_ms);
time_within_day = isolate->date_cache()->TimeInDay(local_time_ms, days); time_within_day = isolate->date_cache()->TimeInDay(local_time_ms, days);
int year, month, day; int year_int, month_int, day_int;
isolate->date_cache()->YearMonthDayFromDays(days, &year, &month, &day); isolate->date_cache()->YearMonthDayFromDays(days, &year_int, &month_int,
m = month; &day_int);
dt = day; month_double = month_int;
day_double = day_int;
} }
if (argc >= 2) { if (argc >= 2) {
Handle<Object> month = args.at(2); Handle<Object> month = args.at(2);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, month, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, month,
Object::ToNumber(isolate, month)); Object::ToNumber(isolate, month));
m = month->Number(); month_double = month->Number();
if (argc >= 3) { if (argc >= 3) {
Handle<Object> date = args.at(3); Handle<Object> day = args.at(3);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, date, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, day,
Object::ToNumber(isolate, date)); Object::ToNumber(isolate, day));
dt = date->Number(); day_double = day->Number();
} }
} }
double time_val = MakeDate(MakeDay(y, m, dt), time_within_day); double time_val =
MakeDate(MakeDay(year_double, month_double, day_double), time_within_day);
return SetLocalDateValue(isolate, date, time_val); return SetLocalDateValue(isolate, date, time_val);
} }
...@@ -534,30 +536,32 @@ BUILTIN(DatePrototypeSetUTCFullYear) { ...@@ -534,30 +536,32 @@ BUILTIN(DatePrototypeSetUTCFullYear) {
Handle<Object> year = args.atOrUndefined(isolate, 1); Handle<Object> year = args.atOrUndefined(isolate, 1);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, year, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, year,
Object::ToNumber(isolate, year)); Object::ToNumber(isolate, year));
double y = year->Number(), m = 0.0, dt = 1.0; double year_double = year->Number(), month_double = 0.0, day_double = 1.0;
int time_within_day = 0; int time_within_day = 0;
if (!std::isnan(date->value().Number())) { if (!std::isnan(date->value().Number())) {
int64_t const time_ms = static_cast<int64_t>(date->value().Number()); int64_t const time_ms = static_cast<int64_t>(date->value().Number());
int const days = isolate->date_cache()->DaysFromTime(time_ms); int const days = isolate->date_cache()->DaysFromTime(time_ms);
time_within_day = isolate->date_cache()->TimeInDay(time_ms, days); time_within_day = isolate->date_cache()->TimeInDay(time_ms, days);
int year, month, day; int year_int, month_int, day_int;
isolate->date_cache()->YearMonthDayFromDays(days, &year, &month, &day); isolate->date_cache()->YearMonthDayFromDays(days, &year_int, &month_int,
m = month; &day_int);
dt = day; month_double = month_int;
day_double = day_int;
} }
if (argc >= 2) { if (argc >= 2) {
Handle<Object> month = args.at(2); Handle<Object> month = args.at(2);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, month, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, month,
Object::ToNumber(isolate, month)); Object::ToNumber(isolate, month));
m = month->Number(); month_double = month->Number();
if (argc >= 3) { if (argc >= 3) {
Handle<Object> date = args.at(3); Handle<Object> day = args.at(3);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, date, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, day,
Object::ToNumber(isolate, date)); Object::ToNumber(isolate, day));
dt = date->Number(); day_double = day->Number();
} }
} }
double const time_val = MakeDate(MakeDay(y, m, dt), time_within_day); double const time_val =
MakeDate(MakeDay(year_double, month_double, day_double), time_within_day);
return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); return *JSDate::SetValue(date, DateCache::TimeClip(time_val));
} }
...@@ -872,11 +876,11 @@ BUILTIN(DatePrototypeSetYear) { ...@@ -872,11 +876,11 @@ BUILTIN(DatePrototypeSetYear) {
Handle<Object> year = args.atOrUndefined(isolate, 1); Handle<Object> year = args.atOrUndefined(isolate, 1);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, year, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, year,
Object::ToNumber(isolate, year)); Object::ToNumber(isolate, year));
double m = 0.0, dt = 1.0, y = year->Number(); double month_double = 0.0, day_double = 1.0, year_double = year->Number();
if (!std::isnan(y)) { if (!std::isnan(year_double)) {
double y_int = DoubleToInteger(y); double year_int = DoubleToInteger(year_double);
if (0.0 <= y_int && y_int <= 99.0) { if (0.0 <= year_int && year_int <= 99.0) {
y = 1900.0 + y_int; year_double = 1900.0 + year_int;
} }
} }
int time_within_day = 0; int time_within_day = 0;
...@@ -885,12 +889,14 @@ BUILTIN(DatePrototypeSetYear) { ...@@ -885,12 +889,14 @@ BUILTIN(DatePrototypeSetYear) {
int64_t local_time_ms = isolate->date_cache()->ToLocal(time_ms); int64_t local_time_ms = isolate->date_cache()->ToLocal(time_ms);
int const days = isolate->date_cache()->DaysFromTime(local_time_ms); int const days = isolate->date_cache()->DaysFromTime(local_time_ms);
time_within_day = isolate->date_cache()->TimeInDay(local_time_ms, days); time_within_day = isolate->date_cache()->TimeInDay(local_time_ms, days);
int year, month, day; int year_int, month_int, day_int;
isolate->date_cache()->YearMonthDayFromDays(days, &year, &month, &day); isolate->date_cache()->YearMonthDayFromDays(days, &year_int, &month_int,
m = month; &day_int);
dt = day; month_double = month_int;
day_double = day_int;
} }
double time_val = MakeDate(MakeDay(y, m, dt), time_within_day); double time_val =
MakeDate(MakeDay(year_double, month_double, day_double), time_within_day);
return SetLocalDateValue(isolate, date, time_val); return SetLocalDateValue(isolate, date, time_val);
} }
......
...@@ -94,21 +94,21 @@ void GeneratorBuiltinsAssembler::InnerResume( ...@@ -94,21 +94,21 @@ void GeneratorBuiltinsAssembler::InnerResume(
BIND(&if_receiverisclosed); BIND(&if_receiverisclosed);
{ {
// The {receiver} is closed already. // The {receiver} is closed already.
TNode<Object> result; TNode<Object> builtin_result;
switch (resume_mode) { switch (resume_mode) {
case JSGeneratorObject::kNext: case JSGeneratorObject::kNext:
result = CallBuiltin(Builtin::kCreateIterResultObject, context, builtin_result = CallBuiltin(Builtin::kCreateIterResultObject, context,
UndefinedConstant(), TrueConstant()); UndefinedConstant(), TrueConstant());
break; break;
case JSGeneratorObject::kReturn: case JSGeneratorObject::kReturn:
result = CallBuiltin(Builtin::kCreateIterResultObject, context, value, builtin_result = CallBuiltin(Builtin::kCreateIterResultObject, context,
TrueConstant()); value, TrueConstant());
break; break;
case JSGeneratorObject::kThrow: case JSGeneratorObject::kThrow:
result = CallRuntime(Runtime::kThrow, context, value); builtin_result = CallRuntime(Runtime::kThrow, context, value);
break; break;
} }
args->PopAndReturn(result); args->PopAndReturn(builtin_result);
} }
BIND(&if_receiverisrunning); BIND(&if_receiverisrunning);
......
...@@ -323,12 +323,13 @@ class WriteBarrierCodeStubAssembler : public CodeStubAssembler { ...@@ -323,12 +323,13 @@ class WriteBarrierCodeStubAssembler : public CodeStubAssembler {
GotoIfNot(IsPageFlagSet(value, MemoryChunk::kEvacuationCandidateMask), GotoIfNot(IsPageFlagSet(value, MemoryChunk::kEvacuationCandidateMask),
&next); &next);
TNode<IntPtrT> object = BitcastTaggedToWord( {
UncheckedParameter<Object>(WriteBarrierDescriptor::kObject)); TNode<IntPtrT> object = BitcastTaggedToWord(
Branch( UncheckedParameter<Object>(WriteBarrierDescriptor::kObject));
IsPageFlagSet(object, MemoryChunk::kSkipEvacuationSlotsRecordingMask), Branch(
&next, &call_incremental_wb); IsPageFlagSet(object, MemoryChunk::kSkipEvacuationSlotsRecordingMask),
&next, &call_incremental_wb);
}
BIND(&call_incremental_wb); BIND(&call_incremental_wb);
{ {
TNode<ExternalReference> function = ExternalConstant( TNode<ExternalReference> function = ExternalConstant(
......
...@@ -1096,7 +1096,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1096,7 +1096,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
BIND(&no_properties); BIND(&no_properties);
{ {
TVARIABLE(Map, map); TVARIABLE(Map, map);
TVARIABLE(HeapObject, properties); TVARIABLE(HeapObject, new_properties);
Label null_proto(this), non_null_proto(this), instantiate_map(this); Label null_proto(this), non_null_proto(this), instantiate_map(this);
Branch(IsNull(prototype), &null_proto, &non_null_proto); Branch(IsNull(prototype), &null_proto, &non_null_proto);
...@@ -1105,17 +1105,18 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1105,17 +1105,18 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
{ {
map = LoadSlowObjectWithNullPrototypeMap(native_context); map = LoadSlowObjectWithNullPrototypeMap(native_context);
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) { if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
properties = new_properties =
AllocateSwissNameDictionary(SwissNameDictionary::kInitialCapacity); AllocateSwissNameDictionary(SwissNameDictionary::kInitialCapacity);
} else { } else {
properties = AllocateNameDictionary(NameDictionary::kInitialCapacity); new_properties =
AllocateNameDictionary(NameDictionary::kInitialCapacity);
} }
Goto(&instantiate_map); Goto(&instantiate_map);
} }
BIND(&non_null_proto); BIND(&non_null_proto);
{ {
properties = EmptyFixedArrayConstant(); new_properties = EmptyFixedArrayConstant();
map = LoadObjectFunctionInitialMap(native_context); map = LoadObjectFunctionInitialMap(native_context);
GotoIf(TaggedEqual(prototype, LoadMapPrototype(map.value())), GotoIf(TaggedEqual(prototype, LoadMapPrototype(map.value())),
&instantiate_map); &instantiate_map);
...@@ -1133,7 +1134,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1133,7 +1134,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
BIND(&instantiate_map); BIND(&instantiate_map);
{ {
TNode<JSObject> instance = TNode<JSObject> instance =
AllocateJSObjectFromMap(map.value(), properties.value()); AllocateJSObjectFromMap(map.value(), new_properties.value());
args.PopAndReturn(instance); args.PopAndReturn(instance);
} }
} }
......
...@@ -260,19 +260,19 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo( ...@@ -260,19 +260,19 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo(
{ {
TNode<IntPtrT> from_cursor = var_from_cursor.value(); TNode<IntPtrT> from_cursor = var_from_cursor.value();
TNode<IntPtrT> to_cursor = var_to_cursor.value(); TNode<IntPtrT> to_cursor = var_to_cursor.value();
TNode<Smi> start = TNode<Smi> start_cursor =
CAST(UnsafeLoadFixedArrayElement(match_info, from_cursor)); CAST(UnsafeLoadFixedArrayElement(match_info, from_cursor));
Label next_iter(this); Label next_iter(this);
GotoIf(SmiEqual(start, SmiConstant(-1)), &next_iter); GotoIf(SmiEqual(start_cursor, SmiConstant(-1)), &next_iter);
TNode<IntPtrT> from_cursor_plus1 = TNode<IntPtrT> from_cursor_plus1 =
IntPtrAdd(from_cursor, IntPtrConstant(1)); IntPtrAdd(from_cursor, IntPtrConstant(1));
TNode<Smi> end = TNode<Smi> end_cursor =
CAST(UnsafeLoadFixedArrayElement(match_info, from_cursor_plus1)); CAST(UnsafeLoadFixedArrayElement(match_info, from_cursor_plus1));
TNode<String> capture = TNode<String> capture = CAST(CallBuiltin(Builtin::kSubString, context,
CAST(CallBuiltin(Builtin::kSubString, context, string, start, end)); string, start_cursor, end_cursor));
UnsafeStoreFixedArrayElement(result_elements, to_cursor, capture); UnsafeStoreFixedArrayElement(result_elements, to_cursor, capture);
Goto(&next_iter); Goto(&next_iter);
...@@ -338,10 +338,10 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo( ...@@ -338,10 +338,10 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo(
TVARIABLE(IntPtrT, var_i, IntPtrZero()); TVARIABLE(IntPtrT, var_i, IntPtrZero());
Label loop(this, &var_i); Label inner_loop(this, &var_i);
Goto(&loop); Goto(&inner_loop);
BIND(&loop); BIND(&inner_loop);
{ {
TNode<IntPtrT> i = var_i.value(); TNode<IntPtrT> i = var_i.value();
TNode<IntPtrT> i_plus_1 = IntPtrAdd(i, IntPtrConstant(1)); TNode<IntPtrT> i_plus_1 = IntPtrAdd(i, IntPtrConstant(1));
...@@ -371,7 +371,7 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo( ...@@ -371,7 +371,7 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo(
var_i = i_plus_2; var_i = i_plus_2;
Branch(IntPtrGreaterThanOrEqual(var_i.value(), names_length), Branch(IntPtrGreaterThanOrEqual(var_i.value(), names_length),
&maybe_build_indices, &loop); &maybe_build_indices, &inner_loop);
BIND(&add_dictionary_property_slow); BIND(&add_dictionary_property_slow);
// If the dictionary needs resizing, the above Add call will jump here // If the dictionary needs resizing, the above Add call will jump here
...@@ -1310,12 +1310,12 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) { ...@@ -1310,12 +1310,12 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
// {maybe_flags} must be undefined in this case, otherwise throw. // {maybe_flags} must be undefined in this case, otherwise throw.
{ {
Label next(this); Label maybe_flags_is_undefined(this);
GotoIf(IsUndefined(maybe_flags), &next); GotoIf(IsUndefined(maybe_flags), &maybe_flags_is_undefined);
ThrowTypeError(context, MessageTemplate::kRegExpFlags); ThrowTypeError(context, MessageTemplate::kRegExpFlags);
BIND(&next); BIND(&maybe_flags_is_undefined);
} }
const TNode<JSRegExp> pattern = CAST(maybe_pattern); const TNode<JSRegExp> pattern = CAST(maybe_pattern);
......
...@@ -1434,9 +1434,10 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) { ...@@ -1434,9 +1434,10 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
TNode<Smi> length = smi_zero; TNode<Smi> length = smi_zero;
TNode<IntPtrT> capacity = IntPtrConstant(0); TNode<IntPtrT> capacity = IntPtrConstant(0);
TNode<JSArray> result = AllocateJSArray(kind, array_map, capacity, length); TNode<JSArray> result_array =
AllocateJSArray(kind, array_map, capacity, length);
args.PopAndReturn(result); args.PopAndReturn(result_array);
} }
} }
......
...@@ -112,9 +112,9 @@ const char* Builtins::Lookup(Address pc) { ...@@ -112,9 +112,9 @@ const char* Builtins::Lookup(Address pc) {
// May be called during initialization (disassembler). // May be called during initialization (disassembler).
if (!initialized_) return nullptr; if (!initialized_) return nullptr;
for (Builtin builtin = Builtins::kFirst; builtin <= Builtins::kLast; for (Builtin builtin_ix = Builtins::kFirst; builtin_ix <= Builtins::kLast;
++builtin) { ++builtin_ix) {
if (code(builtin).contains(isolate_, pc)) return name(builtin); if (code(builtin_ix).contains(isolate_, pc)) return name(builtin_ix);
} }
return nullptr; return nullptr;
} }
......
...@@ -66,7 +66,7 @@ Handle<Code> BuildPlaceholder(Isolate* isolate, Builtin builtin) { ...@@ -66,7 +66,7 @@ Handle<Code> BuildPlaceholder(Isolate* isolate, Builtin builtin) {
ExternalAssemblerBuffer(buffer, kBufferSize)); ExternalAssemblerBuffer(buffer, kBufferSize));
DCHECK(!masm.has_frame()); DCHECK(!masm.has_frame());
{ {
FrameScope scope(&masm, StackFrame::NONE); FrameScope frame_scope(&masm, StackFrame::NONE);
// The contents of placeholder don't matter, as long as they don't create // The contents of placeholder don't matter, as long as they don't create
// embedded constants or external references. // embedded constants or external references.
masm.Move(kJavaScriptCallCodeStartRegister, Smi::zero()); masm.Move(kJavaScriptCallCodeStartRegister, Smi::zero());
......
...@@ -1828,7 +1828,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { ...@@ -1828,7 +1828,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) {
// Push the baseline code return address now, as if it had been pushed by // Push the baseline code return address now, as if it had been pushed by
// the call to this builtin. // the call to this builtin.
__ PushReturnAddressFrom(return_address); __ PushReturnAddressFrom(return_address);
FrameScope frame_scope(masm, StackFrame::INTERNAL); FrameScope inner_frame_scope(masm, StackFrame::INTERNAL);
// Save incoming new target or generator // Save incoming new target or generator
__ Push(new_target); __ Push(new_target);
__ SmiTag(frame_size); __ SmiTag(frame_size);
......
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