Regex replaced "TNode<_> const" to "const TNode<_>"
Bug: v8:9810 Change-Id: I2893c3066616b8fb5b3bebde4797adb0dac109c4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1889878 Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Reviewed-by: Mythri Alle <mythria@chromium.org> Cr-Commit-Position: refs/heads/master@{#64659}
This commit is contained in:
parent
71958d2abf
commit
93c8a25339
@ -113,8 +113,8 @@ TNode<JSObject> ArgumentsBuiltinsAssembler::EmitFastNewRestParameter(
|
||||
|
||||
TNode<BInt> rest_count =
|
||||
IntPtrOrSmiSub(info.argument_count, info.formal_parameter_count);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Map> const array_map =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Map> array_map =
|
||||
LoadJSArrayElementsMap(PACKED_ELEMENTS, native_context);
|
||||
GotoIf(IntPtrOrSmiLessThanOrEqual(rest_count, zero), &no_rest_parameters);
|
||||
|
||||
@ -160,7 +160,7 @@ TNode<JSObject> ArgumentsBuiltinsAssembler::EmitFastNewStrictArguments(
|
||||
info.argument_count, &runtime,
|
||||
JSStrictArgumentsObject::kSize + FixedArray::kHeaderSize, mode);
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TNode<Map> map = CAST(
|
||||
LoadContextElement(native_context, Context::STRICT_ARGUMENTS_MAP_INDEX));
|
||||
GotoIf(BIntEqual(info.argument_count, zero), &empty);
|
||||
@ -220,8 +220,8 @@ TNode<JSObject> ArgumentsBuiltinsAssembler::EmitFastNewSloppyArguments(
|
||||
elements_allocated, &runtime,
|
||||
JSSloppyArgumentsObject::kSize + FixedArray::kHeaderSize * 2, mode);
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Map> const map = CAST(LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Map> map = CAST(LoadContextElement(
|
||||
native_context, Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX));
|
||||
ArgumentsAllocationResult alloc_result =
|
||||
AllocateArgumentsObject(map, info.argument_count, parameter_map_size,
|
||||
@ -308,7 +308,7 @@ TNode<JSObject> ArgumentsBuiltinsAssembler::EmitFastNewSloppyArguments(
|
||||
GotoIfFixedArraySizeDoesntFitInNewSpace(
|
||||
info.argument_count, &runtime,
|
||||
JSSloppyArgumentsObject::kSize + FixedArray::kHeaderSize, mode);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TNode<Map> map = CAST(LoadContextElement(
|
||||
native_context, Context::SLOPPY_ARGUMENTS_MAP_INDEX));
|
||||
result = ConstructParametersObjectFromArgs(
|
||||
@ -322,8 +322,8 @@ TNode<JSObject> ArgumentsBuiltinsAssembler::EmitFastNewSloppyArguments(
|
||||
BIND(&empty);
|
||||
{
|
||||
Comment("Empty JSSloppyArgumentsObject");
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Map> const map = CAST(LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Map> map = CAST(LoadContextElement(
|
||||
native_context, Context::SLOPPY_ARGUMENTS_MAP_INDEX));
|
||||
ArgumentsAllocationResult alloc_result =
|
||||
AllocateArgumentsObject(map, zero, {}, JSSloppyArgumentsObject::kSize);
|
||||
|
@ -1618,7 +1618,7 @@ class ArrayFlattenAssembler : public CodeStubAssembler {
|
||||
// b. Let exists be ? HasProperty(source, P).
|
||||
CSA_ASSERT(this,
|
||||
SmiGreaterThanOrEqual(CAST(source_index), SmiConstant(0)));
|
||||
TNode<Oddball> const exists =
|
||||
const TNode<Oddball> exists =
|
||||
HasProperty(context, source, source_index, kHasProperty);
|
||||
|
||||
// c. If exists is true, then
|
||||
@ -1660,7 +1660,7 @@ class ArrayFlattenAssembler : public CodeStubAssembler {
|
||||
CSA_ASSERT(this, IsJSArray(element));
|
||||
|
||||
// 1. Let elementLen be ? ToLength(? Get(element, "length")).
|
||||
TNode<Object> const element_length =
|
||||
const TNode<Object> element_length =
|
||||
LoadObjectField(element, JSArray::kLengthOffset);
|
||||
|
||||
// 2. Set targetIndex to ? FlattenIntoArray(target, element,
|
||||
@ -1677,7 +1677,7 @@ class ArrayFlattenAssembler : public CodeStubAssembler {
|
||||
CSA_ASSERT(this, IsJSProxy(element));
|
||||
|
||||
// 1. Let elementLen be ? ToLength(? Get(element, "length")).
|
||||
TNode<Number> const element_length = ToLength_Inline(
|
||||
const TNode<Number> element_length = ToLength_Inline(
|
||||
context, GetProperty(context, element, LengthStringConstant()));
|
||||
|
||||
// 2. Set targetIndex to ? FlattenIntoArray(target, element,
|
||||
@ -1758,18 +1758,18 @@ TF_BUILTIN(FlatMapIntoArray, ArrayFlattenAssembler) {
|
||||
|
||||
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flat
|
||||
TF_BUILTIN(ArrayPrototypeFlat, CodeStubAssembler) {
|
||||
TNode<IntPtrT> const argc =
|
||||
const TNode<IntPtrT> argc =
|
||||
ChangeInt32ToIntPtr(Parameter(Descriptor::kJSActualArgumentsCount));
|
||||
CodeStubArguments args(this, argc);
|
||||
TNode<Context> const context = CAST(Parameter(Descriptor::kContext));
|
||||
TNode<Object> const receiver = args.GetReceiver();
|
||||
TNode<Object> const depth = args.GetOptionalArgumentValue(0);
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
const TNode<Object> receiver = args.GetReceiver();
|
||||
const TNode<Object> depth = args.GetOptionalArgumentValue(0);
|
||||
|
||||
// 1. Let O be ? ToObject(this value).
|
||||
TNode<JSReceiver> const o = ToObject_Inline(context, receiver);
|
||||
const TNode<JSReceiver> o = ToObject_Inline(context, receiver);
|
||||
|
||||
// 2. Let sourceLen be ? ToLength(? Get(O, "length")).
|
||||
TNode<Number> const source_length =
|
||||
const TNode<Number> source_length =
|
||||
ToLength_Inline(context, GetProperty(context, o, LengthStringConstant()));
|
||||
|
||||
// 3. Let depthNum be 1.
|
||||
@ -1786,9 +1786,9 @@ TF_BUILTIN(ArrayPrototypeFlat, CodeStubAssembler) {
|
||||
BIND(&done);
|
||||
|
||||
// 5. Let A be ? ArraySpeciesCreate(O, 0).
|
||||
TNode<JSReceiver> const constructor =
|
||||
const TNode<JSReceiver> constructor =
|
||||
CAST(CallRuntime(Runtime::kArraySpeciesConstructor, context, o));
|
||||
TNode<JSReceiver> const a = Construct(context, constructor, SmiConstant(0));
|
||||
const TNode<JSReceiver> a = Construct(context, constructor, SmiConstant(0));
|
||||
|
||||
// 6. Perform ? FlattenIntoArray(A, O, sourceLen, 0, depthNum).
|
||||
CallBuiltin(Builtins::kFlattenIntoArray, context, a, o, source_length,
|
||||
@ -1800,18 +1800,18 @@ TF_BUILTIN(ArrayPrototypeFlat, CodeStubAssembler) {
|
||||
|
||||
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
|
||||
TF_BUILTIN(ArrayPrototypeFlatMap, CodeStubAssembler) {
|
||||
TNode<IntPtrT> const argc =
|
||||
const TNode<IntPtrT> argc =
|
||||
ChangeInt32ToIntPtr(Parameter(Descriptor::kJSActualArgumentsCount));
|
||||
CodeStubArguments args(this, argc);
|
||||
TNode<Context> const context = CAST(Parameter(Descriptor::kContext));
|
||||
TNode<Object> const receiver = args.GetReceiver();
|
||||
TNode<Object> const mapper_function = args.GetOptionalArgumentValue(0);
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
const TNode<Object> receiver = args.GetReceiver();
|
||||
const TNode<Object> mapper_function = args.GetOptionalArgumentValue(0);
|
||||
|
||||
// 1. Let O be ? ToObject(this value).
|
||||
TNode<JSReceiver> const o = ToObject_Inline(context, receiver);
|
||||
const TNode<JSReceiver> o = ToObject_Inline(context, receiver);
|
||||
|
||||
// 2. Let sourceLen be ? ToLength(? Get(O, "length")).
|
||||
TNode<Number> const source_length =
|
||||
const TNode<Number> source_length =
|
||||
ToLength_Inline(context, GetProperty(context, o, LengthStringConstant()));
|
||||
|
||||
// 3. If IsCallable(mapperFunction) is false, throw a TypeError exception.
|
||||
@ -1820,12 +1820,12 @@ TF_BUILTIN(ArrayPrototypeFlatMap, CodeStubAssembler) {
|
||||
GotoIfNot(IsCallable(CAST(mapper_function)), &if_not_callable);
|
||||
|
||||
// 4. If thisArg is present, let T be thisArg; else let T be undefined.
|
||||
TNode<Object> const t = args.GetOptionalArgumentValue(1);
|
||||
const TNode<Object> t = args.GetOptionalArgumentValue(1);
|
||||
|
||||
// 5. Let A be ? ArraySpeciesCreate(O, 0).
|
||||
TNode<JSReceiver> const constructor =
|
||||
const TNode<JSReceiver> constructor =
|
||||
CAST(CallRuntime(Runtime::kArraySpeciesConstructor, context, o));
|
||||
TNode<JSReceiver> const a = Construct(context, constructor, SmiConstant(0));
|
||||
const TNode<JSReceiver> a = Construct(context, constructor, SmiConstant(0));
|
||||
|
||||
// 6. Perform ? FlattenIntoArray(A, O, sourceLen, 0, 1, mapperFunction, T).
|
||||
CallBuiltin(Builtins::kFlatMapIntoArray, context, a, o, source_length,
|
||||
|
@ -30,7 +30,7 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOld(
|
||||
TNode<IntPtrT> on_resolve_context_index,
|
||||
TNode<IntPtrT> on_reject_context_index,
|
||||
TNode<Oddball> is_predicted_as_caught) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
|
||||
static const int kWrappedPromiseOffset =
|
||||
FixedArray::SizeFor(Context::MIN_CONTEXT_EXTENDED_SLOTS);
|
||||
@ -51,7 +51,7 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOld(
|
||||
StoreObjectFieldNoWriteBarrier(
|
||||
closure_context, Context::kLengthOffset,
|
||||
SmiConstant(Context::MIN_CONTEXT_EXTENDED_SLOTS));
|
||||
TNode<Object> const empty_scope_info =
|
||||
const TNode<Object> empty_scope_info =
|
||||
LoadContextElement(native_context, Context::SCOPE_INFO_INDEX);
|
||||
StoreContextElementNoWriteBarrier(
|
||||
closure_context, Context::SCOPE_INFO_INDEX, empty_scope_info);
|
||||
@ -62,10 +62,10 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOld(
|
||||
}
|
||||
|
||||
// Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
TNode<JSFunction> const promise_fun =
|
||||
const TNode<JSFunction> promise_fun =
|
||||
CAST(LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX));
|
||||
CSA_ASSERT(this, IsFunctionWithPrototypeSlotMap(LoadMap(promise_fun)));
|
||||
TNode<Map> const promise_map = CAST(
|
||||
const TNode<Map> promise_map = CAST(
|
||||
LoadObjectField(promise_fun, JSFunction::kPrototypeOrInitialMapOffset));
|
||||
// Assert that the JSPromise map has an instance size is
|
||||
// JSPromise::kSizeWithEmbedderFields.
|
||||
@ -122,7 +122,7 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOptimized(
|
||||
TNode<IntPtrT> on_resolve_context_index,
|
||||
TNode<IntPtrT> on_reject_context_index,
|
||||
TNode<Oddball> is_predicted_as_caught) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
|
||||
static const int kResolveClosureOffset =
|
||||
FixedArray::SizeFor(Context::MIN_CONTEXT_EXTENDED_SLOTS);
|
||||
@ -145,7 +145,7 @@ TNode<Object> AsyncBuiltinsAssembler::AwaitOptimized(
|
||||
StoreObjectFieldNoWriteBarrier(
|
||||
closure_context, Context::kLengthOffset,
|
||||
SmiConstant(Context::MIN_CONTEXT_EXTENDED_SLOTS));
|
||||
TNode<Object> const empty_scope_info =
|
||||
const TNode<Object> empty_scope_info =
|
||||
LoadContextElement(native_context, Context::SCOPE_INFO_INDEX);
|
||||
StoreContextElementNoWriteBarrier(
|
||||
closure_context, Context::SCOPE_INFO_INDEX, empty_scope_info);
|
||||
@ -201,14 +201,14 @@ TNode<Object> AsyncBuiltinsAssembler::Await(
|
||||
// logic.
|
||||
GotoIf(TaggedIsSmi(value), &if_old);
|
||||
TNode<HeapObject> value_object = CAST(value);
|
||||
TNode<Map> const value_map = LoadMap(value_object);
|
||||
const TNode<Map> value_map = LoadMap(value_object);
|
||||
GotoIfNot(IsJSPromiseMap(value_map), &if_old);
|
||||
// We can skip the "constructor" lookup on {value} if it's [[Prototype]]
|
||||
// is the (initial) Promise.prototype and the @@species protector is
|
||||
// intact, as that guards the lookup path for "constructor" on
|
||||
// JSPromise instances which have the (initial) Promise.prototype.
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const promise_prototype =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> promise_prototype =
|
||||
LoadContextElement(native_context, Context::PROMISE_PROTOTYPE_INDEX);
|
||||
GotoIfNot(TaggedEqual(LoadMapPrototype(value_map), promise_prototype),
|
||||
&if_slow_constructor);
|
||||
@ -219,9 +219,9 @@ TNode<Object> AsyncBuiltinsAssembler::Await(
|
||||
// have the %Promise% as its "constructor", so we need to check that as well.
|
||||
BIND(&if_slow_constructor);
|
||||
{
|
||||
TNode<Object> const value_constructor =
|
||||
const TNode<Object> value_constructor =
|
||||
GetProperty(context, value, isolate()->factory()->constructor_string());
|
||||
TNode<Object> const promise_function =
|
||||
const TNode<Object> promise_function =
|
||||
LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX);
|
||||
Branch(TaggedEqual(value_constructor, promise_function), &if_new, &if_old);
|
||||
}
|
||||
@ -306,11 +306,11 @@ TF_BUILTIN(AsyncIteratorValueUnwrap, AsyncBuiltinsAssembler) {
|
||||
TNode<Object> value = CAST(Parameter(Descriptor::kValue));
|
||||
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
|
||||
TNode<Object> const done =
|
||||
const TNode<Object> done =
|
||||
LoadContextElement(context, ValueUnwrapContext::kDoneSlot);
|
||||
CSA_ASSERT(this, IsBoolean(CAST(done)));
|
||||
|
||||
TNode<Object> const unwrapped_value =
|
||||
const TNode<Object> unwrapped_value =
|
||||
CallBuiltin(Builtins::kCreateIterResultObject, context, value, done);
|
||||
|
||||
Return(unwrapped_value);
|
||||
|
@ -123,7 +123,7 @@ class BaseCollectionsAssembler : public CodeStubAssembler {
|
||||
TNode<IntPtrT> EstimatedInitialSize(TNode<Object> initial_entries,
|
||||
TNode<BoolT> is_fast_jsarray);
|
||||
|
||||
void GotoIfNotJSReceiver(TNode<Object> const obj, Label* if_not_receiver);
|
||||
void GotoIfNotJSReceiver(const TNode<Object> obj, Label* if_not_receiver);
|
||||
|
||||
// Determines whether the collection's prototype has been modified.
|
||||
TNode<BoolT> HasInitialCollectionPrototype(Variant variant,
|
||||
@ -522,7 +522,7 @@ TNode<IntPtrT> BaseCollectionsAssembler::EstimatedInitialSize(
|
||||
[=] { return IntPtrConstant(0); });
|
||||
}
|
||||
|
||||
void BaseCollectionsAssembler::GotoIfNotJSReceiver(TNode<Object> const obj,
|
||||
void BaseCollectionsAssembler::GotoIfNotJSReceiver(const TNode<Object> obj,
|
||||
Label* if_not_receiver) {
|
||||
GotoIf(TaggedIsSmi(obj), if_not_receiver);
|
||||
GotoIfNot(IsJSReceiver(CAST(obj)), if_not_receiver);
|
||||
@ -623,11 +623,11 @@ class CollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
|
||||
const TNode<IntPtrT> index)>;
|
||||
template <typename TableType>
|
||||
std::pair<TNode<TableType>, TNode<IntPtrT>> Transition(
|
||||
TNode<TableType> const table, TNode<IntPtrT> const index,
|
||||
const TNode<TableType> table, const TNode<IntPtrT> index,
|
||||
UpdateInTransition<TableType> const& update_in_transition);
|
||||
template <typename IteratorType, typename TableType>
|
||||
std::pair<TNode<TableType>, TNode<IntPtrT>> TransitionAndUpdate(
|
||||
TNode<IteratorType> const iterator);
|
||||
const TNode<IteratorType> iterator);
|
||||
template <typename TableType>
|
||||
std::tuple<TNode<Object>, TNode<IntPtrT>, TNode<IntPtrT>> NextSkipHoles(
|
||||
TNode<TableType> table, TNode<IntPtrT> index, Label* if_end);
|
||||
@ -700,14 +700,14 @@ class CollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
|
||||
Label* if_not_found);
|
||||
|
||||
const TNode<Object> NormalizeNumberKey(const TNode<Object> key);
|
||||
void StoreOrderedHashMapNewEntry(TNode<OrderedHashMap> const table,
|
||||
void StoreOrderedHashMapNewEntry(const TNode<OrderedHashMap> table,
|
||||
const TNode<Object> key,
|
||||
const TNode<Object> value,
|
||||
const TNode<IntPtrT> hash,
|
||||
const TNode<IntPtrT> number_of_buckets,
|
||||
const TNode<IntPtrT> occupancy);
|
||||
|
||||
void StoreOrderedHashSetNewEntry(TNode<OrderedHashSet> const table,
|
||||
void StoreOrderedHashSetNewEntry(const TNode<OrderedHashSet> table,
|
||||
const TNode<Object> key,
|
||||
const TNode<IntPtrT> hash,
|
||||
const TNode<IntPtrT> number_of_buckets,
|
||||
@ -757,12 +757,12 @@ void CollectionsBuiltinsAssembler::FindOrderedHashTableEntry(
|
||||
TVariable<IntPtrT>* entry_start_position, Label* entry_found,
|
||||
Label* not_found) {
|
||||
// Get the index of the bucket.
|
||||
TNode<IntPtrT> const number_of_buckets =
|
||||
const TNode<IntPtrT> number_of_buckets =
|
||||
SmiUntag(CAST(UnsafeLoadFixedArrayElement(
|
||||
table, CollectionType::NumberOfBucketsIndex())));
|
||||
TNode<WordT> const bucket =
|
||||
const TNode<WordT> bucket =
|
||||
WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1)));
|
||||
TNode<IntPtrT> const first_entry = SmiUntag(CAST(UnsafeLoadFixedArrayElement(
|
||||
const TNode<IntPtrT> first_entry = SmiUntag(CAST(UnsafeLoadFixedArrayElement(
|
||||
table, bucket, CollectionType::HashTableStartIndex() * kTaggedSize)));
|
||||
|
||||
// Walk the bucket chain.
|
||||
@ -798,7 +798,7 @@ void CollectionsBuiltinsAssembler::FindOrderedHashTableEntry(
|
||||
number_of_buckets);
|
||||
|
||||
// Load the key from the entry.
|
||||
TNode<Object> const candidate_key = UnsafeLoadFixedArrayElement(
|
||||
const TNode<Object> candidate_key = UnsafeLoadFixedArrayElement(
|
||||
table, entry_start,
|
||||
CollectionType::HashTableStartIndex() * kTaggedSize);
|
||||
|
||||
@ -821,14 +821,14 @@ void CollectionsBuiltinsAssembler::FindOrderedHashTableEntry(
|
||||
|
||||
template <typename IteratorType>
|
||||
TNode<HeapObject> CollectionsBuiltinsAssembler::AllocateJSCollectionIterator(
|
||||
TNode<Context> const context, int map_index,
|
||||
TNode<HeapObject> const collection) {
|
||||
TNode<Object> const table =
|
||||
const TNode<Context> context, int map_index,
|
||||
const TNode<HeapObject> collection) {
|
||||
const TNode<Object> table =
|
||||
LoadObjectField(collection, JSCollection::kTableOffset);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const iterator_map =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> iterator_map =
|
||||
LoadContextElement(native_context, map_index);
|
||||
TNode<HeapObject> const iterator = AllocateInNewSpace(IteratorType::kSize);
|
||||
const TNode<HeapObject> iterator = AllocateInNewSpace(IteratorType::kSize);
|
||||
StoreMapNoWriteBarrier(iterator, iterator_map);
|
||||
StoreObjectFieldRoot(iterator, IteratorType::kPropertiesOrHashOffset,
|
||||
RootIndex::kEmptyFixedArray);
|
||||
@ -869,9 +869,9 @@ TF_BUILTIN(SetConstructor, CollectionsBuiltinsAssembler) {
|
||||
|
||||
TNode<Smi> CollectionsBuiltinsAssembler::CallGetOrCreateHashRaw(
|
||||
const TNode<HeapObject> key) {
|
||||
TNode<ExternalReference> const function_addr =
|
||||
const TNode<ExternalReference> function_addr =
|
||||
ExternalConstant(ExternalReference::get_or_create_hash_raw());
|
||||
TNode<ExternalReference> const isolate_ptr =
|
||||
const TNode<ExternalReference> isolate_ptr =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
|
||||
MachineType type_ptr = MachineType::Pointer();
|
||||
@ -886,9 +886,9 @@ TNode<Smi> CollectionsBuiltinsAssembler::CallGetOrCreateHashRaw(
|
||||
|
||||
TNode<IntPtrT> CollectionsBuiltinsAssembler::CallGetHashRaw(
|
||||
const TNode<HeapObject> key) {
|
||||
TNode<ExternalReference> const function_addr =
|
||||
const TNode<ExternalReference> function_addr =
|
||||
ExternalConstant(ExternalReference::orderedhashmap_gethash_raw());
|
||||
TNode<ExternalReference> const isolate_ptr =
|
||||
const TNode<ExternalReference> isolate_ptr =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
|
||||
MachineType type_ptr = MachineType::Pointer();
|
||||
@ -938,9 +938,9 @@ void CollectionsBuiltinsAssembler::SameValueZeroSmi(TNode<Smi> key_smi,
|
||||
// heap number with the same value.
|
||||
GotoIfNot(IsHeapNumber(CAST(candidate_key)), if_not_same);
|
||||
|
||||
TNode<Float64T> const candidate_key_number =
|
||||
const TNode<Float64T> candidate_key_number =
|
||||
LoadHeapNumberValue(CAST(candidate_key));
|
||||
TNode<Float64T> const key_number = SmiToFloat64(key_smi);
|
||||
const TNode<Float64T> key_number = SmiToFloat64(key_smi);
|
||||
|
||||
GotoIf(Float64Equal(candidate_key_number, key_number), if_same);
|
||||
|
||||
@ -967,7 +967,7 @@ void CollectionsBuiltinsAssembler::
|
||||
// Check if iterator is a keys or values JSMapIterator.
|
||||
GotoIf(TaggedIsSmi(iterator), if_false);
|
||||
TNode<Map> iter_map = LoadMap(CAST(iterator));
|
||||
TNode<Uint16T> const instance_type = LoadMapInstanceType(iter_map);
|
||||
const TNode<Uint16T> instance_type = LoadMapInstanceType(iter_map);
|
||||
GotoIf(InstanceTypeEqual(instance_type, JS_MAP_KEY_ITERATOR_TYPE),
|
||||
&if_key_or_value_iterator);
|
||||
Branch(InstanceTypeEqual(instance_type, JS_MAP_VALUE_ITERATOR_TYPE),
|
||||
@ -975,24 +975,24 @@ void CollectionsBuiltinsAssembler::
|
||||
|
||||
BIND(&if_key_or_value_iterator);
|
||||
// Check that the iterator is not partially consumed.
|
||||
TNode<Object> const index =
|
||||
const TNode<Object> index =
|
||||
LoadObjectField(CAST(iterator), JSMapIterator::kIndexOffset);
|
||||
GotoIfNot(TaggedEqual(index, SmiConstant(0)), if_false);
|
||||
BranchIfMapIteratorProtectorValid(&extra_checks, if_false);
|
||||
|
||||
BIND(&extra_checks);
|
||||
// Check if the iterator object has the original %MapIteratorPrototype%.
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const initial_map_iter_proto = LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> initial_map_iter_proto = LoadContextElement(
|
||||
native_context, Context::INITIAL_MAP_ITERATOR_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> const map_iter_proto = LoadMapPrototype(iter_map);
|
||||
const TNode<HeapObject> map_iter_proto = LoadMapPrototype(iter_map);
|
||||
GotoIfNot(TaggedEqual(map_iter_proto, initial_map_iter_proto), if_false);
|
||||
|
||||
// Check if the original MapIterator prototype has the original
|
||||
// %IteratorPrototype%.
|
||||
TNode<Object> const initial_iter_proto = LoadContextElement(
|
||||
const TNode<Object> initial_iter_proto = LoadContextElement(
|
||||
native_context, Context::INITIAL_ITERATOR_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> const iter_proto =
|
||||
const TNode<HeapObject> iter_proto =
|
||||
LoadMapPrototype(LoadMap(map_iter_proto));
|
||||
Branch(TaggedEqual(iter_proto, initial_iter_proto), if_true, if_false);
|
||||
}
|
||||
@ -1008,7 +1008,7 @@ void BranchIfIterableWithOriginalKeyOrValueMapIterator(
|
||||
|
||||
void CollectionsBuiltinsAssembler::BranchIfSetIteratorProtectorValid(
|
||||
Label* if_true, Label* if_false) {
|
||||
TNode<PropertyCell> const protector_cell = SetIteratorProtectorConstant();
|
||||
const TNode<PropertyCell> protector_cell = SetIteratorProtectorConstant();
|
||||
DCHECK(isolate()->heap()->set_iterator_protector().IsPropertyCell());
|
||||
Branch(
|
||||
TaggedEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset),
|
||||
@ -1024,7 +1024,7 @@ void CollectionsBuiltinsAssembler::BranchIfIterableWithOriginalValueSetIterator(
|
||||
|
||||
GotoIf(TaggedIsSmi(iterable), if_false);
|
||||
TNode<Map> iterable_map = LoadMap(CAST(iterable));
|
||||
TNode<Uint16T> const instance_type = LoadMapInstanceType(iterable_map);
|
||||
const TNode<Uint16T> instance_type = LoadMapInstanceType(iterable_map);
|
||||
|
||||
GotoIf(InstanceTypeEqual(instance_type, JS_SET_TYPE), &if_set);
|
||||
Branch(InstanceTypeEqual(instance_type, JS_SET_VALUE_ITERATOR_TYPE),
|
||||
@ -1032,30 +1032,30 @@ void CollectionsBuiltinsAssembler::BranchIfIterableWithOriginalValueSetIterator(
|
||||
|
||||
BIND(&if_set);
|
||||
// Check if the set object has the original Set prototype.
|
||||
TNode<Object> const initial_set_proto = LoadContextElement(
|
||||
const TNode<Object> initial_set_proto = LoadContextElement(
|
||||
LoadNativeContext(context), Context::INITIAL_SET_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> const set_proto = LoadMapPrototype(iterable_map);
|
||||
const TNode<HeapObject> set_proto = LoadMapPrototype(iterable_map);
|
||||
GotoIfNot(TaggedEqual(set_proto, initial_set_proto), if_false);
|
||||
Goto(&check_protector);
|
||||
|
||||
BIND(&if_value_iterator);
|
||||
// Check that the iterator is not partially consumed.
|
||||
TNode<Object> const index =
|
||||
const TNode<Object> index =
|
||||
LoadObjectField(CAST(iterable), JSSetIterator::kIndexOffset);
|
||||
GotoIfNot(TaggedEqual(index, SmiConstant(0)), if_false);
|
||||
|
||||
// Check if the iterator object has the original SetIterator prototype.
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const initial_set_iter_proto = LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> initial_set_iter_proto = LoadContextElement(
|
||||
native_context, Context::INITIAL_SET_ITERATOR_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> const set_iter_proto = LoadMapPrototype(iterable_map);
|
||||
const TNode<HeapObject> set_iter_proto = LoadMapPrototype(iterable_map);
|
||||
GotoIfNot(TaggedEqual(set_iter_proto, initial_set_iter_proto), if_false);
|
||||
|
||||
// Check if the original SetIterator prototype has the original
|
||||
// %IteratorPrototype%.
|
||||
TNode<Object> const initial_iter_proto = LoadContextElement(
|
||||
const TNode<Object> initial_iter_proto = LoadContextElement(
|
||||
native_context, Context::INITIAL_ITERATOR_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> const iter_proto =
|
||||
const TNode<HeapObject> iter_proto =
|
||||
LoadMapPrototype(LoadMap(set_iter_proto));
|
||||
GotoIfNot(TaggedEqual(iter_proto, initial_iter_proto), if_false);
|
||||
Goto(&check_protector);
|
||||
@ -1169,7 +1169,7 @@ TNode<JSArray> CollectionsBuiltinsAssembler::SetOrSetIteratorToList(
|
||||
TVARIABLE(OrderedHashSet, var_table);
|
||||
Label if_set(this), if_iterator(this), copy(this);
|
||||
|
||||
TNode<Uint16T> const instance_type = LoadInstanceType(CAST(iterable));
|
||||
const TNode<Uint16T> instance_type = LoadInstanceType(CAST(iterable));
|
||||
Branch(InstanceTypeEqual(instance_type, JS_SET_TYPE), &if_set, &if_iterator);
|
||||
|
||||
BIND(&if_set);
|
||||
@ -1256,8 +1256,8 @@ template <typename CollectionType>
|
||||
void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForSmiKey(
|
||||
TNode<CollectionType> table, TNode<Smi> smi_key, TVariable<IntPtrT>* result,
|
||||
Label* entry_found, Label* not_found) {
|
||||
TNode<IntPtrT> const key_untagged = SmiUntag(smi_key);
|
||||
TNode<IntPtrT> const hash =
|
||||
const TNode<IntPtrT> key_untagged = SmiUntag(smi_key);
|
||||
const TNode<IntPtrT> hash =
|
||||
ChangeInt32ToIntPtr(ComputeUnseededHash(key_untagged));
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0)));
|
||||
*result = hash;
|
||||
@ -1273,7 +1273,7 @@ template <typename CollectionType>
|
||||
void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForStringKey(
|
||||
TNode<CollectionType> table, TNode<String> key_tagged,
|
||||
TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) {
|
||||
TNode<IntPtrT> const hash = ComputeStringHash(key_tagged);
|
||||
const TNode<IntPtrT> hash = ComputeStringHash(key_tagged);
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0)));
|
||||
*result = hash;
|
||||
FindOrderedHashTableEntry<CollectionType>(
|
||||
@ -1288,10 +1288,10 @@ template <typename CollectionType>
|
||||
void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForHeapNumberKey(
|
||||
TNode<CollectionType> table, TNode<HeapNumber> key_heap_number,
|
||||
TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) {
|
||||
TNode<IntPtrT> const hash = CallGetHashRaw(key_heap_number);
|
||||
const TNode<IntPtrT> hash = CallGetHashRaw(key_heap_number);
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0)));
|
||||
*result = hash;
|
||||
TNode<Float64T> const key_float = LoadHeapNumberValue(key_heap_number);
|
||||
const TNode<Float64T> key_float = LoadHeapNumberValue(key_heap_number);
|
||||
FindOrderedHashTableEntry<CollectionType>(
|
||||
table, hash,
|
||||
[&](TNode<Object> other_key, Label* if_same, Label* if_not_same) {
|
||||
@ -1304,7 +1304,7 @@ template <typename CollectionType>
|
||||
void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForBigIntKey(
|
||||
TNode<CollectionType> table, TNode<BigInt> key_big_int,
|
||||
TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) {
|
||||
TNode<IntPtrT> const hash = CallGetHashRaw(key_big_int);
|
||||
const TNode<IntPtrT> hash = CallGetHashRaw(key_big_int);
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0)));
|
||||
*result = hash;
|
||||
FindOrderedHashTableEntry<CollectionType>(
|
||||
@ -1319,7 +1319,7 @@ template <typename CollectionType>
|
||||
void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForOtherKey(
|
||||
TNode<CollectionType> table, TNode<HeapObject> key_heap_object,
|
||||
TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) {
|
||||
TNode<IntPtrT> const hash = GetHash(key_heap_object);
|
||||
const TNode<IntPtrT> hash = GetHash(key_heap_object);
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0)));
|
||||
*result = hash;
|
||||
FindOrderedHashTableEntry<CollectionType>(
|
||||
@ -1335,7 +1335,7 @@ TNode<IntPtrT> CollectionsBuiltinsAssembler::ComputeStringHash(
|
||||
TVARIABLE(IntPtrT, var_result);
|
||||
|
||||
Label hash_not_computed(this), done(this, &var_result);
|
||||
TNode<IntPtrT> const hash =
|
||||
const TNode<IntPtrT> hash =
|
||||
ChangeInt32ToIntPtr(LoadNameHash(string_key, &hash_not_computed));
|
||||
var_result = hash;
|
||||
Goto(&done);
|
||||
@ -1383,7 +1383,7 @@ void CollectionsBuiltinsAssembler::SameValueZeroHeapNumber(
|
||||
|
||||
{
|
||||
// {candidate_key} is a heap number.
|
||||
TNode<Float64T> const candidate_float =
|
||||
const TNode<Float64T> candidate_float =
|
||||
LoadHeapNumberValue(CAST(candidate_key));
|
||||
GotoIf(Float64Equal(key_float, candidate_float), if_same);
|
||||
|
||||
@ -1401,7 +1401,7 @@ void CollectionsBuiltinsAssembler::SameValueZeroHeapNumber(
|
||||
|
||||
BIND(&if_smi);
|
||||
{
|
||||
TNode<Float64T> const candidate_float = SmiToFloat64(CAST(candidate_key));
|
||||
const TNode<Float64T> candidate_float = SmiToFloat64(CAST(candidate_key));
|
||||
Branch(Float64Equal(key_float, candidate_float), if_same, if_not_same);
|
||||
}
|
||||
}
|
||||
@ -1453,7 +1453,7 @@ TF_BUILTIN(OrderedHashTableHealIndex, CollectionsBuiltinsAssembler) {
|
||||
template <typename TableType>
|
||||
std::pair<TNode<TableType>, TNode<IntPtrT>>
|
||||
CollectionsBuiltinsAssembler::Transition(
|
||||
TNode<TableType> const table, TNode<IntPtrT> const index,
|
||||
const TNode<TableType> table, const TNode<IntPtrT> index,
|
||||
UpdateInTransition<TableType> const& update_in_transition) {
|
||||
TVARIABLE(IntPtrT, var_index, index);
|
||||
TVARIABLE(TableType, var_table, table);
|
||||
@ -1495,7 +1495,7 @@ CollectionsBuiltinsAssembler::Transition(
|
||||
template <typename IteratorType, typename TableType>
|
||||
std::pair<TNode<TableType>, TNode<IntPtrT>>
|
||||
CollectionsBuiltinsAssembler::TransitionAndUpdate(
|
||||
TNode<IteratorType> const iterator) {
|
||||
const TNode<IteratorType> iterator) {
|
||||
return Transition<TableType>(
|
||||
CAST(LoadObjectField(iterator, IteratorType::kTableOffset)),
|
||||
LoadAndUntagObjectField(iterator, IteratorType::kIndexOffset),
|
||||
@ -1553,7 +1553,7 @@ TF_BUILTIN(MapPrototypeGet, CollectionsBuiltinsAssembler) {
|
||||
|
||||
ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.get");
|
||||
|
||||
TNode<Object> const table =
|
||||
const TNode<Object> table =
|
||||
LoadObjectField<Object>(CAST(receiver), JSMap::kTableOffset);
|
||||
TNode<Smi> index = CAST(
|
||||
CallBuiltin(Builtins::kFindOrderedHashMapEntry, context, table, key));
|
||||
@ -1579,7 +1579,7 @@ TF_BUILTIN(MapPrototypeHas, CollectionsBuiltinsAssembler) {
|
||||
|
||||
ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.has");
|
||||
|
||||
TNode<Object> const table =
|
||||
const TNode<Object> table =
|
||||
LoadObjectField(CAST(receiver), JSMap::kTableOffset);
|
||||
TNode<Smi> index = CAST(
|
||||
CallBuiltin(Builtins::kFindOrderedHashMapEntry, context, table, key));
|
||||
@ -1602,7 +1602,7 @@ const TNode<Object> CollectionsBuiltinsAssembler::NormalizeNumberKey(
|
||||
|
||||
GotoIf(TaggedIsSmi(key), &done);
|
||||
GotoIfNot(IsHeapNumber(CAST(key)), &done);
|
||||
TNode<Float64T> const number = LoadHeapNumberValue(CAST(key));
|
||||
const TNode<Float64T> number = LoadHeapNumberValue(CAST(key));
|
||||
GotoIfNot(Float64Equal(number, Float64Constant(0.0)), &done);
|
||||
// We know the value is zero, so we take the key to be Smi 0.
|
||||
// Another option would be to normalize to Smi here.
|
||||
@ -1623,7 +1623,7 @@ TF_BUILTIN(MapPrototypeSet, CollectionsBuiltinsAssembler) {
|
||||
|
||||
key = NormalizeNumberKey(key);
|
||||
|
||||
TNode<OrderedHashMap> const table =
|
||||
const TNode<OrderedHashMap> table =
|
||||
LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset);
|
||||
|
||||
TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0));
|
||||
@ -1663,10 +1663,10 @@ TF_BUILTIN(MapPrototypeSet, CollectionsBuiltinsAssembler) {
|
||||
table, OrderedHashMap::NumberOfBucketsIndex())));
|
||||
|
||||
STATIC_ASSERT(OrderedHashMap::kLoadFactor == 2);
|
||||
TNode<WordT> const capacity = WordShl(number_of_buckets.value(), 1);
|
||||
TNode<IntPtrT> const number_of_elements = SmiUntag(
|
||||
const TNode<WordT> capacity = WordShl(number_of_buckets.value(), 1);
|
||||
const TNode<IntPtrT> number_of_elements = SmiUntag(
|
||||
CAST(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset())));
|
||||
TNode<IntPtrT> const number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
const TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
table, OrderedHashMap::NumberOfDeletedElementsOffset())));
|
||||
occupancy = IntPtrAdd(number_of_elements, number_of_deleted);
|
||||
GotoIf(IntPtrLessThan(occupancy.value(), capacity), &store_new_entry);
|
||||
@ -1678,9 +1678,9 @@ TF_BUILTIN(MapPrototypeSet, CollectionsBuiltinsAssembler) {
|
||||
LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset);
|
||||
number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement(
|
||||
table_var.value(), OrderedHashMap::NumberOfBucketsIndex())));
|
||||
TNode<IntPtrT> const new_number_of_elements = SmiUntag(CAST(LoadObjectField(
|
||||
const TNode<IntPtrT> new_number_of_elements = SmiUntag(CAST(LoadObjectField(
|
||||
table_var.value(), OrderedHashMap::NumberOfElementsOffset())));
|
||||
TNode<IntPtrT> const new_number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
const TNode<IntPtrT> new_number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
table_var.value(), OrderedHashMap::NumberOfDeletedElementsOffset())));
|
||||
occupancy = IntPtrAdd(new_number_of_elements, new_number_of_deleted);
|
||||
Goto(&store_new_entry);
|
||||
@ -1694,16 +1694,16 @@ TF_BUILTIN(MapPrototypeSet, CollectionsBuiltinsAssembler) {
|
||||
}
|
||||
|
||||
void CollectionsBuiltinsAssembler::StoreOrderedHashMapNewEntry(
|
||||
TNode<OrderedHashMap> const table, const TNode<Object> key,
|
||||
const TNode<OrderedHashMap> table, const TNode<Object> key,
|
||||
const TNode<Object> value, const TNode<IntPtrT> hash,
|
||||
const TNode<IntPtrT> number_of_buckets, const TNode<IntPtrT> occupancy) {
|
||||
TNode<IntPtrT> const bucket =
|
||||
const TNode<IntPtrT> bucket =
|
||||
WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1)));
|
||||
TNode<Smi> bucket_entry = CAST(UnsafeLoadFixedArrayElement(
|
||||
table, bucket, OrderedHashMap::HashTableStartIndex() * kTaggedSize));
|
||||
|
||||
// Store the entry elements.
|
||||
TNode<IntPtrT> const entry_start = IntPtrAdd(
|
||||
const TNode<IntPtrT> entry_start = IntPtrAdd(
|
||||
IntPtrMul(occupancy, IntPtrConstant(OrderedHashMap::kEntrySize)),
|
||||
number_of_buckets);
|
||||
UnsafeStoreFixedArrayElement(
|
||||
@ -1724,7 +1724,7 @@ void CollectionsBuiltinsAssembler::StoreOrderedHashMapNewEntry(
|
||||
OrderedHashMap::HashTableStartIndex() * kTaggedSize);
|
||||
|
||||
// Bump the elements count.
|
||||
TNode<Smi> const number_of_elements =
|
||||
const TNode<Smi> number_of_elements =
|
||||
CAST(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset()));
|
||||
StoreObjectFieldNoWriteBarrier(table,
|
||||
OrderedHashMap::NumberOfElementsOffset(),
|
||||
@ -1739,7 +1739,7 @@ TF_BUILTIN(MapPrototypeDelete, CollectionsBuiltinsAssembler) {
|
||||
ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE,
|
||||
"Map.prototype.delete");
|
||||
|
||||
TNode<OrderedHashMap> const table =
|
||||
const TNode<OrderedHashMap> table =
|
||||
LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset);
|
||||
|
||||
TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0));
|
||||
@ -1762,12 +1762,12 @@ TF_BUILTIN(MapPrototypeDelete, CollectionsBuiltinsAssembler) {
|
||||
OrderedHashMap::kValueOffset));
|
||||
|
||||
// Decrement the number of elements, increment the number of deleted elements.
|
||||
TNode<Smi> const number_of_elements = SmiSub(
|
||||
const TNode<Smi> number_of_elements = SmiSub(
|
||||
CAST(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset())),
|
||||
SmiConstant(1));
|
||||
StoreObjectFieldNoWriteBarrier(
|
||||
table, OrderedHashMap::NumberOfElementsOffset(), number_of_elements);
|
||||
TNode<Smi> const number_of_deleted =
|
||||
const TNode<Smi> number_of_deleted =
|
||||
SmiAdd(CAST(LoadObjectField(
|
||||
table, OrderedHashMap::NumberOfDeletedElementsOffset())),
|
||||
SmiConstant(1));
|
||||
@ -1775,7 +1775,7 @@ TF_BUILTIN(MapPrototypeDelete, CollectionsBuiltinsAssembler) {
|
||||
table, OrderedHashMap::NumberOfDeletedElementsOffset(),
|
||||
number_of_deleted);
|
||||
|
||||
TNode<Smi> const number_of_buckets = CAST(
|
||||
const TNode<Smi> number_of_buckets = CAST(
|
||||
LoadFixedArrayElement(table, OrderedHashMap::NumberOfBucketsIndex()));
|
||||
|
||||
// If there fewer elements than #buckets / 2, shrink the table.
|
||||
@ -1799,7 +1799,7 @@ TF_BUILTIN(SetPrototypeAdd, CollectionsBuiltinsAssembler) {
|
||||
|
||||
key = NormalizeNumberKey(key);
|
||||
|
||||
TNode<OrderedHashSet> const table =
|
||||
const TNode<OrderedHashSet> table =
|
||||
LoadObjectField<OrderedHashSet>(CAST(receiver), JSMap::kTableOffset);
|
||||
|
||||
TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0));
|
||||
@ -1835,10 +1835,10 @@ TF_BUILTIN(SetPrototypeAdd, CollectionsBuiltinsAssembler) {
|
||||
table, OrderedHashSet::NumberOfBucketsIndex())));
|
||||
|
||||
STATIC_ASSERT(OrderedHashSet::kLoadFactor == 2);
|
||||
TNode<WordT> const capacity = WordShl(number_of_buckets.value(), 1);
|
||||
TNode<IntPtrT> const number_of_elements = SmiUntag(
|
||||
const TNode<WordT> capacity = WordShl(number_of_buckets.value(), 1);
|
||||
const TNode<IntPtrT> number_of_elements = SmiUntag(
|
||||
CAST(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset())));
|
||||
TNode<IntPtrT> const number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
const TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
table, OrderedHashSet::NumberOfDeletedElementsOffset())));
|
||||
occupancy = IntPtrAdd(number_of_elements, number_of_deleted);
|
||||
GotoIf(IntPtrLessThan(occupancy.value(), capacity), &store_new_entry);
|
||||
@ -1850,9 +1850,9 @@ TF_BUILTIN(SetPrototypeAdd, CollectionsBuiltinsAssembler) {
|
||||
LoadObjectField<OrderedHashSet>(CAST(receiver), JSMap::kTableOffset);
|
||||
number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement(
|
||||
table_var.value(), OrderedHashSet::NumberOfBucketsIndex())));
|
||||
TNode<IntPtrT> const new_number_of_elements = SmiUntag(CAST(LoadObjectField(
|
||||
const TNode<IntPtrT> new_number_of_elements = SmiUntag(CAST(LoadObjectField(
|
||||
table_var.value(), OrderedHashSet::NumberOfElementsOffset())));
|
||||
TNode<IntPtrT> const new_number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
const TNode<IntPtrT> new_number_of_deleted = SmiUntag(CAST(LoadObjectField(
|
||||
table_var.value(), OrderedHashSet::NumberOfDeletedElementsOffset())));
|
||||
occupancy = IntPtrAdd(new_number_of_elements, new_number_of_deleted);
|
||||
Goto(&store_new_entry);
|
||||
@ -1866,16 +1866,16 @@ TF_BUILTIN(SetPrototypeAdd, CollectionsBuiltinsAssembler) {
|
||||
}
|
||||
|
||||
void CollectionsBuiltinsAssembler::StoreOrderedHashSetNewEntry(
|
||||
TNode<OrderedHashSet> const table, const TNode<Object> key,
|
||||
const TNode<OrderedHashSet> table, const TNode<Object> key,
|
||||
const TNode<IntPtrT> hash, const TNode<IntPtrT> number_of_buckets,
|
||||
const TNode<IntPtrT> occupancy) {
|
||||
TNode<IntPtrT> const bucket =
|
||||
const TNode<IntPtrT> bucket =
|
||||
WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1)));
|
||||
TNode<Smi> bucket_entry = CAST(UnsafeLoadFixedArrayElement(
|
||||
table, bucket, OrderedHashSet::HashTableStartIndex() * kTaggedSize));
|
||||
|
||||
// Store the entry elements.
|
||||
TNode<IntPtrT> const entry_start = IntPtrAdd(
|
||||
const TNode<IntPtrT> entry_start = IntPtrAdd(
|
||||
IntPtrMul(occupancy, IntPtrConstant(OrderedHashSet::kEntrySize)),
|
||||
number_of_buckets);
|
||||
UnsafeStoreFixedArrayElement(
|
||||
@ -1892,7 +1892,7 @@ void CollectionsBuiltinsAssembler::StoreOrderedHashSetNewEntry(
|
||||
OrderedHashSet::HashTableStartIndex() * kTaggedSize);
|
||||
|
||||
// Bump the elements count.
|
||||
TNode<Smi> const number_of_elements =
|
||||
const TNode<Smi> number_of_elements =
|
||||
CAST(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset()));
|
||||
StoreObjectFieldNoWriteBarrier(table,
|
||||
OrderedHashSet::NumberOfElementsOffset(),
|
||||
@ -1907,7 +1907,7 @@ TF_BUILTIN(SetPrototypeDelete, CollectionsBuiltinsAssembler) {
|
||||
ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE,
|
||||
"Set.prototype.delete");
|
||||
|
||||
TNode<OrderedHashSet> const table =
|
||||
const TNode<OrderedHashSet> table =
|
||||
LoadObjectField<OrderedHashSet>(CAST(receiver), JSMap::kTableOffset);
|
||||
|
||||
TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0));
|
||||
@ -1926,12 +1926,12 @@ TF_BUILTIN(SetPrototypeDelete, CollectionsBuiltinsAssembler) {
|
||||
kTaggedSize * OrderedHashSet::HashTableStartIndex());
|
||||
|
||||
// Decrement the number of elements, increment the number of deleted elements.
|
||||
TNode<Smi> const number_of_elements = SmiSub(
|
||||
const TNode<Smi> number_of_elements = SmiSub(
|
||||
CAST(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset())),
|
||||
SmiConstant(1));
|
||||
StoreObjectFieldNoWriteBarrier(
|
||||
table, OrderedHashSet::NumberOfElementsOffset(), number_of_elements);
|
||||
TNode<Smi> const number_of_deleted =
|
||||
const TNode<Smi> number_of_deleted =
|
||||
SmiAdd(CAST(LoadObjectField(
|
||||
table, OrderedHashSet::NumberOfDeletedElementsOffset())),
|
||||
SmiConstant(1));
|
||||
@ -1939,7 +1939,7 @@ TF_BUILTIN(SetPrototypeDelete, CollectionsBuiltinsAssembler) {
|
||||
table, OrderedHashSet::NumberOfDeletedElementsOffset(),
|
||||
number_of_deleted);
|
||||
|
||||
TNode<Smi> const number_of_buckets = CAST(
|
||||
const TNode<Smi> number_of_buckets = CAST(
|
||||
LoadFixedArrayElement(table, OrderedHashSet::NumberOfBucketsIndex()));
|
||||
|
||||
// If there fewer elements than #buckets / 2, shrink the table.
|
||||
@ -1968,7 +1968,7 @@ TF_BUILTIN(MapPrototypeGetSize, CollectionsBuiltinsAssembler) {
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE,
|
||||
"get Map.prototype.size");
|
||||
TNode<OrderedHashMap> const table =
|
||||
const TNode<OrderedHashMap> table =
|
||||
LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset);
|
||||
Return(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset()));
|
||||
}
|
||||
@ -1979,9 +1979,9 @@ TF_BUILTIN(MapPrototypeForEach, CollectionsBuiltinsAssembler) {
|
||||
UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount));
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
CodeStubArguments args(this, argc);
|
||||
TNode<Object> const receiver = args.GetReceiver();
|
||||
TNode<Object> const callback = args.GetOptionalArgumentValue(0);
|
||||
TNode<Object> const this_arg = args.GetOptionalArgumentValue(1);
|
||||
const TNode<Object> receiver = args.GetReceiver();
|
||||
const TNode<Object> callback = args.GetOptionalArgumentValue(0);
|
||||
const TNode<Object> this_arg = args.GetOptionalArgumentValue(1);
|
||||
|
||||
ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, kMethodName);
|
||||
|
||||
@ -2062,7 +2062,7 @@ TF_BUILTIN(MapIteratorPrototypeNext, CollectionsBuiltinsAssembler) {
|
||||
// Ensure that the {receiver} is actually a JSMapIterator.
|
||||
Label if_receiver_valid(this), if_receiver_invalid(this, Label::kDeferred);
|
||||
GotoIf(TaggedIsSmi(receiver), &if_receiver_invalid);
|
||||
TNode<Uint16T> const receiver_instance_type =
|
||||
const TNode<Uint16T> receiver_instance_type =
|
||||
LoadInstanceType(CAST(receiver));
|
||||
GotoIf(
|
||||
InstanceTypeEqual(receiver_instance_type, JS_MAP_KEY_VALUE_ITERATOR_TYPE),
|
||||
@ -2137,7 +2137,7 @@ TF_BUILTIN(SetPrototypeHas, CollectionsBuiltinsAssembler) {
|
||||
|
||||
ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "Set.prototype.has");
|
||||
|
||||
TNode<Object> const table =
|
||||
const TNode<Object> table =
|
||||
LoadObjectField(CAST(receiver), JSMap::kTableOffset);
|
||||
|
||||
TVARIABLE(IntPtrT, entry_start_position, IntPtrConstant(0));
|
||||
@ -2205,7 +2205,7 @@ TF_BUILTIN(SetPrototypeGetSize, CollectionsBuiltinsAssembler) {
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE,
|
||||
"get Set.prototype.size");
|
||||
TNode<OrderedHashSet> const table =
|
||||
const TNode<OrderedHashSet> table =
|
||||
LoadObjectField<OrderedHashSet>(CAST(receiver), JSSet::kTableOffset);
|
||||
Return(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset()));
|
||||
}
|
||||
@ -2216,9 +2216,9 @@ TF_BUILTIN(SetPrototypeForEach, CollectionsBuiltinsAssembler) {
|
||||
UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount));
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
CodeStubArguments args(this, argc);
|
||||
TNode<Object> const receiver = args.GetReceiver();
|
||||
TNode<Object> const callback = args.GetOptionalArgumentValue(0);
|
||||
TNode<Object> const this_arg = args.GetOptionalArgumentValue(1);
|
||||
const TNode<Object> receiver = args.GetReceiver();
|
||||
const TNode<Object> callback = args.GetOptionalArgumentValue(0);
|
||||
const TNode<Object> this_arg = args.GetOptionalArgumentValue(1);
|
||||
|
||||
ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, kMethodName);
|
||||
|
||||
@ -2284,7 +2284,7 @@ TF_BUILTIN(SetIteratorPrototypeNext, CollectionsBuiltinsAssembler) {
|
||||
// Ensure that the {receiver} is actually a JSSetIterator.
|
||||
Label if_receiver_valid(this), if_receiver_invalid(this, Label::kDeferred);
|
||||
GotoIf(TaggedIsSmi(receiver), &if_receiver_invalid);
|
||||
TNode<Uint16T> const receiver_instance_type =
|
||||
const TNode<Uint16T> receiver_instance_type =
|
||||
LoadInstanceType(CAST(receiver));
|
||||
GotoIf(InstanceTypeEqual(receiver_instance_type, JS_SET_VALUE_ITERATOR_TYPE),
|
||||
&if_receiver_valid);
|
||||
@ -2729,8 +2729,8 @@ TF_BUILTIN(WeakMapGet, WeakCollectionsBuiltinsAssembler) {
|
||||
ThrowIfNotInstanceType(context, receiver, JS_WEAK_MAP_TYPE,
|
||||
"WeakMap.prototype.get");
|
||||
|
||||
TNode<EphemeronHashTable> const table = LoadTable(CAST(receiver));
|
||||
TNode<Smi> const index =
|
||||
const TNode<EphemeronHashTable> table = LoadTable(CAST(receiver));
|
||||
const TNode<Smi> index =
|
||||
CAST(CallBuiltin(Builtins::kWeakMapLookupHashIndex, context, table, key));
|
||||
|
||||
GotoIf(TaggedEqual(index, SmiConstant(-1)), &return_undefined);
|
||||
@ -2751,8 +2751,8 @@ TF_BUILTIN(WeakMapPrototypeHas, WeakCollectionsBuiltinsAssembler) {
|
||||
ThrowIfNotInstanceType(context, receiver, JS_WEAK_MAP_TYPE,
|
||||
"WeakMap.prototype.has");
|
||||
|
||||
TNode<EphemeronHashTable> const table = LoadTable(CAST(receiver));
|
||||
TNode<Object> const index =
|
||||
const TNode<EphemeronHashTable> table = LoadTable(CAST(receiver));
|
||||
const TNode<Object> index =
|
||||
CallBuiltin(Builtins::kWeakMapLookupHashIndex, context, table, key);
|
||||
|
||||
GotoIf(TaggedEqual(index, SmiConstant(-1)), &return_false);
|
||||
@ -2915,8 +2915,8 @@ TF_BUILTIN(WeakSetPrototypeHas, WeakCollectionsBuiltinsAssembler) {
|
||||
ThrowIfNotInstanceType(context, receiver, JS_WEAK_SET_TYPE,
|
||||
"WeakSet.prototype.has");
|
||||
|
||||
TNode<EphemeronHashTable> const table = LoadTable(CAST(receiver));
|
||||
TNode<Object> const index =
|
||||
const TNode<EphemeronHashTable> table = LoadTable(CAST(receiver));
|
||||
const TNode<Object> index =
|
||||
CallBuiltin(Builtins::kWeakMapLookupHashIndex, context, table, key);
|
||||
|
||||
GotoIf(TaggedEqual(index, SmiConstant(-1)), &return_false);
|
||||
|
@ -67,7 +67,7 @@ TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) {
|
||||
|
||||
// Bump the closure counter encoded the {feedback_cell}s map.
|
||||
{
|
||||
TNode<Map> const feedback_cell_map = LoadMap(feedback_cell);
|
||||
const TNode<Map> feedback_cell_map = LoadMap(feedback_cell);
|
||||
Label no_closures(this), one_closure(this), cell_done(this);
|
||||
|
||||
GotoIf(IsNoClosuresCellMap(feedback_cell_map), &no_closures);
|
||||
@ -91,7 +91,7 @@ TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) {
|
||||
// SharedFunctionInfo::function_map_index().
|
||||
TNode<Uint32T> flags = LoadObjectField<Uint32T>(
|
||||
shared_function_info, SharedFunctionInfo::kFlagsOffset);
|
||||
TNode<IntPtrT> const function_map_index = Signed(IntPtrAdd(
|
||||
const TNode<IntPtrT> function_map_index = Signed(IntPtrAdd(
|
||||
DecodeWordFromWord32<SharedFunctionInfo::FunctionMapIndexBits>(flags),
|
||||
IntPtrConstant(Context::FIRST_FUNCTION_MAP_INDEX)));
|
||||
CSA_ASSERT(this, UintPtrLessThanOrEqual(
|
||||
@ -100,8 +100,8 @@ TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) {
|
||||
|
||||
// Get the function map in the current native context and set that
|
||||
// as the map of the allocated object.
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Map> const function_map =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Map> function_map =
|
||||
CAST(LoadContextElement(native_context, function_map_index));
|
||||
|
||||
// Create a new closure from the given function info in new space
|
||||
|
@ -40,12 +40,12 @@ class IntlBuiltinsAssembler : public CodeStubAssembler {
|
||||
};
|
||||
|
||||
TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) {
|
||||
TNode<String> const string = CAST(Parameter(Descriptor::kString));
|
||||
const TNode<String> string = CAST(Parameter(Descriptor::kString));
|
||||
|
||||
Label call_c(this), return_string(this), runtime(this, Label::kDeferred);
|
||||
|
||||
// Early exit on empty strings.
|
||||
TNode<Uint32T> const length = LoadStringLengthAsWord32(string);
|
||||
const TNode<Uint32T> length = LoadStringLengthAsWord32(string);
|
||||
GotoIf(Word32Equal(length, Uint32Constant(0)), &return_string);
|
||||
|
||||
// Unpack strings if possible, and bail to runtime unless we get a one-byte
|
||||
@ -54,14 +54,14 @@ TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) {
|
||||
state(), string, ToDirectStringAssembler::kDontUnpackSlicedStrings);
|
||||
to_direct.TryToDirect(&runtime);
|
||||
|
||||
TNode<Int32T> const instance_type = to_direct.instance_type();
|
||||
const TNode<Int32T> instance_type = to_direct.instance_type();
|
||||
CSA_ASSERT(this,
|
||||
Word32BinaryNot(IsIndirectStringInstanceType(instance_type)));
|
||||
GotoIfNot(IsOneByteStringInstanceType(instance_type), &runtime);
|
||||
|
||||
// For short strings, do the conversion in CSA through the lookup table.
|
||||
|
||||
TNode<String> const dst = AllocateSeqOneByteString(length);
|
||||
const TNode<String> dst = AllocateSeqOneByteString(length);
|
||||
|
||||
const int kMaxShortStringLength = 24; // Determined empirically.
|
||||
GotoIf(Uint32GreaterThan(length, Uint32Constant(kMaxShortStringLength)),
|
||||
@ -71,12 +71,12 @@ TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) {
|
||||
const TNode<IntPtrT> dst_ptr = PointerToSeqStringData(dst);
|
||||
TVARIABLE(IntPtrT, var_cursor, IntPtrConstant(0));
|
||||
|
||||
TNode<IntPtrT> const start_address =
|
||||
const TNode<IntPtrT> start_address =
|
||||
ReinterpretCast<IntPtrT>(to_direct.PointerToData(&call_c));
|
||||
TNode<IntPtrT> const end_address =
|
||||
const TNode<IntPtrT> end_address =
|
||||
Signed(IntPtrAdd(start_address, ChangeUint32ToWord(length)));
|
||||
|
||||
TNode<ExternalReference> const to_lower_table_addr =
|
||||
const TNode<ExternalReference> to_lower_table_addr =
|
||||
ExternalConstant(ExternalReference::intl_to_latin1_lower_table());
|
||||
|
||||
TVARIABLE(Word32T, var_did_change, Int32Constant(0));
|
||||
@ -110,9 +110,9 @@ TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) {
|
||||
// String ConvertOneByteToLower(String src, String dst);
|
||||
BIND(&call_c);
|
||||
{
|
||||
TNode<String> const src = to_direct.string();
|
||||
const TNode<String> src = to_direct.string();
|
||||
|
||||
TNode<ExternalReference> const function_addr =
|
||||
const TNode<ExternalReference> function_addr =
|
||||
ExternalConstant(ExternalReference::intl_convert_one_byte_to_lower());
|
||||
|
||||
MachineType type_tagged = MachineType::AnyTagged();
|
||||
@ -129,7 +129,7 @@ TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) {
|
||||
|
||||
BIND(&runtime);
|
||||
{
|
||||
TNode<Object> const result = CallRuntime(Runtime::kStringToLowerCaseIntl,
|
||||
const TNode<Object> result = CallRuntime(Runtime::kStringToLowerCaseIntl,
|
||||
NoContextConstant(), string);
|
||||
Return(result);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ IteratorRecord IteratorBuiltinsAssembler::GetIterator(Node* context,
|
||||
}
|
||||
|
||||
BIND(&get_next);
|
||||
TNode<Object> const next =
|
||||
const TNode<Object> next =
|
||||
GetProperty(context, iterator, factory()->next_string());
|
||||
GotoIfException(next, if_exception, exception);
|
||||
|
||||
@ -387,7 +387,7 @@ void IteratorBuiltinsAssembler::FastIterableToList(
|
||||
iterable, context, &string_maybe_fast_call, &check_map);
|
||||
|
||||
BIND(&string_maybe_fast_call);
|
||||
TNode<IntPtrT> const length = LoadStringLengthAsWord(CAST(iterable));
|
||||
const TNode<IntPtrT> length = LoadStringLengthAsWord(CAST(iterable));
|
||||
// Use string length as conservative approximation of number of codepoints.
|
||||
GotoIf(
|
||||
IntPtrGreaterThan(length, IntPtrConstant(JSArray::kMaxFastArrayLength)),
|
||||
|
@ -216,9 +216,9 @@ TF_BUILTIN(MathRandom, CodeStubAssembler) {
|
||||
GotoIf(SmiAbove(smi_index.value(), SmiConstant(0)), &if_cached);
|
||||
|
||||
// Cache exhausted, populate the cache. Return value is the new index.
|
||||
TNode<ExternalReference> const refill_math_random =
|
||||
const TNode<ExternalReference> refill_math_random =
|
||||
ExternalConstant(ExternalReference::refill_math_random());
|
||||
TNode<ExternalReference> const isolate_ptr =
|
||||
const TNode<ExternalReference> isolate_ptr =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
MachineType type_tagged = MachineType::AnyTagged();
|
||||
MachineType type_ptr = MachineType::Pointer();
|
||||
|
@ -158,9 +158,9 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
|
||||
|
||||
BIND(&is_callback);
|
||||
{
|
||||
TNode<Object> const microtask_callback =
|
||||
const TNode<Object> microtask_callback =
|
||||
LoadObjectField(microtask, CallbackTask::kCallbackOffset);
|
||||
TNode<Object> const microtask_data =
|
||||
const TNode<Object> microtask_data =
|
||||
LoadObjectField(microtask, CallbackTask::kDataOffset);
|
||||
|
||||
// If this turns out to become a bottleneck because of the calls
|
||||
@ -173,7 +173,7 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
|
||||
// But from our current measurements it doesn't seem to be a
|
||||
// serious performance problem, even if the microtask is full
|
||||
// of CallHandlerTasks (which is not a realistic use case anyways).
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallRuntime(Runtime::kRunMicrotaskCallback, current_context,
|
||||
microtask_callback, microtask_data);
|
||||
GotoIfException(result, &if_exception, &var_exception);
|
||||
@ -188,14 +188,14 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
|
||||
TNode<NativeContext> native_context = LoadNativeContext(microtask_context);
|
||||
PrepareForContext(native_context, &done);
|
||||
|
||||
TNode<Object> const promise_to_resolve = LoadObjectField(
|
||||
const TNode<Object> promise_to_resolve = LoadObjectField(
|
||||
microtask, PromiseResolveThenableJobTask::kPromiseToResolveOffset);
|
||||
TNode<Object> const then =
|
||||
const TNode<Object> then =
|
||||
LoadObjectField(microtask, PromiseResolveThenableJobTask::kThenOffset);
|
||||
TNode<Object> const thenable = LoadObjectField(
|
||||
const TNode<Object> thenable = LoadObjectField(
|
||||
microtask, PromiseResolveThenableJobTask::kThenableOffset);
|
||||
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallBuiltin(Builtins::kPromiseResolveThenableJob, native_context,
|
||||
promise_to_resolve, thenable, then);
|
||||
GotoIfException(result, &if_exception, &var_exception);
|
||||
@ -212,18 +212,18 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
|
||||
TNode<NativeContext> native_context = LoadNativeContext(microtask_context);
|
||||
PrepareForContext(native_context, &done);
|
||||
|
||||
TNode<Object> const argument =
|
||||
const TNode<Object> argument =
|
||||
LoadObjectField(microtask, PromiseReactionJobTask::kArgumentOffset);
|
||||
TNode<Object> const handler =
|
||||
const TNode<Object> handler =
|
||||
LoadObjectField(microtask, PromiseReactionJobTask::kHandlerOffset);
|
||||
TNode<HeapObject> const promise_or_capability = CAST(LoadObjectField(
|
||||
const TNode<HeapObject> promise_or_capability = CAST(LoadObjectField(
|
||||
microtask, PromiseReactionJobTask::kPromiseOrCapabilityOffset));
|
||||
|
||||
// Run the promise before/debug hook if enabled.
|
||||
RunPromiseHook(Runtime::kPromiseHookBefore, microtask_context,
|
||||
promise_or_capability);
|
||||
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallBuiltin(Builtins::kPromiseFulfillReactionJob, microtask_context,
|
||||
argument, handler, promise_or_capability);
|
||||
GotoIfException(result, &if_exception, &var_exception);
|
||||
@ -245,18 +245,18 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
|
||||
TNode<NativeContext> native_context = LoadNativeContext(microtask_context);
|
||||
PrepareForContext(native_context, &done);
|
||||
|
||||
TNode<Object> const argument =
|
||||
const TNode<Object> argument =
|
||||
LoadObjectField(microtask, PromiseReactionJobTask::kArgumentOffset);
|
||||
TNode<Object> const handler =
|
||||
const TNode<Object> handler =
|
||||
LoadObjectField(microtask, PromiseReactionJobTask::kHandlerOffset);
|
||||
TNode<HeapObject> const promise_or_capability = CAST(LoadObjectField(
|
||||
const TNode<HeapObject> promise_or_capability = CAST(LoadObjectField(
|
||||
microtask, PromiseReactionJobTask::kPromiseOrCapabilityOffset));
|
||||
|
||||
// Run the promise before/debug hook if enabled.
|
||||
RunPromiseHook(Runtime::kPromiseHookBefore, microtask_context,
|
||||
promise_or_capability);
|
||||
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallBuiltin(Builtins::kPromiseRejectReactionJob, microtask_context,
|
||||
argument, handler, promise_or_capability);
|
||||
GotoIfException(result, &if_exception, &var_exception);
|
||||
|
@ -1062,9 +1062,9 @@ TF_BUILTIN(ObjectPrototypeValueOf, CodeStubAssembler) {
|
||||
|
||||
// ES #sec-object.create
|
||||
TF_BUILTIN(CreateObjectWithoutProperties, ObjectBuiltinsAssembler) {
|
||||
TNode<Object> const prototype = CAST(Parameter(Descriptor::kPrototypeArg));
|
||||
TNode<Context> const context = CAST(Parameter(Descriptor::kContext));
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<Object> prototype = CAST(Parameter(Descriptor::kPrototypeArg));
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
Label call_runtime(this, Label::kDeferred), prototype_null(this),
|
||||
prototype_jsreceiver(this);
|
||||
{
|
||||
@ -1221,8 +1221,8 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
|
||||
|
||||
// ES #sec-object.is
|
||||
TF_BUILTIN(ObjectIs, ObjectBuiltinsAssembler) {
|
||||
TNode<Object> const left = CAST(Parameter(Descriptor::kLeft));
|
||||
TNode<Object> const right = CAST(Parameter(Descriptor::kRight));
|
||||
const TNode<Object> left = CAST(Parameter(Descriptor::kLeft));
|
||||
const TNode<Object> right = CAST(Parameter(Descriptor::kRight));
|
||||
|
||||
Label return_true(this), return_false(this);
|
||||
BranchIfSameValue(left, right, &return_true, &return_false);
|
||||
@ -1235,15 +1235,15 @@ TF_BUILTIN(ObjectIs, ObjectBuiltinsAssembler) {
|
||||
}
|
||||
|
||||
TF_BUILTIN(CreateIterResultObject, ObjectBuiltinsAssembler) {
|
||||
TNode<Object> const value = CAST(Parameter(Descriptor::kValue));
|
||||
TNode<Oddball> const done = CAST(Parameter(Descriptor::kDone));
|
||||
TNode<Context> const context = CAST(Parameter(Descriptor::kContext));
|
||||
const TNode<Object> value = CAST(Parameter(Descriptor::kValue));
|
||||
const TNode<Oddball> done = CAST(Parameter(Descriptor::kDone));
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Map> const map = CAST(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Map> map = CAST(
|
||||
LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
|
||||
TNode<JSObject> const result = AllocateJSObjectFromMap(map);
|
||||
const TNode<JSObject> result = AllocateJSObjectFromMap(map);
|
||||
|
||||
StoreObjectFieldNoWriteBarrier(result, JSIteratorResult::kValueOffset, value);
|
||||
StoreObjectFieldNoWriteBarrier(result, JSIteratorResult::kDoneOffset, done);
|
||||
|
@ -26,13 +26,13 @@ using PromiseResolvingFunctions = TorqueStructPromiseResolvingFunctions;
|
||||
|
||||
TNode<JSPromise> PromiseBuiltinsAssembler::AllocateJSPromise(
|
||||
TNode<Context> context) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<JSFunction> const promise_fun =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<JSFunction> promise_fun =
|
||||
CAST(LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX));
|
||||
CSA_ASSERT(this, IsFunctionWithPrototypeSlotMap(LoadMap(promise_fun)));
|
||||
TNode<Object> const promise_map =
|
||||
const TNode<Object> promise_map =
|
||||
LoadObjectField(promise_fun, JSFunction::kPrototypeOrInitialMapOffset);
|
||||
TNode<HeapObject> const promise =
|
||||
const TNode<HeapObject> promise =
|
||||
Allocate(JSPromise::kSizeWithEmbedderFields);
|
||||
StoreMapNoWriteBarrier(promise, promise_map);
|
||||
StoreObjectFieldRoot(promise, JSPromise::kPropertiesOrHashOffset,
|
||||
@ -169,7 +169,7 @@ Node* PromiseBuiltinsAssembler::CreatePromiseAllResolveElementContext(
|
||||
TNode<JSArray> values_array = AllocateJSArray(
|
||||
PACKED_ELEMENTS, array_map, IntPtrConstant(0), SmiConstant(0));
|
||||
|
||||
TNode<Context> const context = AllocateSyntheticFunctionContext(
|
||||
const TNode<Context> context = AllocateSyntheticFunctionContext(
|
||||
CAST(native_context), PromiseBuiltins::kPromiseAllResolveElementLength);
|
||||
StoreContextElementNoWriteBarrier(
|
||||
context, PromiseBuiltins::kPromiseAllResolveElementRemainingSlot,
|
||||
@ -221,15 +221,15 @@ TNode<Context> PromiseBuiltinsAssembler::CreatePromiseResolvingFunctionsContext(
|
||||
}
|
||||
|
||||
Node* PromiseBuiltinsAssembler::PromiseHasHandler(Node* promise) {
|
||||
TNode<Smi> const flags =
|
||||
const TNode<Smi> flags =
|
||||
CAST(LoadObjectField(promise, JSPromise::kFlagsOffset));
|
||||
return IsSetWord(SmiUntag(flags), 1 << JSPromise::kHasHandlerBit);
|
||||
}
|
||||
|
||||
void PromiseBuiltinsAssembler::PromiseSetHasHandler(Node* promise) {
|
||||
TNode<Smi> const flags =
|
||||
const TNode<Smi> flags =
|
||||
CAST(LoadObjectField(promise, JSPromise::kFlagsOffset));
|
||||
TNode<Smi> const new_flags =
|
||||
const TNode<Smi> new_flags =
|
||||
SmiOr(flags, SmiConstant(1 << JSPromise::kHasHandlerBit));
|
||||
StoreObjectFieldNoWriteBarrier(promise, JSPromise::kFlagsOffset, new_flags);
|
||||
}
|
||||
@ -241,7 +241,7 @@ TNode<BoolT> PromiseBuiltinsAssembler::IsPromiseStatus(
|
||||
|
||||
TNode<Word32T> PromiseBuiltinsAssembler::PromiseStatus(Node* promise) {
|
||||
STATIC_ASSERT(JSPromise::kStatusShift == 0);
|
||||
TNode<Smi> const flags =
|
||||
const TNode<Smi> flags =
|
||||
CAST(LoadObjectField(promise, JSPromise::kFlagsOffset));
|
||||
return Word32And(SmiToInt32(flags), Int32Constant(JSPromise::kStatusMask));
|
||||
}
|
||||
@ -253,16 +253,16 @@ void PromiseBuiltinsAssembler::PromiseSetStatus(
|
||||
CHECK_NE(status, v8::Promise::kPending);
|
||||
|
||||
TNode<Smi> mask = SmiConstant(status);
|
||||
TNode<Smi> const flags =
|
||||
const TNode<Smi> flags =
|
||||
CAST(LoadObjectField(promise, JSPromise::kFlagsOffset));
|
||||
StoreObjectFieldNoWriteBarrier(promise, JSPromise::kFlagsOffset,
|
||||
SmiOr(flags, mask));
|
||||
}
|
||||
|
||||
void PromiseBuiltinsAssembler::PromiseSetHandledHint(Node* promise) {
|
||||
TNode<Smi> const flags =
|
||||
const TNode<Smi> flags =
|
||||
CAST(LoadObjectField(promise, JSPromise::kFlagsOffset));
|
||||
TNode<Smi> const new_flags =
|
||||
const TNode<Smi> new_flags =
|
||||
SmiOr(flags, SmiConstant(1 << JSPromise::kHandledHintBit));
|
||||
StoreObjectFieldNoWriteBarrier(promise, JSPromise::kFlagsOffset, new_flags);
|
||||
}
|
||||
@ -282,7 +282,7 @@ void PromiseBuiltinsAssembler::PerformPromiseThen(
|
||||
IsUndefined(result_promise_or_capability)));
|
||||
|
||||
Label if_pending(this), if_notpending(this), done(this);
|
||||
TNode<Word32T> const status = PromiseStatus(promise);
|
||||
const TNode<Word32T> status = PromiseStatus(promise);
|
||||
Branch(IsPromiseStatus(status, v8::Promise::kPending), &if_pending,
|
||||
&if_notpending);
|
||||
|
||||
@ -389,7 +389,7 @@ TF_BUILTIN(PerformPromiseThen, PromiseBuiltinsAssembler) {
|
||||
TNode<PromiseReaction> PromiseBuiltinsAssembler::AllocatePromiseReaction(
|
||||
TNode<Object> next, TNode<HeapObject> promise_or_capability,
|
||||
TNode<HeapObject> fulfill_handler, TNode<HeapObject> reject_handler) {
|
||||
TNode<HeapObject> const reaction = Allocate(PromiseReaction::kSize);
|
||||
const TNode<HeapObject> reaction = Allocate(PromiseReaction::kSize);
|
||||
StoreMapNoWriteBarrier(reaction, RootIndex::kPromiseReactionMap);
|
||||
StoreObjectFieldNoWriteBarrier(reaction, PromiseReaction::kNextOffset, next);
|
||||
StoreObjectFieldNoWriteBarrier(reaction,
|
||||
@ -406,7 +406,7 @@ TNode<PromiseReactionJobTask>
|
||||
PromiseBuiltinsAssembler::AllocatePromiseReactionJobTask(
|
||||
TNode<Map> map, TNode<Context> context, TNode<Object> argument,
|
||||
TNode<HeapObject> handler, TNode<HeapObject> promise_or_capability) {
|
||||
TNode<HeapObject> const microtask =
|
||||
const TNode<HeapObject> microtask =
|
||||
Allocate(PromiseReactionJobTask::kSizeOfAllPromiseReactionJobTasks);
|
||||
StoreMapNoWriteBarrier(microtask, map);
|
||||
StoreObjectFieldNoWriteBarrier(
|
||||
@ -571,7 +571,7 @@ Node* PromiseBuiltinsAssembler::InvokeThen(Node* native_context, Node* receiver,
|
||||
VARIABLE(var_result, MachineRepresentation::kTagged);
|
||||
Label if_fast(this), if_slow(this, Label::kDeferred), done(this, &var_result);
|
||||
GotoIf(TaggedIsSmi(receiver), &if_slow);
|
||||
TNode<Map> const receiver_map = LoadMap(receiver);
|
||||
const TNode<Map> receiver_map = LoadMap(receiver);
|
||||
// We can skip the "then" lookup on {receiver} if it's [[Prototype]]
|
||||
// is the (initial) Promise.prototype and the Promise#then protector
|
||||
// is intact, as that guards the lookup path for the "then" property
|
||||
@ -581,7 +581,7 @@ Node* PromiseBuiltinsAssembler::InvokeThen(Node* native_context, Node* receiver,
|
||||
|
||||
BIND(&if_fast);
|
||||
{
|
||||
TNode<Object> const then =
|
||||
const TNode<Object> then =
|
||||
LoadContextElement(native_context, Context::PROMISE_THEN_INDEX);
|
||||
Node* const result =
|
||||
CallJS(CodeFactory::CallFunction(
|
||||
@ -593,7 +593,7 @@ Node* PromiseBuiltinsAssembler::InvokeThen(Node* native_context, Node* receiver,
|
||||
|
||||
BIND(&if_slow);
|
||||
{
|
||||
TNode<Object> const then = GetProperty(native_context, receiver,
|
||||
const TNode<Object> then = GetProperty(native_context, receiver,
|
||||
isolate()->factory()->then_string());
|
||||
Node* const result = CallJS(
|
||||
CodeFactory::Call(isolate(), ConvertReceiverMode::kNotNullOrUndefined),
|
||||
@ -621,7 +621,7 @@ Node* PromiseBuiltinsAssembler::CallResolve(Node* native_context,
|
||||
|
||||
BIND(&if_fast);
|
||||
{
|
||||
TNode<Object> const result = CallBuiltin(
|
||||
const TNode<Object> result = CallBuiltin(
|
||||
Builtins::kPromiseResolve, native_context, constructor, value);
|
||||
GotoIfException(result, if_exception, var_exception);
|
||||
|
||||
@ -686,7 +686,7 @@ void PromiseBuiltinsAssembler::BranchIfPromiseThenLookupChainIntact(
|
||||
|
||||
GotoIfForceSlowPath(if_slow);
|
||||
GotoIfNot(IsJSPromiseMap(receiver_map), if_slow);
|
||||
TNode<Object> const promise_prototype =
|
||||
const TNode<Object> promise_prototype =
|
||||
LoadContextElement(native_context, Context::PROMISE_PROTOTYPE_INDEX);
|
||||
GotoIfNot(TaggedEqual(LoadMapPrototype(receiver_map), promise_prototype),
|
||||
if_slow);
|
||||
@ -771,12 +771,12 @@ TF_BUILTIN(PromiseCapabilityDefaultReject, PromiseBuiltinsAssembler) {
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
// 2. Let promise be F.[[Promise]].
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
LoadContextElement(context, PromiseBuiltins::kPromiseSlot);
|
||||
|
||||
// 3. Let alreadyResolved be F.[[AlreadyResolved]].
|
||||
Label if_already_resolved(this, Label::kDeferred);
|
||||
TNode<Object> const already_resolved =
|
||||
const TNode<Object> already_resolved =
|
||||
LoadContextElement(context, PromiseBuiltins::kAlreadyResolvedSlot);
|
||||
|
||||
// 4. If alreadyResolved.[[Value]] is true, return undefined.
|
||||
@ -787,7 +787,7 @@ TF_BUILTIN(PromiseCapabilityDefaultReject, PromiseBuiltinsAssembler) {
|
||||
context, PromiseBuiltins::kAlreadyResolvedSlot, TrueConstant());
|
||||
|
||||
// 6. Return RejectPromise(promise, reason).
|
||||
TNode<Object> const debug_event =
|
||||
const TNode<Object> debug_event =
|
||||
LoadContextElement(context, PromiseBuiltins::kDebugEventSlot);
|
||||
Return(CallBuiltin(Builtins::kRejectPromise, context, promise, reason,
|
||||
debug_event));
|
||||
@ -805,12 +805,12 @@ TF_BUILTIN(PromiseCapabilityDefaultResolve, PromiseBuiltinsAssembler) {
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
// 2. Let promise be F.[[Promise]].
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
LoadContextElement(context, PromiseBuiltins::kPromiseSlot);
|
||||
|
||||
// 3. Let alreadyResolved be F.[[AlreadyResolved]].
|
||||
Label if_already_resolved(this, Label::kDeferred);
|
||||
TNode<Object> const already_resolved =
|
||||
const TNode<Object> already_resolved =
|
||||
LoadContextElement(context, PromiseBuiltins::kAlreadyResolvedSlot);
|
||||
|
||||
// 4. If alreadyResolved.[[Value]] is true, return undefined.
|
||||
@ -863,11 +863,11 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
|
||||
|
||||
GotoIf(TaggedIsSmi(executor), &if_notcallable);
|
||||
|
||||
TNode<Map> const executor_map = LoadMap(CAST(executor));
|
||||
const TNode<Map> executor_map = LoadMap(CAST(executor));
|
||||
GotoIfNot(IsCallableMap(executor_map), &if_notcallable);
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<JSFunction> const promise_fun =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<JSFunction> promise_fun =
|
||||
CAST(LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX));
|
||||
Node* const is_debug_active = IsDebugActive();
|
||||
Label if_targetisnotmodified(this),
|
||||
@ -886,7 +886,7 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
|
||||
|
||||
BIND(&if_targetisnotmodified);
|
||||
{
|
||||
TNode<JSPromise> const instance = AllocateAndInitJSPromise(context);
|
||||
const TNode<JSPromise> instance = AllocateAndInitJSPromise(context);
|
||||
var_result.Bind(instance);
|
||||
Goto(&debug_push);
|
||||
}
|
||||
@ -954,7 +954,7 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
|
||||
// Silently fail if the stack looks fishy.
|
||||
BIND(&if_noaccess);
|
||||
{
|
||||
TNode<Smi> const counter_id =
|
||||
const TNode<Smi> counter_id =
|
||||
SmiConstant(v8::Isolate::kPromiseConstructorReturnedUndefined);
|
||||
CallRuntime(Runtime::kIncrementUseCounter, context, counter_id);
|
||||
Return(UndefinedConstant());
|
||||
@ -978,10 +978,10 @@ TF_BUILTIN(PromisePrototypeThen, PromiseBuiltinsAssembler) {
|
||||
// 3. Let C be ? SpeciesConstructor(promise, %Promise%).
|
||||
Label fast_promise_capability(this), slow_constructor(this, Label::kDeferred),
|
||||
slow_promise_capability(this, Label::kDeferred);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TNode<JSFunction> promise_fun =
|
||||
CAST(LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX));
|
||||
TNode<Map> const promise_map = LoadMap(js_promise);
|
||||
const TNode<Map> promise_map = LoadMap(js_promise);
|
||||
BranchIfPromiseSpeciesLookupChainIntact(
|
||||
native_context, promise_map, &fast_promise_capability, &slow_constructor);
|
||||
|
||||
@ -1007,8 +1007,8 @@ TF_BUILTIN(PromisePrototypeThen, PromiseBuiltinsAssembler) {
|
||||
|
||||
BIND(&slow_promise_capability);
|
||||
{
|
||||
TNode<Oddball> const debug_event = TrueConstant();
|
||||
TNode<PromiseCapability> const capability = CAST(CallBuiltin(
|
||||
const TNode<Oddball> debug_event = TrueConstant();
|
||||
const TNode<PromiseCapability> capability = CAST(CallBuiltin(
|
||||
Builtins::kNewPromiseCapability, context, constructor, debug_event));
|
||||
var_result_promise =
|
||||
LoadObjectField(capability, PromiseCapability::kPromiseOffset);
|
||||
@ -1061,12 +1061,12 @@ TF_BUILTIN(PromisePrototypeThen, PromiseBuiltinsAssembler) {
|
||||
TF_BUILTIN(PromisePrototypeCatch, PromiseBuiltinsAssembler) {
|
||||
// 1. Let promise be the this value.
|
||||
Node* const receiver = Parameter(Descriptor::kReceiver);
|
||||
TNode<Oddball> const on_fulfilled = UndefinedConstant();
|
||||
const TNode<Oddball> on_fulfilled = UndefinedConstant();
|
||||
Node* const on_rejected = Parameter(Descriptor::kOnRejected);
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
// 2. Return ? Invoke(promise, "then", « undefined, onRejected »).
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
Return(InvokeThen(native_context, receiver, on_fulfilled, on_rejected));
|
||||
}
|
||||
|
||||
@ -1090,7 +1090,7 @@ TF_BUILTIN(PromiseResolveThenableJob, PromiseBuiltinsAssembler) {
|
||||
TNode<Object> promise_then =
|
||||
LoadContextElement(native_context, Context::PROMISE_THEN_INDEX);
|
||||
GotoIfNot(TaggedEqual(then, promise_then), &if_slow);
|
||||
TNode<Map> const thenable_map = LoadMap(thenable);
|
||||
const TNode<Map> thenable_map = LoadMap(thenable);
|
||||
GotoIfNot(IsJSPromiseMap(thenable_map), &if_slow);
|
||||
GotoIf(IsPromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate(),
|
||||
&if_slow);
|
||||
@ -1215,7 +1215,7 @@ void PromiseBuiltinsAssembler::PromiseReactionJob(Node* context, Node* argument,
|
||||
{
|
||||
// In the general case we need to call the (user provided)
|
||||
// promiseCapability.[[Resolve]] function.
|
||||
TNode<Object> const resolve = LoadObjectField(
|
||||
const TNode<Object> resolve = LoadObjectField(
|
||||
promise_or_capability, PromiseCapability::kResolveOffset);
|
||||
Node* const result = CallJS(
|
||||
CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
|
||||
@ -1248,7 +1248,7 @@ void PromiseBuiltinsAssembler::PromiseReactionJob(Node* context, Node* argument,
|
||||
Label if_exception(this, Label::kDeferred);
|
||||
VARIABLE(var_exception, MachineRepresentation::kTagged,
|
||||
TheHoleConstant());
|
||||
TNode<Object> const reject = LoadObjectField(
|
||||
const TNode<Object> reject = LoadObjectField(
|
||||
promise_or_capability, PromiseCapability::kRejectOffset);
|
||||
Node* const result = CallJS(
|
||||
CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
|
||||
@ -1322,7 +1322,7 @@ TF_BUILTIN(PromiseResolve, PromiseBuiltinsAssembler) {
|
||||
|
||||
// Check if {value} is a JSPromise.
|
||||
GotoIf(TaggedIsSmi(value), &if_need_to_allocate);
|
||||
TNode<Map> const value_map = LoadMap(CAST(value));
|
||||
const TNode<Map> value_map = LoadMap(CAST(value));
|
||||
GotoIfNot(IsJSPromiseMap(value_map), &if_need_to_allocate);
|
||||
|
||||
// We can skip the "constructor" lookup on {value} if it's [[Prototype]]
|
||||
@ -1362,24 +1362,24 @@ TF_BUILTIN(PromiseResolve, PromiseBuiltinsAssembler) {
|
||||
// create NewPromiseCapability.
|
||||
BIND(&if_nativepromise);
|
||||
{
|
||||
TNode<JSPromise> const result = AllocateAndInitJSPromise(context);
|
||||
const TNode<JSPromise> result = AllocateAndInitJSPromise(context);
|
||||
CallBuiltin(Builtins::kResolvePromise, context, result, value);
|
||||
Return(result);
|
||||
}
|
||||
|
||||
BIND(&if_notnativepromise);
|
||||
{
|
||||
TNode<Oddball> const debug_event = TrueConstant();
|
||||
TNode<PromiseCapability> const capability = CAST(CallBuiltin(
|
||||
const TNode<Oddball> debug_event = TrueConstant();
|
||||
const TNode<PromiseCapability> capability = CAST(CallBuiltin(
|
||||
Builtins::kNewPromiseCapability, context, constructor, debug_event));
|
||||
|
||||
TNode<Object> const resolve =
|
||||
const TNode<Object> resolve =
|
||||
LoadObjectField(capability, PromiseCapability::kResolveOffset);
|
||||
CallJS(
|
||||
CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
|
||||
context, resolve, UndefinedConstant(), value);
|
||||
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
LoadObjectField(capability, PromiseCapability::kPromiseOffset);
|
||||
Return(result);
|
||||
}
|
||||
@ -1392,7 +1392,7 @@ TF_BUILTIN(PromiseGetCapabilitiesExecutor, PromiseBuiltinsAssembler) {
|
||||
Node* const reject = Parameter(Descriptor::kReject);
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
TNode<PromiseCapability> const capability =
|
||||
const TNode<PromiseCapability> capability =
|
||||
CAST(LoadContextElement(context, PromiseBuiltins::kCapabilitySlot));
|
||||
|
||||
Label if_alreadyinvoked(this, Label::kDeferred);
|
||||
@ -1423,7 +1423,7 @@ TF_BUILTIN(PromiseReject, PromiseBuiltinsAssembler) {
|
||||
"PromiseReject");
|
||||
|
||||
Label if_nativepromise(this), if_custompromise(this, Label::kDeferred);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
|
||||
TNode<Object> promise_fun =
|
||||
LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX);
|
||||
@ -1432,7 +1432,7 @@ TF_BUILTIN(PromiseReject, PromiseBuiltinsAssembler) {
|
||||
|
||||
BIND(&if_nativepromise);
|
||||
{
|
||||
TNode<JSPromise> const promise =
|
||||
const TNode<JSPromise> promise =
|
||||
AllocateAndSetJSPromise(context, v8::Promise::kRejected, reason);
|
||||
CallRuntime(Runtime::kPromiseRejectEventFromStack, context, promise,
|
||||
reason);
|
||||
@ -1442,18 +1442,18 @@ TF_BUILTIN(PromiseReject, PromiseBuiltinsAssembler) {
|
||||
BIND(&if_custompromise);
|
||||
{
|
||||
// 3. Let promiseCapability be ? NewPromiseCapability(C).
|
||||
TNode<Oddball> const debug_event = TrueConstant();
|
||||
TNode<PromiseCapability> const capability = CAST(CallBuiltin(
|
||||
const TNode<Oddball> debug_event = TrueConstant();
|
||||
const TNode<PromiseCapability> capability = CAST(CallBuiltin(
|
||||
Builtins::kNewPromiseCapability, context, receiver, debug_event));
|
||||
|
||||
// 4. Perform ? Call(promiseCapability.[[Reject]], undefined, « r »).
|
||||
TNode<Object> const reject =
|
||||
const TNode<Object> reject =
|
||||
LoadObjectField(capability, PromiseCapability::kRejectOffset);
|
||||
CallJS(CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
|
||||
context, reject, UndefinedConstant(), reason);
|
||||
|
||||
// 5. Return promiseCapability.[[Promise]].
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
LoadObjectField(capability, PromiseCapability::kPromiseOffset);
|
||||
Return(promise);
|
||||
}
|
||||
@ -1471,11 +1471,11 @@ std::pair<Node*, Node*> PromiseBuiltinsAssembler::CreatePromiseFinallyFunctions(
|
||||
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
|
||||
const TNode<SharedFunctionInfo> then_finally_info = CAST(LoadContextElement(
|
||||
native_context, Context::PROMISE_THEN_FINALLY_SHARED_FUN));
|
||||
TNode<JSFunction> const then_finally = AllocateFunctionWithMapAndContext(
|
||||
const TNode<JSFunction> then_finally = AllocateFunctionWithMapAndContext(
|
||||
map, then_finally_info, promise_context);
|
||||
const TNode<SharedFunctionInfo> catch_finally_info = CAST(LoadContextElement(
|
||||
native_context, Context::PROMISE_CATCH_FINALLY_SHARED_FUN));
|
||||
TNode<JSFunction> const catch_finally = AllocateFunctionWithMapAndContext(
|
||||
const TNode<JSFunction> catch_finally = AllocateFunctionWithMapAndContext(
|
||||
map, catch_finally_info, promise_context);
|
||||
return std::make_pair(then_finally, catch_finally);
|
||||
}
|
||||
@ -1483,7 +1483,7 @@ std::pair<Node*, Node*> PromiseBuiltinsAssembler::CreatePromiseFinallyFunctions(
|
||||
TF_BUILTIN(PromiseValueThunkFinally, PromiseBuiltinsAssembler) {
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
TNode<Object> const value =
|
||||
const TNode<Object> value =
|
||||
LoadContextElement(context, PromiseBuiltins::kValueSlot);
|
||||
Return(value);
|
||||
}
|
||||
@ -1499,7 +1499,7 @@ Node* PromiseBuiltinsAssembler::CreateValueThunkFunction(Node* value,
|
||||
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
|
||||
const TNode<SharedFunctionInfo> value_thunk_info = CAST(LoadContextElement(
|
||||
native_context, Context::PROMISE_VALUE_THUNK_FINALLY_SHARED_FUN));
|
||||
TNode<JSFunction> const value_thunk = AllocateFunctionWithMapAndContext(
|
||||
const TNode<JSFunction> value_thunk = AllocateFunctionWithMapAndContext(
|
||||
map, value_thunk_info, value_thunk_context);
|
||||
return value_thunk;
|
||||
}
|
||||
@ -1511,7 +1511,7 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) {
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
// 1. Let onFinally be F.[[OnFinally]].
|
||||
TNode<HeapObject> const on_finally =
|
||||
const TNode<HeapObject> on_finally =
|
||||
CAST(LoadContextElement(context, PromiseBuiltins::kOnFinallySlot));
|
||||
|
||||
// 2. Assert: IsCallable(onFinally) is true.
|
||||
@ -1523,18 +1523,18 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) {
|
||||
context, on_finally, UndefinedConstant());
|
||||
|
||||
// 4. Let C be F.[[Constructor]].
|
||||
TNode<JSFunction> const constructor =
|
||||
const TNode<JSFunction> constructor =
|
||||
CAST(LoadContextElement(context, PromiseBuiltins::kConstructorSlot));
|
||||
|
||||
// 5. Assert: IsConstructor(C) is true.
|
||||
CSA_ASSERT(this, IsConstructor(constructor));
|
||||
|
||||
// 6. Let promise be ? PromiseResolve(C, result).
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
CallBuiltin(Builtins::kPromiseResolve, context, constructor, result);
|
||||
|
||||
// 7. Let valueThunk be equivalent to a function that returns value.
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
Node* const value_thunk = CreateValueThunkFunction(value, native_context);
|
||||
|
||||
// 8. Return ? Invoke(promise, "then", « valueThunk »).
|
||||
@ -1544,7 +1544,7 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) {
|
||||
TF_BUILTIN(PromiseThrowerFinally, PromiseBuiltinsAssembler) {
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
TNode<Object> const reason =
|
||||
const TNode<Object> reason =
|
||||
LoadContextElement(context, PromiseBuiltins::kValueSlot);
|
||||
CallRuntime(Runtime::kThrow, context, reason);
|
||||
Unreachable();
|
||||
@ -1561,7 +1561,7 @@ Node* PromiseBuiltinsAssembler::CreateThrowerFunction(Node* reason,
|
||||
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
|
||||
const TNode<SharedFunctionInfo> thrower_info = CAST(LoadContextElement(
|
||||
native_context, Context::PROMISE_THROWER_FINALLY_SHARED_FUN));
|
||||
TNode<JSFunction> const thrower =
|
||||
const TNode<JSFunction> thrower =
|
||||
AllocateFunctionWithMapAndContext(map, thrower_info, thrower_context);
|
||||
return thrower;
|
||||
}
|
||||
@ -1573,7 +1573,7 @@ TF_BUILTIN(PromiseCatchFinally, PromiseBuiltinsAssembler) {
|
||||
Node* const context = Parameter(Descriptor::kContext);
|
||||
|
||||
// 1. Let onFinally be F.[[OnFinally]].
|
||||
TNode<HeapObject> const on_finally =
|
||||
const TNode<HeapObject> on_finally =
|
||||
CAST(LoadContextElement(context, PromiseBuiltins::kOnFinallySlot));
|
||||
|
||||
// 2. Assert: IsCallable(onFinally) is true.
|
||||
@ -1585,18 +1585,18 @@ TF_BUILTIN(PromiseCatchFinally, PromiseBuiltinsAssembler) {
|
||||
context, on_finally, UndefinedConstant());
|
||||
|
||||
// 4. Let C be F.[[Constructor]].
|
||||
TNode<JSFunction> const constructor =
|
||||
const TNode<JSFunction> constructor =
|
||||
CAST(LoadContextElement(context, PromiseBuiltins::kConstructorSlot));
|
||||
|
||||
// 5. Assert: IsConstructor(C) is true.
|
||||
CSA_ASSERT(this, IsConstructor(constructor));
|
||||
|
||||
// 6. Let promise be ? PromiseResolve(C, result).
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
CallBuiltin(Builtins::kPromiseResolve, context, constructor, result);
|
||||
|
||||
// 7. Let thrower be equivalent to a function that throws reason.
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
Node* const thrower = CreateThrowerFunction(reason, native_context);
|
||||
|
||||
// 8. Return ? Invoke(promise, "then", « thrower »).
|
||||
@ -1617,18 +1617,18 @@ TF_BUILTIN(PromisePrototypeFinally, PromiseBuiltinsAssembler) {
|
||||
"Promise.prototype.finally");
|
||||
|
||||
// 3. Let C be ? SpeciesConstructor(promise, %Promise%).
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const promise_fun =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> promise_fun =
|
||||
LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX);
|
||||
VARIABLE(var_constructor, MachineRepresentation::kTagged, promise_fun);
|
||||
Label slow_constructor(this, Label::kDeferred), done_constructor(this);
|
||||
TNode<Map> const receiver_map = LoadMap(receiver);
|
||||
const TNode<Map> receiver_map = LoadMap(receiver);
|
||||
GotoIfNot(IsJSPromiseMap(receiver_map), &slow_constructor);
|
||||
BranchIfPromiseSpeciesLookupChainIntact(native_context, receiver_map,
|
||||
&done_constructor, &slow_constructor);
|
||||
BIND(&slow_constructor);
|
||||
{
|
||||
TNode<JSReceiver> const constructor =
|
||||
const TNode<JSReceiver> constructor =
|
||||
SpeciesConstructor(context, receiver, CAST(promise_fun));
|
||||
var_constructor.Bind(constructor);
|
||||
Goto(&done_constructor);
|
||||
@ -1728,9 +1728,9 @@ TF_BUILTIN(RejectPromise, PromiseBuiltinsAssembler) {
|
||||
|
||||
// ES #sec-promise-resolve-functions
|
||||
TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) {
|
||||
TNode<JSPromise> const promise = CAST(Parameter(Descriptor::kPromise));
|
||||
TNode<Object> const resolution = CAST(Parameter(Descriptor::kResolution));
|
||||
TNode<Context> const context = CAST(Parameter(Descriptor::kContext));
|
||||
const TNode<JSPromise> promise = CAST(Parameter(Descriptor::kPromise));
|
||||
const TNode<Object> resolution = CAST(Parameter(Descriptor::kResolution));
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
|
||||
Label do_enqueue(this), if_fulfill(this), if_reject(this, Label::kDeferred),
|
||||
if_runtime(this, Label::kDeferred);
|
||||
@ -1759,11 +1759,11 @@ TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) {
|
||||
// is intact, as that guards the lookup path for the "then" property
|
||||
// on JSPromise instances which have the (initial) %PromisePrototype%.
|
||||
Label if_fast(this), if_receiver(this), if_slow(this, Label::kDeferred);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
GotoIfForceSlowPath(&if_slow);
|
||||
GotoIf(IsPromiseThenProtectorCellInvalid(), &if_slow);
|
||||
GotoIfNot(IsJSPromiseMap(resolution_map), &if_receiver);
|
||||
TNode<Object> const promise_prototype =
|
||||
const TNode<Object> promise_prototype =
|
||||
LoadContextElement(native_context, Context::PROMISE_PROTOTYPE_INDEX);
|
||||
Branch(TaggedEqual(LoadMapPrototype(resolution_map), promise_prototype),
|
||||
&if_fast, &if_slow);
|
||||
@ -1785,7 +1785,7 @@ TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) {
|
||||
// results from async generators.
|
||||
CSA_ASSERT(this, IsJSReceiverMap(resolution_map));
|
||||
CSA_ASSERT(this, Word32BinaryNot(IsPromiseThenProtectorCellInvalid()));
|
||||
TNode<Object> const iterator_result_map =
|
||||
const TNode<Object> iterator_result_map =
|
||||
LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX);
|
||||
Branch(TaggedEqual(resolution_map, iterator_result_map), &if_fulfill,
|
||||
&if_slow);
|
||||
@ -1802,7 +1802,7 @@ TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) {
|
||||
|
||||
// 11. If IsCallable(thenAction) is false, then
|
||||
GotoIf(TaggedIsSmi(then), &if_fulfill);
|
||||
TNode<Map> const then_map = LoadMap(CAST(then));
|
||||
const TNode<Map> then_map = LoadMap(CAST(then));
|
||||
GotoIfNot(IsCallableMap(then_map), &if_fulfill);
|
||||
var_then = CAST(then);
|
||||
Goto(&do_enqueue);
|
||||
@ -1888,9 +1888,9 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
// Let next be IteratorStep(iteratorRecord.[[Iterator]]).
|
||||
// If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
|
||||
// ReturnIfAbrupt(next).
|
||||
TNode<Map> const fast_iterator_result_map = CAST(
|
||||
const TNode<Map> fast_iterator_result_map = CAST(
|
||||
LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
TNode<JSReceiver> const next = iter_assembler.IteratorStep(
|
||||
const TNode<JSReceiver> next = iter_assembler.IteratorStep(
|
||||
native_context, iterator, &done_loop, fast_iterator_result_map,
|
||||
if_exception, var_exception);
|
||||
|
||||
@ -1898,12 +1898,12 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
// If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to
|
||||
// true.
|
||||
// ReturnIfAbrupt(nextValue).
|
||||
TNode<Object> const next_value = iter_assembler.IteratorValue(
|
||||
const TNode<Object> next_value = iter_assembler.IteratorValue(
|
||||
native_context, next, fast_iterator_result_map, if_exception,
|
||||
var_exception);
|
||||
|
||||
// Check if we reached the limit.
|
||||
TNode<Smi> const index = var_index.value();
|
||||
const TNode<Smi> index = var_index.value();
|
||||
GotoIf(SmiEqual(index, SmiConstant(PropertyArray::HashField::kMax)),
|
||||
&too_many_elements);
|
||||
|
||||
@ -1912,7 +1912,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
|
||||
// Set remainingElementsCount.[[Value]] to
|
||||
// remainingElementsCount.[[Value]] + 1.
|
||||
TNode<Smi> const remaining_elements_count = CAST(LoadContextElement(
|
||||
const TNode<Smi> remaining_elements_count = CAST(LoadContextElement(
|
||||
resolve_element_context,
|
||||
PromiseBuiltins::kPromiseAllResolveElementRemainingSlot));
|
||||
StoreContextElementNoWriteBarrier(
|
||||
@ -1931,9 +1931,9 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
// Set resolveElement.[[Values]] to values.
|
||||
// Set resolveElement.[[Capability]] to resultCapability.
|
||||
// Set resolveElement.[[RemainingElements]] to remainingElementsCount.
|
||||
TNode<Object> const resolve_element_fun = create_resolve_element_function(
|
||||
const TNode<Object> resolve_element_fun = create_resolve_element_function(
|
||||
resolve_element_context, index, native_context, Cast(capability));
|
||||
TNode<Object> const reject_element_fun = create_reject_element_function(
|
||||
const TNode<Object> reject_element_fun = create_reject_element_function(
|
||||
resolve_element_context, index, native_context, Cast(capability));
|
||||
|
||||
// We can skip the "resolve" lookup on the {constructor} as well as the
|
||||
@ -1959,7 +1959,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
&if_slow);
|
||||
GotoIf(IsPromiseSpeciesProtectorCellInvalid(), &if_slow);
|
||||
GotoIf(TaggedIsSmi(next_value), &if_slow);
|
||||
TNode<Map> const next_value_map = LoadMap(CAST(next_value));
|
||||
const TNode<Map> next_value_map = LoadMap(CAST(next_value));
|
||||
BranchIfPromiseThenLookupChainIntact(native_context, next_value_map,
|
||||
&if_fast, &if_slow);
|
||||
|
||||
@ -1984,7 +1984,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
|
||||
// Perform ? Invoke(nextPromise, "then", « resolveElement,
|
||||
// resultCapability.[[Reject]] »).
|
||||
TNode<Object> const then =
|
||||
const TNode<Object> then =
|
||||
GetProperty(native_context, next_promise, factory()->then_string());
|
||||
GotoIfException(then, &close_iterator, var_exception);
|
||||
|
||||
@ -2017,7 +2017,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
// function and pass the larger indices via a separate context, but it
|
||||
// doesn't seem likely that we need this, and it's unclear how the rest
|
||||
// of the system deals with 2**21 live Promises anyways.
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallRuntime(Runtime::kThrowRangeError, native_context,
|
||||
SmiConstant(MessageTemplate::kTooManyElementsInPromiseAll));
|
||||
GotoIfException(result, &close_iterator, var_exception);
|
||||
@ -2053,14 +2053,14 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
// capacity here. We may already have elements here in case of some
|
||||
// fancy Thenable that calls the resolve callback immediately, so we need
|
||||
// to handle that correctly here.
|
||||
TNode<JSArray> const values_array = CAST(LoadContextElement(
|
||||
const TNode<JSArray> values_array = CAST(LoadContextElement(
|
||||
resolve_element_context,
|
||||
PromiseBuiltins::kPromiseAllResolveElementValuesArraySlot));
|
||||
TNode<FixedArrayBase> const old_elements = LoadElements(values_array);
|
||||
TNode<Smi> const old_capacity = LoadFixedArrayBaseLength(old_elements);
|
||||
TNode<Smi> const new_capacity = var_index.value();
|
||||
const TNode<FixedArrayBase> old_elements = LoadElements(values_array);
|
||||
const TNode<Smi> old_capacity = LoadFixedArrayBaseLength(old_elements);
|
||||
const TNode<Smi> new_capacity = var_index.value();
|
||||
GotoIf(SmiGreaterThanOrEqual(old_capacity, new_capacity), &return_promise);
|
||||
TNode<FixedArrayBase> const new_elements =
|
||||
const TNode<FixedArrayBase> new_elements =
|
||||
AllocateFixedArray(PACKED_ELEMENTS, new_capacity, SMI_PARAMETERS,
|
||||
AllocationFlag::kAllowLargeObjectAllocation);
|
||||
CopyFixedArrayElements(PACKED_ELEMENTS, old_elements, PACKED_ELEMENTS,
|
||||
@ -2075,9 +2075,9 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
// « valuesArray »).
|
||||
BIND(&resolve_promise);
|
||||
{
|
||||
TNode<Object> const resolve =
|
||||
const TNode<Object> resolve =
|
||||
LoadObjectField(capability, PromiseCapability::kResolveOffset);
|
||||
TNode<Object> const values_array = LoadContextElement(
|
||||
const TNode<Object> values_array = LoadContextElement(
|
||||
resolve_element_context,
|
||||
PromiseBuiltins::kPromiseAllResolveElementValuesArraySlot);
|
||||
Node* const resolve_call = CallJS(
|
||||
@ -2091,7 +2091,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
|
||||
BIND(&return_promise);
|
||||
}
|
||||
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
LoadObjectField(capability, PromiseCapability::kPromiseOffset);
|
||||
return promise;
|
||||
}
|
||||
@ -2110,8 +2110,8 @@ void PromiseBuiltinsAssembler::Generate_PromiseAll(
|
||||
// Let promiseCapability be ? NewPromiseCapability(C).
|
||||
// Don't fire debugEvent so that forwarding the rejection through all does not
|
||||
// trigger redundant ExceptionEvents
|
||||
TNode<Oddball> const debug_event = FalseConstant();
|
||||
TNode<PromiseCapability> const capability = CAST(CallBuiltin(
|
||||
const TNode<Oddball> debug_event = FalseConstant();
|
||||
const TNode<PromiseCapability> capability = CAST(CallBuiltin(
|
||||
Builtins::kNewPromiseCapability, context, receiver, debug_event));
|
||||
|
||||
VARIABLE(var_exception, MachineRepresentation::kTagged, TheHoleConstant());
|
||||
@ -2137,12 +2137,12 @@ void PromiseBuiltinsAssembler::Generate_PromiseAll(
|
||||
{
|
||||
// Exception must be bound to a JS value.
|
||||
CSA_SLOW_ASSERT(this, IsNotTheHole(var_exception.value()));
|
||||
TNode<Object> const reject =
|
||||
const TNode<Object> reject =
|
||||
LoadObjectField(capability, PromiseCapability::kRejectOffset);
|
||||
CallJS(CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
|
||||
context, reject, UndefinedConstant(), var_exception.value());
|
||||
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
LoadObjectField(capability, PromiseCapability::kPromiseOffset);
|
||||
Return(promise);
|
||||
}
|
||||
@ -2389,20 +2389,20 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
|
||||
VARIABLE(var_exception, MachineRepresentation::kTagged, TheHoleConstant());
|
||||
|
||||
Node* const receiver = Parameter(Descriptor::kReceiver);
|
||||
TNode<Context> const context = CAST(Parameter(Descriptor::kContext));
|
||||
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
ThrowIfNotJSReceiver(context, CAST(receiver),
|
||||
MessageTemplate::kCalledOnNonObject, "Promise.race");
|
||||
|
||||
// Let promiseCapability be ? NewPromiseCapability(C).
|
||||
// Don't fire debugEvent so that forwarding the rejection through all does not
|
||||
// trigger redundant ExceptionEvents
|
||||
TNode<Oddball> const debug_event = FalseConstant();
|
||||
TNode<PromiseCapability> const capability = CAST(CallBuiltin(
|
||||
const TNode<Oddball> debug_event = FalseConstant();
|
||||
const TNode<PromiseCapability> capability = CAST(CallBuiltin(
|
||||
Builtins::kNewPromiseCapability, context, receiver, debug_event));
|
||||
|
||||
TNode<Object> const resolve =
|
||||
const TNode<Object> resolve =
|
||||
LoadObjectField(capability, PromiseCapability::kResolveOffset);
|
||||
TNode<Object> const reject =
|
||||
const TNode<Object> reject =
|
||||
LoadObjectField(capability, PromiseCapability::kRejectOffset);
|
||||
|
||||
Label close_iterator(this, Label::kDeferred);
|
||||
@ -2425,7 +2425,7 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
|
||||
// as that guards the lookup path for the "resolve" property on the
|
||||
// Promise constructor.
|
||||
Label loop(this), break_loop(this), if_slow(this, Label::kDeferred);
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TVARIABLE(Object, var_promise_resolve_function, UndefinedConstant());
|
||||
GotoIfNotPromiseResolveLookupChainIntact(native_context, receiver,
|
||||
&if_slow);
|
||||
@ -2448,13 +2448,13 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
|
||||
|
||||
BIND(&loop);
|
||||
{
|
||||
TNode<Map> const fast_iterator_result_map = CAST(LoadContextElement(
|
||||
const TNode<Map> fast_iterator_result_map = CAST(LoadContextElement(
|
||||
native_context, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
|
||||
// Let next be IteratorStep(iteratorRecord.[[Iterator]]).
|
||||
// If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
|
||||
// ReturnIfAbrupt(next).
|
||||
TNode<JSReceiver> const next = iter_assembler.IteratorStep(
|
||||
const TNode<JSReceiver> next = iter_assembler.IteratorStep(
|
||||
context, iterator, &break_loop, fast_iterator_result_map,
|
||||
&reject_promise, &var_exception);
|
||||
|
||||
@ -2462,7 +2462,7 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
|
||||
// If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to
|
||||
// true.
|
||||
// ReturnIfAbrupt(nextValue).
|
||||
TNode<Object> const next_value =
|
||||
const TNode<Object> next_value =
|
||||
iter_assembler.IteratorValue(context, next, fast_iterator_result_map,
|
||||
&reject_promise, &var_exception);
|
||||
|
||||
@ -2474,7 +2474,7 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
|
||||
|
||||
// Perform ? Invoke(nextPromise, "then", « resolveElement,
|
||||
// resultCapability.[[Reject]] »).
|
||||
TNode<Object> const then =
|
||||
const TNode<Object> then =
|
||||
GetProperty(context, next_promise, factory()->then_string());
|
||||
GotoIfException(then, &close_iterator, &var_exception);
|
||||
|
||||
@ -2506,12 +2506,12 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
|
||||
|
||||
BIND(&reject_promise);
|
||||
{
|
||||
TNode<Object> const reject =
|
||||
const TNode<Object> reject =
|
||||
LoadObjectField(capability, PromiseCapability::kRejectOffset);
|
||||
CallJS(CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
|
||||
context, reject, UndefinedConstant(), var_exception.value());
|
||||
|
||||
TNode<Object> const promise =
|
||||
const TNode<Object> promise =
|
||||
LoadObjectField(capability, PromiseCapability::kPromiseOffset);
|
||||
Return(promise);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ Node* ProxiesCodeStubAssembler::AllocateJSArrayForCodeStubArguments(
|
||||
|
||||
Node* ProxiesCodeStubAssembler::CreateProxyRevokeFunctionContext(
|
||||
Node* proxy, Node* native_context) {
|
||||
TNode<Context> const context = AllocateSyntheticFunctionContext(
|
||||
const TNode<Context> context = AllocateSyntheticFunctionContext(
|
||||
CAST(native_context), kProxyContextLength);
|
||||
StoreContextElementNoWriteBarrier(context, kProxySlot, proxy);
|
||||
return context;
|
||||
@ -125,7 +125,7 @@ Node* ProxiesCodeStubAssembler::CreateProxyRevokeFunctionContext(
|
||||
|
||||
TNode<JSFunction> ProxiesCodeStubAssembler::AllocateProxyRevokeFunction(
|
||||
TNode<Context> context, TNode<JSProxy> proxy) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
|
||||
const TNode<Context> proxy_context =
|
||||
CAST(CreateProxyRevokeFunctionContext(proxy, native_context));
|
||||
|
@ -834,12 +834,12 @@ TNode<BoolT> RegExpBuiltinsAssembler::IsFastRegExpNoPrototype(
|
||||
GotoIfForceSlowPath(&out);
|
||||
#endif
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<HeapObject> const regexp_fun =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<HeapObject> regexp_fun =
|
||||
CAST(LoadContextElement(native_context, Context::REGEXP_FUNCTION_INDEX));
|
||||
TNode<Object> const initial_map =
|
||||
const TNode<Object> initial_map =
|
||||
LoadObjectField(regexp_fun, JSFunction::kPrototypeOrInitialMapOffset);
|
||||
TNode<BoolT> const has_initialmap = TaggedEqual(map, initial_map);
|
||||
const TNode<BoolT> has_initialmap = TaggedEqual(map, initial_map);
|
||||
|
||||
var_result = has_initialmap;
|
||||
GotoIfNot(has_initialmap, &out);
|
||||
@ -979,10 +979,10 @@ void RegExpBuiltinsAssembler::BranchIfFastRegExpResult(
|
||||
const TNode<Context> context, const TNode<Object> object,
|
||||
Label* if_isunmodified, Label* if_ismodified) {
|
||||
// Could be a Smi.
|
||||
TNode<Map> const map = LoadReceiverMap(object);
|
||||
const TNode<Map> map = LoadReceiverMap(object);
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const initial_regexp_result_map =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> initial_regexp_result_map =
|
||||
LoadContextElement(native_context, Context::REGEXP_RESULT_MAP_INDEX);
|
||||
|
||||
Branch(TaggedEqual(map, initial_regexp_result_map), if_isunmodified,
|
||||
@ -1012,10 +1012,10 @@ TF_BUILTIN(RegExpExecAtom, RegExpBuiltinsAssembler) {
|
||||
UintPtrLessThanOrEqual(SmiUntag(last_index),
|
||||
LoadStringLengthAsWord(subject_string)));
|
||||
|
||||
TNode<String> const needle_string =
|
||||
const TNode<String> needle_string =
|
||||
CAST(UnsafeLoadFixedArrayElement(data, JSRegExp::kAtomPatternIndex));
|
||||
|
||||
TNode<Smi> const match_from =
|
||||
const TNode<Smi> match_from =
|
||||
CAST(CallBuiltin(Builtins::kStringIndexOf, context, subject_string,
|
||||
needle_string, last_index));
|
||||
|
||||
@ -1031,7 +1031,7 @@ TF_BUILTIN(RegExpExecAtom, RegExpBuiltinsAssembler) {
|
||||
const int kNumRegisters = 2;
|
||||
STATIC_ASSERT(RegExpMatchInfo::kInitialCaptureIndices >= kNumRegisters);
|
||||
|
||||
TNode<Smi> const match_to =
|
||||
const TNode<Smi> match_to =
|
||||
SmiAdd(match_from, LoadStringLengthAsSmi(needle_string));
|
||||
|
||||
UnsafeStoreFixedArrayElement(
|
||||
@ -1073,7 +1073,7 @@ TNode<String> RegExpBuiltinsAssembler::FlagsGetter(TNode<Context> context,
|
||||
bool is_fastpath) {
|
||||
Isolate* isolate = this->isolate();
|
||||
|
||||
TNode<IntPtrT> const int_one = IntPtrConstant(1);
|
||||
const TNode<IntPtrT> int_one = IntPtrConstant(1);
|
||||
TVARIABLE(Uint32T, var_length, Uint32Constant(0));
|
||||
TVARIABLE(IntPtrT, var_flags);
|
||||
|
||||
@ -1083,7 +1083,7 @@ TNode<String> RegExpBuiltinsAssembler::FlagsGetter(TNode<Context> context,
|
||||
if (is_fastpath) {
|
||||
// Refer to JSRegExp's flag property on the fast-path.
|
||||
CSA_ASSERT(this, IsJSRegExp(CAST(regexp)));
|
||||
TNode<Smi> const flags_smi =
|
||||
const TNode<Smi> flags_smi =
|
||||
CAST(LoadObjectField(CAST(regexp), JSRegExp::kFlagsOffset));
|
||||
var_flags = SmiUntag(flags_smi);
|
||||
|
||||
@ -1112,7 +1112,7 @@ TNode<String> RegExpBuiltinsAssembler::FlagsGetter(TNode<Context> context,
|
||||
#define CASE_FOR_FLAG(NAME, FLAG) \
|
||||
do { \
|
||||
Label next(this); \
|
||||
TNode<Object> const flag = GetProperty( \
|
||||
const TNode<Object> flag = GetProperty( \
|
||||
context, regexp, isolate->factory()->InternalizeUtf8String(NAME)); \
|
||||
Label if_isflagset(this); \
|
||||
BranchIfToBooleanIsTrue(flag, &if_isflagset, &next); \
|
||||
@ -1136,7 +1136,7 @@ TNode<String> RegExpBuiltinsAssembler::FlagsGetter(TNode<Context> context,
|
||||
// char for each set flag.
|
||||
|
||||
{
|
||||
TNode<String> const result = AllocateSeqOneByteString(var_length.value());
|
||||
const TNode<String> result = AllocateSeqOneByteString(var_length.value());
|
||||
|
||||
TVARIABLE(IntPtrT, var_offset,
|
||||
IntPtrConstant(SeqOneByteString::kHeaderSize - kHeapObjectTag));
|
||||
@ -1145,7 +1145,7 @@ TNode<String> RegExpBuiltinsAssembler::FlagsGetter(TNode<Context> context,
|
||||
do { \
|
||||
Label next(this); \
|
||||
GotoIfNot(IsSetWord(var_flags.value(), FLAG), &next); \
|
||||
TNode<Int32T> const value = Int32Constant(CHAR); \
|
||||
const TNode<Int32T> value = Int32Constant(CHAR); \
|
||||
StoreNoWriteBarrier(MachineRepresentation::kWord8, result, \
|
||||
var_offset.value(), value); \
|
||||
var_offset = IntPtrAdd(var_offset.value(), int_one); \
|
||||
@ -1171,12 +1171,12 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpInitialize(
|
||||
const TNode<Context> context, const TNode<JSRegExp> regexp,
|
||||
const TNode<Object> maybe_pattern, const TNode<Object> maybe_flags) {
|
||||
// Normalize pattern.
|
||||
TNode<Object> const pattern = Select<Object>(
|
||||
const TNode<Object> pattern = Select<Object>(
|
||||
IsUndefined(maybe_pattern), [=] { return EmptyStringConstant(); },
|
||||
[=] { return ToString_Inline(context, maybe_pattern); });
|
||||
|
||||
// Normalize flags.
|
||||
TNode<Object> const flags = Select<Object>(
|
||||
const TNode<Object> flags = Select<Object>(
|
||||
IsUndefined(maybe_flags), [=] { return EmptyStringConstant(); },
|
||||
[=] { return ToString_Inline(context, maybe_flags); });
|
||||
|
||||
@ -1285,7 +1285,7 @@ TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
|
||||
|
||||
BIND(&allocate_jsregexp);
|
||||
{
|
||||
TNode<Map> const initial_map = CAST(LoadObjectField(
|
||||
const TNode<Map> initial_map = CAST(LoadObjectField(
|
||||
regexp_function, JSFunction::kPrototypeOrInitialMapOffset));
|
||||
var_regexp = CAST(AllocateJSObjectFromMap(initial_map));
|
||||
Goto(&next);
|
||||
@ -1340,8 +1340,8 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
|
||||
}
|
||||
|
||||
const TNode<JSRegExp> pattern = CAST(maybe_pattern);
|
||||
TNode<String> const new_flags = FlagsGetter(context, pattern, true);
|
||||
TNode<Object> const new_pattern =
|
||||
const TNode<String> new_flags = FlagsGetter(context, pattern, true);
|
||||
const TNode<Object> new_pattern =
|
||||
LoadObjectField(pattern, JSRegExp::kSourceOffset);
|
||||
|
||||
var_flags = new_flags;
|
||||
@ -1500,7 +1500,7 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(
|
||||
|
||||
TVARIABLE(Object, var_result);
|
||||
|
||||
TNode<BoolT> const is_global =
|
||||
const TNode<BoolT> is_global =
|
||||
FlagGetter(context, regexp, JSRegExp::kGlobal, is_fastpath);
|
||||
|
||||
Label if_isglobal(this), if_isnotglobal(this), done(this);
|
||||
@ -1516,7 +1516,7 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(
|
||||
|
||||
BIND(&if_isglobal);
|
||||
{
|
||||
TNode<BoolT> const is_unicode =
|
||||
const TNode<BoolT> is_unicode =
|
||||
FlagGetter(context, regexp, JSRegExp::kUnicode, is_fastpath);
|
||||
|
||||
StoreLastIndex(context, regexp, SmiZero(), is_fastpath);
|
||||
@ -1565,9 +1565,9 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(
|
||||
|
||||
BIND(&dosubstring);
|
||||
{
|
||||
TNode<Object> const match_from = UnsafeLoadFixedArrayElement(
|
||||
const TNode<Object> match_from = UnsafeLoadFixedArrayElement(
|
||||
match_indices, RegExpMatchInfo::kFirstCaptureIndex);
|
||||
TNode<Object> const match_to = UnsafeLoadFixedArrayElement(
|
||||
const TNode<Object> match_to = UnsafeLoadFixedArrayElement(
|
||||
match_indices, RegExpMatchInfo::kFirstCaptureIndex + 1);
|
||||
var_match = CAST(CallBuiltin(Builtins::kSubString, context, string,
|
||||
match_from, match_to));
|
||||
@ -1579,7 +1579,7 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(
|
||||
Goto(&if_didmatch);
|
||||
} else {
|
||||
DCHECK(!is_fastpath);
|
||||
TNode<Object> const result = RegExpExec(context, CAST(regexp), string);
|
||||
const TNode<Object> result = RegExpExec(context, CAST(regexp), string);
|
||||
|
||||
Label load_match(this);
|
||||
Branch(IsNull(result), &if_didnotmatch, &load_match);
|
||||
@ -1608,7 +1608,7 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(
|
||||
|
||||
// Advance last index if the match is the empty string.
|
||||
|
||||
TNode<Smi> const match_length = LoadStringLengthAsSmi(match);
|
||||
const TNode<Smi> match_length = LoadStringLengthAsSmi(match);
|
||||
GotoIfNot(SmiEqual(match_length, SmiZero()), &loop);
|
||||
|
||||
TNode<Object> last_index = LoadLastIndex(context, regexp, is_fastpath);
|
||||
@ -1696,17 +1696,17 @@ TNode<Object> RegExpMatchAllAssembler::CreateRegExpStringIterator(
|
||||
// JSRegExp, {string} is a String, and {limit} is a Smi.
|
||||
TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
TNode<Context> context, TNode<JSRegExp> regexp, TNode<String> string,
|
||||
TNode<Smi> const limit) {
|
||||
const TNode<Smi> limit) {
|
||||
CSA_ASSERT(this, IsFastRegExpPermissive(context, regexp));
|
||||
CSA_ASSERT(this, Word32BinaryNot(FastFlagGetter(regexp, JSRegExp::kSticky)));
|
||||
|
||||
TNode<IntPtrT> const int_limit = SmiUntag(limit);
|
||||
const TNode<IntPtrT> int_limit = SmiUntag(limit);
|
||||
|
||||
const ElementsKind kind = PACKED_ELEMENTS;
|
||||
const ParameterMode mode = CodeStubAssembler::INTPTR_PARAMETERS;
|
||||
|
||||
TNode<AllocationSite> allocation_site = {};
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TNode<Map> array_map = LoadJSArrayElementsMap(kind, native_context);
|
||||
|
||||
Label return_empty_array(this, Label::kDeferred);
|
||||
@ -1720,7 +1720,7 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
BIND(&next);
|
||||
}
|
||||
|
||||
TNode<Smi> const string_length = LoadStringLengthAsSmi(string);
|
||||
const TNode<Smi> string_length = LoadStringLengthAsSmi(string);
|
||||
|
||||
// If passed the empty {string}, return either an empty array or a singleton
|
||||
// array depending on whether the {regexp} matches.
|
||||
@ -1730,10 +1730,10 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
|
||||
BIND(&if_stringisempty);
|
||||
{
|
||||
TNode<Object> const last_match_info = LoadContextElement(
|
||||
const TNode<Object> last_match_info = LoadContextElement(
|
||||
native_context, Context::REGEXP_LAST_MATCH_INFO_INDEX);
|
||||
|
||||
TNode<Object> const match_indices =
|
||||
const TNode<Object> match_indices =
|
||||
CallBuiltin(Builtins::kRegExpExecInternal, context, regexp, string,
|
||||
SmiZero(), last_match_info);
|
||||
|
||||
@ -1772,8 +1772,8 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
|
||||
BIND(&loop);
|
||||
{
|
||||
TNode<Smi> const next_search_from = var_next_search_from.value();
|
||||
TNode<Smi> const last_matched_until = var_last_matched_until.value();
|
||||
const TNode<Smi> next_search_from = var_next_search_from.value();
|
||||
const TNode<Smi> last_matched_until = var_last_matched_until.value();
|
||||
|
||||
// We're done if we've reached the end of the string.
|
||||
{
|
||||
@ -1785,10 +1785,10 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
|
||||
// Search for the given {regexp}.
|
||||
|
||||
TNode<Object> const last_match_info = LoadContextElement(
|
||||
const TNode<Object> last_match_info = LoadContextElement(
|
||||
native_context, Context::REGEXP_LAST_MATCH_INFO_INDEX);
|
||||
|
||||
TNode<HeapObject> const match_indices_ho =
|
||||
const TNode<HeapObject> match_indices_ho =
|
||||
CAST(CallBuiltin(Builtins::kRegExpExecInternal, context, regexp, string,
|
||||
next_search_from, last_match_info));
|
||||
|
||||
@ -1800,7 +1800,7 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
}
|
||||
|
||||
TNode<FixedArray> match_indices = CAST(match_indices_ho);
|
||||
TNode<Smi> const match_from = CAST(UnsafeLoadFixedArrayElement(
|
||||
const TNode<Smi> match_from = CAST(UnsafeLoadFixedArrayElement(
|
||||
match_indices, RegExpMatchInfo::kFirstCaptureIndex));
|
||||
|
||||
// We're done if the match starts beyond the string.
|
||||
@ -1810,7 +1810,7 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
BIND(&next);
|
||||
}
|
||||
|
||||
TNode<Smi> const match_to = CAST(UnsafeLoadFixedArrayElement(
|
||||
const TNode<Smi> match_to = CAST(UnsafeLoadFixedArrayElement(
|
||||
match_indices, RegExpMatchInfo::kFirstCaptureIndex + 1));
|
||||
|
||||
// Advance index and continue if the match is empty.
|
||||
@ -1820,9 +1820,9 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
GotoIfNot(SmiEqual(match_to, next_search_from), &next);
|
||||
GotoIfNot(SmiEqual(match_to, last_matched_until), &next);
|
||||
|
||||
TNode<BoolT> const is_unicode =
|
||||
const TNode<BoolT> is_unicode =
|
||||
FastFlagGetter(regexp, JSRegExp::kUnicode);
|
||||
TNode<Number> const new_next_search_from =
|
||||
const TNode<Number> new_next_search_from =
|
||||
AdvanceStringIndex(string, next_search_from, is_unicode, true);
|
||||
var_next_search_from = CAST(new_next_search_from);
|
||||
Goto(&loop);
|
||||
@ -1832,17 +1832,17 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
|
||||
// A valid match was found, add the new substring to the array.
|
||||
{
|
||||
TNode<Smi> const from = last_matched_until;
|
||||
TNode<Smi> const to = match_from;
|
||||
const TNode<Smi> from = last_matched_until;
|
||||
const TNode<Smi> to = match_from;
|
||||
array.Push(CallBuiltin(Builtins::kSubString, context, string, from, to));
|
||||
GotoIf(WordEqual(array.length(), int_limit), &out);
|
||||
}
|
||||
|
||||
// Add all captures to the array.
|
||||
{
|
||||
TNode<Smi> const num_registers = CAST(LoadFixedArrayElement(
|
||||
const TNode<Smi> num_registers = CAST(LoadFixedArrayElement(
|
||||
match_indices, RegExpMatchInfo::kNumberOfCapturesIndex));
|
||||
TNode<IntPtrT> const int_num_registers = SmiUntag(num_registers);
|
||||
const TNode<IntPtrT> int_num_registers = SmiUntag(num_registers);
|
||||
|
||||
TVARIABLE(IntPtrT, var_reg, IntPtrConstant(2));
|
||||
|
||||
@ -1855,10 +1855,10 @@ TNode<JSArray> RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(
|
||||
BIND(&nested_loop);
|
||||
{
|
||||
const TNode<IntPtrT> reg = var_reg.value();
|
||||
TNode<Object> const from = LoadFixedArrayElement(
|
||||
const TNode<Object> from = LoadFixedArrayElement(
|
||||
match_indices, reg,
|
||||
RegExpMatchInfo::kFirstCaptureIndex * kTaggedSize, mode);
|
||||
TNode<Smi> const to = CAST(LoadFixedArrayElement(
|
||||
const TNode<Smi> to = CAST(LoadFixedArrayElement(
|
||||
match_indices, reg,
|
||||
(RegExpMatchInfo::kFirstCaptureIndex + 1) * kTaggedSize, mode));
|
||||
|
||||
|
@ -168,13 +168,13 @@ class RegExpBuiltinsAssembler : public CodeStubAssembler {
|
||||
|
||||
TNode<Object> RegExpPrototypeMatchBody(TNode<Context> context,
|
||||
TNode<Object> regexp,
|
||||
TNode<String> const string,
|
||||
const TNode<String> string,
|
||||
const bool is_fastpath);
|
||||
|
||||
TNode<JSArray> RegExpPrototypeSplitBody(TNode<Context> context,
|
||||
TNode<JSRegExp> regexp,
|
||||
TNode<String> const string,
|
||||
TNode<Smi> const limit);
|
||||
const TNode<String> string,
|
||||
const TNode<Smi> limit);
|
||||
};
|
||||
|
||||
class RegExpMatchAllAssembler : public RegExpBuiltinsAssembler {
|
||||
|
@ -65,13 +65,13 @@ void StringBuiltinsAssembler::DispatchOnStringEncodings(
|
||||
|
||||
// First combine the encodings.
|
||||
|
||||
TNode<Int32T> const encoding_mask = Int32Constant(kStringEncodingMask);
|
||||
TNode<Word32T> const lhs_encoding =
|
||||
const TNode<Int32T> encoding_mask = Int32Constant(kStringEncodingMask);
|
||||
const TNode<Word32T> lhs_encoding =
|
||||
Word32And(lhs_instance_type, encoding_mask);
|
||||
TNode<Word32T> const rhs_encoding =
|
||||
const TNode<Word32T> rhs_encoding =
|
||||
Word32And(rhs_instance_type, encoding_mask);
|
||||
|
||||
TNode<Word32T> const combined_encodings =
|
||||
const TNode<Word32T> combined_encodings =
|
||||
Word32Or(lhs_encoding, Word32Shr(rhs_encoding, 1));
|
||||
|
||||
// Then dispatch on the combined encoding.
|
||||
@ -101,9 +101,9 @@ Node* StringBuiltinsAssembler::CallSearchStringRaw(Node* const subject_ptr,
|
||||
Node* const search_ptr,
|
||||
Node* const search_length,
|
||||
Node* const start_position) {
|
||||
TNode<ExternalReference> const function_addr = ExternalConstant(
|
||||
const TNode<ExternalReference> function_addr = ExternalConstant(
|
||||
ExternalReference::search_string_raw<SubjectChar, PatternChar>());
|
||||
TNode<ExternalReference> const isolate_ptr =
|
||||
const TNode<ExternalReference> isolate_ptr =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
|
||||
MachineType type_ptr = MachineType::Pointer();
|
||||
@ -898,13 +898,13 @@ TF_BUILTIN(StringFromCharCode, StringBuiltinsAssembler) {
|
||||
}
|
||||
|
||||
void StringBuiltinsAssembler::StringIndexOf(
|
||||
TNode<String> const subject_string, TNode<String> const search_string,
|
||||
TNode<Smi> const position,
|
||||
const TNode<String> subject_string, const TNode<String> search_string,
|
||||
const TNode<Smi> position,
|
||||
const std::function<void(TNode<Smi>)>& f_return) {
|
||||
TNode<IntPtrT> const int_zero = IntPtrConstant(0);
|
||||
TNode<IntPtrT> const search_length = LoadStringLengthAsWord(search_string);
|
||||
TNode<IntPtrT> const subject_length = LoadStringLengthAsWord(subject_string);
|
||||
TNode<IntPtrT> const start_position = IntPtrMax(SmiUntag(position), int_zero);
|
||||
const TNode<IntPtrT> int_zero = IntPtrConstant(0);
|
||||
const TNode<IntPtrT> search_length = LoadStringLengthAsWord(search_string);
|
||||
const TNode<IntPtrT> subject_length = LoadStringLengthAsWord(subject_string);
|
||||
const TNode<IntPtrT> start_position = IntPtrMax(SmiUntag(position), int_zero);
|
||||
|
||||
Label zero_length_needle(this), return_minus_1(this);
|
||||
{
|
||||
@ -932,13 +932,13 @@ void StringBuiltinsAssembler::StringIndexOf(
|
||||
search_to_direct.TryToDirect(&call_runtime_unchecked);
|
||||
|
||||
// Load pointers to string data.
|
||||
TNode<RawPtrT> const subject_ptr =
|
||||
const TNode<RawPtrT> subject_ptr =
|
||||
subject_to_direct.PointerToData(&call_runtime_unchecked);
|
||||
TNode<RawPtrT> const search_ptr =
|
||||
const TNode<RawPtrT> search_ptr =
|
||||
search_to_direct.PointerToData(&call_runtime_unchecked);
|
||||
|
||||
TNode<IntPtrT> const subject_offset = subject_to_direct.offset();
|
||||
TNode<IntPtrT> const search_offset = search_to_direct.offset();
|
||||
const TNode<IntPtrT> subject_offset = subject_to_direct.offset();
|
||||
const TNode<IntPtrT> search_offset = search_to_direct.offset();
|
||||
|
||||
// Like String::IndexOf, the actual matching is done by the optimized
|
||||
// SearchString method in string-search.h. Dispatch based on string instance
|
||||
@ -961,9 +961,9 @@ void StringBuiltinsAssembler::StringIndexOf(
|
||||
|
||||
BIND(&one_one);
|
||||
{
|
||||
TNode<RawPtrT> const adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
subject_ptr, subject_offset, String::ONE_BYTE_ENCODING);
|
||||
TNode<RawPtrT> const adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
search_ptr, search_offset, String::ONE_BYTE_ENCODING);
|
||||
|
||||
Label direct_memchr_call(this), generic_fast_path(this);
|
||||
@ -974,22 +974,22 @@ void StringBuiltinsAssembler::StringIndexOf(
|
||||
// search strings.
|
||||
BIND(&direct_memchr_call);
|
||||
{
|
||||
TNode<RawPtrT> const string_addr =
|
||||
const TNode<RawPtrT> string_addr =
|
||||
RawPtrAdd(adjusted_subject_ptr, start_position);
|
||||
TNode<IntPtrT> const search_length =
|
||||
const TNode<IntPtrT> search_length =
|
||||
IntPtrSub(subject_length, start_position);
|
||||
TNode<IntPtrT> const search_byte =
|
||||
const TNode<IntPtrT> search_byte =
|
||||
ChangeInt32ToIntPtr(Load(MachineType::Uint8(), adjusted_search_ptr));
|
||||
|
||||
TNode<ExternalReference> const memchr =
|
||||
const TNode<ExternalReference> memchr =
|
||||
ExternalConstant(ExternalReference::libc_memchr_function());
|
||||
TNode<RawPtrT> const result_address = UncheckedCast<RawPtrT>(
|
||||
const TNode<RawPtrT> result_address = UncheckedCast<RawPtrT>(
|
||||
CallCFunction(memchr, MachineType::Pointer(),
|
||||
std::make_pair(MachineType::Pointer(), string_addr),
|
||||
std::make_pair(MachineType::IntPtr(), search_byte),
|
||||
std::make_pair(MachineType::UintPtr(), search_length)));
|
||||
GotoIf(WordEqual(result_address, int_zero), &return_minus_1);
|
||||
TNode<IntPtrT> const result_index =
|
||||
const TNode<IntPtrT> result_index =
|
||||
IntPtrAdd(RawPtrSub(result_address, string_addr), start_position);
|
||||
f_return(SmiTag(result_index));
|
||||
}
|
||||
@ -1005,9 +1005,9 @@ void StringBuiltinsAssembler::StringIndexOf(
|
||||
|
||||
BIND(&one_two);
|
||||
{
|
||||
TNode<RawPtrT> const adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
subject_ptr, subject_offset, String::ONE_BYTE_ENCODING);
|
||||
TNode<RawPtrT> const adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
search_ptr, search_offset, String::TWO_BYTE_ENCODING);
|
||||
|
||||
Node* const result = CallSearchStringRaw<onebyte_t, twobyte_t>(
|
||||
@ -1018,9 +1018,9 @@ void StringBuiltinsAssembler::StringIndexOf(
|
||||
|
||||
BIND(&two_one);
|
||||
{
|
||||
TNode<RawPtrT> const adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
subject_ptr, subject_offset, String::TWO_BYTE_ENCODING);
|
||||
TNode<RawPtrT> const adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
search_ptr, search_offset, String::ONE_BYTE_ENCODING);
|
||||
|
||||
Node* const result = CallSearchStringRaw<twobyte_t, onebyte_t>(
|
||||
@ -1031,9 +1031,9 @@ void StringBuiltinsAssembler::StringIndexOf(
|
||||
|
||||
BIND(&two_two);
|
||||
{
|
||||
TNode<RawPtrT> const adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_subject_ptr = PointerToStringDataAtIndex(
|
||||
subject_ptr, subject_offset, String::TWO_BYTE_ENCODING);
|
||||
TNode<RawPtrT> const adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
const TNode<RawPtrT> adjusted_search_ptr = PointerToStringDataAtIndex(
|
||||
search_ptr, search_offset, String::TWO_BYTE_ENCODING);
|
||||
|
||||
Node* const result = CallSearchStringRaw<twobyte_t, twobyte_t>(
|
||||
@ -1099,7 +1099,7 @@ void StringIncludesIndexOfAssembler::Generate(SearchVariant variant,
|
||||
TNode<IntPtrT> argc,
|
||||
TNode<Context> context) {
|
||||
CodeStubArguments arguments(this, argc);
|
||||
TNode<Object> const receiver = arguments.GetReceiver();
|
||||
const TNode<Object> receiver = arguments.GetReceiver();
|
||||
|
||||
TVARIABLE(Object, var_search_string);
|
||||
TVARIABLE(Object, var_position);
|
||||
@ -1134,8 +1134,8 @@ void StringIncludesIndexOfAssembler::Generate(SearchVariant variant,
|
||||
BIND(&fast_path);
|
||||
{
|
||||
Comment("Fast Path");
|
||||
TNode<Object> const search = var_search_string.value();
|
||||
TNode<Smi> const position = CAST(var_position.value());
|
||||
const TNode<Object> search = var_search_string.value();
|
||||
const TNode<Smi> position = CAST(var_position.value());
|
||||
GotoIf(TaggedIsSmi(receiver), &call_runtime);
|
||||
GotoIf(TaggedIsSmi(search), &call_runtime);
|
||||
GotoIfNot(IsString(CAST(receiver)), &call_runtime);
|
||||
@ -1157,7 +1157,7 @@ void StringIncludesIndexOfAssembler::Generate(SearchVariant variant,
|
||||
Runtime::FunctionId runtime = variant == kIndexOf
|
||||
? Runtime::kStringIndexOf
|
||||
: Runtime::kStringIncludes;
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallRuntime(runtime, context, receiver, var_search_string.value(),
|
||||
var_position.value());
|
||||
arguments.PopAndReturn(result);
|
||||
@ -1213,7 +1213,7 @@ void StringBuiltinsAssembler::MaybeCallFunctionAtSymbol(
|
||||
// We handle the former by jumping to {out} for null values as well, while
|
||||
// the latter is already handled by the Call({maybe_func}) operation.
|
||||
|
||||
TNode<Object> const maybe_func = GetProperty(context, object, symbol);
|
||||
const TNode<Object> maybe_func = GetProperty(context, object, symbol);
|
||||
GotoIf(IsUndefined(maybe_func), &out);
|
||||
GotoIf(IsNull(maybe_func), &out);
|
||||
|
||||
@ -1227,9 +1227,9 @@ TNode<Smi> StringBuiltinsAssembler::IndexOfDollarChar(Node* const context,
|
||||
Node* const string) {
|
||||
CSA_ASSERT(this, IsString(string));
|
||||
|
||||
TNode<String> const dollar_string = HeapConstant(
|
||||
const TNode<String> dollar_string = HeapConstant(
|
||||
isolate()->factory()->LookupSingleCharacterStringFromCode('$'));
|
||||
TNode<Smi> const dollar_ix =
|
||||
const TNode<Smi> dollar_ix =
|
||||
CAST(CallBuiltin(Builtins::kStringIndexOf, context, string, dollar_string,
|
||||
SmiConstant(0)));
|
||||
return dollar_ix;
|
||||
@ -1254,17 +1254,17 @@ compiler::Node* StringBuiltinsAssembler::GetSubstitution(
|
||||
// TODO(jgruber): Possibly extend this in the future to handle more complex
|
||||
// cases without runtime calls.
|
||||
|
||||
TNode<Smi> const dollar_index = IndexOfDollarChar(context, replace_string);
|
||||
const TNode<Smi> dollar_index = IndexOfDollarChar(context, replace_string);
|
||||
Branch(SmiIsNegative(dollar_index), &out, &runtime);
|
||||
|
||||
BIND(&runtime);
|
||||
{
|
||||
CSA_ASSERT(this, TaggedIsPositiveSmi(dollar_index));
|
||||
|
||||
TNode<Object> const matched =
|
||||
const TNode<Object> matched =
|
||||
CallBuiltin(Builtins::kStringSubstring, context, subject_string,
|
||||
SmiUntag(match_start_index), SmiUntag(match_end_index));
|
||||
TNode<Object> const replacement_string =
|
||||
const TNode<Object> replacement_string =
|
||||
CallRuntime(Runtime::kGetSubstitution, context, matched, subject_string,
|
||||
match_start_index, replace_string, dollar_index);
|
||||
var_result.Bind(replacement_string);
|
||||
@ -1285,7 +1285,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
Node* const replace = Parameter(Descriptor::kReplace);
|
||||
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
|
||||
TNode<Smi> const smi_zero = SmiConstant(0);
|
||||
const TNode<Smi> smi_zero = SmiConstant(0);
|
||||
|
||||
RequireObjectCoercible(context, receiver, "String.prototype.replace");
|
||||
|
||||
@ -1307,11 +1307,11 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
|
||||
// Convert {receiver} and {search} to strings.
|
||||
|
||||
TNode<String> const subject_string = ToString_Inline(context, receiver);
|
||||
TNode<String> const search_string = ToString_Inline(context, search);
|
||||
const TNode<String> subject_string = ToString_Inline(context, receiver);
|
||||
const TNode<String> search_string = ToString_Inline(context, search);
|
||||
|
||||
TNode<IntPtrT> const subject_length = LoadStringLengthAsWord(subject_string);
|
||||
TNode<IntPtrT> const search_length = LoadStringLengthAsWord(search_string);
|
||||
const TNode<IntPtrT> subject_length = LoadStringLengthAsWord(subject_string);
|
||||
const TNode<IntPtrT> search_length = LoadStringLengthAsWord(search_string);
|
||||
|
||||
// Fast-path single-char {search}, long cons {receiver}, and simple string
|
||||
// {replace}.
|
||||
@ -1323,7 +1323,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
GotoIf(TaggedIsSmi(replace), &next);
|
||||
GotoIfNot(IsString(replace), &next);
|
||||
|
||||
TNode<Uint16T> const subject_instance_type =
|
||||
const TNode<Uint16T> subject_instance_type =
|
||||
LoadInstanceType(subject_string);
|
||||
GotoIfNot(IsConsStringInstanceType(subject_instance_type), &next);
|
||||
|
||||
@ -1344,7 +1344,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
// longer substrings - we can handle up to 8 chars (one-byte) / 4 chars
|
||||
// (2-byte).
|
||||
|
||||
TNode<Smi> const match_start_index =
|
||||
const TNode<Smi> match_start_index =
|
||||
CAST(CallBuiltin(Builtins::kStringIndexOf, context, subject_string,
|
||||
search_string, smi_zero));
|
||||
|
||||
@ -1372,7 +1372,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
BIND(&next);
|
||||
}
|
||||
|
||||
TNode<Smi> const match_end_index =
|
||||
const TNode<Smi> match_end_index =
|
||||
SmiAdd(match_start_index, SmiFromIntPtr(search_length));
|
||||
|
||||
VARIABLE(var_result, MachineRepresentation::kTagged, EmptyStringConstant());
|
||||
@ -1382,7 +1382,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
Label next(this);
|
||||
|
||||
GotoIf(SmiEqual(match_start_index, smi_zero), &next);
|
||||
TNode<Object> const prefix =
|
||||
const TNode<Object> prefix =
|
||||
CallBuiltin(Builtins::kStringSubstring, context, subject_string,
|
||||
IntPtrConstant(0), SmiUntag(match_start_index));
|
||||
var_result.Bind(prefix);
|
||||
@ -1404,7 +1404,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
Node* const replacement =
|
||||
CallJS(call_callable, context, replace, UndefinedConstant(),
|
||||
search_string, match_start_index, subject_string);
|
||||
TNode<String> const replacement_string =
|
||||
const TNode<String> replacement_string =
|
||||
ToString_Inline(context, replacement);
|
||||
var_result.Bind(CallBuiltin(Builtins::kStringAdd_CheckNone, context,
|
||||
var_result.value(), replacement_string));
|
||||
@ -1413,7 +1413,7 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
|
||||
BIND(&if_notcallablereplace);
|
||||
{
|
||||
TNode<String> const replace_string = ToString_Inline(context, replace);
|
||||
const TNode<String> replace_string = ToString_Inline(context, replace);
|
||||
Node* const replacement =
|
||||
GetSubstitution(context, subject_string, match_start_index,
|
||||
match_end_index, replace_string);
|
||||
@ -1424,10 +1424,10 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
|
||||
|
||||
BIND(&out);
|
||||
{
|
||||
TNode<Object> const suffix =
|
||||
const TNode<Object> suffix =
|
||||
CallBuiltin(Builtins::kStringSubstring, context, subject_string,
|
||||
SmiUntag(match_end_index), subject_length);
|
||||
TNode<Object> const result = CallBuiltin(
|
||||
const TNode<Object> result = CallBuiltin(
|
||||
Builtins::kStringAdd_CheckNone, context, var_result.value(), suffix);
|
||||
Return(result);
|
||||
}
|
||||
@ -1704,13 +1704,13 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
|
||||
const int kSeparatorArg = 0;
|
||||
const int kLimitArg = 1;
|
||||
|
||||
TNode<IntPtrT> const argc =
|
||||
const TNode<IntPtrT> argc =
|
||||
ChangeInt32ToIntPtr(Parameter(Descriptor::kJSActualArgumentsCount));
|
||||
CodeStubArguments args(this, argc);
|
||||
|
||||
TNode<Object> receiver = args.GetReceiver();
|
||||
TNode<Object> const separator = args.GetOptionalArgumentValue(kSeparatorArg);
|
||||
TNode<Object> const limit = args.GetOptionalArgumentValue(kLimitArg);
|
||||
const TNode<Object> separator = args.GetOptionalArgumentValue(kSeparatorArg);
|
||||
const TNode<Object> limit = args.GetOptionalArgumentValue(kLimitArg);
|
||||
TNode<NativeContext> context = CAST(Parameter(Descriptor::kContext));
|
||||
|
||||
TNode<Smi> smi_zero = SmiConstant(0);
|
||||
@ -1740,7 +1740,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
|
||||
TNode<Number> limit_number = Select<Number>(
|
||||
IsUndefined(limit), [=] { return NumberConstant(kMaxUInt32); },
|
||||
[=] { return ToUint32(context, limit); });
|
||||
TNode<String> const separator_string = ToString_Inline(context, separator);
|
||||
const TNode<String> separator_string = ToString_Inline(context, separator);
|
||||
|
||||
Label return_empty_array(this);
|
||||
|
||||
@ -1754,7 +1754,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
|
||||
GotoIfNot(IsUndefined(separator), &next);
|
||||
|
||||
const ElementsKind kind = PACKED_ELEMENTS;
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TNode<Map> array_map = LoadJSArrayElementsMap(kind, native_context);
|
||||
|
||||
TNode<Smi> length = SmiConstant(1);
|
||||
@ -1784,7 +1784,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
|
||||
BIND(&next);
|
||||
}
|
||||
|
||||
TNode<Object> const result =
|
||||
const TNode<Object> result =
|
||||
CallRuntime(Runtime::kStringSplit, context, subject_string,
|
||||
separator_string, limit_number);
|
||||
args.PopAndReturn(result);
|
||||
@ -1792,7 +1792,7 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
|
||||
BIND(&return_empty_array);
|
||||
{
|
||||
const ElementsKind kind = PACKED_ELEMENTS;
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
TNode<Map> array_map = LoadJSArrayElementsMap(kind, native_context);
|
||||
|
||||
TNode<Smi> length = smi_zero;
|
||||
@ -1847,16 +1847,16 @@ void StringTrimAssembler::Generate(String::TrimMode mode,
|
||||
TNode<Object> receiver = arguments.GetReceiver();
|
||||
|
||||
// Check that {receiver} is coercible to Object and convert it to a String.
|
||||
TNode<String> const string = ToThisString(context, receiver, method_name);
|
||||
TNode<IntPtrT> const string_length = LoadStringLengthAsWord(string);
|
||||
const TNode<String> string = ToThisString(context, receiver, method_name);
|
||||
const TNode<IntPtrT> string_length = LoadStringLengthAsWord(string);
|
||||
|
||||
ToDirectStringAssembler to_direct(state(), string);
|
||||
to_direct.TryToDirect(&if_runtime);
|
||||
TNode<RawPtrT> const string_data = to_direct.PointerToData(&if_runtime);
|
||||
TNode<Int32T> const instance_type = to_direct.instance_type();
|
||||
TNode<BoolT> const is_stringonebyte =
|
||||
const TNode<RawPtrT> string_data = to_direct.PointerToData(&if_runtime);
|
||||
const TNode<Int32T> instance_type = to_direct.instance_type();
|
||||
const TNode<BoolT> is_stringonebyte =
|
||||
IsOneByteStringInstanceType(instance_type);
|
||||
TNode<IntPtrT> const string_data_offset = to_direct.offset();
|
||||
const TNode<IntPtrT> string_data_offset = to_direct.offset();
|
||||
|
||||
TVARIABLE(IntPtrT, var_start, IntPtrConstant(0));
|
||||
TVARIABLE(IntPtrT, var_end, IntPtrSub(string_length, IntPtrConstant(1)));
|
||||
@ -1887,7 +1887,7 @@ void StringTrimAssembler::Generate(String::TrimMode mode,
|
||||
void StringTrimAssembler::ScanForNonWhiteSpaceOrLineTerminator(
|
||||
Node* const string_data, Node* const string_data_offset,
|
||||
Node* const is_stringonebyte, TVariable<IntPtrT>* const var_index,
|
||||
TNode<IntPtrT> const end, int increment, Label* const if_none_found) {
|
||||
const TNode<IntPtrT> end, int increment, Label* const if_none_found) {
|
||||
Label if_stringisonebyte(this), out(this);
|
||||
|
||||
GotoIf(is_stringonebyte, &if_stringisonebyte);
|
||||
@ -1911,7 +1911,7 @@ void StringTrimAssembler::ScanForNonWhiteSpaceOrLineTerminator(
|
||||
}
|
||||
|
||||
void StringTrimAssembler::BuildLoop(
|
||||
TVariable<IntPtrT>* const var_index, TNode<IntPtrT> const end,
|
||||
TVariable<IntPtrT>* const var_index, const TNode<IntPtrT> end,
|
||||
int increment, Label* const if_none_found, Label* const out,
|
||||
const std::function<Node*(Node*)>& get_character) {
|
||||
Label loop(this, var_index);
|
||||
@ -1928,7 +1928,7 @@ void StringTrimAssembler::BuildLoop(
|
||||
}
|
||||
|
||||
void StringTrimAssembler::GotoIfNotWhiteSpaceOrLineTerminator(
|
||||
TNode<Word32T> const char_code, Label* const if_not_whitespace) {
|
||||
const TNode<Word32T> char_code, Label* const if_not_whitespace) {
|
||||
Label out(this);
|
||||
|
||||
// 0x0020 - SPACE (Intentionally out of order to fast path a commmon case)
|
||||
@ -2170,8 +2170,8 @@ TNode<String> StringBuiltinsAssembler::SubString(TNode<String> string,
|
||||
ToDirectStringAssembler to_direct(state(), string);
|
||||
Label end(this), runtime(this);
|
||||
|
||||
TNode<IntPtrT> const substr_length = IntPtrSub(to, from);
|
||||
TNode<IntPtrT> const string_length = LoadStringLengthAsWord(string);
|
||||
const TNode<IntPtrT> substr_length = IntPtrSub(to, from);
|
||||
const TNode<IntPtrT> string_length = LoadStringLengthAsWord(string);
|
||||
|
||||
// Begin dispatching based on substring length.
|
||||
|
||||
@ -2191,7 +2191,7 @@ TNode<String> StringBuiltinsAssembler::SubString(TNode<String> string,
|
||||
|
||||
TNode<String> direct_string = to_direct.TryToDirect(&runtime);
|
||||
TNode<IntPtrT> offset = IntPtrAdd(from, to_direct.offset());
|
||||
TNode<Int32T> const instance_type = to_direct.instance_type();
|
||||
const TNode<Int32T> instance_type = to_direct.instance_type();
|
||||
|
||||
// The subject string can only be external or sequential string of either
|
||||
// encoding at this point.
|
||||
@ -2249,7 +2249,7 @@ TNode<String> StringBuiltinsAssembler::SubString(TNode<String> string,
|
||||
// Handle external string.
|
||||
BIND(&external_string);
|
||||
{
|
||||
TNode<RawPtrT> const fake_sequential_string =
|
||||
const TNode<RawPtrT> fake_sequential_string =
|
||||
to_direct.PointerToString(&runtime);
|
||||
|
||||
var_result = AllocAndCopyStringCharacters(
|
||||
|
@ -91,9 +91,9 @@ class StringBuiltinsAssembler : public CodeStubAssembler {
|
||||
using StringAtAccessor = std::function<TNode<Object>(
|
||||
TNode<String> receiver, TNode<IntPtrT> length, TNode<IntPtrT> index)>;
|
||||
|
||||
void StringIndexOf(TNode<String> const subject_string,
|
||||
TNode<String> const search_string,
|
||||
TNode<Smi> const position,
|
||||
void StringIndexOf(const TNode<String> subject_string,
|
||||
const TNode<String> search_string,
|
||||
const TNode<Smi> position,
|
||||
const std::function<void(TNode<Smi>)>& f_return);
|
||||
|
||||
TNode<Smi> IndexOfDollarChar(Node* const context, Node* const string);
|
||||
@ -186,7 +186,7 @@ class StringTrimAssembler : public StringBuiltinsAssembler {
|
||||
: StringBuiltinsAssembler(state) {}
|
||||
|
||||
V8_EXPORT_PRIVATE void GotoIfNotWhiteSpaceOrLineTerminator(
|
||||
TNode<Word32T> const char_code, Label* const if_not_whitespace);
|
||||
const TNode<Word32T> char_code, Label* const if_not_whitespace);
|
||||
|
||||
protected:
|
||||
void Generate(String::TrimMode mode, const char* method, TNode<IntPtrT> argc,
|
||||
@ -195,9 +195,9 @@ class StringTrimAssembler : public StringBuiltinsAssembler {
|
||||
void ScanForNonWhiteSpaceOrLineTerminator(
|
||||
Node* const string_data, Node* const string_data_offset,
|
||||
Node* const is_stringonebyte, TVariable<IntPtrT>* const var_index,
|
||||
TNode<IntPtrT> const end, int increment, Label* const if_none_found);
|
||||
const TNode<IntPtrT> end, int increment, Label* const if_none_found);
|
||||
|
||||
void BuildLoop(TVariable<IntPtrT>* const var_index, TNode<IntPtrT> const end,
|
||||
void BuildLoop(TVariable<IntPtrT>* const var_index, const TNode<IntPtrT> end,
|
||||
int increment, Label* const if_none_found, Label* const out,
|
||||
const std::function<Node*(Node*)>& get_character);
|
||||
};
|
||||
|
@ -1018,10 +1018,10 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
|
||||
BuildFastLoop<Smi>(
|
||||
SmiConstant(0), final_length.value(),
|
||||
[&](TNode<Smi> index) {
|
||||
TNode<Object> const k_value =
|
||||
const TNode<Object> k_value =
|
||||
GetProperty(context, final_source.value(), index);
|
||||
|
||||
TNode<Object> const mapped_value =
|
||||
const TNode<Object> mapped_value =
|
||||
CallJS(CodeFactory::Call(isolate()), context, map_fn, this_arg,
|
||||
k_value, index);
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
void GrowableFixedArray::Push(TNode<Object> const value) {
|
||||
TNode<IntPtrT> const length = var_length_.value();
|
||||
TNode<IntPtrT> const capacity = var_capacity_.value();
|
||||
void GrowableFixedArray::Push(const TNode<Object> value) {
|
||||
const TNode<IntPtrT> length = var_length_.value();
|
||||
const TNode<IntPtrT> capacity = var_capacity_.value();
|
||||
|
||||
Label grow(this), store(this);
|
||||
Branch(IntPtrEqual(capacity, length), &grow, &store);
|
||||
@ -26,25 +26,25 @@ void GrowableFixedArray::Push(TNode<Object> const value) {
|
||||
|
||||
BIND(&store);
|
||||
{
|
||||
TNode<FixedArray> const array = var_array_.value();
|
||||
const TNode<FixedArray> array = var_array_.value();
|
||||
UnsafeStoreFixedArrayElement(array, length, value);
|
||||
|
||||
var_length_ = IntPtrAdd(length, IntPtrConstant(1));
|
||||
}
|
||||
}
|
||||
|
||||
TNode<JSArray> GrowableFixedArray::ToJSArray(TNode<Context> const context) {
|
||||
TNode<JSArray> GrowableFixedArray::ToJSArray(const TNode<Context> context) {
|
||||
const ElementsKind kind = PACKED_ELEMENTS;
|
||||
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Map> const array_map = LoadJSArrayElementsMap(kind, native_context);
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Map> array_map = LoadJSArrayElementsMap(kind, native_context);
|
||||
|
||||
// Shrink to fit if necessary.
|
||||
{
|
||||
Label next(this);
|
||||
|
||||
TNode<IntPtrT> const length = var_length_.value();
|
||||
TNode<IntPtrT> const capacity = var_capacity_.value();
|
||||
const TNode<IntPtrT> length = var_length_.value();
|
||||
const TNode<IntPtrT> capacity = var_capacity_.value();
|
||||
|
||||
GotoIf(WordEqual(length, capacity), &next);
|
||||
|
||||
@ -55,8 +55,8 @@ TNode<JSArray> GrowableFixedArray::ToJSArray(TNode<Context> const context) {
|
||||
BIND(&next);
|
||||
}
|
||||
|
||||
TNode<Smi> const result_length = SmiTag(length());
|
||||
TNode<JSArray> const result =
|
||||
const TNode<Smi> result_length = SmiTag(length());
|
||||
const TNode<JSArray> result =
|
||||
AllocateJSArray(array_map, var_array_.value(), result_length);
|
||||
return result;
|
||||
}
|
||||
@ -69,7 +69,7 @@ TNode<IntPtrT> GrowableFixedArray::NewCapacity(
|
||||
// Growth rate is analog to JSObject::NewElementsCapacity:
|
||||
// new_capacity = (current_capacity + (current_capacity >> 1)) + 16.
|
||||
|
||||
TNode<IntPtrT> const new_capacity =
|
||||
const TNode<IntPtrT> new_capacity =
|
||||
IntPtrAdd(IntPtrAdd(current_capacity, WordShr(current_capacity, 1)),
|
||||
IntPtrConstant(16));
|
||||
|
||||
@ -77,12 +77,12 @@ TNode<IntPtrT> GrowableFixedArray::NewCapacity(
|
||||
}
|
||||
|
||||
TNode<FixedArray> GrowableFixedArray::ResizeFixedArray(
|
||||
TNode<IntPtrT> const element_count, TNode<IntPtrT> const new_capacity) {
|
||||
const TNode<IntPtrT> element_count, const TNode<IntPtrT> new_capacity) {
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(element_count, IntPtrConstant(0)));
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(new_capacity, IntPtrConstant(0)));
|
||||
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(new_capacity, element_count));
|
||||
|
||||
TNode<FixedArray> const from_array = var_array_.value();
|
||||
const TNode<FixedArray> from_array = var_array_.value();
|
||||
|
||||
CodeStubAssembler::ExtractFixedArrayFlags flags;
|
||||
flags |= CodeStubAssembler::ExtractFixedArrayFlag::kFixedArrays;
|
||||
|
@ -30,17 +30,17 @@ class GrowableFixedArray : public CodeStubAssembler {
|
||||
TVariable<IntPtrT>* var_length() { return &var_length_; }
|
||||
TVariable<IntPtrT>* var_capacity() { return &var_capacity_; }
|
||||
|
||||
void Push(TNode<Object> const value);
|
||||
void Push(const TNode<Object> value);
|
||||
|
||||
TNode<JSArray> ToJSArray(TNode<Context> const context);
|
||||
TNode<JSArray> ToJSArray(const TNode<Context> context);
|
||||
|
||||
private:
|
||||
TNode<IntPtrT> NewCapacity(TNode<IntPtrT> current_capacity);
|
||||
|
||||
// Creates a new array with {new_capacity} and copies the first
|
||||
// {element_count} elements from the current array.
|
||||
TNode<FixedArray> ResizeFixedArray(TNode<IntPtrT> const element_count,
|
||||
TNode<IntPtrT> const new_capacity);
|
||||
TNode<FixedArray> ResizeFixedArray(const TNode<IntPtrT> element_count,
|
||||
const TNode<IntPtrT> new_capacity);
|
||||
|
||||
private:
|
||||
TVariable<FixedArray> var_array_;
|
||||
|
@ -1195,7 +1195,7 @@ void CodeStubAssembler::BranchIfJSReceiver(SloppyTNode<Object> object,
|
||||
|
||||
void CodeStubAssembler::GotoIfForceSlowPath(Label* if_true) {
|
||||
#ifdef V8_ENABLE_FORCE_SLOW_PATH
|
||||
TNode<ExternalReference> const force_slow_path_addr =
|
||||
const TNode<ExternalReference> force_slow_path_addr =
|
||||
ExternalConstant(ExternalReference::force_slow_path(isolate()));
|
||||
Node* const force_slow = Load(MachineType::Uint8(), force_slow_path_addr);
|
||||
|
||||
@ -2752,11 +2752,11 @@ TNode<Map> CodeStubAssembler::LoadJSArrayElementsMap(
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsGeneratorFunction(
|
||||
TNode<JSFunction> function) {
|
||||
TNode<SharedFunctionInfo> const shared_function_info =
|
||||
const TNode<SharedFunctionInfo> shared_function_info =
|
||||
LoadObjectField<SharedFunctionInfo>(
|
||||
function, JSFunction::kSharedFunctionInfoOffset);
|
||||
|
||||
TNode<Uint32T> const function_kind =
|
||||
const TNode<Uint32T> function_kind =
|
||||
DecodeWord32<SharedFunctionInfo::FunctionKindBits>(LoadObjectField(
|
||||
shared_function_info, SharedFunctionInfo::kFlagsOffset,
|
||||
MachineType::Uint32()));
|
||||
@ -4862,7 +4862,7 @@ void CodeStubAssembler::MoveElements(ElementsKind kind,
|
||||
IntPtrConstant(ElementsKindToByteSize(kind)));
|
||||
auto loop_body = [&](Node* array, Node* offset) {
|
||||
Node* const element = Load(MachineType::AnyTagged(), array, offset);
|
||||
TNode<WordT> const delta_offset = IntPtrAdd(offset, delta);
|
||||
const TNode<WordT> delta_offset = IntPtrAdd(offset, delta);
|
||||
Store(array, delta_offset, element);
|
||||
};
|
||||
|
||||
@ -4955,7 +4955,7 @@ void CodeStubAssembler::CopyElements(ElementsKind kind,
|
||||
src_elements, kind, begin, end,
|
||||
[&](Node* array, Node* offset) {
|
||||
Node* const element = Load(MachineType::AnyTagged(), array, offset);
|
||||
TNode<WordT> const delta_offset = IntPtrAdd(offset, delta);
|
||||
const TNode<WordT> delta_offset = IntPtrAdd(offset, delta);
|
||||
if (write_barrier == SKIP_WRITE_BARRIER) {
|
||||
StoreNoWriteBarrier(MachineRepresentation::kTagged, dst_elements,
|
||||
delta_offset, element);
|
||||
@ -5818,7 +5818,7 @@ Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value,
|
||||
|
||||
// Load the instance type of the {value}.
|
||||
var_value_map.Bind(LoadMap(value));
|
||||
TNode<Uint16T> const value_instance_type =
|
||||
const TNode<Uint16T> value_instance_type =
|
||||
LoadMapInstanceType(var_value_map.value());
|
||||
|
||||
Branch(Word32Equal(value_instance_type, Int32Constant(instance_type)), &out,
|
||||
@ -5843,7 +5843,7 @@ void CodeStubAssembler::ThrowIfNotJSReceiver(TNode<Context> context,
|
||||
|
||||
// Load the instance type of the {value}.
|
||||
TNode<Map> value_map = LoadMap(CAST(value));
|
||||
TNode<Uint16T> const value_instance_type = LoadMapInstanceType(value_map);
|
||||
const TNode<Uint16T> value_instance_type = LoadMapInstanceType(value_map);
|
||||
|
||||
Branch(IsJSReceiverInstanceType(value_instance_type), &done,
|
||||
&throw_exception);
|
||||
@ -6012,8 +6012,8 @@ TNode<BoolT> CodeStubAssembler::IsPromiseSpeciesProtectorCellInvalid() {
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsPrototypeInitialArrayPrototype(
|
||||
SloppyTNode<Context> context, SloppyTNode<Map> map) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const initial_array_prototype = LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> initial_array_prototype = LoadContextElement(
|
||||
native_context, Context::INITIAL_ARRAY_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> proto = LoadMapPrototype(map);
|
||||
return TaggedEqual(proto, initial_array_prototype);
|
||||
@ -6021,8 +6021,8 @@ TNode<BoolT> CodeStubAssembler::IsPrototypeInitialArrayPrototype(
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsPrototypeTypedArrayPrototype(
|
||||
SloppyTNode<Context> context, SloppyTNode<Map> map) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const typed_array_prototype =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> typed_array_prototype =
|
||||
LoadContextElement(native_context, Context::TYPED_ARRAY_PROTOTYPE_INDEX);
|
||||
TNode<HeapObject> proto = LoadMapPrototype(map);
|
||||
TNode<HeapObject> proto_of_proto = Select<HeapObject>(
|
||||
@ -6033,32 +6033,32 @@ TNode<BoolT> CodeStubAssembler::IsPrototypeTypedArrayPrototype(
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsFastAliasedArgumentsMap(
|
||||
TNode<Context> context, TNode<Map> map) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const arguments_map = LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> arguments_map = LoadContextElement(
|
||||
native_context, Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX);
|
||||
return TaggedEqual(arguments_map, map);
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsSlowAliasedArgumentsMap(
|
||||
TNode<Context> context, TNode<Map> map) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const arguments_map = LoadContextElement(
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> arguments_map = LoadContextElement(
|
||||
native_context, Context::SLOW_ALIASED_ARGUMENTS_MAP_INDEX);
|
||||
return TaggedEqual(arguments_map, map);
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsSloppyArgumentsMap(TNode<Context> context,
|
||||
TNode<Map> map) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const arguments_map =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> arguments_map =
|
||||
LoadContextElement(native_context, Context::SLOPPY_ARGUMENTS_MAP_INDEX);
|
||||
return TaggedEqual(arguments_map, map);
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsStrictArgumentsMap(TNode<Context> context,
|
||||
TNode<Map> map) {
|
||||
TNode<NativeContext> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const arguments_map =
|
||||
const TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||
const TNode<Object> arguments_map =
|
||||
LoadContextElement(native_context, Context::STRICT_ARGUMENTS_MAP_INDEX);
|
||||
return TaggedEqual(arguments_map, map);
|
||||
}
|
||||
@ -6348,7 +6348,7 @@ TNode<BoolT> CodeStubAssembler::IsFixedArrayWithKindOrEmpty(
|
||||
|
||||
GotoIf(IsFixedArrayWithKind(object, kind), &out);
|
||||
|
||||
TNode<Smi> const length = LoadFixedArrayBaseLength(CAST(object));
|
||||
const TNode<Smi> length = LoadFixedArrayBaseLength(CAST(object));
|
||||
GotoIf(SmiEqual(length, SmiConstant(0)), &out);
|
||||
|
||||
var_result = Int32FalseConstant();
|
||||
@ -6738,10 +6738,10 @@ TNode<Int32T> CodeStubAssembler::StringCharCodeAt(TNode<String> string,
|
||||
|
||||
ToDirectStringAssembler to_direct(state(), string);
|
||||
to_direct.TryToDirect(&if_runtime);
|
||||
TNode<UintPtrT> const offset =
|
||||
const TNode<UintPtrT> offset =
|
||||
UintPtrAdd(index, Unsigned(to_direct.offset()));
|
||||
TNode<Int32T> const instance_type = to_direct.instance_type();
|
||||
TNode<RawPtrT> const string_data = to_direct.PointerToData(&if_runtime);
|
||||
const TNode<Int32T> instance_type = to_direct.instance_type();
|
||||
const TNode<RawPtrT> string_data = to_direct.PointerToData(&if_runtime);
|
||||
|
||||
// Check if the {string} is a TwoByteSeqString or a OneByteSeqString.
|
||||
Branch(IsOneByteStringInstanceType(instance_type), &if_stringisonebyte,
|
||||
@ -6864,7 +6864,7 @@ TNode<String> ToDirectStringAssembler::TryToDirect(Label* if_bailout) {
|
||||
};
|
||||
STATIC_ASSERT(arraysize(values) == arraysize(labels));
|
||||
|
||||
TNode<Int32T> const representation = Word32And(
|
||||
const TNode<Int32T> representation = Word32And(
|
||||
var_instance_type_.value(), Int32Constant(kStringRepresentationMask));
|
||||
Switch(representation, if_bailout, values, labels, arraysize(values));
|
||||
}
|
||||
@ -6873,12 +6873,12 @@ TNode<String> ToDirectStringAssembler::TryToDirect(Label* if_bailout) {
|
||||
// Flat cons strings have an empty second part.
|
||||
BIND(&if_iscons);
|
||||
{
|
||||
TNode<String> const string = var_string_.value();
|
||||
const TNode<String> string = var_string_.value();
|
||||
GotoIfNot(IsEmptyString(
|
||||
LoadObjectField<String>(string, ConsString::kSecondOffset)),
|
||||
if_bailout);
|
||||
|
||||
TNode<String> const lhs =
|
||||
const TNode<String> lhs =
|
||||
LoadObjectField<String>(string, ConsString::kFirstOffset);
|
||||
var_string_ = lhs;
|
||||
var_instance_type_ = LoadInstanceType(lhs);
|
||||
@ -6892,12 +6892,12 @@ TNode<String> ToDirectStringAssembler::TryToDirect(Label* if_bailout) {
|
||||
if (!FLAG_string_slices || (flags_ & kDontUnpackSlicedStrings)) {
|
||||
Goto(if_bailout);
|
||||
} else {
|
||||
TNode<String> const string = var_string_.value();
|
||||
TNode<IntPtrT> const sliced_offset =
|
||||
const TNode<String> string = var_string_.value();
|
||||
const TNode<IntPtrT> sliced_offset =
|
||||
LoadAndUntagObjectField(string, SlicedString::kOffsetOffset);
|
||||
var_offset_ = IntPtrAdd(var_offset_.value(), sliced_offset);
|
||||
|
||||
TNode<String> const parent =
|
||||
const TNode<String> parent =
|
||||
LoadObjectField<String>(string, SlicedString::kParentOffset);
|
||||
var_string_ = parent;
|
||||
var_instance_type_ = LoadInstanceType(parent);
|
||||
@ -6909,10 +6909,10 @@ TNode<String> ToDirectStringAssembler::TryToDirect(Label* if_bailout) {
|
||||
// Thin string. Fetch the actual string.
|
||||
BIND(&if_isthin);
|
||||
{
|
||||
TNode<String> const string = var_string_.value();
|
||||
TNode<String> const actual_string =
|
||||
const TNode<String> string = var_string_.value();
|
||||
const TNode<String> actual_string =
|
||||
LoadObjectField<String>(string, ThinString::kActualOffset);
|
||||
TNode<Uint16T> const actual_instance_type = LoadInstanceType(actual_string);
|
||||
const TNode<Uint16T> actual_instance_type = LoadInstanceType(actual_string);
|
||||
|
||||
var_string_ = actual_string;
|
||||
var_instance_type_ = actual_instance_type;
|
||||
@ -7351,8 +7351,8 @@ void CodeStubAssembler::TaggedToNumeric(Node* context, Node* value, Label* done,
|
||||
// ES#sec-touint32
|
||||
TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
SloppyTNode<Object> input) {
|
||||
TNode<Float64T> const float_zero = Float64Constant(0.0);
|
||||
TNode<Float64T> const float_two_32 =
|
||||
const TNode<Float64T> float_zero = Float64Constant(0.0);
|
||||
const TNode<Float64T> float_two_32 =
|
||||
Float64Constant(static_cast<double>(1ULL << 32));
|
||||
|
||||
Label out(this);
|
||||
@ -7368,7 +7368,7 @@ TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
BIND(&next);
|
||||
}
|
||||
|
||||
TNode<Number> const number = ToNumber(context, input);
|
||||
const TNode<Number> number = ToNumber(context, input);
|
||||
var_result.Bind(number);
|
||||
|
||||
// Perhaps we have a positive smi now.
|
||||
@ -7383,7 +7383,7 @@ TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
|
||||
BIND(&if_isnegativesmi);
|
||||
{
|
||||
TNode<Int32T> const uint32_value = SmiToInt32(CAST(number));
|
||||
const TNode<Int32T> uint32_value = SmiToInt32(CAST(number));
|
||||
TNode<Float64T> float64_value = ChangeUint32ToFloat64(uint32_value);
|
||||
var_result.Bind(AllocateHeapNumberWithValue(float64_value));
|
||||
Goto(&out);
|
||||
@ -7392,7 +7392,7 @@ TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
BIND(&if_isheapnumber);
|
||||
{
|
||||
Label return_zero(this);
|
||||
TNode<Float64T> const value = LoadHeapNumberValue(CAST(number));
|
||||
const TNode<Float64T> value = LoadHeapNumberValue(CAST(number));
|
||||
|
||||
{
|
||||
// +-0.
|
||||
@ -7411,7 +7411,7 @@ TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
{
|
||||
// +Infinity.
|
||||
Label next(this);
|
||||
TNode<Float64T> const positive_infinity =
|
||||
const TNode<Float64T> positive_infinity =
|
||||
Float64Constant(std::numeric_limits<double>::infinity());
|
||||
Branch(Float64Equal(value, positive_infinity), &return_zero, &next);
|
||||
BIND(&next);
|
||||
@ -7420,7 +7420,7 @@ TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
{
|
||||
// -Infinity.
|
||||
Label next(this);
|
||||
TNode<Float64T> const negative_infinity =
|
||||
const TNode<Float64T> negative_infinity =
|
||||
Float64Constant(-1.0 * std::numeric_limits<double>::infinity());
|
||||
Branch(Float64Equal(value, negative_infinity), &return_zero, &next);
|
||||
BIND(&next);
|
||||
@ -7436,7 +7436,7 @@ TNode<Number> CodeStubAssembler::ToUint32(SloppyTNode<Context> context,
|
||||
x = Float64Add(x, float_two_32);
|
||||
x = Float64Mod(x, float_two_32);
|
||||
|
||||
TNode<Number> const result = ChangeFloat64ToTagged(x);
|
||||
const TNode<Number> result = ChangeFloat64ToTagged(x);
|
||||
var_result.Bind(result);
|
||||
Goto(&out);
|
||||
}
|
||||
@ -7772,7 +7772,7 @@ void CodeStubAssembler::TryInternalizeString(
|
||||
Label* if_not_internalized, Label* if_bailout) {
|
||||
TNode<ExternalReference> function =
|
||||
ExternalConstant(ExternalReference::try_internalize_string_function());
|
||||
TNode<ExternalReference> const isolate_ptr =
|
||||
const TNode<ExternalReference> isolate_ptr =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
TNode<Object> result =
|
||||
CAST(CallCFunction(function, MachineType::AnyTagged(),
|
||||
@ -8034,9 +8034,9 @@ Node* CodeStubAssembler::ComputeUnseededHash(Node* key) {
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::ComputeSeededHash(Node* key) {
|
||||
TNode<ExternalReference> const function_addr =
|
||||
const TNode<ExternalReference> function_addr =
|
||||
ExternalConstant(ExternalReference::compute_integer_hash());
|
||||
TNode<ExternalReference> const isolate_ptr =
|
||||
const TNode<ExternalReference> isolate_ptr =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
|
||||
MachineType type_ptr = MachineType::Pointer();
|
||||
@ -12211,10 +12211,10 @@ void CodeStubAssembler::BranchIfSameValue(SloppyTNode<Object> lhs,
|
||||
// value.
|
||||
Label if_lhsisheapnumber(this), if_lhsisstring(this),
|
||||
if_lhsisbigint(this);
|
||||
TNode<Map> const lhs_map = LoadMap(CAST(lhs));
|
||||
const TNode<Map> lhs_map = LoadMap(CAST(lhs));
|
||||
GotoIf(IsHeapNumberMap(lhs_map), &if_lhsisheapnumber);
|
||||
if (mode != SameValueMode::kNumbersOnly) {
|
||||
TNode<Uint16T> const lhs_instance_type =
|
||||
const TNode<Uint16T> lhs_instance_type =
|
||||
LoadMapInstanceType(lhs_map);
|
||||
GotoIf(IsStringInstanceType(lhs_instance_type), &if_lhsisstring);
|
||||
GotoIf(IsBigIntInstanceType(lhs_instance_type), &if_lhsisbigint);
|
||||
@ -12235,7 +12235,7 @@ void CodeStubAssembler::BranchIfSameValue(SloppyTNode<Object> lhs,
|
||||
// Now we can only yield true if {rhs} is also a String
|
||||
// with the same sequence of characters.
|
||||
GotoIfNot(IsString(CAST(rhs)), if_false);
|
||||
TNode<Object> const result = CallBuiltin(
|
||||
const TNode<Object> result = CallBuiltin(
|
||||
Builtins::kStringEqual, NoContextConstant(), lhs, rhs);
|
||||
Branch(IsTrue(result), if_true, if_false);
|
||||
}
|
||||
@ -12243,7 +12243,7 @@ void CodeStubAssembler::BranchIfSameValue(SloppyTNode<Object> lhs,
|
||||
BIND(&if_lhsisbigint);
|
||||
{
|
||||
GotoIfNot(IsBigInt(CAST(rhs)), if_false);
|
||||
TNode<Object> const result = CallRuntime(
|
||||
const TNode<Object> result = CallRuntime(
|
||||
Runtime::kBigIntEqualToBigInt, NoContextConstant(), lhs, rhs);
|
||||
Branch(IsTrue(result), if_true, if_false);
|
||||
}
|
||||
@ -12271,8 +12271,8 @@ void CodeStubAssembler::BranchIfSameNumberValue(TNode<Float64T> lhs_value,
|
||||
// We still need to handle the case when {lhs} and {rhs} are -0.0 and
|
||||
// 0.0 (or vice versa). Compare the high word to
|
||||
// distinguish between the two.
|
||||
TNode<Uint32T> const lhs_hi_word = Float64ExtractHighWord32(lhs_value);
|
||||
TNode<Uint32T> const rhs_hi_word = Float64ExtractHighWord32(rhs_value);
|
||||
const TNode<Uint32T> lhs_hi_word = Float64ExtractHighWord32(lhs_value);
|
||||
const TNode<Uint32T> rhs_hi_word = Float64ExtractHighWord32(rhs_value);
|
||||
|
||||
// If x is +0 and y is -0, return false.
|
||||
// If x is -0 and y is +0, return false.
|
||||
@ -13109,19 +13109,19 @@ Node* CodeStubAssembler::IsDebugActive() {
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPromiseHookEnabled() {
|
||||
TNode<RawPtrT> const promise_hook = Load<RawPtrT>(
|
||||
const TNode<RawPtrT> promise_hook = Load<RawPtrT>(
|
||||
ExternalConstant(ExternalReference::promise_hook_address(isolate())));
|
||||
return WordNotEqual(promise_hook, IntPtrConstant(0));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::HasAsyncEventDelegate() {
|
||||
TNode<RawPtrT> const async_event_delegate = Load<RawPtrT>(ExternalConstant(
|
||||
const TNode<RawPtrT> async_event_delegate = Load<RawPtrT>(ExternalConstant(
|
||||
ExternalReference::async_event_delegate_address(isolate())));
|
||||
return WordNotEqual(async_event_delegate, IntPtrConstant(0));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPromiseHookEnabledOrHasAsyncEventDelegate() {
|
||||
TNode<Uint8T> const promise_hook_or_async_event_delegate =
|
||||
const TNode<Uint8T> promise_hook_or_async_event_delegate =
|
||||
Load<Uint8T>(ExternalConstant(
|
||||
ExternalReference::promise_hook_or_async_event_delegate_address(
|
||||
isolate())));
|
||||
@ -13130,7 +13130,7 @@ Node* CodeStubAssembler::IsPromiseHookEnabledOrHasAsyncEventDelegate() {
|
||||
|
||||
Node* CodeStubAssembler::
|
||||
IsPromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate() {
|
||||
TNode<Uint8T> const promise_hook_or_debug_is_active_or_async_event_delegate =
|
||||
const TNode<Uint8T> promise_hook_or_debug_is_active_or_async_event_delegate =
|
||||
Load<Uint8T>(ExternalConstant(
|
||||
ExternalReference::
|
||||
promise_hook_or_debug_is_active_or_async_event_delegate_address(
|
||||
@ -13260,14 +13260,14 @@ TNode<Code> CodeStubAssembler::GetSharedFunctionInfoCode(
|
||||
TNode<JSFunction> CodeStubAssembler::AllocateFunctionWithMapAndContext(
|
||||
TNode<Map> map, TNode<SharedFunctionInfo> shared_info,
|
||||
TNode<Context> context) {
|
||||
TNode<Code> const code = GetSharedFunctionInfoCode(shared_info);
|
||||
const TNode<Code> code = GetSharedFunctionInfoCode(shared_info);
|
||||
|
||||
// TODO(ishell): All the callers of this function pass map loaded from
|
||||
// Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX. So we can remove
|
||||
// map parameter.
|
||||
CSA_ASSERT(this, Word32BinaryNot(IsConstructorMap(map)));
|
||||
CSA_ASSERT(this, Word32BinaryNot(IsFunctionWithPrototypeSlotMap(map)));
|
||||
TNode<HeapObject> const fun = Allocate(JSFunction::kSizeWithoutPrototype);
|
||||
const TNode<HeapObject> fun = Allocate(JSFunction::kSizeWithoutPrototype);
|
||||
STATIC_ASSERT(JSFunction::kSizeWithoutPrototype == 7 * kTaggedSize);
|
||||
StoreMapNoWriteBarrier(fun, map);
|
||||
StoreObjectFieldRoot(fun, JSObject::kPropertiesOrHashOffset,
|
||||
@ -13432,7 +13432,7 @@ void CodeStubAssembler::InitializeSyntheticFunctionContext(
|
||||
SmiConstant(slots));
|
||||
|
||||
TNode<Context> context = CAST(context_heap_object);
|
||||
TNode<Object> const empty_scope_info =
|
||||
const TNode<Object> empty_scope_info =
|
||||
LoadContextElement(native_context, Context::SCOPE_INFO_INDEX);
|
||||
StoreContextElementNoWriteBarrier(context, Context::SCOPE_INFO_INDEX,
|
||||
empty_scope_info);
|
||||
|
@ -197,7 +197,7 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
|
||||
#define CSA_ASSERT_JS_ARGC_OP(csa, Op, op, expected) \
|
||||
(csa)->Assert( \
|
||||
[&]() -> compiler::Node* { \
|
||||
TNode<Word32T> const argc = UncheckedCast<Word32T>( \
|
||||
const TNode<Word32T> argc = UncheckedCast<Word32T>( \
|
||||
(csa)->Parameter(Descriptor::kJSActualArgumentsCount)); \
|
||||
return (csa)->Op(argc, (csa)->Int32Constant(expected)); \
|
||||
}, \
|
||||
@ -3540,7 +3540,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
|
||||
template <class... TArgs>
|
||||
Node* MakeTypeError(MessageTemplate message, Node* context, TArgs... args) {
|
||||
STATIC_ASSERT(sizeof...(TArgs) <= 3);
|
||||
TNode<Object> const make_type_error = LoadContextElement(
|
||||
const TNode<Object> make_type_error = LoadContextElement(
|
||||
LoadNativeContext(context), Context::MAKE_TYPE_ERROR_INDEX);
|
||||
return CallJS(CodeFactory::Call(isolate()), context, make_type_error,
|
||||
UndefinedConstant(), SmiConstant(message), args...);
|
||||
|
@ -269,13 +269,13 @@ TNode<Object> IntrinsicsGenerator::CreateAsyncFromSyncIterator(
|
||||
__ GotoIf(__ TaggedIsSmi(sync_iterator), ¬_receiver);
|
||||
__ GotoIfNot(__ IsJSReceiver(__ CAST(sync_iterator)), ¬_receiver);
|
||||
|
||||
TNode<Object> const next =
|
||||
const TNode<Object> next =
|
||||
__ GetProperty(context, sync_iterator, factory()->next_string());
|
||||
|
||||
TNode<NativeContext> const native_context = __ LoadNativeContext(context);
|
||||
TNode<Map> const map = __ CAST(__ LoadContextElement(
|
||||
const TNode<NativeContext> native_context = __ LoadNativeContext(context);
|
||||
const TNode<Map> map = __ CAST(__ LoadContextElement(
|
||||
native_context, Context::ASYNC_FROM_SYNC_ITERATOR_MAP_INDEX));
|
||||
TNode<JSObject> const iterator = __ AllocateJSObjectFromMap(map);
|
||||
const TNode<JSObject> iterator = __ AllocateJSObjectFromMap(map);
|
||||
|
||||
__ StoreObjectFieldNoWriteBarrier(
|
||||
iterator, JSAsyncFromSyncIterator::kSyncIteratorOffset, sync_iterator);
|
||||
@ -308,7 +308,7 @@ TNode<Object> IntrinsicsGenerator::GeneratorGetResumeMode(
|
||||
const InterpreterAssembler::RegListNodePair& args, TNode<Context> context) {
|
||||
TNode<JSGeneratorObject> generator =
|
||||
__ CAST(__ LoadRegisterFromRegisterList(args, 0));
|
||||
TNode<Object> const value =
|
||||
const TNode<Object> value =
|
||||
__ LoadObjectField(generator, JSGeneratorObject::kResumeModeOffset);
|
||||
|
||||
return value;
|
||||
@ -326,10 +326,10 @@ TNode<Object> IntrinsicsGenerator::GeneratorClose(
|
||||
|
||||
TNode<Object> IntrinsicsGenerator::GetImportMetaObject(
|
||||
const InterpreterAssembler::RegListNodePair& args, TNode<Context> context) {
|
||||
TNode<Context> const module_context = __ LoadModuleContext(context);
|
||||
TNode<HeapObject> const module =
|
||||
const TNode<Context> module_context = __ LoadModuleContext(context);
|
||||
const TNode<HeapObject> module =
|
||||
__ CAST(__ LoadContextElement(module_context, Context::EXTENSION_INDEX));
|
||||
TNode<Object> const import_meta =
|
||||
const TNode<Object> import_meta =
|
||||
__ LoadObjectField(module, SourceTextModule::kImportMetaOffset);
|
||||
|
||||
InterpreterAssembler::TVariable<Object> return_value(assembler_);
|
||||
|
@ -71,7 +71,7 @@ TEST(CallCFunction) {
|
||||
CodeStubAssembler m(asm_tester.state());
|
||||
|
||||
{
|
||||
TNode<ExternalReference> const fun_constant = m.ExternalConstant(
|
||||
const TNode<ExternalReference> fun_constant = m.ExternalConstant(
|
||||
ExternalReference::Create(reinterpret_cast<Address>(sum10)));
|
||||
|
||||
MachineType type_intptr = MachineType::IntPtr();
|
||||
@ -105,7 +105,7 @@ TEST(CallCFunctionWithCallerSavedRegisters) {
|
||||
CodeStubAssembler m(asm_tester.state());
|
||||
|
||||
{
|
||||
TNode<ExternalReference> const fun_constant = m.ExternalConstant(
|
||||
const TNode<ExternalReference> fun_constant = m.ExternalConstant(
|
||||
ExternalReference::Create(reinterpret_cast<Address>(sum3)));
|
||||
|
||||
MachineType type_intptr = MachineType::IntPtr();
|
||||
@ -2456,7 +2456,7 @@ TEST(AllocateAndInitJSPromise) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<JSPromise> const promise = m.AllocateAndInitJSPromise(m.CAST(context));
|
||||
const TNode<JSPromise> promise = m.AllocateAndInitJSPromise(m.CAST(context));
|
||||
m.Return(promise);
|
||||
|
||||
FunctionTester ft(asm_tester.GenerateCode(), kNumParams);
|
||||
@ -2473,7 +2473,7 @@ TEST(AllocateAndSetJSPromise) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<JSPromise> const promise = m.AllocateAndSetJSPromise(
|
||||
const TNode<JSPromise> promise = m.AllocateAndSetJSPromise(
|
||||
m.CAST(context), v8::Promise::kRejected, m.SmiConstant(1));
|
||||
m.Return(promise);
|
||||
|
||||
@ -2536,7 +2536,7 @@ TEST(PromiseHasHandler) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<JSPromise> const promise =
|
||||
const TNode<JSPromise> promise =
|
||||
m.AllocateAndInitJSPromise(m.CAST(context), m.UndefinedConstant());
|
||||
m.Return(m.SelectBooleanConstant(m.PromiseHasHandler(promise)));
|
||||
|
||||
@ -2554,10 +2554,10 @@ TEST(CreatePromiseResolvingFunctionsContext) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<NativeContext> const native_context = m.LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = m.LoadNativeContext(context);
|
||||
const TNode<JSPromise> promise =
|
||||
m.AllocateAndInitJSPromise(m.CAST(context), m.UndefinedConstant());
|
||||
TNode<Context> const promise_context =
|
||||
const TNode<Context> promise_context =
|
||||
m.CreatePromiseResolvingFunctionsContext(
|
||||
promise, m.BooleanConstant(false), native_context);
|
||||
m.Return(promise_context);
|
||||
@ -2582,7 +2582,7 @@ TEST(CreatePromiseResolvingFunctions) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<NativeContext> const native_context = m.LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = m.LoadNativeContext(context);
|
||||
const TNode<JSPromise> promise =
|
||||
m.AllocateAndInitJSPromise(m.CAST(context), m.UndefinedConstant());
|
||||
PromiseResolvingFunctions funcs = m.CreatePromiseResolvingFunctions(
|
||||
@ -2672,7 +2672,7 @@ TEST(AllocateFunctionWithMapAndContext) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<NativeContext> const native_context = m.LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = m.LoadNativeContext(context);
|
||||
const TNode<JSPromise> promise =
|
||||
m.AllocateAndInitJSPromise(m.CAST(context), m.UndefinedConstant());
|
||||
TNode<Context> promise_context = m.CreatePromiseResolvingFunctionsContext(
|
||||
@ -2680,9 +2680,9 @@ TEST(AllocateFunctionWithMapAndContext) {
|
||||
TNode<Object> resolve_info = m.LoadContextElement(
|
||||
native_context,
|
||||
Context::PROMISE_CAPABILITY_DEFAULT_RESOLVE_SHARED_FUN_INDEX);
|
||||
TNode<Object> const map = m.LoadContextElement(
|
||||
const TNode<Object> map = m.LoadContextElement(
|
||||
native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX);
|
||||
TNode<JSFunction> const resolve = m.AllocateFunctionWithMapAndContext(
|
||||
const TNode<JSFunction> resolve = m.AllocateFunctionWithMapAndContext(
|
||||
m.CAST(map), m.CAST(resolve_info), promise_context);
|
||||
m.Return(resolve);
|
||||
|
||||
@ -2710,9 +2710,9 @@ TEST(CreatePromiseGetCapabilitiesExecutorContext) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<NativeContext> const native_context = m.LoadNativeContext(context);
|
||||
const TNode<NativeContext> native_context = m.LoadNativeContext(context);
|
||||
|
||||
TNode<Map> const map = m.PromiseCapabilityMapConstant();
|
||||
const TNode<Map> map = m.PromiseCapabilityMapConstant();
|
||||
Node* const capability = m.AllocateStruct(map);
|
||||
m.StoreObjectFieldNoWriteBarrier(
|
||||
capability, PromiseCapability::kPromiseOffset, m.UndefinedConstant());
|
||||
@ -2745,12 +2745,12 @@ TEST(NewPromiseCapability) {
|
||||
PromiseBuiltinsAssembler m(asm_tester.state());
|
||||
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
TNode<NativeContext> const native_context = m.LoadNativeContext(context);
|
||||
TNode<Object> const promise_constructor =
|
||||
const TNode<NativeContext> native_context = m.LoadNativeContext(context);
|
||||
const TNode<Object> promise_constructor =
|
||||
m.LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX);
|
||||
|
||||
TNode<Oddball> const debug_event = m.TrueConstant();
|
||||
TNode<Object> const capability =
|
||||
const TNode<Oddball> debug_event = m.TrueConstant();
|
||||
const TNode<Object> capability =
|
||||
m.CallBuiltin(Builtins::kNewPromiseCapability, context,
|
||||
promise_constructor, debug_event);
|
||||
m.Return(capability);
|
||||
@ -2792,8 +2792,8 @@ TEST(NewPromiseCapability) {
|
||||
Node* const context = m.Parameter(kNumParams + 2);
|
||||
|
||||
Node* const constructor = m.Parameter(1);
|
||||
TNode<Oddball> const debug_event = m.TrueConstant();
|
||||
TNode<Object> const capability = m.CallBuiltin(
|
||||
const TNode<Oddball> debug_event = m.TrueConstant();
|
||||
const TNode<Object> capability = m.CallBuiltin(
|
||||
Builtins::kNewPromiseCapability, context, constructor, debug_event);
|
||||
m.Return(capability);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user