[CSA] Type CodeStubAssembler::Is* methods
Bug: v8:7570 Change-Id: I74b482b670ce0e78dca012cbe8d9c2f65fdae5b9 Reviewed-on: https://chromium-review.googlesource.com/1030554 Commit-Queue: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#52846}
This commit is contained in:
parent
440533d5d4
commit
37b8684ec3
@ -290,7 +290,8 @@ macro HasPropertyObject(
|
||||
}
|
||||
}
|
||||
|
||||
extern macro IsCallable(Object): bit;
|
||||
extern macro IsCallable(HeapObject): bit;
|
||||
extern macro TaggedIsCallable(Object): bit;
|
||||
extern macro IsDetachedBuffer(JSArrayBuffer): bit;
|
||||
|
||||
type ParameterMode;
|
||||
|
@ -1305,7 +1305,7 @@ TF_BUILTIN(ArrayPrototypeSlice, ArrayPrototypeSliceCodeStubAssembler) {
|
||||
load_arguments_length(this);
|
||||
|
||||
GotoIf(TaggedIsSmi(receiver), &generic_length);
|
||||
GotoIfNot(IsJSArray(receiver), &check_arguments_length);
|
||||
GotoIfNot(IsJSArray(CAST(receiver)), &check_arguments_length);
|
||||
|
||||
TNode<JSArray> array_receiver = CAST(receiver);
|
||||
o = array_receiver;
|
||||
@ -1852,7 +1852,7 @@ class ArrayPopulatorAssembler : public CodeStubAssembler {
|
||||
TVARIABLE(Object, array);
|
||||
Label is_constructor(this), is_not_constructor(this), done(this);
|
||||
GotoIf(TaggedIsSmi(receiver), &is_not_constructor);
|
||||
Branch(IsConstructor(receiver), &is_constructor, &is_not_constructor);
|
||||
Branch(IsConstructor(CAST(receiver)), &is_constructor, &is_not_constructor);
|
||||
|
||||
BIND(&is_constructor);
|
||||
{
|
||||
@ -1885,7 +1885,7 @@ class ArrayPopulatorAssembler : public CodeStubAssembler {
|
||||
Label is_constructor(this), is_not_constructor(this), done(this);
|
||||
CSA_ASSERT(this, IsNumberNormalized(length));
|
||||
GotoIf(TaggedIsSmi(receiver), &is_not_constructor);
|
||||
Branch(IsConstructor(receiver), &is_constructor, &is_not_constructor);
|
||||
Branch(IsConstructor(CAST(receiver)), &is_constructor, &is_not_constructor);
|
||||
|
||||
BIND(&is_constructor);
|
||||
{
|
||||
@ -1996,7 +1996,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
|
||||
Label no_error(this), error(this);
|
||||
GotoIf(IsUndefined(map_function), &no_error);
|
||||
GotoIf(TaggedIsSmi(map_function), &error);
|
||||
Branch(IsCallable(map_function), &no_error, &error);
|
||||
Branch(IsCallable(CAST(map_function)), &no_error, &error);
|
||||
|
||||
BIND(&error);
|
||||
ThrowTypeError(context, MessageTemplate::kCalledNonCallable, map_function);
|
||||
@ -2033,7 +2033,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
|
||||
{
|
||||
Label get_method_not_callable(this, Label::kDeferred), next(this);
|
||||
GotoIf(TaggedIsSmi(iterator_method), &get_method_not_callable);
|
||||
GotoIfNot(IsCallable(iterator_method), &get_method_not_callable);
|
||||
GotoIfNot(IsCallable(CAST(iterator_method)), &get_method_not_callable);
|
||||
Goto(&next);
|
||||
|
||||
BIND(&get_method_not_callable);
|
||||
@ -2073,7 +2073,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
|
||||
Label next(this);
|
||||
GotoIf(IsUndefined(map_function), &next);
|
||||
|
||||
CSA_ASSERT(this, IsCallable(map_function));
|
||||
CSA_ASSERT(this, IsCallable(CAST(map_function)));
|
||||
Node* v = CallJS(CodeFactory::Call(isolate()), context, map_function,
|
||||
this_arg, value.value(), index.value());
|
||||
GotoIfException(v, &on_exception, &var_exception);
|
||||
@ -2149,7 +2149,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
|
||||
Label next(this);
|
||||
GotoIf(IsUndefined(map_function), &next);
|
||||
|
||||
CSA_ASSERT(this, IsCallable(map_function));
|
||||
CSA_ASSERT(this, IsCallable(CAST(map_function)));
|
||||
value = CAST(CallJS(CodeFactory::Call(isolate()), context, map_function,
|
||||
this_arg, value.value(), index.value()));
|
||||
Goto(&next);
|
||||
@ -3191,7 +3191,7 @@ void ArrayIncludesIndexofAssembler::GenerateSmiOrObject(
|
||||
&return_not_found);
|
||||
Node* element_k = LoadFixedArrayElement(elements, index_var.value());
|
||||
GotoIf(TaggedIsSmi(element_k), &continue_loop);
|
||||
GotoIfNot(IsHeapNumber(element_k), &continue_loop);
|
||||
GotoIfNot(IsHeapNumber(CAST(element_k)), &continue_loop);
|
||||
BranchIfFloat64IsNaN(LoadHeapNumberValue(element_k), &return_found,
|
||||
&continue_loop);
|
||||
|
||||
@ -3243,7 +3243,7 @@ void ArrayIncludesIndexofAssembler::GenerateSmiOrObject(
|
||||
Node* element_k = LoadFixedArrayElement(elements, index_var.value());
|
||||
Label continue_loop(this);
|
||||
GotoIf(TaggedIsSmi(element_k), &continue_loop);
|
||||
GotoIfNot(IsBigInt(element_k), &continue_loop);
|
||||
GotoIfNot(IsBigInt(CAST(element_k)), &continue_loop);
|
||||
TNode<Object> result = CallRuntime(Runtime::kBigIntEqualToBigInt, context,
|
||||
search_element, element_k);
|
||||
Branch(WordEqual(result, TrueConstant()), &return_found, &continue_loop);
|
||||
@ -3548,7 +3548,7 @@ TF_BUILTIN(ArrayIteratorPrototypeNext, CodeStubAssembler) {
|
||||
// If O does not have all of the internal slots of an Array Iterator Instance
|
||||
// (22.1.5.3), throw a TypeError exception
|
||||
GotoIf(TaggedIsSmi(iterator), &throw_bad_receiver);
|
||||
GotoIfNot(IsJSArrayIterator(iterator), &throw_bad_receiver);
|
||||
GotoIfNot(IsJSArrayIterator(CAST(iterator)), &throw_bad_receiver);
|
||||
|
||||
// Let a be O.[[IteratedObject]].
|
||||
Node* array =
|
||||
|
@ -116,13 +116,13 @@ class BaseCollectionsAssembler : public CodeStubAssembler {
|
||||
|
||||
// Loads an element from a fixed array. If the element is the hole, returns
|
||||
// `undefined`.
|
||||
TNode<Object> LoadAndNormalizeFixedArrayElement(TNode<Object> elements,
|
||||
TNode<Object> LoadAndNormalizeFixedArrayElement(TNode<HeapObject> elements,
|
||||
TNode<IntPtrT> index);
|
||||
|
||||
// Loads an element from a fixed double array. If the element is the hole,
|
||||
// returns `undefined`.
|
||||
TNode<Object> LoadAndNormalizeFixedDoubleArrayElement(TNode<Object> elements,
|
||||
TNode<IntPtrT> index);
|
||||
TNode<Object> LoadAndNormalizeFixedDoubleArrayElement(
|
||||
TNode<HeapObject> elements, TNode<IntPtrT> index);
|
||||
|
||||
// Loads key and value variables with the first and second elements of an
|
||||
// array. If the array lacks 2 elements, undefined is used.
|
||||
@ -385,7 +385,7 @@ TNode<Object> BaseCollectionsAssembler::GetAddFunction(
|
||||
|
||||
Label exit(this), if_notcallable(this, Label::kDeferred);
|
||||
GotoIf(TaggedIsSmi(add_func), &if_notcallable);
|
||||
GotoIfNot(IsCallable(add_func), &if_notcallable);
|
||||
GotoIfNot(IsCallable(CAST(add_func)), &if_notcallable);
|
||||
Goto(&exit);
|
||||
|
||||
BIND(&if_notcallable);
|
||||
@ -484,20 +484,20 @@ TNode<BoolT> BaseCollectionsAssembler::HasInitialCollectionPrototype(
|
||||
TNode<Map> initial_prototype_map =
|
||||
CAST(LoadContextElement(native_context, initial_prototype_index));
|
||||
TNode<Map> collection_proto_map =
|
||||
LoadMap(CAST(LoadMapPrototype(LoadMap(CAST(collection)))));
|
||||
LoadMap(LoadMapPrototype(LoadMap(CAST(collection))));
|
||||
|
||||
return WordEqual(collection_proto_map, initial_prototype_map);
|
||||
}
|
||||
|
||||
TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedArrayElement(
|
||||
TNode<Object> elements, TNode<IntPtrT> index) {
|
||||
TNode<HeapObject> elements, TNode<IntPtrT> index) {
|
||||
TNode<Object> element = LoadFixedArrayElement(elements, index);
|
||||
return Select<Object>(IsTheHole(element), [=] { return UndefinedConstant(); },
|
||||
[=] { return element; });
|
||||
}
|
||||
|
||||
TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement(
|
||||
TNode<Object> elements, TNode<IntPtrT> index) {
|
||||
TNode<HeapObject> elements, TNode<IntPtrT> index) {
|
||||
TVARIABLE(Object, entry);
|
||||
Label if_hole(this, Label::kDeferred), next(this);
|
||||
TNode<Float64T> element = UncheckedCast<Float64T>(LoadFixedDoubleArrayElement(
|
||||
@ -1956,7 +1956,7 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
|
||||
: BaseCollectionsAssembler(state) {}
|
||||
|
||||
protected:
|
||||
void AddEntry(TNode<Object> table, TNode<IntPtrT> key_index,
|
||||
void AddEntry(TNode<HeapObject> table, TNode<IntPtrT> key_index,
|
||||
TNode<Object> key, TNode<Object> value,
|
||||
TNode<IntPtrT> number_of_elements);
|
||||
|
||||
@ -1972,19 +1972,19 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
|
||||
// the {key} is found.
|
||||
typedef std::function<void(TNode<Object> entry_key, Label* if_same)>
|
||||
KeyComparator;
|
||||
TNode<IntPtrT> FindKeyIndex(TNode<Object> table, TNode<IntPtrT> key_hash,
|
||||
TNode<IntPtrT> FindKeyIndex(TNode<HeapObject> table, TNode<IntPtrT> key_hash,
|
||||
TNode<IntPtrT> entry_mask,
|
||||
const KeyComparator& key_compare);
|
||||
|
||||
// Builds code that finds an ObjectHashTable entry available for a new entry.
|
||||
TNode<IntPtrT> FindKeyIndexForInsertion(TNode<Object> table,
|
||||
TNode<IntPtrT> FindKeyIndexForInsertion(TNode<HeapObject> table,
|
||||
TNode<IntPtrT> key_hash,
|
||||
TNode<IntPtrT> entry_mask);
|
||||
|
||||
// Builds code that finds the ObjectHashTable entry with key that matches
|
||||
// {key} and returns the entry's key index. If {key} cannot be found, jumps to
|
||||
// {if_not_found}.
|
||||
TNode<IntPtrT> FindKeyIndexForKey(TNode<Object> table, TNode<Object> key,
|
||||
TNode<IntPtrT> FindKeyIndexForKey(TNode<HeapObject> table, TNode<Object> key,
|
||||
TNode<IntPtrT> hash,
|
||||
TNode<IntPtrT> entry_mask,
|
||||
Label* if_not_found);
|
||||
@ -1994,12 +1994,12 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
|
||||
TNode<IntPtrT> number_of_deleted);
|
||||
TNode<IntPtrT> KeyIndexFromEntry(TNode<IntPtrT> entry);
|
||||
|
||||
TNode<IntPtrT> LoadNumberOfElements(TNode<Object> table, int offset);
|
||||
TNode<IntPtrT> LoadNumberOfDeleted(TNode<Object> table, int offset = 0);
|
||||
TNode<Object> LoadTable(SloppyTNode<Object> collection);
|
||||
TNode<IntPtrT> LoadTableCapacity(TNode<Object> table);
|
||||
TNode<IntPtrT> LoadNumberOfElements(TNode<HeapObject> table, int offset);
|
||||
TNode<IntPtrT> LoadNumberOfDeleted(TNode<HeapObject> table, int offset = 0);
|
||||
TNode<HeapObject> LoadTable(SloppyTNode<HeapObject> collection);
|
||||
TNode<IntPtrT> LoadTableCapacity(TNode<HeapObject> table);
|
||||
|
||||
void RemoveEntry(TNode<Object> table, TNode<IntPtrT> key_index,
|
||||
void RemoveEntry(TNode<HeapObject> table, TNode<IntPtrT> key_index,
|
||||
TNode<IntPtrT> number_of_elements);
|
||||
TNode<BoolT> ShouldRehash(TNode<IntPtrT> number_of_elements,
|
||||
TNode<IntPtrT> number_of_deleted);
|
||||
@ -2009,7 +2009,7 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
|
||||
};
|
||||
|
||||
void WeakCollectionsBuiltinsAssembler::AddEntry(
|
||||
TNode<Object> table, TNode<IntPtrT> key_index, TNode<Object> key,
|
||||
TNode<HeapObject> table, TNode<IntPtrT> key_index, TNode<Object> key,
|
||||
TNode<Object> value, TNode<IntPtrT> number_of_elements) {
|
||||
// See ObjectHashTable::AddEntry().
|
||||
TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index);
|
||||
@ -2070,7 +2070,7 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::EntryMask(
|
||||
}
|
||||
|
||||
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndex(
|
||||
TNode<Object> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask,
|
||||
TNode<HeapObject> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask,
|
||||
const KeyComparator& key_compare) {
|
||||
// See HashTable::FirstProbe().
|
||||
TVARIABLE(IntPtrT, var_entry, WordAnd(key_hash, entry_mask));
|
||||
@ -2099,7 +2099,8 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndex(
|
||||
}
|
||||
|
||||
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForInsertion(
|
||||
TNode<Object> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask) {
|
||||
TNode<HeapObject> table, TNode<IntPtrT> key_hash,
|
||||
TNode<IntPtrT> entry_mask) {
|
||||
// See HashTable::FindInsertionEntry().
|
||||
auto is_not_live = [&](TNode<Object> entry_key, Label* if_found) {
|
||||
// This is the the negative form BaseShape::IsLive().
|
||||
@ -2109,7 +2110,7 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForInsertion(
|
||||
}
|
||||
|
||||
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForKey(
|
||||
TNode<Object> table, TNode<Object> key, TNode<IntPtrT> hash,
|
||||
TNode<HeapObject> table, TNode<Object> key, TNode<IntPtrT> hash,
|
||||
TNode<IntPtrT> entry_mask, Label* if_not_found) {
|
||||
// See HashTable::FindEntry().
|
||||
auto match_key_or_exit_on_empty = [&](TNode<Object> entry_key,
|
||||
@ -2131,26 +2132,26 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::KeyIndexFromEntry(
|
||||
}
|
||||
|
||||
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfElements(
|
||||
TNode<Object> table, int offset) {
|
||||
TNode<HeapObject> table, int offset) {
|
||||
TNode<IntPtrT> number_of_elements = SmiUntag(CAST(
|
||||
LoadFixedArrayElement(table, ObjectHashTable::kNumberOfElementsIndex)));
|
||||
return IntPtrAdd(number_of_elements, IntPtrConstant(offset));
|
||||
}
|
||||
|
||||
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfDeleted(
|
||||
TNode<Object> table, int offset) {
|
||||
TNode<HeapObject> table, int offset) {
|
||||
TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadFixedArrayElement(
|
||||
table, ObjectHashTable::kNumberOfDeletedElementsIndex)));
|
||||
return IntPtrAdd(number_of_deleted, IntPtrConstant(offset));
|
||||
}
|
||||
|
||||
TNode<Object> WeakCollectionsBuiltinsAssembler::LoadTable(
|
||||
SloppyTNode<Object> collection) {
|
||||
return LoadObjectField(CAST(collection), JSWeakCollection::kTableOffset);
|
||||
TNode<HeapObject> WeakCollectionsBuiltinsAssembler::LoadTable(
|
||||
SloppyTNode<HeapObject> collection) {
|
||||
return CAST(LoadObjectField(collection, JSWeakCollection::kTableOffset));
|
||||
}
|
||||
|
||||
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadTableCapacity(
|
||||
TNode<Object> table) {
|
||||
TNode<HeapObject> table) {
|
||||
return SmiUntag(
|
||||
CAST(LoadFixedArrayElement(table, ObjectHashTable::kCapacityIndex)));
|
||||
}
|
||||
@ -2174,7 +2175,7 @@ TNode<Word32T> WeakCollectionsBuiltinsAssembler::InsufficientCapacityToAdd(
|
||||
}
|
||||
|
||||
void WeakCollectionsBuiltinsAssembler::RemoveEntry(
|
||||
TNode<Object> table, TNode<IntPtrT> key_index,
|
||||
TNode<HeapObject> table, TNode<IntPtrT> key_index,
|
||||
TNode<IntPtrT> number_of_elements) {
|
||||
// See ObjectHashTable::RemoveEntry().
|
||||
TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index);
|
||||
@ -2228,7 +2229,7 @@ TF_BUILTIN(WeakSetConstructor, WeakCollectionsBuiltinsAssembler) {
|
||||
}
|
||||
|
||||
TF_BUILTIN(WeakMapLookupHashIndex, WeakCollectionsBuiltinsAssembler) {
|
||||
TNode<Object> table = CAST(Parameter(Descriptor::kTable));
|
||||
TNode<HeapObject> table = CAST(Parameter(Descriptor::kTable));
|
||||
TNode<Object> key = CAST(Parameter(Descriptor::kKey));
|
||||
|
||||
Label if_not_found(this);
|
||||
@ -2293,7 +2294,7 @@ TF_BUILTIN(WeakMapHas, WeakCollectionsBuiltinsAssembler) {
|
||||
// (ObjectHashTable) of a WeakMap or WeakSet.
|
||||
TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
|
||||
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
TNode<Object> collection = CAST(Parameter(Descriptor::kCollection));
|
||||
TNode<HeapObject> collection = CAST(Parameter(Descriptor::kCollection));
|
||||
TNode<Object> key = CAST(Parameter(Descriptor::kKey));
|
||||
|
||||
Label call_runtime(this), if_not_found(this);
|
||||
@ -2301,7 +2302,7 @@ TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
|
||||
GotoIfNotJSReceiver(key, &if_not_found);
|
||||
|
||||
TNode<IntPtrT> hash = LoadJSReceiverIdentityHash(key, &if_not_found);
|
||||
TNode<Object> table = LoadTable(collection);
|
||||
TNode<HeapObject> table = LoadTable(collection);
|
||||
TNode<IntPtrT> capacity = LoadTableCapacity(table);
|
||||
TNode<IntPtrT> key_index =
|
||||
FindKeyIndexForKey(table, key, hash, EntryMask(capacity), &if_not_found);
|
||||
@ -2323,15 +2324,15 @@ TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
|
||||
// a WeakMap or WeakSet.
|
||||
TF_BUILTIN(WeakCollectionSet, WeakCollectionsBuiltinsAssembler) {
|
||||
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
|
||||
TNode<Object> collection = CAST(Parameter(Descriptor::kCollection));
|
||||
TNode<Object> key = CAST(Parameter(Descriptor::kKey));
|
||||
TNode<HeapObject> collection = CAST(Parameter(Descriptor::kCollection));
|
||||
TNode<JSReceiver> key = CAST(Parameter(Descriptor::kKey));
|
||||
TNode<Object> value = CAST(Parameter(Descriptor::kValue));
|
||||
|
||||
CSA_ASSERT(this, IsJSReceiver(key));
|
||||
|
||||
Label call_runtime(this), if_no_hash(this), if_not_found(this);
|
||||
|
||||
TNode<Object> table = LoadTable(collection);
|
||||
TNode<HeapObject> table = LoadTable(collection);
|
||||
TNode<IntPtrT> capacity = LoadTableCapacity(table);
|
||||
TNode<IntPtrT> entry_mask = EntryMask(capacity);
|
||||
|
||||
|
@ -17,7 +17,7 @@ void ProxiesCodeStubAssembler::GotoIfRevokedProxy(Node* object,
|
||||
Label* if_proxy_revoked) {
|
||||
Label proxy_not_revoked(this);
|
||||
GotoIfNot(IsJSProxy(object), &proxy_not_revoked);
|
||||
Branch(IsJSReceiver(LoadObjectField(object, JSProxy::kHandlerOffset)),
|
||||
Branch(IsJSReceiver(CAST(LoadObjectField(object, JSProxy::kHandlerOffset))),
|
||||
&proxy_not_revoked, if_proxy_revoked);
|
||||
BIND(&proxy_not_revoked);
|
||||
}
|
||||
|
@ -906,7 +906,7 @@ void RegExpBuiltinsAssembler::BranchIfFastRegExp(Node* const context,
|
||||
|
||||
Node* const initial_proto_initial_map =
|
||||
LoadContextElement(native_context, Context::REGEXP_PROTOTYPE_MAP_INDEX);
|
||||
Node* const proto_map = LoadMap(CAST(LoadMapPrototype(map)));
|
||||
Node* const proto_map = LoadMap(LoadMapPrototype(map));
|
||||
Node* const proto_has_initialmap =
|
||||
WordEqual(proto_map, initial_proto_initial_map);
|
||||
|
||||
@ -3151,8 +3151,8 @@ TF_BUILTIN(RegExpStringIteratorPrototypeNext, RegExpStringIteratorAssembler) {
|
||||
// 1. Let O be the this value.
|
||||
// 2. If Type(O) is not Object, throw a TypeError exception.
|
||||
GotoIf(TaggedIsSmi(maybe_receiver), &throw_bad_receiver);
|
||||
GotoIfNot(IsJSReceiver(maybe_receiver), &throw_bad_receiver);
|
||||
TNode<HeapObject> receiver = CAST(maybe_receiver);
|
||||
GotoIfNot(IsJSReceiver(receiver), &throw_bad_receiver);
|
||||
|
||||
// 3. If O does not have all of the internal slots of a RegExp String Iterator
|
||||
// Object Instance (see 5.3), throw a TypeError exception.
|
||||
|
@ -1045,7 +1045,7 @@ void StringBuiltinsAssembler::MaybeCallFunctionAtSymbol(
|
||||
LoadContextElement(native_context, Context::STRING_FUNCTION_INDEX);
|
||||
Node* const initial_map =
|
||||
LoadObjectField(string_fun, JSFunction::kPrototypeOrInitialMapOffset);
|
||||
Node* const proto_map = LoadMap(CAST(LoadMapPrototype(initial_map)));
|
||||
Node* const proto_map = LoadMap(LoadMapPrototype(initial_map));
|
||||
|
||||
Branch(WordEqual(proto_map, initial_proto_initial_map), &out, &next);
|
||||
|
||||
@ -1519,8 +1519,8 @@ TF_BUILTIN(StringPrototypeMatchAll, StringBuiltinsAssembler) {
|
||||
auto if_regexp_call = [&] {
|
||||
// MaybeCallFunctionAtSymbol guarantees fast path is chosen only if
|
||||
// maybe_regexp is a fast regexp and receiver is a string.
|
||||
CSA_ASSERT(this, IsString(receiver));
|
||||
var_receiver_string = CAST(receiver);
|
||||
CSA_ASSERT(this, IsString(var_receiver_string.value()));
|
||||
var_is_fast_regexp = Int32TrueConstant();
|
||||
Goto(&return_match_all_iterator);
|
||||
};
|
||||
@ -1904,7 +1904,7 @@ TF_BUILTIN(StringPrototypeSubstr, StringBuiltinsAssembler) {
|
||||
// two cases according to the spec: if it is negative, "" is returned; if
|
||||
// it is positive, then length is set to {string_length} - {start}.
|
||||
|
||||
CSA_ASSERT(this, IsHeapNumber(var_length.value()));
|
||||
CSA_ASSERT(this, IsHeapNumber(CAST(var_length.value())));
|
||||
|
||||
Label if_isnegative(this), if_ispositive(this);
|
||||
TNode<Float64T> const float_zero = Float64Constant(0.);
|
||||
|
@ -625,10 +625,10 @@ void TypedArrayBuiltinsAssembler::ConstructByArrayLike(
|
||||
|
||||
void TypedArrayBuiltinsAssembler::ConstructByIterable(
|
||||
TNode<Context> context, TNode<JSTypedArray> holder,
|
||||
TNode<JSReceiver> iterable, TNode<Object> iterator_fn,
|
||||
TNode<JSReceiver> iterable, TNode<JSReceiver> iterator_fn,
|
||||
TNode<Smi> element_size) {
|
||||
CSA_ASSERT(this, IsCallable(iterator_fn));
|
||||
Label fast_path(this), slow_path(this), done(this);
|
||||
CSA_ASSERT(this, IsCallable(iterator_fn));
|
||||
|
||||
TNode<JSArray> array_like = CAST(
|
||||
CallBuiltin(Builtins::kIterableToList, context, iterable, iterator_fn));
|
||||
@ -669,9 +669,10 @@ TF_BUILTIN(CreateTypedArray, TypedArrayBuiltinsAssembler) {
|
||||
SmiTag(GetTypedArrayElementSize(LoadElementsKind(result)));
|
||||
|
||||
GotoIf(TaggedIsSmi(arg1), &if_arg1isnumber);
|
||||
GotoIf(IsJSArrayBuffer(arg1), &if_arg1isbuffer);
|
||||
GotoIf(IsJSTypedArray(arg1), &if_arg1istypedarray);
|
||||
GotoIf(IsJSReceiver(arg1), &if_arg1isreceiver);
|
||||
TNode<HeapObject> arg1_heap_object = UncheckedCast<HeapObject>(arg1);
|
||||
GotoIf(IsJSArrayBuffer(arg1_heap_object), &if_arg1isbuffer);
|
||||
GotoIf(IsJSTypedArray(arg1_heap_object), &if_arg1istypedarray);
|
||||
GotoIf(IsJSReceiver(arg1_heap_object), &if_arg1isreceiver);
|
||||
Goto(&if_arg1isnumber);
|
||||
|
||||
// https://tc39.github.io/ecma262/#sec-typedarray-buffer-byteoffset-length
|
||||
@ -685,7 +686,7 @@ TF_BUILTIN(CreateTypedArray, TypedArrayBuiltinsAssembler) {
|
||||
// https://tc39.github.io/ecma262/#sec-typedarray-typedarray
|
||||
BIND(&if_arg1istypedarray);
|
||||
{
|
||||
TNode<JSTypedArray> typed_array = CAST(arg1);
|
||||
TNode<JSTypedArray> typed_array = CAST(arg1_heap_object);
|
||||
ConstructByTypedArray(context, result, typed_array, element_size);
|
||||
Goto(&return_result);
|
||||
}
|
||||
@ -695,18 +696,19 @@ TF_BUILTIN(CreateTypedArray, TypedArrayBuiltinsAssembler) {
|
||||
{
|
||||
Label if_iteratorundefined(this), if_iteratornotcallable(this);
|
||||
// Get iterator symbol
|
||||
TNode<Object> iteratorFn =
|
||||
CAST(GetMethod(context, arg1, isolate()->factory()->iterator_symbol(),
|
||||
&if_iteratorundefined));
|
||||
TNode<Object> iteratorFn = CAST(GetMethod(
|
||||
context, arg1_heap_object, isolate()->factory()->iterator_symbol(),
|
||||
&if_iteratorundefined));
|
||||
GotoIf(TaggedIsSmi(iteratorFn), &if_iteratornotcallable);
|
||||
GotoIfNot(IsCallable(iteratorFn), &if_iteratornotcallable);
|
||||
GotoIfNot(IsCallable(CAST(iteratorFn)), &if_iteratornotcallable);
|
||||
|
||||
ConstructByIterable(context, result, CAST(arg1), iteratorFn, element_size);
|
||||
ConstructByIterable(context, result, CAST(arg1_heap_object),
|
||||
CAST(iteratorFn), element_size);
|
||||
Goto(&return_result);
|
||||
|
||||
BIND(&if_iteratorundefined);
|
||||
{
|
||||
TNode<HeapObject> array_like = CAST(arg1);
|
||||
TNode<HeapObject> array_like = arg1_heap_object;
|
||||
TNode<Object> initial_length =
|
||||
GetProperty(context, arg1, LengthStringConstant());
|
||||
|
||||
@ -914,9 +916,8 @@ TNode<JSTypedArray> TypedArrayBuiltinsAssembler::SpeciesCreateByLength(
|
||||
CSA_ASSERT(this, TaggedIsPositiveSmi(len));
|
||||
|
||||
// Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor).
|
||||
TNode<Object> constructor = TypedArraySpeciesConstructor(context, exemplar);
|
||||
CSA_ASSERT(this, IsJSFunction(constructor));
|
||||
|
||||
TNode<JSFunction> constructor =
|
||||
CAST(TypedArraySpeciesConstructor(context, exemplar));
|
||||
return CreateByLength(context, constructor, len, method_name);
|
||||
}
|
||||
|
||||
@ -1204,7 +1205,7 @@ TNode<BoolT> TypedArrayBuiltinsAssembler::NumberIsNaN(TNode<Number> value) {
|
||||
|
||||
BIND(&is_heapnumber);
|
||||
{
|
||||
CSA_ASSERT(this, IsHeapNumber(value));
|
||||
CSA_ASSERT(this, IsHeapNumber(CAST(value)));
|
||||
|
||||
TNode<Float64T> value_f = LoadHeapNumberValue(CAST(value));
|
||||
result = Float64NotEqual(value_f, value_f);
|
||||
@ -1230,7 +1231,7 @@ TF_BUILTIN(TypedArrayPrototypeSet, TypedArrayBuiltinsAssembler) {
|
||||
// Check the receiver is a typed array.
|
||||
TNode<Object> receiver = args.GetReceiver();
|
||||
GotoIf(TaggedIsSmi(receiver), &if_receiver_is_not_typedarray);
|
||||
GotoIfNot(IsJSTypedArray(receiver), &if_receiver_is_not_typedarray);
|
||||
GotoIfNot(IsJSTypedArray(CAST(receiver)), &if_receiver_is_not_typedarray);
|
||||
|
||||
// Normalize offset argument (using ToInteger) and handle heap number cases.
|
||||
TNode<Object> offset = args.GetOptionalArgumentValue(1, SmiConstant(0));
|
||||
@ -1256,7 +1257,7 @@ TF_BUILTIN(TypedArrayPrototypeSet, TypedArrayBuiltinsAssembler) {
|
||||
Label call_runtime(this);
|
||||
TNode<Object> source = args.GetOptionalArgumentValue(0);
|
||||
GotoIf(TaggedIsSmi(source), &call_runtime);
|
||||
GotoIf(IsJSTypedArray(source), &if_source_is_typed_array);
|
||||
GotoIf(IsJSTypedArray(CAST(source)), &if_source_is_typed_array);
|
||||
BranchIfFastJSArray(source, context, &if_source_is_fast_jsarray,
|
||||
&call_runtime);
|
||||
|
||||
@ -1535,7 +1536,7 @@ void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeIterationMethod(
|
||||
Label throw_bad_receiver(this, Label::kDeferred);
|
||||
|
||||
GotoIf(TaggedIsSmi(receiver), &throw_bad_receiver);
|
||||
GotoIfNot(IsJSTypedArray(receiver), &throw_bad_receiver);
|
||||
GotoIfNot(IsJSTypedArray(CAST(receiver)), &throw_bad_receiver);
|
||||
|
||||
// Check if the {receiver}'s JSArrayBuffer was neutered.
|
||||
Node* receiver_buffer =
|
||||
@ -1596,7 +1597,7 @@ TF_BUILTIN(TypedArrayOf, TypedArrayBuiltinsAssembler) {
|
||||
// 4. If IsConstructor(C) is false, throw a TypeError exception.
|
||||
TNode<Object> receiver = args.GetReceiver();
|
||||
GotoIf(TaggedIsSmi(receiver), &if_not_constructor);
|
||||
GotoIfNot(IsConstructor(receiver), &if_not_constructor);
|
||||
GotoIfNot(IsConstructor(CAST(receiver)), &if_not_constructor);
|
||||
|
||||
// 5. Let newObj be ? TypedArrayCreate(C, len).
|
||||
TNode<JSTypedArray> new_typed_array =
|
||||
@ -1742,7 +1743,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
|
||||
// 2. If IsConstructor(C) is false, throw a TypeError exception.
|
||||
TNode<Object> receiver = args.GetReceiver();
|
||||
GotoIf(TaggedIsSmi(receiver), &if_not_constructor);
|
||||
GotoIfNot(IsConstructor(receiver), &if_not_constructor);
|
||||
GotoIfNot(IsConstructor(CAST(receiver)), &if_not_constructor);
|
||||
|
||||
// 3. If mapfn is present and mapfn is not undefined, then
|
||||
TNode<Object> map_fn = args.GetOptionalArgumentValue(1);
|
||||
@ -1753,7 +1754,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
|
||||
// b. Let mapping be true.
|
||||
// 4. Else, let mapping be false.
|
||||
GotoIf(TaggedIsSmi(map_fn), &if_map_fn_not_callable);
|
||||
GotoIfNot(IsCallable(map_fn), &if_map_fn_not_callable);
|
||||
GotoIfNot(IsCallable(CAST(map_fn)), &if_map_fn_not_callable);
|
||||
mapping = Int32TrueConstant();
|
||||
Goto(&check_iterator);
|
||||
|
||||
@ -1776,7 +1777,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
|
||||
CAST(GetMethod(context, source, isolate()->factory()->iterator_symbol(),
|
||||
&from_array_like));
|
||||
GotoIf(TaggedIsSmi(iterator_fn), &if_iterator_fn_not_callable);
|
||||
GotoIfNot(IsCallable(iterator_fn), &if_iterator_fn_not_callable);
|
||||
GotoIfNot(IsCallable(CAST(iterator_fn)), &if_iterator_fn_not_callable);
|
||||
|
||||
// We are using the iterator.
|
||||
Label if_length_not_smi(this, Label::kDeferred);
|
||||
@ -1923,7 +1924,7 @@ TF_BUILTIN(TypedArrayPrototypeFilter, TypedArrayBuiltinsAssembler) {
|
||||
// 4. If IsCallable(callbackfn) is false, throw a TypeError exception.
|
||||
TNode<Object> callbackfn = args.GetOptionalArgumentValue(0);
|
||||
GotoIf(TaggedIsSmi(callbackfn), &if_callback_not_callable);
|
||||
GotoIfNot(IsCallable(callbackfn), &if_callback_not_callable);
|
||||
GotoIfNot(IsCallable(CAST(callbackfn)), &if_callback_not_callable);
|
||||
|
||||
// 5. If thisArg is present, let T be thisArg; else let T be undefined.
|
||||
TNode<Object> this_arg = args.GetOptionalArgumentValue(1);
|
||||
|
@ -45,7 +45,8 @@ class TypedArrayBuiltinsAssembler : public CodeStubAssembler {
|
||||
TNode<JSReceiver> buffer_constructor);
|
||||
void ConstructByIterable(TNode<Context> context, TNode<JSTypedArray> holder,
|
||||
TNode<JSReceiver> iterable,
|
||||
TNode<Object> iterator_fn, TNode<Smi> element_size);
|
||||
TNode<JSReceiver> iterator_fn,
|
||||
TNode<Smi> element_size);
|
||||
|
||||
void SetupTypedArray(TNode<JSTypedArray> holder, TNode<Smi> length,
|
||||
TNode<Number> byte_offset, TNode<Number> byte_length);
|
||||
|
@ -269,8 +269,7 @@ module typed_array {
|
||||
// 1. If comparefn is not undefined and IsCallable(comparefn) is false,
|
||||
// throw a TypeError exception.
|
||||
let comparefn_obj: Object = arguments.length > 0 ? arguments[0] : undefined;
|
||||
if (comparefn_obj != undefined &&
|
||||
(TaggedIsSmi(comparefn_obj) || !IsCallable(comparefn_obj))) {
|
||||
if (comparefn_obj != undefined && !TaggedIsCallable(comparefn_obj)) {
|
||||
ThrowTypeError(context, kBadSortComparisonFunction, comparefn_obj);
|
||||
}
|
||||
|
||||
|
@ -228,14 +228,10 @@ HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR);
|
||||
HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST);
|
||||
#undef HEAP_CONSTANT_TEST
|
||||
|
||||
Node* CodeStubAssembler::HashSeed() {
|
||||
TNode<Int32T> CodeStubAssembler::HashSeed() {
|
||||
return LoadAndUntagToWord32Root(Heap::kHashSeedRootIndex);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::StaleRegisterConstant() {
|
||||
return LoadRoot(Heap::kStaleRegisterRootIndex);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IntPtrOrSmiConstant(int value, ParameterMode mode) {
|
||||
if (mode == SMI_PARAMETERS) {
|
||||
return SmiConstant(value);
|
||||
@ -1310,7 +1306,7 @@ TNode<IntPtrT> CodeStubAssembler::LoadAndUntagSmi(Node* base, int index) {
|
||||
}
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::LoadAndUntagToWord32Root(
|
||||
TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32Root(
|
||||
Heap::RootListIndex root_index) {
|
||||
Node* roots_array_start =
|
||||
ExternalConstant(ExternalReference::roots_array_start(isolate()));
|
||||
@ -1319,7 +1315,8 @@ Node* CodeStubAssembler::LoadAndUntagToWord32Root(
|
||||
#if V8_TARGET_LITTLE_ENDIAN
|
||||
index += kPointerSize / 2;
|
||||
#endif
|
||||
return Load(MachineType::Int32(), roots_array_start, IntPtrConstant(index));
|
||||
return UncheckedCast<Int32T>(
|
||||
Load(MachineType::Int32(), roots_array_start, IntPtrConstant(index)));
|
||||
} else {
|
||||
return SmiToInt32(Load(MachineType::AnyTagged(), roots_array_start,
|
||||
IntPtrConstant(index)));
|
||||
@ -1489,9 +1486,9 @@ TNode<DescriptorArray> CodeStubAssembler::LoadMapDescriptors(
|
||||
return CAST(LoadObjectField(map, Map::kDescriptorsOffset));
|
||||
}
|
||||
|
||||
TNode<Object> CodeStubAssembler::LoadMapPrototype(SloppyTNode<Map> map) {
|
||||
TNode<HeapObject> CodeStubAssembler::LoadMapPrototype(SloppyTNode<Map> map) {
|
||||
CSA_SLOW_ASSERT(this, IsMap(map));
|
||||
return LoadObjectField(map, Map::kPrototypeOffset);
|
||||
return CAST(LoadObjectField(map, Map::kPrototypeOffset));
|
||||
}
|
||||
|
||||
TNode<PrototypeInfo> CodeStubAssembler::LoadMapPrototypeInfo(
|
||||
@ -1567,8 +1564,8 @@ Node* CodeStubAssembler::LoadMapEnumLength(SloppyTNode<Map> map) {
|
||||
}
|
||||
|
||||
TNode<Object> CodeStubAssembler::LoadMapBackPointer(SloppyTNode<Map> map) {
|
||||
TNode<Object> object =
|
||||
LoadObjectField(map, Map::kConstructorOrBackPointerOffset);
|
||||
TNode<HeapObject> object =
|
||||
CAST(LoadObjectField(map, Map::kConstructorOrBackPointerOffset));
|
||||
return Select<Object>(IsMap(object), [=] { return object; },
|
||||
[=] { return UndefinedConstant(); });
|
||||
}
|
||||
@ -1757,7 +1754,7 @@ TNode<MaybeObject> CodeStubAssembler::LoadArrayElement(
|
||||
}
|
||||
|
||||
TNode<Object> CodeStubAssembler::LoadFixedArrayElement(
|
||||
SloppyTNode<Object> object, Node* index_node, int additional_offset,
|
||||
SloppyTNode<HeapObject> object, Node* index_node, int additional_offset,
|
||||
ParameterMode parameter_mode, LoadSensitivity needs_poisoning) {
|
||||
// This function is currently used for non-FixedArrays (e.g., PropertyArrays)
|
||||
// and thus the reasonable assert IsFixedArraySubclass(object) is
|
||||
@ -2029,7 +2026,7 @@ TNode<Object> CodeStubAssembler::LoadFeedbackVectorSlot(
|
||||
}
|
||||
|
||||
TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32ArrayElement(
|
||||
SloppyTNode<Object> object, int array_header_size, Node* index_node,
|
||||
SloppyTNode<HeapObject> object, int array_header_size, Node* index_node,
|
||||
int additional_offset, ParameterMode parameter_mode) {
|
||||
CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode));
|
||||
int32_t header_size = array_header_size + additional_offset - kHeapObjectTag;
|
||||
@ -2048,7 +2045,7 @@ TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32ArrayElement(
|
||||
}
|
||||
|
||||
TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement(
|
||||
SloppyTNode<Object> object, Node* index_node, int additional_offset,
|
||||
SloppyTNode<HeapObject> object, Node* index_node, int additional_offset,
|
||||
ParameterMode parameter_mode) {
|
||||
CSA_SLOW_ASSERT(this, IsFixedArraySubclass(object));
|
||||
return LoadAndUntagToWord32ArrayElement(object, FixedArray::kHeaderSize,
|
||||
@ -2619,18 +2616,10 @@ TNode<String> CodeStubAssembler::AllocateSeqOneByteString(
|
||||
return CAST(result);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsZeroOrContext(Node* object) {
|
||||
Label out(this);
|
||||
VARIABLE(var_result, MachineRepresentation::kWord32, Int32Constant(1));
|
||||
|
||||
GotoIf(WordEqual(object, SmiConstant(0)), &out);
|
||||
GotoIf(IsContext(object), &out);
|
||||
|
||||
var_result.Bind(Int32Constant(0));
|
||||
Goto(&out);
|
||||
|
||||
BIND(&out);
|
||||
return var_result.value();
|
||||
TNode<BoolT> CodeStubAssembler::IsZeroOrContext(SloppyTNode<Object> object) {
|
||||
return Select<BoolT>(WordEqual(object, SmiConstant(0)),
|
||||
[=] { return Int32TrueConstant(); },
|
||||
[=] { return IsContext(CAST(object)); });
|
||||
}
|
||||
|
||||
TNode<String> CodeStubAssembler::AllocateSeqOneByteString(
|
||||
@ -4635,70 +4624,70 @@ TNode<BoolT> CodeStubAssembler::IsDictionaryMap(SloppyTNode<Map> map) {
|
||||
return IsSetWord32<Map::IsDictionaryMapBit>(bit_field3);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsExtensibleMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsExtensibleMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsSetWord32<Map::IsExtensibleBit>(LoadMapBitField2(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsCallableMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsCallableMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsSetWord32<Map::IsCallableBit>(LoadMapBitField(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsDeprecatedMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsDeprecatedMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsSetWord32<Map::IsDeprecatedBit>(LoadMapBitField3(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsUndetectableMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsUndetectableMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsSetWord32<Map::IsUndetectableBit>(LoadMapBitField(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsNoElementsProtectorCellInvalid() {
|
||||
TNode<BoolT> CodeStubAssembler::IsNoElementsProtectorCellInvalid() {
|
||||
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
|
||||
Node* cell = LoadRoot(Heap::kNoElementsProtectorRootIndex);
|
||||
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
|
||||
return WordEqual(cell_value, invalid);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPromiseResolveProtectorCellInvalid() {
|
||||
TNode<BoolT> CodeStubAssembler::IsPromiseResolveProtectorCellInvalid() {
|
||||
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
|
||||
Node* cell = LoadRoot(Heap::kPromiseResolveProtectorRootIndex);
|
||||
Node* cell_value = LoadObjectField(cell, Cell::kValueOffset);
|
||||
return WordEqual(cell_value, invalid);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPromiseThenProtectorCellInvalid() {
|
||||
TNode<BoolT> CodeStubAssembler::IsPromiseThenProtectorCellInvalid() {
|
||||
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
|
||||
Node* cell = LoadRoot(Heap::kPromiseThenProtectorRootIndex);
|
||||
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
|
||||
return WordEqual(cell_value, invalid);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsArraySpeciesProtectorCellInvalid() {
|
||||
TNode<BoolT> CodeStubAssembler::IsArraySpeciesProtectorCellInvalid() {
|
||||
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
|
||||
Node* cell = LoadRoot(Heap::kArraySpeciesProtectorRootIndex);
|
||||
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
|
||||
return WordEqual(cell_value, invalid);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsTypedArraySpeciesProtectorCellInvalid() {
|
||||
TNode<BoolT> CodeStubAssembler::IsTypedArraySpeciesProtectorCellInvalid() {
|
||||
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
|
||||
Node* cell = LoadRoot(Heap::kTypedArraySpeciesProtectorRootIndex);
|
||||
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
|
||||
return WordEqual(cell_value, invalid);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPromiseSpeciesProtectorCellInvalid() {
|
||||
TNode<BoolT> CodeStubAssembler::IsPromiseSpeciesProtectorCellInvalid() {
|
||||
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
|
||||
Node* cell = LoadRoot(Heap::kPromiseSpeciesProtectorRootIndex);
|
||||
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
|
||||
return WordEqual(cell_value, invalid);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPrototypeInitialArrayPrototype(Node* context,
|
||||
Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsPrototypeInitialArrayPrototype(
|
||||
SloppyTNode<Context> context, SloppyTNode<Map> map) {
|
||||
Node* const native_context = LoadNativeContext(context);
|
||||
Node* const initial_array_prototype = LoadContextElement(
|
||||
native_context, Context::INITIAL_ARRAY_PROTOTYPE_INDEX);
|
||||
@ -4711,35 +4700,44 @@ TNode<BoolT> CodeStubAssembler::IsPrototypeTypedArrayPrototype(
|
||||
TNode<Context> const native_context = LoadNativeContext(context);
|
||||
TNode<Object> const typed_array_prototype =
|
||||
LoadContextElement(native_context, Context::TYPED_ARRAY_PROTOTYPE_INDEX);
|
||||
TNode<Object> proto = LoadMapPrototype(map);
|
||||
TNode<Object> proto_of_proto = Select<Object>(
|
||||
IsJSObject(proto), [=] { return LoadMapPrototype(LoadMap(CAST(proto))); },
|
||||
TNode<HeapObject> proto = LoadMapPrototype(map);
|
||||
TNode<HeapObject> proto_of_proto = Select<HeapObject>(
|
||||
IsJSObject(proto), [=] { return LoadMapPrototype(LoadMap(proto)); },
|
||||
[=] { return NullConstant(); });
|
||||
return WordEqual(proto_of_proto, typed_array_prototype);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsCallable(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::TaggedIsCallable(TNode<Object> object) {
|
||||
return Select<BoolT>(
|
||||
TaggedIsSmi(object), [=] { return Int32FalseConstant(); },
|
||||
[=] {
|
||||
return IsCallableMap(LoadMap(UncheckedCast<HeapObject>(object)));
|
||||
});
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsCallable(SloppyTNode<HeapObject> object) {
|
||||
return IsCallableMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsCell(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsCell(SloppyTNode<HeapObject> object) {
|
||||
return WordEqual(LoadMap(object), LoadRoot(Heap::kCellMapRootIndex));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsCode(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsCode(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, CODE_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsConstructorMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsConstructorMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsSetWord32<Map::IsConstructorBit>(LoadMapBitField(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsConstructor(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsConstructor(SloppyTNode<HeapObject> object) {
|
||||
return IsConstructorMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFunctionWithPrototypeSlotMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFunctionWithPrototypeSlotMap(
|
||||
SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsSetWord32<Map::HasPrototypeSlotBit>(LoadMapBitField(map));
|
||||
}
|
||||
@ -4757,177 +4755,200 @@ TNode<BoolT> CodeStubAssembler::IsCustomElementsReceiverInstanceType(
|
||||
Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsStringInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
STATIC_ASSERT(INTERNALIZED_STRING_TYPE == FIRST_TYPE);
|
||||
return Int32LessThan(instance_type, Int32Constant(FIRST_NONSTRING_TYPE));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsOneByteStringInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsOneByteStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
CSA_ASSERT(this, IsStringInstanceType(instance_type));
|
||||
return Word32Equal(
|
||||
Word32And(instance_type, Int32Constant(kStringEncodingMask)),
|
||||
Int32Constant(kOneByteStringTag));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsSequentialStringInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsSequentialStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
CSA_ASSERT(this, IsStringInstanceType(instance_type));
|
||||
return Word32Equal(
|
||||
Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
|
||||
Int32Constant(kSeqStringTag));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsConsStringInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsConsStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
CSA_ASSERT(this, IsStringInstanceType(instance_type));
|
||||
return Word32Equal(
|
||||
Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
|
||||
Int32Constant(kConsStringTag));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsIndirectStringInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsIndirectStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
CSA_ASSERT(this, IsStringInstanceType(instance_type));
|
||||
STATIC_ASSERT(kIsIndirectStringMask == 0x1);
|
||||
STATIC_ASSERT(kIsIndirectStringTag == 0x1);
|
||||
return Word32And(instance_type, Int32Constant(kIsIndirectStringMask));
|
||||
return UncheckedCast<BoolT>(
|
||||
Word32And(instance_type, Int32Constant(kIsIndirectStringMask)));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsExternalStringInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsExternalStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
CSA_ASSERT(this, IsStringInstanceType(instance_type));
|
||||
return Word32Equal(
|
||||
Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
|
||||
Int32Constant(kExternalStringTag));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsShortExternalStringInstanceType(
|
||||
Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsShortExternalStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
CSA_ASSERT(this, IsStringInstanceType(instance_type));
|
||||
STATIC_ASSERT(kShortExternalStringTag != 0);
|
||||
return IsSetWord32(instance_type, kShortExternalStringMask);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSReceiverInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSReceiverInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
|
||||
return Int32GreaterThanOrEqual(instance_type,
|
||||
Int32Constant(FIRST_JS_RECEIVER_TYPE));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSReceiverMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSReceiverMap(SloppyTNode<Map> map) {
|
||||
return IsJSReceiverInstanceType(LoadMapInstanceType(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSReceiver(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSReceiver(SloppyTNode<HeapObject> object) {
|
||||
return IsJSReceiverMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsNullOrJSReceiver(Node* object) {
|
||||
return Word32Or(IsJSReceiver(object), IsNull(object));
|
||||
TNode<BoolT> CodeStubAssembler::IsNullOrJSReceiver(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return UncheckedCast<BoolT>(Word32Or(IsJSReceiver(object), IsNull(object)));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsNullOrUndefined(Node* const value) {
|
||||
return Word32Or(IsUndefined(value), IsNull(value));
|
||||
TNode<BoolT> CodeStubAssembler::IsNullOrUndefined(SloppyTNode<Object> value) {
|
||||
return UncheckedCast<BoolT>(Word32Or(IsUndefined(value), IsNull(value)));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSGlobalProxyInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSGlobalProxyInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return InstanceTypeEqual(instance_type, JS_GLOBAL_PROXY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSObjectInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSObjectInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE);
|
||||
return Int32GreaterThanOrEqual(instance_type,
|
||||
Int32Constant(FIRST_JS_OBJECT_TYPE));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSObjectMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSObjectMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return IsJSObjectInstanceType(LoadMapInstanceType(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSObject(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSObject(SloppyTNode<HeapObject> object) {
|
||||
return IsJSObjectMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSPromiseMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSPromiseMap(SloppyTNode<Map> map) {
|
||||
CSA_ASSERT(this, IsMap(map));
|
||||
return InstanceTypeEqual(LoadMapInstanceType(map), JS_PROMISE_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSPromise(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSPromise(SloppyTNode<HeapObject> object) {
|
||||
return IsJSPromiseMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSProxy(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSProxy(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_PROXY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSGlobalProxy(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSGlobalProxy(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_GLOBAL_PROXY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsMap(Node* map) { return IsMetaMap(LoadMap(map)); }
|
||||
TNode<BoolT> CodeStubAssembler::IsMap(SloppyTNode<HeapObject> map) {
|
||||
return IsMetaMap(LoadMap(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSValueInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSValueInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return InstanceTypeEqual(instance_type, JS_VALUE_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSValue(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSValue(SloppyTNode<HeapObject> object) {
|
||||
return IsJSValueMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSValueMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSValueMap(SloppyTNode<Map> map) {
|
||||
return IsJSValueInstanceType(LoadMapInstanceType(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSArrayInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSArrayInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return InstanceTypeEqual(instance_type, JS_ARRAY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSArray(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSArray(SloppyTNode<HeapObject> object) {
|
||||
return IsJSArrayMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSArrayMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSArrayMap(SloppyTNode<Map> map) {
|
||||
return IsJSArrayInstanceType(LoadMapInstanceType(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSArrayIterator(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSArrayIterator(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_ARRAY_ITERATOR_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSAsyncGeneratorObject(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSAsyncGeneratorObject(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_ASYNC_GENERATOR_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsContext(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsContext(SloppyTNode<HeapObject> object) {
|
||||
Node* instance_type = LoadInstanceType(object);
|
||||
return Word32And(
|
||||
return UncheckedCast<BoolT>(Word32And(
|
||||
Int32GreaterThanOrEqual(instance_type, Int32Constant(FIRST_CONTEXT_TYPE)),
|
||||
Int32LessThanOrEqual(instance_type, Int32Constant(LAST_CONTEXT_TYPE)));
|
||||
Int32LessThanOrEqual(instance_type, Int32Constant(LAST_CONTEXT_TYPE))));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFixedArray(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFixedArray(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, FIXED_ARRAY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFixedArraySubclass(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFixedArraySubclass(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
Node* instance_type = LoadInstanceType(object);
|
||||
return Word32And(Int32GreaterThanOrEqual(
|
||||
instance_type, Int32Constant(FIRST_FIXED_ARRAY_TYPE)),
|
||||
Int32LessThanOrEqual(instance_type,
|
||||
Int32Constant(LAST_FIXED_ARRAY_TYPE)));
|
||||
return UncheckedCast<BoolT>(
|
||||
Word32And(Int32GreaterThanOrEqual(instance_type,
|
||||
Int32Constant(FIRST_FIXED_ARRAY_TYPE)),
|
||||
Int32LessThanOrEqual(instance_type,
|
||||
Int32Constant(LAST_FIXED_ARRAY_TYPE))));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsNotWeakFixedArraySubclass(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsNotWeakFixedArraySubclass(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
Node* instance_type = LoadInstanceType(object);
|
||||
return Word32Or(
|
||||
return UncheckedCast<BoolT>(Word32Or(
|
||||
Int32LessThan(instance_type, Int32Constant(FIRST_WEAK_FIXED_ARRAY_TYPE)),
|
||||
Int32GreaterThan(instance_type,
|
||||
Int32Constant(LAST_WEAK_FIXED_ARRAY_TYPE)));
|
||||
Int32Constant(LAST_WEAK_FIXED_ARRAY_TYPE))));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPromiseCapability(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsPromiseCapability(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, PROMISE_CAPABILITY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPropertyArray(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsPropertyArray(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, PROPERTY_ARRAY_TYPE);
|
||||
}
|
||||
|
||||
@ -4940,24 +4961,25 @@ Node* CodeStubAssembler::IsPropertyArray(Node* object) {
|
||||
// source array is empty.
|
||||
// TODO(jgruber): It might we worth creating an empty_double_array constant to
|
||||
// simplify this case.
|
||||
Node* CodeStubAssembler::IsFixedArrayWithKindOrEmpty(Node* object,
|
||||
ElementsKind kind) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFixedArrayWithKindOrEmpty(
|
||||
SloppyTNode<HeapObject> object, ElementsKind kind) {
|
||||
Label out(this);
|
||||
VARIABLE(var_result, MachineRepresentation::kWord32, Int32Constant(1));
|
||||
TVARIABLE(BoolT, var_result, Int32TrueConstant());
|
||||
|
||||
GotoIf(IsFixedArrayWithKind(object, kind), &out);
|
||||
|
||||
Node* const length = LoadFixedArrayBaseLength(object);
|
||||
Node* const length = LoadFixedArrayBaseLength(CAST(object));
|
||||
GotoIf(SmiEqual(length, SmiConstant(0)), &out);
|
||||
|
||||
var_result.Bind(Int32Constant(0));
|
||||
var_result = Int32FalseConstant();
|
||||
Goto(&out);
|
||||
|
||||
BIND(&out);
|
||||
return var_result.value();
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFixedArrayWithKind(Node* object, ElementsKind kind) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFixedArrayWithKind(
|
||||
SloppyTNode<HeapObject> object, ElementsKind kind) {
|
||||
if (IsDoubleElementsKind(kind)) {
|
||||
return IsFixedDoubleArray(object);
|
||||
} else {
|
||||
@ -4966,81 +4988,90 @@ Node* CodeStubAssembler::IsFixedArrayWithKind(Node* object, ElementsKind kind) {
|
||||
}
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsWeakCell(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsWeakCell(SloppyTNode<HeapObject> object) {
|
||||
return IsWeakCellMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsBoolean(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsBoolean(SloppyTNode<HeapObject> object) {
|
||||
return IsBooleanMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPropertyCell(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsPropertyCell(SloppyTNode<HeapObject> object) {
|
||||
return IsPropertyCellMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsAccessorInfo(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsAccessorInfo(SloppyTNode<HeapObject> object) {
|
||||
return IsAccessorInfoMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsAccessorPair(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsAccessorPair(SloppyTNode<HeapObject> object) {
|
||||
return IsAccessorPairMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsAllocationSite(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsAllocationSite(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return IsAllocationSiteMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsAnyHeapNumber(Node* object) {
|
||||
return Word32Or(IsMutableHeapNumber(object), IsHeapNumber(object));
|
||||
TNode<BoolT> CodeStubAssembler::IsAnyHeapNumber(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return UncheckedCast<BoolT>(
|
||||
Word32Or(IsMutableHeapNumber(object), IsHeapNumber(object)));
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsHeapNumber(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsHeapNumber(SloppyTNode<HeapObject> object) {
|
||||
return IsHeapNumberMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsMutableHeapNumber(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsMutableHeapNumber(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return IsMutableHeapNumberMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFeedbackCell(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFeedbackCell(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, FEEDBACK_CELL_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFeedbackVector(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFeedbackVector(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return IsFeedbackVectorMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsName(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsName(SloppyTNode<HeapObject> object) {
|
||||
return Int32LessThanOrEqual(LoadInstanceType(object),
|
||||
Int32Constant(LAST_NAME_TYPE));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsString(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsString(SloppyTNode<HeapObject> object) {
|
||||
return IsStringInstanceType(LoadInstanceType(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsSymbolInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsSymbolInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return InstanceTypeEqual(instance_type, SYMBOL_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsSymbol(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsSymbol(SloppyTNode<HeapObject> object) {
|
||||
return IsSymbolMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsBigIntInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsBigIntInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return InstanceTypeEqual(instance_type, BIGINT_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsBigInt(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsBigInt(SloppyTNode<HeapObject> object) {
|
||||
return IsBigIntInstanceType(LoadInstanceType(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsPrimitiveInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsPrimitiveInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return Int32LessThanOrEqual(instance_type,
|
||||
Int32Constant(LAST_PRIMITIVE_TYPE));
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsPrivateSymbol(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsPrivateSymbol(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return Select<BoolT>(
|
||||
IsSymbol(object),
|
||||
[=] {
|
||||
@ -5052,75 +5083,84 @@ TNode<BoolT> CodeStubAssembler::IsPrivateSymbol(Node* object) {
|
||||
[=] { return Int32FalseConstant(); });
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsNativeContext(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsNativeContext(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return WordEqual(LoadMap(object), LoadRoot(Heap::kNativeContextMapRootIndex));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFixedDoubleArray(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsFixedDoubleArray(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return WordEqual(LoadMap(object), FixedDoubleArrayMapConstant());
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsHashTable(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsHashTable(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, HASH_TABLE_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsDictionary(Node* object) {
|
||||
return Word32Or(IsHashTable(object), IsNumberDictionary(object));
|
||||
TNode<BoolT> CodeStubAssembler::IsDictionary(SloppyTNode<HeapObject> object) {
|
||||
return UncheckedCast<BoolT>(
|
||||
Word32Or(IsHashTable(object), IsNumberDictionary(object)));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsNumberDictionary(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsNumberDictionary(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return WordEqual(LoadMap(object),
|
||||
LoadRoot(Heap::kNumberDictionaryMapRootIndex));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSGeneratorObject(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSGeneratorObject(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_GENERATOR_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSFunctionInstanceType(Node* instance_type) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSFunctionInstanceType(
|
||||
SloppyTNode<Int32T> instance_type) {
|
||||
return InstanceTypeEqual(instance_type, JS_FUNCTION_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSFunction(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSFunction(SloppyTNode<HeapObject> object) {
|
||||
return IsJSFunctionMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSFunctionMap(Node* map) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSFunctionMap(SloppyTNode<Map> map) {
|
||||
return IsJSFunctionInstanceType(LoadMapInstanceType(map));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSTypedArray(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSTypedArray(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_TYPED_ARRAY_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSArrayBuffer(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSArrayBuffer(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_ARRAY_BUFFER_TYPE);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsFixedTypedArray(Node* object) {
|
||||
Node* instance_type = LoadInstanceType(object);
|
||||
return Word32And(
|
||||
TNode<BoolT> CodeStubAssembler::IsFixedTypedArray(
|
||||
SloppyTNode<HeapObject> object) {
|
||||
TNode<Int32T> instance_type = LoadInstanceType(object);
|
||||
return UncheckedCast<BoolT>(Word32And(
|
||||
Int32GreaterThanOrEqual(instance_type,
|
||||
Int32Constant(FIRST_FIXED_TYPED_ARRAY_TYPE)),
|
||||
Int32LessThanOrEqual(instance_type,
|
||||
Int32Constant(LAST_FIXED_TYPED_ARRAY_TYPE)));
|
||||
Int32Constant(LAST_FIXED_TYPED_ARRAY_TYPE))));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsJSRegExp(Node* object) {
|
||||
TNode<BoolT> CodeStubAssembler::IsJSRegExp(SloppyTNode<HeapObject> object) {
|
||||
return HasInstanceType(object, JS_REGEXP_TYPE);
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsNumber(SloppyTNode<Object> object) {
|
||||
return Select<BoolT>(TaggedIsSmi(object), [=] { return Int32TrueConstant(); },
|
||||
[=] { return IsHeapNumber(object); });
|
||||
[=] { return IsHeapNumber(CAST(object)); });
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsNumeric(SloppyTNode<Object> object) {
|
||||
return Select<BoolT>(TaggedIsSmi(object), [=] { return Int32TrueConstant(); },
|
||||
[=] {
|
||||
return UncheckedCast<BoolT>(
|
||||
Word32Or(IsHeapNumber(object), IsBigInt(object)));
|
||||
});
|
||||
return Select<BoolT>(
|
||||
TaggedIsSmi(object), [=] { return Int32TrueConstant(); },
|
||||
[=] {
|
||||
return UncheckedCast<BoolT>(
|
||||
Word32Or(IsHeapNumber(CAST(object)), IsBigInt(CAST(object))));
|
||||
});
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsNumberNormalized(SloppyTNode<Number> number) {
|
||||
@ -6159,7 +6199,7 @@ TNode<Number> CodeStubAssembler::ToNumber_Inline(SloppyTNode<Context> context,
|
||||
BIND(¬_smi);
|
||||
{
|
||||
var_result =
|
||||
Select<Number>(IsHeapNumber(input), [=] { return CAST(input); },
|
||||
Select<Number>(IsHeapNumber(CAST(input)), [=] { return CAST(input); },
|
||||
[=] {
|
||||
return CAST(CallBuiltin(Builtins::kNonNumberToNumber,
|
||||
context, input));
|
||||
@ -6210,7 +6250,7 @@ TNode<BigInt> CodeStubAssembler::ToBigInt(SloppyTNode<Context> context,
|
||||
Label if_bigint(this), done(this), if_throw(this);
|
||||
|
||||
GotoIf(TaggedIsSmi(input), &if_throw);
|
||||
GotoIf(IsBigInt(input), &if_bigint);
|
||||
GotoIf(IsBigInt(CAST(input)), &if_bigint);
|
||||
var_result = CAST(CallRuntime(Runtime::kToBigInt, context, input));
|
||||
Goto(&done);
|
||||
|
||||
@ -6420,7 +6460,7 @@ TNode<String> CodeStubAssembler::ToString_Inline(SloppyTNode<Context> context,
|
||||
Label stub_call(this, Label::kDeferred), out(this);
|
||||
|
||||
GotoIf(TaggedIsSmi(input), &stub_call);
|
||||
Branch(IsString(input), &out, &stub_call);
|
||||
Branch(IsString(CAST(input)), &out, &stub_call);
|
||||
|
||||
BIND(&stub_call);
|
||||
var_result.Bind(CallBuiltin(Builtins::kToString, context, input));
|
||||
@ -6570,7 +6610,8 @@ TNode<Number> CodeStubAssembler::ToInteger(SloppyTNode<Context> context,
|
||||
// Check if {arg} is a HeapNumber.
|
||||
Label if_argisheapnumber(this),
|
||||
if_argisnotheapnumber(this, Label::kDeferred);
|
||||
Branch(IsHeapNumber(arg), &if_argisheapnumber, &if_argisnotheapnumber);
|
||||
Branch(IsHeapNumber(CAST(arg)), &if_argisheapnumber,
|
||||
&if_argisnotheapnumber);
|
||||
|
||||
BIND(&if_argisheapnumber);
|
||||
{
|
||||
|
@ -22,55 +22,55 @@ class StubCache;
|
||||
|
||||
enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
|
||||
|
||||
#define HEAP_CONSTANT_LIST(V) \
|
||||
V(AccessorInfoMap, accessor_info_map, AccessorInfoMap) \
|
||||
V(AccessorPairMap, accessor_pair_map, AccessorPairMap) \
|
||||
V(AllocationSiteMap, allocation_site_map, AllocationSiteMap) \
|
||||
V(BooleanMap, boolean_map, BooleanMap) \
|
||||
V(CodeMap, code_map, CodeMap) \
|
||||
V(EmptyPropertyDictionary, empty_property_dictionary, \
|
||||
EmptyPropertyDictionary) \
|
||||
V(EmptyFixedArray, empty_fixed_array, EmptyFixedArray) \
|
||||
V(EmptySlowElementDictionary, empty_slow_element_dictionary, \
|
||||
EmptySlowElementDictionary) \
|
||||
V(empty_string, empty_string, EmptyString) \
|
||||
V(EmptyWeakCell, empty_weak_cell, EmptyWeakCell) \
|
||||
V(FalseValue, false_value, False) \
|
||||
V(FeedbackVectorMap, feedback_vector_map, FeedbackVectorMap) \
|
||||
V(FixedArrayMap, fixed_array_map, FixedArrayMap) \
|
||||
V(FixedCOWArrayMap, fixed_cow_array_map, FixedCOWArrayMap) \
|
||||
V(FixedDoubleArrayMap, fixed_double_array_map, FixedDoubleArrayMap) \
|
||||
V(FunctionTemplateInfoMap, function_template_info_map, \
|
||||
FunctionTemplateInfoMap) \
|
||||
V(GlobalPropertyCellMap, global_property_cell_map, PropertyCellMap) \
|
||||
V(has_instance_symbol, has_instance_symbol, HasInstanceSymbol) \
|
||||
V(HeapNumberMap, heap_number_map, HeapNumberMap) \
|
||||
V(iterator_symbol, iterator_symbol, IteratorSymbol) \
|
||||
V(length_string, length_string, LengthString) \
|
||||
V(ManyClosuresCellMap, many_closures_cell_map, ManyClosuresCellMap) \
|
||||
V(MetaMap, meta_map, MetaMap) \
|
||||
V(MinusZeroValue, minus_zero_value, MinusZero) \
|
||||
V(MutableHeapNumberMap, mutable_heap_number_map, MutableHeapNumberMap) \
|
||||
V(NanValue, nan_value, Nan) \
|
||||
V(NoClosuresCellMap, no_closures_cell_map, NoClosuresCellMap) \
|
||||
V(NullValue, null_value, Null) \
|
||||
V(OneClosureCellMap, one_closure_cell_map, OneClosureCellMap) \
|
||||
V(prototype_string, prototype_string, PrototypeString) \
|
||||
V(ArraySpeciesProtector, array_species_protector, ArraySpeciesProtector) \
|
||||
V(TypedArraySpeciesProtector, typed_array_species_protector, \
|
||||
TypedArraySpeciesProtector) \
|
||||
V(PromiseSpeciesProtector, promise_species_protector, \
|
||||
PromiseSpeciesProtector) \
|
||||
V(StoreHandler0Map, store_handler0_map, StoreHandler0Map) \
|
||||
V(SymbolMap, symbol_map, SymbolMap) \
|
||||
V(TheHoleValue, the_hole_value, TheHole) \
|
||||
V(TransitionArrayMap, transition_array_map, TransitionArrayMap) \
|
||||
V(TrueValue, true_value, True) \
|
||||
V(Tuple2Map, tuple2_map, Tuple2Map) \
|
||||
V(Tuple3Map, tuple3_map, Tuple3Map) \
|
||||
V(UndefinedValue, undefined_value, Undefined) \
|
||||
V(WeakCellMap, weak_cell_map, WeakCellMap) \
|
||||
V(SharedFunctionInfoMap, shared_function_info_map, SharedFunctionInfoMap)
|
||||
#define HEAP_CONSTANT_LIST(V) \
|
||||
V(AccessorInfoMap, accessor_info_map, AccessorInfoMap) \
|
||||
V(AccessorPairMap, accessor_pair_map, AccessorPairMap) \
|
||||
V(AllocationSiteMap, allocation_site_map, AllocationSiteMap) \
|
||||
V(ArraySpeciesProtector, array_species_protector, ArraySpeciesProtector) \
|
||||
V(BooleanMap, boolean_map, BooleanMap) \
|
||||
V(CodeMap, code_map, CodeMap) \
|
||||
V(EmptyFixedArray, empty_fixed_array, EmptyFixedArray) \
|
||||
V(EmptyPropertyDictionary, empty_property_dictionary, \
|
||||
EmptyPropertyDictionary) \
|
||||
V(EmptySlowElementDictionary, empty_slow_element_dictionary, \
|
||||
EmptySlowElementDictionary) \
|
||||
V(empty_string, empty_string, EmptyString) \
|
||||
V(EmptyWeakCell, empty_weak_cell, EmptyWeakCell) \
|
||||
V(FalseValue, false_value, False) \
|
||||
V(FeedbackVectorMap, feedback_vector_map, FeedbackVectorMap) \
|
||||
V(FixedArrayMap, fixed_array_map, FixedArrayMap) \
|
||||
V(FixedCOWArrayMap, fixed_cow_array_map, FixedCOWArrayMap) \
|
||||
V(FixedDoubleArrayMap, fixed_double_array_map, FixedDoubleArrayMap) \
|
||||
V(FunctionTemplateInfoMap, function_template_info_map, \
|
||||
FunctionTemplateInfoMap) \
|
||||
V(GlobalPropertyCellMap, global_property_cell_map, PropertyCellMap) \
|
||||
V(has_instance_symbol, has_instance_symbol, HasInstanceSymbol) \
|
||||
V(HeapNumberMap, heap_number_map, HeapNumberMap) \
|
||||
V(iterator_symbol, iterator_symbol, IteratorSymbol) \
|
||||
V(length_string, length_string, LengthString) \
|
||||
V(ManyClosuresCellMap, many_closures_cell_map, ManyClosuresCellMap) \
|
||||
V(MetaMap, meta_map, MetaMap) \
|
||||
V(MinusZeroValue, minus_zero_value, MinusZero) \
|
||||
V(MutableHeapNumberMap, mutable_heap_number_map, MutableHeapNumberMap) \
|
||||
V(NanValue, nan_value, Nan) \
|
||||
V(NoClosuresCellMap, no_closures_cell_map, NoClosuresCellMap) \
|
||||
V(NullValue, null_value, Null) \
|
||||
V(OneClosureCellMap, one_closure_cell_map, OneClosureCellMap) \
|
||||
V(PromiseSpeciesProtector, promise_species_protector, \
|
||||
PromiseSpeciesProtector) \
|
||||
V(prototype_string, prototype_string, PrototypeString) \
|
||||
V(SharedFunctionInfoMap, shared_function_info_map, SharedFunctionInfoMap) \
|
||||
V(StoreHandler0Map, store_handler0_map, StoreHandler0Map) \
|
||||
V(SymbolMap, symbol_map, SymbolMap) \
|
||||
V(TheHoleValue, the_hole_value, TheHole) \
|
||||
V(TransitionArrayMap, transition_array_map, TransitionArrayMap) \
|
||||
V(TrueValue, true_value, True) \
|
||||
V(Tuple2Map, tuple2_map, Tuple2Map) \
|
||||
V(Tuple3Map, tuple3_map, Tuple3Map) \
|
||||
V(TypedArraySpeciesProtector, typed_array_species_protector, \
|
||||
TypedArraySpeciesProtector) \
|
||||
V(UndefinedValue, undefined_value, Undefined) \
|
||||
V(WeakCellMap, weak_cell_map, WeakCellMap)
|
||||
|
||||
// Returned from IteratorBuiltinsAssembler::GetIterator(). Struct is declared
|
||||
// here to simplify use in other generated builtins.
|
||||
@ -167,15 +167,17 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
}
|
||||
|
||||
TNode<JSArray> TaggedToJSArray(TNode<Object> value, Label* fail) {
|
||||
GotoIfNot(IsJSArray(value), fail);
|
||||
return UncheckedCast<JSArray>(value);
|
||||
GotoIf(TaggedIsSmi(value), fail);
|
||||
TNode<HeapObject> heap_object = CAST(value);
|
||||
GotoIfNot(IsJSArray(heap_object), fail);
|
||||
return UncheckedCast<JSArray>(heap_object);
|
||||
}
|
||||
|
||||
TNode<HeapObject> TaggedToCallable(TNode<Object> value, Label* fail) {
|
||||
TNode<JSReceiver> TaggedToCallable(TNode<Object> value, Label* fail) {
|
||||
GotoIf(TaggedIsSmi(value), fail);
|
||||
TNode<HeapObject> result = UncheckedCast<HeapObject>(value);
|
||||
GotoIfNot(IsCallableMap(LoadMap(result)), fail);
|
||||
return result;
|
||||
GotoIfNot(IsCallable(result), fail);
|
||||
return CAST(result);
|
||||
}
|
||||
|
||||
Node* MatchesParameterMode(Node* value, ParameterMode mode);
|
||||
@ -217,8 +219,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST)
|
||||
#undef HEAP_CONSTANT_TEST
|
||||
|
||||
Node* HashSeed();
|
||||
Node* StaleRegisterConstant();
|
||||
TNode<Int32T> HashSeed();
|
||||
|
||||
Node* IntPtrOrSmiConstant(int value, ParameterMode mode);
|
||||
|
||||
@ -453,8 +454,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
TNode<BoolT> WordIsWordAligned(SloppyTNode<WordT> word);
|
||||
TNode<BoolT> WordIsPowerOfTwo(SloppyTNode<IntPtrT> value);
|
||||
|
||||
Node* IsNotTheHole(Node* value) { return Word32BinaryNot(IsTheHole(value)); }
|
||||
|
||||
#if DEBUG
|
||||
void Bind(Label* label, AssemblerDebugInfo debug_info);
|
||||
#else
|
||||
@ -545,7 +544,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
// Load a SMI and untag it.
|
||||
TNode<IntPtrT> LoadAndUntagSmi(Node* base, int index);
|
||||
// Load a SMI root, untag it, and convert to Word32.
|
||||
Node* LoadAndUntagToWord32Root(Heap::RootListIndex root_index);
|
||||
TNode<Int32T> LoadAndUntagToWord32Root(Heap::RootListIndex root_index);
|
||||
|
||||
TNode<MaybeObject> LoadMaybeWeakObjectField(SloppyTNode<HeapObject> object,
|
||||
int offset) {
|
||||
@ -605,7 +604,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
// Load the instance descriptors of a map.
|
||||
TNode<DescriptorArray> LoadMapDescriptors(SloppyTNode<Map> map);
|
||||
// Load the prototype of a map.
|
||||
TNode<Object> LoadMapPrototype(SloppyTNode<Map> map);
|
||||
TNode<HeapObject> LoadMapPrototype(SloppyTNode<Map> map);
|
||||
// Load the prototype info of a map. The result has to be checked if it is a
|
||||
// prototype info object or not.
|
||||
TNode<PrototypeInfo> LoadMapPrototypeInfo(SloppyTNode<Map> map,
|
||||
@ -680,11 +679,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
|
||||
// Load an array element from a FixedArray.
|
||||
TNode<Object> LoadFixedArrayElement(
|
||||
SloppyTNode<Object> object, Node* index, int additional_offset = 0,
|
||||
SloppyTNode<HeapObject> object, Node* index, int additional_offset = 0,
|
||||
ParameterMode parameter_mode = INTPTR_PARAMETERS,
|
||||
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe);
|
||||
|
||||
TNode<Object> LoadFixedArrayElement(SloppyTNode<Object> object,
|
||||
TNode<Object> LoadFixedArrayElement(SloppyTNode<HeapObject> object,
|
||||
TNode<IntPtrT> index,
|
||||
LoadSensitivity needs_poisoning) {
|
||||
return LoadFixedArrayElement(object, index, 0, INTPTR_PARAMETERS,
|
||||
@ -692,7 +691,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
}
|
||||
|
||||
TNode<Object> LoadFixedArrayElement(
|
||||
SloppyTNode<Object> object, TNode<IntPtrT> index,
|
||||
SloppyTNode<HeapObject> object, TNode<IntPtrT> index,
|
||||
int additional_offset = 0,
|
||||
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
|
||||
return LoadFixedArrayElement(object, index, additional_offset,
|
||||
@ -700,30 +699,31 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
}
|
||||
|
||||
TNode<Object> LoadFixedArrayElement(
|
||||
SloppyTNode<Object> object, int index, int additional_offset = 0,
|
||||
SloppyTNode<HeapObject> object, int index, int additional_offset = 0,
|
||||
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
|
||||
return LoadFixedArrayElement(object, IntPtrConstant(index),
|
||||
additional_offset, INTPTR_PARAMETERS,
|
||||
needs_poisoning);
|
||||
}
|
||||
TNode<Object> LoadFixedArrayElement(TNode<Object> object, TNode<Smi> index) {
|
||||
TNode<Object> LoadFixedArrayElement(TNode<HeapObject> object,
|
||||
TNode<Smi> index) {
|
||||
return LoadFixedArrayElement(object, index, 0, SMI_PARAMETERS);
|
||||
}
|
||||
|
||||
// Load an array element from a FixedArray / WeakFixedArray, untag it and
|
||||
// return it as Word32.
|
||||
TNode<Int32T> LoadAndUntagToWord32ArrayElement(
|
||||
SloppyTNode<Object> object, int array_header_size, Node* index,
|
||||
SloppyTNode<HeapObject> object, int array_header_size, Node* index,
|
||||
int additional_offset = 0,
|
||||
ParameterMode parameter_mode = INTPTR_PARAMETERS);
|
||||
|
||||
// Load an array element from a FixedArray, untag it and return it as Word32.
|
||||
TNode<Int32T> LoadAndUntagToWord32FixedArrayElement(
|
||||
SloppyTNode<Object> object, Node* index, int additional_offset = 0,
|
||||
SloppyTNode<HeapObject> object, Node* index, int additional_offset = 0,
|
||||
ParameterMode parameter_mode = INTPTR_PARAMETERS);
|
||||
|
||||
TNode<Int32T> LoadAndUntagToWord32FixedArrayElement(
|
||||
SloppyTNode<Object> object, int index, int additional_offset = 0) {
|
||||
SloppyTNode<HeapObject> object, int index, int additional_offset = 0) {
|
||||
return LoadAndUntagToWord32FixedArrayElement(
|
||||
object, IntPtrConstant(index), additional_offset, INTPTR_PARAMETERS);
|
||||
}
|
||||
@ -1309,110 +1309,116 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
// Check whether the map is for an object with special properties, such as a
|
||||
// JSProxy or an object with interceptors.
|
||||
TNode<BoolT> InstanceTypeEqual(SloppyTNode<Int32T> instance_type, int type);
|
||||
Node* IsAccessorInfo(Node* object);
|
||||
Node* IsAccessorPair(Node* object);
|
||||
Node* IsAllocationSite(Node* object);
|
||||
Node* IsAnyHeapNumber(Node* object);
|
||||
Node* IsNoElementsProtectorCellInvalid();
|
||||
Node* IsBigIntInstanceType(Node* instance_type);
|
||||
Node* IsBigInt(Node* object);
|
||||
Node* IsBoolean(Node* object);
|
||||
Node* IsCallableMap(Node* map);
|
||||
Node* IsCallable(Node* object);
|
||||
Node* IsCell(Node* object);
|
||||
Node* IsCode(Node* object);
|
||||
Node* IsConsStringInstanceType(Node* instance_type);
|
||||
Node* IsConstructorMap(Node* map);
|
||||
Node* IsConstructor(Node* object);
|
||||
Node* IsDeprecatedMap(Node* map);
|
||||
Node* IsDictionary(Node* object);
|
||||
Node* IsExtensibleMap(Node* map);
|
||||
Node* IsExternalStringInstanceType(Node* instance_type);
|
||||
TNode<BoolT> IsAccessorInfo(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsAccessorPair(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsAllocationSite(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsAnyHeapNumber(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsNoElementsProtectorCellInvalid();
|
||||
TNode<BoolT> IsBigIntInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsBigInt(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsBoolean(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsCallableMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsCallable(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> TaggedIsCallable(TNode<Object> object);
|
||||
TNode<BoolT> IsCell(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsCode(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsConsStringInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsConstructorMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsConstructor(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsDeprecatedMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsDictionary(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsExtensibleMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsExternalStringInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsFastJSArray(SloppyTNode<Object> object,
|
||||
SloppyTNode<Context> context);
|
||||
TNode<BoolT> IsFastJSArrayWithNoCustomIteration(
|
||||
TNode<Object> object, TNode<Context> context,
|
||||
TNode<Context> native_context);
|
||||
Node* IsFeedbackCell(Node* object);
|
||||
Node* IsFeedbackVector(Node* object);
|
||||
Node* IsContext(Node* object);
|
||||
Node* IsFixedArray(Node* object);
|
||||
Node* IsFixedArraySubclass(Node* object);
|
||||
Node* IsFixedArrayWithKind(Node* object, ElementsKind kind);
|
||||
Node* IsFixedArrayWithKindOrEmpty(Node* object, ElementsKind kind);
|
||||
Node* IsFixedDoubleArray(Node* object);
|
||||
Node* IsFixedTypedArray(Node* object);
|
||||
Node* IsFunctionWithPrototypeSlotMap(Node* map);
|
||||
Node* IsHashTable(Node* object);
|
||||
TNode<BoolT> IsHeapNumber(Node* object);
|
||||
Node* IsIndirectStringInstanceType(Node* instance_type);
|
||||
Node* IsJSArrayBuffer(Node* object);
|
||||
Node* IsJSArrayInstanceType(Node* instance_type);
|
||||
Node* IsJSArrayMap(Node* object);
|
||||
Node* IsJSArray(Node* object);
|
||||
Node* IsJSArrayIterator(Node* object);
|
||||
Node* IsJSAsyncGeneratorObject(Node* object);
|
||||
Node* IsJSFunctionInstanceType(Node* instance_type);
|
||||
Node* IsJSFunctionMap(Node* object);
|
||||
Node* IsJSFunction(Node* object);
|
||||
Node* IsJSGeneratorObject(Node* object);
|
||||
Node* IsJSGlobalProxyInstanceType(Node* instance_type);
|
||||
Node* IsJSGlobalProxy(Node* object);
|
||||
Node* IsJSObjectInstanceType(Node* instance_type);
|
||||
Node* IsJSObjectMap(Node* map);
|
||||
Node* IsJSObject(Node* object);
|
||||
Node* IsJSPromiseMap(Node* map);
|
||||
Node* IsJSPromise(Node* object);
|
||||
Node* IsJSProxy(Node* object);
|
||||
Node* IsJSReceiverInstanceType(Node* instance_type);
|
||||
Node* IsJSReceiverMap(Node* map);
|
||||
Node* IsJSReceiver(Node* object);
|
||||
Node* IsJSRegExp(Node* object);
|
||||
Node* IsJSTypedArray(Node* object);
|
||||
Node* IsJSValueInstanceType(Node* instance_type);
|
||||
Node* IsJSValueMap(Node* map);
|
||||
Node* IsJSValue(Node* object);
|
||||
Node* IsMap(Node* object);
|
||||
Node* IsMutableHeapNumber(Node* object);
|
||||
Node* IsName(Node* object);
|
||||
Node* IsNativeContext(Node* object);
|
||||
Node* IsNullOrJSReceiver(Node* object);
|
||||
Node* IsNullOrUndefined(Node* object);
|
||||
Node* IsNumberDictionary(Node* object);
|
||||
Node* IsOneByteStringInstanceType(Node* instance_type);
|
||||
Node* IsPrimitiveInstanceType(Node* instance_type);
|
||||
TNode<BoolT> IsPrivateSymbol(Node* object);
|
||||
Node* IsPromiseCapability(Node* object);
|
||||
Node* IsPropertyArray(Node* object);
|
||||
Node* IsPropertyCell(Node* object);
|
||||
Node* IsPrototypeInitialArrayPrototype(Node* context, Node* map);
|
||||
TNode<BoolT> IsFeedbackCell(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsFeedbackVector(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsContext(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsFixedArray(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsFixedArraySubclass(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsFixedArrayWithKind(SloppyTNode<HeapObject> object,
|
||||
ElementsKind kind);
|
||||
TNode<BoolT> IsFixedArrayWithKindOrEmpty(SloppyTNode<HeapObject> object,
|
||||
ElementsKind kind);
|
||||
TNode<BoolT> IsFixedDoubleArray(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsFixedTypedArray(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsFunctionWithPrototypeSlotMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsHashTable(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsHeapNumber(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsIndirectStringInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSArrayBuffer(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSArrayInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSArrayMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsJSArray(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSArrayIterator(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSAsyncGeneratorObject(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSFunctionInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSFunctionMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsJSFunction(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSGeneratorObject(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSGlobalProxyInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSGlobalProxy(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSObjectInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSObjectMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsJSObject(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSPromiseMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsJSPromise(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSProxy(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSReceiverInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSReceiverMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsJSReceiver(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSRegExp(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSTypedArray(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsJSValueInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsJSValueMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsJSValue(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsMap(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsMutableHeapNumber(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsName(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsNativeContext(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsNullOrJSReceiver(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsNullOrUndefined(SloppyTNode<Object> object);
|
||||
TNode<BoolT> IsNumberDictionary(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsOneByteStringInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsPrimitiveInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsPrivateSymbol(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsPromiseCapability(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsPropertyArray(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsPropertyCell(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsPrototypeInitialArrayPrototype(SloppyTNode<Context> context,
|
||||
SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsPrototypeTypedArrayPrototype(SloppyTNode<Context> context,
|
||||
SloppyTNode<Map> map);
|
||||
Node* IsSequentialStringInstanceType(Node* instance_type);
|
||||
Node* IsShortExternalStringInstanceType(Node* instance_type);
|
||||
TNode<BoolT> IsSequentialStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsShortExternalStringInstanceType(
|
||||
SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsSpecialReceiverInstanceType(TNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsCustomElementsReceiverInstanceType(
|
||||
TNode<Int32T> instance_type);
|
||||
Node* IsSpecialReceiverMap(Node* map);
|
||||
Node* IsStringInstanceType(Node* instance_type);
|
||||
Node* IsString(Node* object);
|
||||
Node* IsSymbolInstanceType(Node* instance_type);
|
||||
Node* IsSymbol(Node* object);
|
||||
Node* IsUndetectableMap(Node* map);
|
||||
Node* IsWeakCell(Node* object);
|
||||
Node* IsZeroOrContext(Node* object);
|
||||
TNode<BoolT> IsSpecialReceiverMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsStringInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsString(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsSymbolInstanceType(SloppyTNode<Int32T> instance_type);
|
||||
TNode<BoolT> IsSymbol(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsUndetectableMap(SloppyTNode<Map> map);
|
||||
TNode<BoolT> IsWeakCell(SloppyTNode<HeapObject> object);
|
||||
TNode<BoolT> IsZeroOrContext(SloppyTNode<Object> object);
|
||||
|
||||
Node* IsNotWeakFixedArraySubclass(Node* object);
|
||||
TNode<BoolT> IsNotWeakFixedArraySubclass(SloppyTNode<HeapObject> object);
|
||||
|
||||
inline Node* IsSharedFunctionInfo(Node* object) {
|
||||
return IsSharedFunctionInfoMap(LoadMap(object));
|
||||
}
|
||||
|
||||
Node* IsPromiseResolveProtectorCellInvalid();
|
||||
Node* IsPromiseThenProtectorCellInvalid();
|
||||
Node* IsArraySpeciesProtectorCellInvalid();
|
||||
Node* IsTypedArraySpeciesProtectorCellInvalid();
|
||||
Node* IsPromiseSpeciesProtectorCellInvalid();
|
||||
TNode<BoolT> IsPromiseResolveProtectorCellInvalid();
|
||||
TNode<BoolT> IsPromiseThenProtectorCellInvalid();
|
||||
TNode<BoolT> IsArraySpeciesProtectorCellInvalid();
|
||||
TNode<BoolT> IsTypedArraySpeciesProtectorCellInvalid();
|
||||
TNode<BoolT> IsPromiseSpeciesProtectorCellInvalid();
|
||||
|
||||
// True iff |object| is a Smi or a HeapNumber.
|
||||
TNode<BoolT> IsNumber(SloppyTNode<Object> object);
|
||||
|
@ -1654,7 +1654,8 @@ Node* InterpreterAssembler::ImportRegisterFile(
|
||||
Node* reg_index = IntPtrSub(IntPtrConstant(Register(0).ToOperand()), index);
|
||||
StoreRegister(value, reg_index);
|
||||
|
||||
StoreFixedArrayElement(array, index, StaleRegisterConstant());
|
||||
StoreFixedArrayElement(array, index,
|
||||
LoadRoot(Heap::kStaleRegisterRootIndex));
|
||||
|
||||
var_index.Bind(IntPtrAdd(index, IntPtrConstant(1)));
|
||||
Goto(&loop);
|
||||
|
Loading…
Reference in New Issue
Block a user