[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:
Camillo Bruni 2018-04-27 13:27:17 +02:00 committed by Commit Bot
parent 440533d5d4
commit 37b8684ec3
12 changed files with 432 additions and 381 deletions

View File

@ -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; extern macro IsDetachedBuffer(JSArrayBuffer): bit;
type ParameterMode; type ParameterMode;

View File

@ -1305,7 +1305,7 @@ TF_BUILTIN(ArrayPrototypeSlice, ArrayPrototypeSliceCodeStubAssembler) {
load_arguments_length(this); load_arguments_length(this);
GotoIf(TaggedIsSmi(receiver), &generic_length); GotoIf(TaggedIsSmi(receiver), &generic_length);
GotoIfNot(IsJSArray(receiver), &check_arguments_length); GotoIfNot(IsJSArray(CAST(receiver)), &check_arguments_length);
TNode<JSArray> array_receiver = CAST(receiver); TNode<JSArray> array_receiver = CAST(receiver);
o = array_receiver; o = array_receiver;
@ -1852,7 +1852,7 @@ class ArrayPopulatorAssembler : public CodeStubAssembler {
TVARIABLE(Object, array); TVARIABLE(Object, array);
Label is_constructor(this), is_not_constructor(this), done(this); Label is_constructor(this), is_not_constructor(this), done(this);
GotoIf(TaggedIsSmi(receiver), &is_not_constructor); 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); BIND(&is_constructor);
{ {
@ -1885,7 +1885,7 @@ class ArrayPopulatorAssembler : public CodeStubAssembler {
Label is_constructor(this), is_not_constructor(this), done(this); Label is_constructor(this), is_not_constructor(this), done(this);
CSA_ASSERT(this, IsNumberNormalized(length)); CSA_ASSERT(this, IsNumberNormalized(length));
GotoIf(TaggedIsSmi(receiver), &is_not_constructor); 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); BIND(&is_constructor);
{ {
@ -1996,7 +1996,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
Label no_error(this), error(this); Label no_error(this), error(this);
GotoIf(IsUndefined(map_function), &no_error); GotoIf(IsUndefined(map_function), &no_error);
GotoIf(TaggedIsSmi(map_function), &error); GotoIf(TaggedIsSmi(map_function), &error);
Branch(IsCallable(map_function), &no_error, &error); Branch(IsCallable(CAST(map_function)), &no_error, &error);
BIND(&error); BIND(&error);
ThrowTypeError(context, MessageTemplate::kCalledNonCallable, map_function); ThrowTypeError(context, MessageTemplate::kCalledNonCallable, map_function);
@ -2033,7 +2033,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
{ {
Label get_method_not_callable(this, Label::kDeferred), next(this); Label get_method_not_callable(this, Label::kDeferred), next(this);
GotoIf(TaggedIsSmi(iterator_method), &get_method_not_callable); 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); Goto(&next);
BIND(&get_method_not_callable); BIND(&get_method_not_callable);
@ -2073,7 +2073,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
Label next(this); Label next(this);
GotoIf(IsUndefined(map_function), &next); 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, Node* v = CallJS(CodeFactory::Call(isolate()), context, map_function,
this_arg, value.value(), index.value()); this_arg, value.value(), index.value());
GotoIfException(v, &on_exception, &var_exception); GotoIfException(v, &on_exception, &var_exception);
@ -2149,7 +2149,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
Label next(this); Label next(this);
GotoIf(IsUndefined(map_function), &next); 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, value = CAST(CallJS(CodeFactory::Call(isolate()), context, map_function,
this_arg, value.value(), index.value())); this_arg, value.value(), index.value()));
Goto(&next); Goto(&next);
@ -3191,7 +3191,7 @@ void ArrayIncludesIndexofAssembler::GenerateSmiOrObject(
&return_not_found); &return_not_found);
Node* element_k = LoadFixedArrayElement(elements, index_var.value()); Node* element_k = LoadFixedArrayElement(elements, index_var.value());
GotoIf(TaggedIsSmi(element_k), &continue_loop); 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, BranchIfFloat64IsNaN(LoadHeapNumberValue(element_k), &return_found,
&continue_loop); &continue_loop);
@ -3243,7 +3243,7 @@ void ArrayIncludesIndexofAssembler::GenerateSmiOrObject(
Node* element_k = LoadFixedArrayElement(elements, index_var.value()); Node* element_k = LoadFixedArrayElement(elements, index_var.value());
Label continue_loop(this); Label continue_loop(this);
GotoIf(TaggedIsSmi(element_k), &continue_loop); 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, TNode<Object> result = CallRuntime(Runtime::kBigIntEqualToBigInt, context,
search_element, element_k); search_element, element_k);
Branch(WordEqual(result, TrueConstant()), &return_found, &continue_loop); 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 // If O does not have all of the internal slots of an Array Iterator Instance
// (22.1.5.3), throw a TypeError exception // (22.1.5.3), throw a TypeError exception
GotoIf(TaggedIsSmi(iterator), &throw_bad_receiver); GotoIf(TaggedIsSmi(iterator), &throw_bad_receiver);
GotoIfNot(IsJSArrayIterator(iterator), &throw_bad_receiver); GotoIfNot(IsJSArrayIterator(CAST(iterator)), &throw_bad_receiver);
// Let a be O.[[IteratedObject]]. // Let a be O.[[IteratedObject]].
Node* array = Node* array =

View File

@ -116,13 +116,13 @@ class BaseCollectionsAssembler : public CodeStubAssembler {
// Loads an element from a fixed array. If the element is the hole, returns // Loads an element from a fixed array. If the element is the hole, returns
// `undefined`. // `undefined`.
TNode<Object> LoadAndNormalizeFixedArrayElement(TNode<Object> elements, TNode<Object> LoadAndNormalizeFixedArrayElement(TNode<HeapObject> elements,
TNode<IntPtrT> index); TNode<IntPtrT> index);
// Loads an element from a fixed double array. If the element is the hole, // Loads an element from a fixed double array. If the element is the hole,
// returns `undefined`. // returns `undefined`.
TNode<Object> LoadAndNormalizeFixedDoubleArrayElement(TNode<Object> elements, TNode<Object> LoadAndNormalizeFixedDoubleArrayElement(
TNode<IntPtrT> index); TNode<HeapObject> elements, TNode<IntPtrT> index);
// Loads key and value variables with the first and second elements of an // Loads key and value variables with the first and second elements of an
// array. If the array lacks 2 elements, undefined is used. // 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); Label exit(this), if_notcallable(this, Label::kDeferred);
GotoIf(TaggedIsSmi(add_func), &if_notcallable); GotoIf(TaggedIsSmi(add_func), &if_notcallable);
GotoIfNot(IsCallable(add_func), &if_notcallable); GotoIfNot(IsCallable(CAST(add_func)), &if_notcallable);
Goto(&exit); Goto(&exit);
BIND(&if_notcallable); BIND(&if_notcallable);
@ -484,20 +484,20 @@ TNode<BoolT> BaseCollectionsAssembler::HasInitialCollectionPrototype(
TNode<Map> initial_prototype_map = TNode<Map> initial_prototype_map =
CAST(LoadContextElement(native_context, initial_prototype_index)); CAST(LoadContextElement(native_context, initial_prototype_index));
TNode<Map> collection_proto_map = TNode<Map> collection_proto_map =
LoadMap(CAST(LoadMapPrototype(LoadMap(CAST(collection))))); LoadMap(LoadMapPrototype(LoadMap(CAST(collection))));
return WordEqual(collection_proto_map, initial_prototype_map); return WordEqual(collection_proto_map, initial_prototype_map);
} }
TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedArrayElement( TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedArrayElement(
TNode<Object> elements, TNode<IntPtrT> index) { TNode<HeapObject> elements, TNode<IntPtrT> index) {
TNode<Object> element = LoadFixedArrayElement(elements, index); TNode<Object> element = LoadFixedArrayElement(elements, index);
return Select<Object>(IsTheHole(element), [=] { return UndefinedConstant(); }, return Select<Object>(IsTheHole(element), [=] { return UndefinedConstant(); },
[=] { return element; }); [=] { return element; });
} }
TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement( TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement(
TNode<Object> elements, TNode<IntPtrT> index) { TNode<HeapObject> elements, TNode<IntPtrT> index) {
TVARIABLE(Object, entry); TVARIABLE(Object, entry);
Label if_hole(this, Label::kDeferred), next(this); Label if_hole(this, Label::kDeferred), next(this);
TNode<Float64T> element = UncheckedCast<Float64T>(LoadFixedDoubleArrayElement( TNode<Float64T> element = UncheckedCast<Float64T>(LoadFixedDoubleArrayElement(
@ -1956,7 +1956,7 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
: BaseCollectionsAssembler(state) {} : BaseCollectionsAssembler(state) {}
protected: 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<Object> key, TNode<Object> value,
TNode<IntPtrT> number_of_elements); TNode<IntPtrT> number_of_elements);
@ -1972,19 +1972,19 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
// the {key} is found. // the {key} is found.
typedef std::function<void(TNode<Object> entry_key, Label* if_same)> typedef std::function<void(TNode<Object> entry_key, Label* if_same)>
KeyComparator; 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, TNode<IntPtrT> entry_mask,
const KeyComparator& key_compare); const KeyComparator& key_compare);
// Builds code that finds an ObjectHashTable entry available for a new entry. // 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> key_hash,
TNode<IntPtrT> entry_mask); TNode<IntPtrT> entry_mask);
// Builds code that finds the ObjectHashTable entry with key that matches // 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 // {key} and returns the entry's key index. If {key} cannot be found, jumps to
// {if_not_found}. // {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> hash,
TNode<IntPtrT> entry_mask, TNode<IntPtrT> entry_mask,
Label* if_not_found); Label* if_not_found);
@ -1994,12 +1994,12 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
TNode<IntPtrT> number_of_deleted); TNode<IntPtrT> number_of_deleted);
TNode<IntPtrT> KeyIndexFromEntry(TNode<IntPtrT> entry); TNode<IntPtrT> KeyIndexFromEntry(TNode<IntPtrT> entry);
TNode<IntPtrT> LoadNumberOfElements(TNode<Object> table, int offset); TNode<IntPtrT> LoadNumberOfElements(TNode<HeapObject> table, int offset);
TNode<IntPtrT> LoadNumberOfDeleted(TNode<Object> table, int offset = 0); TNode<IntPtrT> LoadNumberOfDeleted(TNode<HeapObject> table, int offset = 0);
TNode<Object> LoadTable(SloppyTNode<Object> collection); TNode<HeapObject> LoadTable(SloppyTNode<HeapObject> collection);
TNode<IntPtrT> LoadTableCapacity(TNode<Object> table); 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<IntPtrT> number_of_elements);
TNode<BoolT> ShouldRehash(TNode<IntPtrT> number_of_elements, TNode<BoolT> ShouldRehash(TNode<IntPtrT> number_of_elements,
TNode<IntPtrT> number_of_deleted); TNode<IntPtrT> number_of_deleted);
@ -2009,7 +2009,7 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
}; };
void WeakCollectionsBuiltinsAssembler::AddEntry( 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) { TNode<Object> value, TNode<IntPtrT> number_of_elements) {
// See ObjectHashTable::AddEntry(). // See ObjectHashTable::AddEntry().
TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index); TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index);
@ -2070,7 +2070,7 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::EntryMask(
} }
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndex( 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) { const KeyComparator& key_compare) {
// See HashTable::FirstProbe(). // See HashTable::FirstProbe().
TVARIABLE(IntPtrT, var_entry, WordAnd(key_hash, entry_mask)); TVARIABLE(IntPtrT, var_entry, WordAnd(key_hash, entry_mask));
@ -2099,7 +2099,8 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndex(
} }
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForInsertion( 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(). // See HashTable::FindInsertionEntry().
auto is_not_live = [&](TNode<Object> entry_key, Label* if_found) { auto is_not_live = [&](TNode<Object> entry_key, Label* if_found) {
// This is the the negative form BaseShape::IsLive(). // This is the the negative form BaseShape::IsLive().
@ -2109,7 +2110,7 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForInsertion(
} }
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForKey( 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) { TNode<IntPtrT> entry_mask, Label* if_not_found) {
// See HashTable::FindEntry(). // See HashTable::FindEntry().
auto match_key_or_exit_on_empty = [&](TNode<Object> entry_key, auto match_key_or_exit_on_empty = [&](TNode<Object> entry_key,
@ -2131,26 +2132,26 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::KeyIndexFromEntry(
} }
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfElements( TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfElements(
TNode<Object> table, int offset) { TNode<HeapObject> table, int offset) {
TNode<IntPtrT> number_of_elements = SmiUntag(CAST( TNode<IntPtrT> number_of_elements = SmiUntag(CAST(
LoadFixedArrayElement(table, ObjectHashTable::kNumberOfElementsIndex))); LoadFixedArrayElement(table, ObjectHashTable::kNumberOfElementsIndex)));
return IntPtrAdd(number_of_elements, IntPtrConstant(offset)); return IntPtrAdd(number_of_elements, IntPtrConstant(offset));
} }
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfDeleted( TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfDeleted(
TNode<Object> table, int offset) { TNode<HeapObject> table, int offset) {
TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadFixedArrayElement( TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadFixedArrayElement(
table, ObjectHashTable::kNumberOfDeletedElementsIndex))); table, ObjectHashTable::kNumberOfDeletedElementsIndex)));
return IntPtrAdd(number_of_deleted, IntPtrConstant(offset)); return IntPtrAdd(number_of_deleted, IntPtrConstant(offset));
} }
TNode<Object> WeakCollectionsBuiltinsAssembler::LoadTable( TNode<HeapObject> WeakCollectionsBuiltinsAssembler::LoadTable(
SloppyTNode<Object> collection) { SloppyTNode<HeapObject> collection) {
return LoadObjectField(CAST(collection), JSWeakCollection::kTableOffset); return CAST(LoadObjectField(collection, JSWeakCollection::kTableOffset));
} }
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadTableCapacity( TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadTableCapacity(
TNode<Object> table) { TNode<HeapObject> table) {
return SmiUntag( return SmiUntag(
CAST(LoadFixedArrayElement(table, ObjectHashTable::kCapacityIndex))); CAST(LoadFixedArrayElement(table, ObjectHashTable::kCapacityIndex)));
} }
@ -2174,7 +2175,7 @@ TNode<Word32T> WeakCollectionsBuiltinsAssembler::InsufficientCapacityToAdd(
} }
void WeakCollectionsBuiltinsAssembler::RemoveEntry( void WeakCollectionsBuiltinsAssembler::RemoveEntry(
TNode<Object> table, TNode<IntPtrT> key_index, TNode<HeapObject> table, TNode<IntPtrT> key_index,
TNode<IntPtrT> number_of_elements) { TNode<IntPtrT> number_of_elements) {
// See ObjectHashTable::RemoveEntry(). // See ObjectHashTable::RemoveEntry().
TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index); TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index);
@ -2228,7 +2229,7 @@ TF_BUILTIN(WeakSetConstructor, WeakCollectionsBuiltinsAssembler) {
} }
TF_BUILTIN(WeakMapLookupHashIndex, 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)); TNode<Object> key = CAST(Parameter(Descriptor::kKey));
Label if_not_found(this); Label if_not_found(this);
@ -2293,7 +2294,7 @@ TF_BUILTIN(WeakMapHas, WeakCollectionsBuiltinsAssembler) {
// (ObjectHashTable) of a WeakMap or WeakSet. // (ObjectHashTable) of a WeakMap or WeakSet.
TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) { TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
TNode<Context> context = CAST(Parameter(Descriptor::kContext)); 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)); TNode<Object> key = CAST(Parameter(Descriptor::kKey));
Label call_runtime(this), if_not_found(this); Label call_runtime(this), if_not_found(this);
@ -2301,7 +2302,7 @@ TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
GotoIfNotJSReceiver(key, &if_not_found); GotoIfNotJSReceiver(key, &if_not_found);
TNode<IntPtrT> hash = LoadJSReceiverIdentityHash(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> capacity = LoadTableCapacity(table);
TNode<IntPtrT> key_index = TNode<IntPtrT> key_index =
FindKeyIndexForKey(table, key, hash, EntryMask(capacity), &if_not_found); FindKeyIndexForKey(table, key, hash, EntryMask(capacity), &if_not_found);
@ -2323,15 +2324,15 @@ TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
// a WeakMap or WeakSet. // a WeakMap or WeakSet.
TF_BUILTIN(WeakCollectionSet, WeakCollectionsBuiltinsAssembler) { TF_BUILTIN(WeakCollectionSet, WeakCollectionsBuiltinsAssembler) {
TNode<Context> context = CAST(Parameter(Descriptor::kContext)); 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)); TNode<JSReceiver> key = CAST(Parameter(Descriptor::kKey));
TNode<Object> value = CAST(Parameter(Descriptor::kValue)); TNode<Object> value = CAST(Parameter(Descriptor::kValue));
CSA_ASSERT(this, IsJSReceiver(key)); CSA_ASSERT(this, IsJSReceiver(key));
Label call_runtime(this), if_no_hash(this), if_not_found(this); 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> capacity = LoadTableCapacity(table);
TNode<IntPtrT> entry_mask = EntryMask(capacity); TNode<IntPtrT> entry_mask = EntryMask(capacity);

View File

@ -17,7 +17,7 @@ void ProxiesCodeStubAssembler::GotoIfRevokedProxy(Node* object,
Label* if_proxy_revoked) { Label* if_proxy_revoked) {
Label proxy_not_revoked(this); Label proxy_not_revoked(this);
GotoIfNot(IsJSProxy(object), &proxy_not_revoked); 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); &proxy_not_revoked, if_proxy_revoked);
BIND(&proxy_not_revoked); BIND(&proxy_not_revoked);
} }

View File

@ -906,7 +906,7 @@ void RegExpBuiltinsAssembler::BranchIfFastRegExp(Node* const context,
Node* const initial_proto_initial_map = Node* const initial_proto_initial_map =
LoadContextElement(native_context, Context::REGEXP_PROTOTYPE_MAP_INDEX); 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 = Node* const proto_has_initialmap =
WordEqual(proto_map, initial_proto_initial_map); WordEqual(proto_map, initial_proto_initial_map);
@ -3151,8 +3151,8 @@ TF_BUILTIN(RegExpStringIteratorPrototypeNext, RegExpStringIteratorAssembler) {
// 1. Let O be the this value. // 1. Let O be the this value.
// 2. If Type(O) is not Object, throw a TypeError exception. // 2. If Type(O) is not Object, throw a TypeError exception.
GotoIf(TaggedIsSmi(maybe_receiver), &throw_bad_receiver); GotoIf(TaggedIsSmi(maybe_receiver), &throw_bad_receiver);
GotoIfNot(IsJSReceiver(maybe_receiver), &throw_bad_receiver);
TNode<HeapObject> receiver = CAST(maybe_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 // 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. // Object Instance (see 5.3), throw a TypeError exception.

View File

@ -1045,7 +1045,7 @@ void StringBuiltinsAssembler::MaybeCallFunctionAtSymbol(
LoadContextElement(native_context, Context::STRING_FUNCTION_INDEX); LoadContextElement(native_context, Context::STRING_FUNCTION_INDEX);
Node* const initial_map = Node* const initial_map =
LoadObjectField(string_fun, JSFunction::kPrototypeOrInitialMapOffset); 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); Branch(WordEqual(proto_map, initial_proto_initial_map), &out, &next);
@ -1519,8 +1519,8 @@ TF_BUILTIN(StringPrototypeMatchAll, StringBuiltinsAssembler) {
auto if_regexp_call = [&] { auto if_regexp_call = [&] {
// MaybeCallFunctionAtSymbol guarantees fast path is chosen only if // MaybeCallFunctionAtSymbol guarantees fast path is chosen only if
// maybe_regexp is a fast regexp and receiver is a string. // maybe_regexp is a fast regexp and receiver is a string.
CSA_ASSERT(this, IsString(receiver));
var_receiver_string = CAST(receiver); var_receiver_string = CAST(receiver);
CSA_ASSERT(this, IsString(var_receiver_string.value()));
var_is_fast_regexp = Int32TrueConstant(); var_is_fast_regexp = Int32TrueConstant();
Goto(&return_match_all_iterator); 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 // two cases according to the spec: if it is negative, "" is returned; if
// it is positive, then length is set to {string_length} - {start}. // 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); Label if_isnegative(this), if_ispositive(this);
TNode<Float64T> const float_zero = Float64Constant(0.); TNode<Float64T> const float_zero = Float64Constant(0.);

View File

@ -625,10 +625,10 @@ void TypedArrayBuiltinsAssembler::ConstructByArrayLike(
void TypedArrayBuiltinsAssembler::ConstructByIterable( void TypedArrayBuiltinsAssembler::ConstructByIterable(
TNode<Context> context, TNode<JSTypedArray> holder, TNode<Context> context, TNode<JSTypedArray> holder,
TNode<JSReceiver> iterable, TNode<Object> iterator_fn, TNode<JSReceiver> iterable, TNode<JSReceiver> iterator_fn,
TNode<Smi> element_size) { TNode<Smi> element_size) {
CSA_ASSERT(this, IsCallable(iterator_fn));
Label fast_path(this), slow_path(this), done(this); Label fast_path(this), slow_path(this), done(this);
CSA_ASSERT(this, IsCallable(iterator_fn));
TNode<JSArray> array_like = CAST( TNode<JSArray> array_like = CAST(
CallBuiltin(Builtins::kIterableToList, context, iterable, iterator_fn)); CallBuiltin(Builtins::kIterableToList, context, iterable, iterator_fn));
@ -669,9 +669,10 @@ TF_BUILTIN(CreateTypedArray, TypedArrayBuiltinsAssembler) {
SmiTag(GetTypedArrayElementSize(LoadElementsKind(result))); SmiTag(GetTypedArrayElementSize(LoadElementsKind(result)));
GotoIf(TaggedIsSmi(arg1), &if_arg1isnumber); GotoIf(TaggedIsSmi(arg1), &if_arg1isnumber);
GotoIf(IsJSArrayBuffer(arg1), &if_arg1isbuffer); TNode<HeapObject> arg1_heap_object = UncheckedCast<HeapObject>(arg1);
GotoIf(IsJSTypedArray(arg1), &if_arg1istypedarray); GotoIf(IsJSArrayBuffer(arg1_heap_object), &if_arg1isbuffer);
GotoIf(IsJSReceiver(arg1), &if_arg1isreceiver); GotoIf(IsJSTypedArray(arg1_heap_object), &if_arg1istypedarray);
GotoIf(IsJSReceiver(arg1_heap_object), &if_arg1isreceiver);
Goto(&if_arg1isnumber); Goto(&if_arg1isnumber);
// https://tc39.github.io/ecma262/#sec-typedarray-buffer-byteoffset-length // 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 // https://tc39.github.io/ecma262/#sec-typedarray-typedarray
BIND(&if_arg1istypedarray); BIND(&if_arg1istypedarray);
{ {
TNode<JSTypedArray> typed_array = CAST(arg1); TNode<JSTypedArray> typed_array = CAST(arg1_heap_object);
ConstructByTypedArray(context, result, typed_array, element_size); ConstructByTypedArray(context, result, typed_array, element_size);
Goto(&return_result); Goto(&return_result);
} }
@ -695,18 +696,19 @@ TF_BUILTIN(CreateTypedArray, TypedArrayBuiltinsAssembler) {
{ {
Label if_iteratorundefined(this), if_iteratornotcallable(this); Label if_iteratorundefined(this), if_iteratornotcallable(this);
// Get iterator symbol // Get iterator symbol
TNode<Object> iteratorFn = TNode<Object> iteratorFn = CAST(GetMethod(
CAST(GetMethod(context, arg1, isolate()->factory()->iterator_symbol(), context, arg1_heap_object, isolate()->factory()->iterator_symbol(),
&if_iteratorundefined)); &if_iteratorundefined));
GotoIf(TaggedIsSmi(iteratorFn), &if_iteratornotcallable); 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); Goto(&return_result);
BIND(&if_iteratorundefined); BIND(&if_iteratorundefined);
{ {
TNode<HeapObject> array_like = CAST(arg1); TNode<HeapObject> array_like = arg1_heap_object;
TNode<Object> initial_length = TNode<Object> initial_length =
GetProperty(context, arg1, LengthStringConstant()); GetProperty(context, arg1, LengthStringConstant());
@ -914,9 +916,8 @@ TNode<JSTypedArray> TypedArrayBuiltinsAssembler::SpeciesCreateByLength(
CSA_ASSERT(this, TaggedIsPositiveSmi(len)); CSA_ASSERT(this, TaggedIsPositiveSmi(len));
// Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor). // Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor).
TNode<Object> constructor = TypedArraySpeciesConstructor(context, exemplar); TNode<JSFunction> constructor =
CSA_ASSERT(this, IsJSFunction(constructor)); CAST(TypedArraySpeciesConstructor(context, exemplar));
return CreateByLength(context, constructor, len, method_name); return CreateByLength(context, constructor, len, method_name);
} }
@ -1204,7 +1205,7 @@ TNode<BoolT> TypedArrayBuiltinsAssembler::NumberIsNaN(TNode<Number> value) {
BIND(&is_heapnumber); BIND(&is_heapnumber);
{ {
CSA_ASSERT(this, IsHeapNumber(value)); CSA_ASSERT(this, IsHeapNumber(CAST(value)));
TNode<Float64T> value_f = LoadHeapNumberValue(CAST(value)); TNode<Float64T> value_f = LoadHeapNumberValue(CAST(value));
result = Float64NotEqual(value_f, value_f); result = Float64NotEqual(value_f, value_f);
@ -1230,7 +1231,7 @@ TF_BUILTIN(TypedArrayPrototypeSet, TypedArrayBuiltinsAssembler) {
// Check the receiver is a typed array. // Check the receiver is a typed array.
TNode<Object> receiver = args.GetReceiver(); TNode<Object> receiver = args.GetReceiver();
GotoIf(TaggedIsSmi(receiver), &if_receiver_is_not_typedarray); 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. // Normalize offset argument (using ToInteger) and handle heap number cases.
TNode<Object> offset = args.GetOptionalArgumentValue(1, SmiConstant(0)); TNode<Object> offset = args.GetOptionalArgumentValue(1, SmiConstant(0));
@ -1256,7 +1257,7 @@ TF_BUILTIN(TypedArrayPrototypeSet, TypedArrayBuiltinsAssembler) {
Label call_runtime(this); Label call_runtime(this);
TNode<Object> source = args.GetOptionalArgumentValue(0); TNode<Object> source = args.GetOptionalArgumentValue(0);
GotoIf(TaggedIsSmi(source), &call_runtime); 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, BranchIfFastJSArray(source, context, &if_source_is_fast_jsarray,
&call_runtime); &call_runtime);
@ -1535,7 +1536,7 @@ void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeIterationMethod(
Label throw_bad_receiver(this, Label::kDeferred); Label throw_bad_receiver(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &throw_bad_receiver); 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. // Check if the {receiver}'s JSArrayBuffer was neutered.
Node* receiver_buffer = Node* receiver_buffer =
@ -1596,7 +1597,7 @@ TF_BUILTIN(TypedArrayOf, TypedArrayBuiltinsAssembler) {
// 4. If IsConstructor(C) is false, throw a TypeError exception. // 4. If IsConstructor(C) is false, throw a TypeError exception.
TNode<Object> receiver = args.GetReceiver(); TNode<Object> receiver = args.GetReceiver();
GotoIf(TaggedIsSmi(receiver), &if_not_constructor); 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). // 5. Let newObj be ? TypedArrayCreate(C, len).
TNode<JSTypedArray> new_typed_array = TNode<JSTypedArray> new_typed_array =
@ -1742,7 +1743,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
// 2. If IsConstructor(C) is false, throw a TypeError exception. // 2. If IsConstructor(C) is false, throw a TypeError exception.
TNode<Object> receiver = args.GetReceiver(); TNode<Object> receiver = args.GetReceiver();
GotoIf(TaggedIsSmi(receiver), &if_not_constructor); 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 // 3. If mapfn is present and mapfn is not undefined, then
TNode<Object> map_fn = args.GetOptionalArgumentValue(1); TNode<Object> map_fn = args.GetOptionalArgumentValue(1);
@ -1753,7 +1754,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
// b. Let mapping be true. // b. Let mapping be true.
// 4. Else, let mapping be false. // 4. Else, let mapping be false.
GotoIf(TaggedIsSmi(map_fn), &if_map_fn_not_callable); 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(); mapping = Int32TrueConstant();
Goto(&check_iterator); Goto(&check_iterator);
@ -1776,7 +1777,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
CAST(GetMethod(context, source, isolate()->factory()->iterator_symbol(), CAST(GetMethod(context, source, isolate()->factory()->iterator_symbol(),
&from_array_like)); &from_array_like));
GotoIf(TaggedIsSmi(iterator_fn), &if_iterator_fn_not_callable); 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. // We are using the iterator.
Label if_length_not_smi(this, Label::kDeferred); 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. // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.
TNode<Object> callbackfn = args.GetOptionalArgumentValue(0); TNode<Object> callbackfn = args.GetOptionalArgumentValue(0);
GotoIf(TaggedIsSmi(callbackfn), &if_callback_not_callable); 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. // 5. If thisArg is present, let T be thisArg; else let T be undefined.
TNode<Object> this_arg = args.GetOptionalArgumentValue(1); TNode<Object> this_arg = args.GetOptionalArgumentValue(1);

View File

@ -45,7 +45,8 @@ class TypedArrayBuiltinsAssembler : public CodeStubAssembler {
TNode<JSReceiver> buffer_constructor); TNode<JSReceiver> buffer_constructor);
void ConstructByIterable(TNode<Context> context, TNode<JSTypedArray> holder, void ConstructByIterable(TNode<Context> context, TNode<JSTypedArray> holder,
TNode<JSReceiver> iterable, 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, void SetupTypedArray(TNode<JSTypedArray> holder, TNode<Smi> length,
TNode<Number> byte_offset, TNode<Number> byte_length); TNode<Number> byte_offset, TNode<Number> byte_length);

View File

@ -269,8 +269,7 @@ module typed_array {
// 1. If comparefn is not undefined and IsCallable(comparefn) is false, // 1. If comparefn is not undefined and IsCallable(comparefn) is false,
// throw a TypeError exception. // throw a TypeError exception.
let comparefn_obj: Object = arguments.length > 0 ? arguments[0] : undefined; let comparefn_obj: Object = arguments.length > 0 ? arguments[0] : undefined;
if (comparefn_obj != undefined && if (comparefn_obj != undefined && !TaggedIsCallable(comparefn_obj)) {
(TaggedIsSmi(comparefn_obj) || !IsCallable(comparefn_obj))) {
ThrowTypeError(context, kBadSortComparisonFunction, comparefn_obj); ThrowTypeError(context, kBadSortComparisonFunction, comparefn_obj);
} }

View File

@ -228,14 +228,10 @@ HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR);
HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST); HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST);
#undef HEAP_CONSTANT_TEST #undef HEAP_CONSTANT_TEST
Node* CodeStubAssembler::HashSeed() { TNode<Int32T> CodeStubAssembler::HashSeed() {
return LoadAndUntagToWord32Root(Heap::kHashSeedRootIndex); return LoadAndUntagToWord32Root(Heap::kHashSeedRootIndex);
} }
Node* CodeStubAssembler::StaleRegisterConstant() {
return LoadRoot(Heap::kStaleRegisterRootIndex);
}
Node* CodeStubAssembler::IntPtrOrSmiConstant(int value, ParameterMode mode) { Node* CodeStubAssembler::IntPtrOrSmiConstant(int value, ParameterMode mode) {
if (mode == SMI_PARAMETERS) { if (mode == SMI_PARAMETERS) {
return SmiConstant(value); 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) { Heap::RootListIndex root_index) {
Node* roots_array_start = Node* roots_array_start =
ExternalConstant(ExternalReference::roots_array_start(isolate())); ExternalConstant(ExternalReference::roots_array_start(isolate()));
@ -1319,7 +1315,8 @@ Node* CodeStubAssembler::LoadAndUntagToWord32Root(
#if V8_TARGET_LITTLE_ENDIAN #if V8_TARGET_LITTLE_ENDIAN
index += kPointerSize / 2; index += kPointerSize / 2;
#endif #endif
return Load(MachineType::Int32(), roots_array_start, IntPtrConstant(index)); return UncheckedCast<Int32T>(
Load(MachineType::Int32(), roots_array_start, IntPtrConstant(index)));
} else { } else {
return SmiToInt32(Load(MachineType::AnyTagged(), roots_array_start, return SmiToInt32(Load(MachineType::AnyTagged(), roots_array_start,
IntPtrConstant(index))); IntPtrConstant(index)));
@ -1489,9 +1486,9 @@ TNode<DescriptorArray> CodeStubAssembler::LoadMapDescriptors(
return CAST(LoadObjectField(map, Map::kDescriptorsOffset)); 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)); CSA_SLOW_ASSERT(this, IsMap(map));
return LoadObjectField(map, Map::kPrototypeOffset); return CAST(LoadObjectField(map, Map::kPrototypeOffset));
} }
TNode<PrototypeInfo> CodeStubAssembler::LoadMapPrototypeInfo( TNode<PrototypeInfo> CodeStubAssembler::LoadMapPrototypeInfo(
@ -1567,8 +1564,8 @@ Node* CodeStubAssembler::LoadMapEnumLength(SloppyTNode<Map> map) {
} }
TNode<Object> CodeStubAssembler::LoadMapBackPointer(SloppyTNode<Map> map) { TNode<Object> CodeStubAssembler::LoadMapBackPointer(SloppyTNode<Map> map) {
TNode<Object> object = TNode<HeapObject> object =
LoadObjectField(map, Map::kConstructorOrBackPointerOffset); CAST(LoadObjectField(map, Map::kConstructorOrBackPointerOffset));
return Select<Object>(IsMap(object), [=] { return object; }, return Select<Object>(IsMap(object), [=] { return object; },
[=] { return UndefinedConstant(); }); [=] { return UndefinedConstant(); });
} }
@ -1757,7 +1754,7 @@ TNode<MaybeObject> CodeStubAssembler::LoadArrayElement(
} }
TNode<Object> CodeStubAssembler::LoadFixedArrayElement( 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) { ParameterMode parameter_mode, LoadSensitivity needs_poisoning) {
// This function is currently used for non-FixedArrays (e.g., PropertyArrays) // This function is currently used for non-FixedArrays (e.g., PropertyArrays)
// and thus the reasonable assert IsFixedArraySubclass(object) is // and thus the reasonable assert IsFixedArraySubclass(object) is
@ -2029,7 +2026,7 @@ TNode<Object> CodeStubAssembler::LoadFeedbackVectorSlot(
} }
TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32ArrayElement( 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) { int additional_offset, ParameterMode parameter_mode) {
CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode));
int32_t header_size = array_header_size + additional_offset - kHeapObjectTag; int32_t header_size = array_header_size + additional_offset - kHeapObjectTag;
@ -2048,7 +2045,7 @@ TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32ArrayElement(
} }
TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement( 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) { ParameterMode parameter_mode) {
CSA_SLOW_ASSERT(this, IsFixedArraySubclass(object)); CSA_SLOW_ASSERT(this, IsFixedArraySubclass(object));
return LoadAndUntagToWord32ArrayElement(object, FixedArray::kHeaderSize, return LoadAndUntagToWord32ArrayElement(object, FixedArray::kHeaderSize,
@ -2619,18 +2616,10 @@ TNode<String> CodeStubAssembler::AllocateSeqOneByteString(
return CAST(result); return CAST(result);
} }
Node* CodeStubAssembler::IsZeroOrContext(Node* object) { TNode<BoolT> CodeStubAssembler::IsZeroOrContext(SloppyTNode<Object> object) {
Label out(this); return Select<BoolT>(WordEqual(object, SmiConstant(0)),
VARIABLE(var_result, MachineRepresentation::kWord32, Int32Constant(1)); [=] { return Int32TrueConstant(); },
[=] { return IsContext(CAST(object)); });
GotoIf(WordEqual(object, SmiConstant(0)), &out);
GotoIf(IsContext(object), &out);
var_result.Bind(Int32Constant(0));
Goto(&out);
BIND(&out);
return var_result.value();
} }
TNode<String> CodeStubAssembler::AllocateSeqOneByteString( TNode<String> CodeStubAssembler::AllocateSeqOneByteString(
@ -4635,70 +4624,70 @@ TNode<BoolT> CodeStubAssembler::IsDictionaryMap(SloppyTNode<Map> map) {
return IsSetWord32<Map::IsDictionaryMapBit>(bit_field3); return IsSetWord32<Map::IsDictionaryMapBit>(bit_field3);
} }
Node* CodeStubAssembler::IsExtensibleMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsExtensibleMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsSetWord32<Map::IsExtensibleBit>(LoadMapBitField2(map)); return IsSetWord32<Map::IsExtensibleBit>(LoadMapBitField2(map));
} }
Node* CodeStubAssembler::IsCallableMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsCallableMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsSetWord32<Map::IsCallableBit>(LoadMapBitField(map)); return IsSetWord32<Map::IsCallableBit>(LoadMapBitField(map));
} }
Node* CodeStubAssembler::IsDeprecatedMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsDeprecatedMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsSetWord32<Map::IsDeprecatedBit>(LoadMapBitField3(map)); return IsSetWord32<Map::IsDeprecatedBit>(LoadMapBitField3(map));
} }
Node* CodeStubAssembler::IsUndetectableMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsUndetectableMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsSetWord32<Map::IsUndetectableBit>(LoadMapBitField(map)); return IsSetWord32<Map::IsUndetectableBit>(LoadMapBitField(map));
} }
Node* CodeStubAssembler::IsNoElementsProtectorCellInvalid() { TNode<BoolT> CodeStubAssembler::IsNoElementsProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid); Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kNoElementsProtectorRootIndex); Node* cell = LoadRoot(Heap::kNoElementsProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset); Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
return WordEqual(cell_value, invalid); return WordEqual(cell_value, invalid);
} }
Node* CodeStubAssembler::IsPromiseResolveProtectorCellInvalid() { TNode<BoolT> CodeStubAssembler::IsPromiseResolveProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid); Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kPromiseResolveProtectorRootIndex); Node* cell = LoadRoot(Heap::kPromiseResolveProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, Cell::kValueOffset); Node* cell_value = LoadObjectField(cell, Cell::kValueOffset);
return WordEqual(cell_value, invalid); return WordEqual(cell_value, invalid);
} }
Node* CodeStubAssembler::IsPromiseThenProtectorCellInvalid() { TNode<BoolT> CodeStubAssembler::IsPromiseThenProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid); Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kPromiseThenProtectorRootIndex); Node* cell = LoadRoot(Heap::kPromiseThenProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset); Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
return WordEqual(cell_value, invalid); return WordEqual(cell_value, invalid);
} }
Node* CodeStubAssembler::IsArraySpeciesProtectorCellInvalid() { TNode<BoolT> CodeStubAssembler::IsArraySpeciesProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid); Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kArraySpeciesProtectorRootIndex); Node* cell = LoadRoot(Heap::kArraySpeciesProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset); Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
return WordEqual(cell_value, invalid); return WordEqual(cell_value, invalid);
} }
Node* CodeStubAssembler::IsTypedArraySpeciesProtectorCellInvalid() { TNode<BoolT> CodeStubAssembler::IsTypedArraySpeciesProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid); Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kTypedArraySpeciesProtectorRootIndex); Node* cell = LoadRoot(Heap::kTypedArraySpeciesProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset); Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
return WordEqual(cell_value, invalid); return WordEqual(cell_value, invalid);
} }
Node* CodeStubAssembler::IsPromiseSpeciesProtectorCellInvalid() { TNode<BoolT> CodeStubAssembler::IsPromiseSpeciesProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid); Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kPromiseSpeciesProtectorRootIndex); Node* cell = LoadRoot(Heap::kPromiseSpeciesProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset); Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
return WordEqual(cell_value, invalid); return WordEqual(cell_value, invalid);
} }
Node* CodeStubAssembler::IsPrototypeInitialArrayPrototype(Node* context, TNode<BoolT> CodeStubAssembler::IsPrototypeInitialArrayPrototype(
Node* map) { SloppyTNode<Context> context, SloppyTNode<Map> map) {
Node* const native_context = LoadNativeContext(context); Node* const native_context = LoadNativeContext(context);
Node* const initial_array_prototype = LoadContextElement( Node* const initial_array_prototype = LoadContextElement(
native_context, Context::INITIAL_ARRAY_PROTOTYPE_INDEX); native_context, Context::INITIAL_ARRAY_PROTOTYPE_INDEX);
@ -4711,35 +4700,44 @@ TNode<BoolT> CodeStubAssembler::IsPrototypeTypedArrayPrototype(
TNode<Context> const native_context = LoadNativeContext(context); TNode<Context> const native_context = LoadNativeContext(context);
TNode<Object> const typed_array_prototype = TNode<Object> const typed_array_prototype =
LoadContextElement(native_context, Context::TYPED_ARRAY_PROTOTYPE_INDEX); LoadContextElement(native_context, Context::TYPED_ARRAY_PROTOTYPE_INDEX);
TNode<Object> proto = LoadMapPrototype(map); TNode<HeapObject> proto = LoadMapPrototype(map);
TNode<Object> proto_of_proto = Select<Object>( TNode<HeapObject> proto_of_proto = Select<HeapObject>(
IsJSObject(proto), [=] { return LoadMapPrototype(LoadMap(CAST(proto))); }, IsJSObject(proto), [=] { return LoadMapPrototype(LoadMap(proto)); },
[=] { return NullConstant(); }); [=] { return NullConstant(); });
return WordEqual(proto_of_proto, typed_array_prototype); 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)); return IsCallableMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsCell(Node* object) { TNode<BoolT> CodeStubAssembler::IsCell(SloppyTNode<HeapObject> object) {
return WordEqual(LoadMap(object), LoadRoot(Heap::kCellMapRootIndex)); return WordEqual(LoadMap(object), LoadRoot(Heap::kCellMapRootIndex));
} }
Node* CodeStubAssembler::IsCode(Node* object) { TNode<BoolT> CodeStubAssembler::IsCode(SloppyTNode<HeapObject> object) {
return HasInstanceType(object, CODE_TYPE); return HasInstanceType(object, CODE_TYPE);
} }
Node* CodeStubAssembler::IsConstructorMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsConstructorMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsSetWord32<Map::IsConstructorBit>(LoadMapBitField(map)); return IsSetWord32<Map::IsConstructorBit>(LoadMapBitField(map));
} }
Node* CodeStubAssembler::IsConstructor(Node* object) { TNode<BoolT> CodeStubAssembler::IsConstructor(SloppyTNode<HeapObject> object) {
return IsConstructorMap(LoadMap(object)); return IsConstructorMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsFunctionWithPrototypeSlotMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsFunctionWithPrototypeSlotMap(
SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsSetWord32<Map::HasPrototypeSlotBit>(LoadMapBitField(map)); return IsSetWord32<Map::HasPrototypeSlotBit>(LoadMapBitField(map));
} }
@ -4757,177 +4755,200 @@ TNode<BoolT> CodeStubAssembler::IsCustomElementsReceiverInstanceType(
Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)); 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); STATIC_ASSERT(INTERNALIZED_STRING_TYPE == FIRST_TYPE);
return Int32LessThan(instance_type, Int32Constant(FIRST_NONSTRING_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)); CSA_ASSERT(this, IsStringInstanceType(instance_type));
return Word32Equal( return Word32Equal(
Word32And(instance_type, Int32Constant(kStringEncodingMask)), Word32And(instance_type, Int32Constant(kStringEncodingMask)),
Int32Constant(kOneByteStringTag)); Int32Constant(kOneByteStringTag));
} }
Node* CodeStubAssembler::IsSequentialStringInstanceType(Node* instance_type) { TNode<BoolT> CodeStubAssembler::IsSequentialStringInstanceType(
SloppyTNode<Int32T> instance_type) {
CSA_ASSERT(this, IsStringInstanceType(instance_type)); CSA_ASSERT(this, IsStringInstanceType(instance_type));
return Word32Equal( return Word32Equal(
Word32And(instance_type, Int32Constant(kStringRepresentationMask)), Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
Int32Constant(kSeqStringTag)); Int32Constant(kSeqStringTag));
} }
Node* CodeStubAssembler::IsConsStringInstanceType(Node* instance_type) { TNode<BoolT> CodeStubAssembler::IsConsStringInstanceType(
SloppyTNode<Int32T> instance_type) {
CSA_ASSERT(this, IsStringInstanceType(instance_type)); CSA_ASSERT(this, IsStringInstanceType(instance_type));
return Word32Equal( return Word32Equal(
Word32And(instance_type, Int32Constant(kStringRepresentationMask)), Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
Int32Constant(kConsStringTag)); Int32Constant(kConsStringTag));
} }
Node* CodeStubAssembler::IsIndirectStringInstanceType(Node* instance_type) { TNode<BoolT> CodeStubAssembler::IsIndirectStringInstanceType(
SloppyTNode<Int32T> instance_type) {
CSA_ASSERT(this, IsStringInstanceType(instance_type)); CSA_ASSERT(this, IsStringInstanceType(instance_type));
STATIC_ASSERT(kIsIndirectStringMask == 0x1); STATIC_ASSERT(kIsIndirectStringMask == 0x1);
STATIC_ASSERT(kIsIndirectStringTag == 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)); CSA_ASSERT(this, IsStringInstanceType(instance_type));
return Word32Equal( return Word32Equal(
Word32And(instance_type, Int32Constant(kStringRepresentationMask)), Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
Int32Constant(kExternalStringTag)); Int32Constant(kExternalStringTag));
} }
Node* CodeStubAssembler::IsShortExternalStringInstanceType( TNode<BoolT> CodeStubAssembler::IsShortExternalStringInstanceType(
Node* instance_type) { SloppyTNode<Int32T> instance_type) {
CSA_ASSERT(this, IsStringInstanceType(instance_type)); CSA_ASSERT(this, IsStringInstanceType(instance_type));
STATIC_ASSERT(kShortExternalStringTag != 0); STATIC_ASSERT(kShortExternalStringTag != 0);
return IsSetWord32(instance_type, kShortExternalStringMask); 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); STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
return Int32GreaterThanOrEqual(instance_type, return Int32GreaterThanOrEqual(instance_type,
Int32Constant(FIRST_JS_RECEIVER_TYPE)); Int32Constant(FIRST_JS_RECEIVER_TYPE));
} }
Node* CodeStubAssembler::IsJSReceiverMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsJSReceiverMap(SloppyTNode<Map> map) {
return IsJSReceiverInstanceType(LoadMapInstanceType(map)); return IsJSReceiverInstanceType(LoadMapInstanceType(map));
} }
Node* CodeStubAssembler::IsJSReceiver(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSReceiver(SloppyTNode<HeapObject> object) {
return IsJSReceiverMap(LoadMap(object)); return IsJSReceiverMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsNullOrJSReceiver(Node* object) { TNode<BoolT> CodeStubAssembler::IsNullOrJSReceiver(
return Word32Or(IsJSReceiver(object), IsNull(object)); SloppyTNode<HeapObject> object) {
return UncheckedCast<BoolT>(Word32Or(IsJSReceiver(object), IsNull(object)));
} }
Node* CodeStubAssembler::IsNullOrUndefined(Node* const value) { TNode<BoolT> CodeStubAssembler::IsNullOrUndefined(SloppyTNode<Object> value) {
return Word32Or(IsUndefined(value), IsNull(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); 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); STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE);
return Int32GreaterThanOrEqual(instance_type, return Int32GreaterThanOrEqual(instance_type,
Int32Constant(FIRST_JS_OBJECT_TYPE)); Int32Constant(FIRST_JS_OBJECT_TYPE));
} }
Node* CodeStubAssembler::IsJSObjectMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsJSObjectMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return IsJSObjectInstanceType(LoadMapInstanceType(map)); return IsJSObjectInstanceType(LoadMapInstanceType(map));
} }
Node* CodeStubAssembler::IsJSObject(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSObject(SloppyTNode<HeapObject> object) {
return IsJSObjectMap(LoadMap(object)); return IsJSObjectMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsJSPromiseMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsJSPromiseMap(SloppyTNode<Map> map) {
CSA_ASSERT(this, IsMap(map)); CSA_ASSERT(this, IsMap(map));
return InstanceTypeEqual(LoadMapInstanceType(map), JS_PROMISE_TYPE); return InstanceTypeEqual(LoadMapInstanceType(map), JS_PROMISE_TYPE);
} }
Node* CodeStubAssembler::IsJSPromise(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSPromise(SloppyTNode<HeapObject> object) {
return IsJSPromiseMap(LoadMap(object)); return IsJSPromiseMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsJSProxy(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSProxy(SloppyTNode<HeapObject> object) {
return HasInstanceType(object, JS_PROXY_TYPE); 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); 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); return InstanceTypeEqual(instance_type, JS_VALUE_TYPE);
} }
Node* CodeStubAssembler::IsJSValue(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSValue(SloppyTNode<HeapObject> object) {
return IsJSValueMap(LoadMap(object)); return IsJSValueMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsJSValueMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsJSValueMap(SloppyTNode<Map> map) {
return IsJSValueInstanceType(LoadMapInstanceType(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); return InstanceTypeEqual(instance_type, JS_ARRAY_TYPE);
} }
Node* CodeStubAssembler::IsJSArray(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSArray(SloppyTNode<HeapObject> object) {
return IsJSArrayMap(LoadMap(object)); return IsJSArrayMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsJSArrayMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsJSArrayMap(SloppyTNode<Map> map) {
return IsJSArrayInstanceType(LoadMapInstanceType(map)); return IsJSArrayInstanceType(LoadMapInstanceType(map));
} }
Node* CodeStubAssembler::IsJSArrayIterator(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSArrayIterator(
SloppyTNode<HeapObject> object) {
return HasInstanceType(object, JS_ARRAY_ITERATOR_TYPE); 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); 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); Node* instance_type = LoadInstanceType(object);
return Word32And( return UncheckedCast<BoolT>(Word32And(
Int32GreaterThanOrEqual(instance_type, Int32Constant(FIRST_CONTEXT_TYPE)), 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); return HasInstanceType(object, FIXED_ARRAY_TYPE);
} }
Node* CodeStubAssembler::IsFixedArraySubclass(Node* object) { TNode<BoolT> CodeStubAssembler::IsFixedArraySubclass(
SloppyTNode<HeapObject> object) {
Node* instance_type = LoadInstanceType(object); Node* instance_type = LoadInstanceType(object);
return Word32And(Int32GreaterThanOrEqual( return UncheckedCast<BoolT>(
instance_type, Int32Constant(FIRST_FIXED_ARRAY_TYPE)), Word32And(Int32GreaterThanOrEqual(instance_type,
Int32Constant(FIRST_FIXED_ARRAY_TYPE)),
Int32LessThanOrEqual(instance_type, Int32LessThanOrEqual(instance_type,
Int32Constant(LAST_FIXED_ARRAY_TYPE))); Int32Constant(LAST_FIXED_ARRAY_TYPE))));
} }
Node* CodeStubAssembler::IsNotWeakFixedArraySubclass(Node* object) { TNode<BoolT> CodeStubAssembler::IsNotWeakFixedArraySubclass(
SloppyTNode<HeapObject> object) {
Node* instance_type = LoadInstanceType(object); Node* instance_type = LoadInstanceType(object);
return Word32Or( return UncheckedCast<BoolT>(Word32Or(
Int32LessThan(instance_type, Int32Constant(FIRST_WEAK_FIXED_ARRAY_TYPE)), Int32LessThan(instance_type, Int32Constant(FIRST_WEAK_FIXED_ARRAY_TYPE)),
Int32GreaterThan(instance_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); return HasInstanceType(object, PROMISE_CAPABILITY_TYPE);
} }
Node* CodeStubAssembler::IsPropertyArray(Node* object) { TNode<BoolT> CodeStubAssembler::IsPropertyArray(
SloppyTNode<HeapObject> object) {
return HasInstanceType(object, PROPERTY_ARRAY_TYPE); return HasInstanceType(object, PROPERTY_ARRAY_TYPE);
} }
@ -4940,24 +4961,25 @@ Node* CodeStubAssembler::IsPropertyArray(Node* object) {
// source array is empty. // source array is empty.
// TODO(jgruber): It might we worth creating an empty_double_array constant to // TODO(jgruber): It might we worth creating an empty_double_array constant to
// simplify this case. // simplify this case.
Node* CodeStubAssembler::IsFixedArrayWithKindOrEmpty(Node* object, TNode<BoolT> CodeStubAssembler::IsFixedArrayWithKindOrEmpty(
ElementsKind kind) { SloppyTNode<HeapObject> object, ElementsKind kind) {
Label out(this); Label out(this);
VARIABLE(var_result, MachineRepresentation::kWord32, Int32Constant(1)); TVARIABLE(BoolT, var_result, Int32TrueConstant());
GotoIf(IsFixedArrayWithKind(object, kind), &out); GotoIf(IsFixedArrayWithKind(object, kind), &out);
Node* const length = LoadFixedArrayBaseLength(object); Node* const length = LoadFixedArrayBaseLength(CAST(object));
GotoIf(SmiEqual(length, SmiConstant(0)), &out); GotoIf(SmiEqual(length, SmiConstant(0)), &out);
var_result.Bind(Int32Constant(0)); var_result = Int32FalseConstant();
Goto(&out); Goto(&out);
BIND(&out); BIND(&out);
return var_result.value(); return var_result.value();
} }
Node* CodeStubAssembler::IsFixedArrayWithKind(Node* object, ElementsKind kind) { TNode<BoolT> CodeStubAssembler::IsFixedArrayWithKind(
SloppyTNode<HeapObject> object, ElementsKind kind) {
if (IsDoubleElementsKind(kind)) { if (IsDoubleElementsKind(kind)) {
return IsFixedDoubleArray(object); return IsFixedDoubleArray(object);
} else { } 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)); return IsWeakCellMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsBoolean(Node* object) { TNode<BoolT> CodeStubAssembler::IsBoolean(SloppyTNode<HeapObject> object) {
return IsBooleanMap(LoadMap(object)); return IsBooleanMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsPropertyCell(Node* object) { TNode<BoolT> CodeStubAssembler::IsPropertyCell(SloppyTNode<HeapObject> object) {
return IsPropertyCellMap(LoadMap(object)); return IsPropertyCellMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsAccessorInfo(Node* object) { TNode<BoolT> CodeStubAssembler::IsAccessorInfo(SloppyTNode<HeapObject> object) {
return IsAccessorInfoMap(LoadMap(object)); return IsAccessorInfoMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsAccessorPair(Node* object) { TNode<BoolT> CodeStubAssembler::IsAccessorPair(SloppyTNode<HeapObject> object) {
return IsAccessorPairMap(LoadMap(object)); return IsAccessorPairMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsAllocationSite(Node* object) { TNode<BoolT> CodeStubAssembler::IsAllocationSite(
SloppyTNode<HeapObject> object) {
return IsAllocationSiteMap(LoadMap(object)); return IsAllocationSiteMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsAnyHeapNumber(Node* object) { TNode<BoolT> CodeStubAssembler::IsAnyHeapNumber(
return Word32Or(IsMutableHeapNumber(object), IsHeapNumber(object)); 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)); return IsHeapNumberMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsMutableHeapNumber(Node* object) { TNode<BoolT> CodeStubAssembler::IsMutableHeapNumber(
SloppyTNode<HeapObject> object) {
return IsMutableHeapNumberMap(LoadMap(object)); return IsMutableHeapNumberMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsFeedbackCell(Node* object) { TNode<BoolT> CodeStubAssembler::IsFeedbackCell(SloppyTNode<HeapObject> object) {
return HasInstanceType(object, FEEDBACK_CELL_TYPE); return HasInstanceType(object, FEEDBACK_CELL_TYPE);
} }
Node* CodeStubAssembler::IsFeedbackVector(Node* object) { TNode<BoolT> CodeStubAssembler::IsFeedbackVector(
SloppyTNode<HeapObject> object) {
return IsFeedbackVectorMap(LoadMap(object)); return IsFeedbackVectorMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsName(Node* object) { TNode<BoolT> CodeStubAssembler::IsName(SloppyTNode<HeapObject> object) {
return Int32LessThanOrEqual(LoadInstanceType(object), return Int32LessThanOrEqual(LoadInstanceType(object),
Int32Constant(LAST_NAME_TYPE)); Int32Constant(LAST_NAME_TYPE));
} }
Node* CodeStubAssembler::IsString(Node* object) { TNode<BoolT> CodeStubAssembler::IsString(SloppyTNode<HeapObject> object) {
return IsStringInstanceType(LoadInstanceType(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); return InstanceTypeEqual(instance_type, SYMBOL_TYPE);
} }
Node* CodeStubAssembler::IsSymbol(Node* object) { TNode<BoolT> CodeStubAssembler::IsSymbol(SloppyTNode<HeapObject> object) {
return IsSymbolMap(LoadMap(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); return InstanceTypeEqual(instance_type, BIGINT_TYPE);
} }
Node* CodeStubAssembler::IsBigInt(Node* object) { TNode<BoolT> CodeStubAssembler::IsBigInt(SloppyTNode<HeapObject> object) {
return IsBigIntInstanceType(LoadInstanceType(object)); return IsBigIntInstanceType(LoadInstanceType(object));
} }
Node* CodeStubAssembler::IsPrimitiveInstanceType(Node* instance_type) { TNode<BoolT> CodeStubAssembler::IsPrimitiveInstanceType(
SloppyTNode<Int32T> instance_type) {
return Int32LessThanOrEqual(instance_type, return Int32LessThanOrEqual(instance_type,
Int32Constant(LAST_PRIMITIVE_TYPE)); Int32Constant(LAST_PRIMITIVE_TYPE));
} }
TNode<BoolT> CodeStubAssembler::IsPrivateSymbol(Node* object) { TNode<BoolT> CodeStubAssembler::IsPrivateSymbol(
SloppyTNode<HeapObject> object) {
return Select<BoolT>( return Select<BoolT>(
IsSymbol(object), IsSymbol(object),
[=] { [=] {
@ -5052,74 +5083,83 @@ TNode<BoolT> CodeStubAssembler::IsPrivateSymbol(Node* object) {
[=] { return Int32FalseConstant(); }); [=] { return Int32FalseConstant(); });
} }
Node* CodeStubAssembler::IsNativeContext(Node* object) { TNode<BoolT> CodeStubAssembler::IsNativeContext(
SloppyTNode<HeapObject> object) {
return WordEqual(LoadMap(object), LoadRoot(Heap::kNativeContextMapRootIndex)); return WordEqual(LoadMap(object), LoadRoot(Heap::kNativeContextMapRootIndex));
} }
Node* CodeStubAssembler::IsFixedDoubleArray(Node* object) { TNode<BoolT> CodeStubAssembler::IsFixedDoubleArray(
SloppyTNode<HeapObject> object) {
return WordEqual(LoadMap(object), FixedDoubleArrayMapConstant()); return WordEqual(LoadMap(object), FixedDoubleArrayMapConstant());
} }
Node* CodeStubAssembler::IsHashTable(Node* object) { TNode<BoolT> CodeStubAssembler::IsHashTable(SloppyTNode<HeapObject> object) {
return HasInstanceType(object, HASH_TABLE_TYPE); return HasInstanceType(object, HASH_TABLE_TYPE);
} }
Node* CodeStubAssembler::IsDictionary(Node* object) { TNode<BoolT> CodeStubAssembler::IsDictionary(SloppyTNode<HeapObject> object) {
return Word32Or(IsHashTable(object), IsNumberDictionary(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), return WordEqual(LoadMap(object),
LoadRoot(Heap::kNumberDictionaryMapRootIndex)); LoadRoot(Heap::kNumberDictionaryMapRootIndex));
} }
Node* CodeStubAssembler::IsJSGeneratorObject(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSGeneratorObject(
SloppyTNode<HeapObject> object) {
return HasInstanceType(object, JS_GENERATOR_OBJECT_TYPE); 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); return InstanceTypeEqual(instance_type, JS_FUNCTION_TYPE);
} }
Node* CodeStubAssembler::IsJSFunction(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSFunction(SloppyTNode<HeapObject> object) {
return IsJSFunctionMap(LoadMap(object)); return IsJSFunctionMap(LoadMap(object));
} }
Node* CodeStubAssembler::IsJSFunctionMap(Node* map) { TNode<BoolT> CodeStubAssembler::IsJSFunctionMap(SloppyTNode<Map> map) {
return IsJSFunctionInstanceType(LoadMapInstanceType(map)); return IsJSFunctionInstanceType(LoadMapInstanceType(map));
} }
Node* CodeStubAssembler::IsJSTypedArray(Node* object) { TNode<BoolT> CodeStubAssembler::IsJSTypedArray(SloppyTNode<HeapObject> object) {
return HasInstanceType(object, JS_TYPED_ARRAY_TYPE); 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); return HasInstanceType(object, JS_ARRAY_BUFFER_TYPE);
} }
Node* CodeStubAssembler::IsFixedTypedArray(Node* object) { TNode<BoolT> CodeStubAssembler::IsFixedTypedArray(
Node* instance_type = LoadInstanceType(object); SloppyTNode<HeapObject> object) {
return Word32And( TNode<Int32T> instance_type = LoadInstanceType(object);
return UncheckedCast<BoolT>(Word32And(
Int32GreaterThanOrEqual(instance_type, Int32GreaterThanOrEqual(instance_type,
Int32Constant(FIRST_FIXED_TYPED_ARRAY_TYPE)), Int32Constant(FIRST_FIXED_TYPED_ARRAY_TYPE)),
Int32LessThanOrEqual(instance_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); return HasInstanceType(object, JS_REGEXP_TYPE);
} }
TNode<BoolT> CodeStubAssembler::IsNumber(SloppyTNode<Object> object) { TNode<BoolT> CodeStubAssembler::IsNumber(SloppyTNode<Object> object) {
return Select<BoolT>(TaggedIsSmi(object), [=] { return Int32TrueConstant(); }, return Select<BoolT>(TaggedIsSmi(object), [=] { return Int32TrueConstant(); },
[=] { return IsHeapNumber(object); }); [=] { return IsHeapNumber(CAST(object)); });
} }
TNode<BoolT> CodeStubAssembler::IsNumeric(SloppyTNode<Object> object) { TNode<BoolT> CodeStubAssembler::IsNumeric(SloppyTNode<Object> object) {
return Select<BoolT>(TaggedIsSmi(object), [=] { return Int32TrueConstant(); }, return Select<BoolT>(
TaggedIsSmi(object), [=] { return Int32TrueConstant(); },
[=] { [=] {
return UncheckedCast<BoolT>( return UncheckedCast<BoolT>(
Word32Or(IsHeapNumber(object), IsBigInt(object))); Word32Or(IsHeapNumber(CAST(object)), IsBigInt(CAST(object))));
}); });
} }
@ -6159,7 +6199,7 @@ TNode<Number> CodeStubAssembler::ToNumber_Inline(SloppyTNode<Context> context,
BIND(&not_smi); BIND(&not_smi);
{ {
var_result = var_result =
Select<Number>(IsHeapNumber(input), [=] { return CAST(input); }, Select<Number>(IsHeapNumber(CAST(input)), [=] { return CAST(input); },
[=] { [=] {
return CAST(CallBuiltin(Builtins::kNonNumberToNumber, return CAST(CallBuiltin(Builtins::kNonNumberToNumber,
context, input)); context, input));
@ -6210,7 +6250,7 @@ TNode<BigInt> CodeStubAssembler::ToBigInt(SloppyTNode<Context> context,
Label if_bigint(this), done(this), if_throw(this); Label if_bigint(this), done(this), if_throw(this);
GotoIf(TaggedIsSmi(input), &if_throw); GotoIf(TaggedIsSmi(input), &if_throw);
GotoIf(IsBigInt(input), &if_bigint); GotoIf(IsBigInt(CAST(input)), &if_bigint);
var_result = CAST(CallRuntime(Runtime::kToBigInt, context, input)); var_result = CAST(CallRuntime(Runtime::kToBigInt, context, input));
Goto(&done); Goto(&done);
@ -6420,7 +6460,7 @@ TNode<String> CodeStubAssembler::ToString_Inline(SloppyTNode<Context> context,
Label stub_call(this, Label::kDeferred), out(this); Label stub_call(this, Label::kDeferred), out(this);
GotoIf(TaggedIsSmi(input), &stub_call); GotoIf(TaggedIsSmi(input), &stub_call);
Branch(IsString(input), &out, &stub_call); Branch(IsString(CAST(input)), &out, &stub_call);
BIND(&stub_call); BIND(&stub_call);
var_result.Bind(CallBuiltin(Builtins::kToString, context, input)); 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. // Check if {arg} is a HeapNumber.
Label if_argisheapnumber(this), Label if_argisheapnumber(this),
if_argisnotheapnumber(this, Label::kDeferred); if_argisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumber(arg), &if_argisheapnumber, &if_argisnotheapnumber); Branch(IsHeapNumber(CAST(arg)), &if_argisheapnumber,
&if_argisnotheapnumber);
BIND(&if_argisheapnumber); BIND(&if_argisheapnumber);
{ {

View File

@ -26,11 +26,12 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
V(AccessorInfoMap, accessor_info_map, AccessorInfoMap) \ V(AccessorInfoMap, accessor_info_map, AccessorInfoMap) \
V(AccessorPairMap, accessor_pair_map, AccessorPairMap) \ V(AccessorPairMap, accessor_pair_map, AccessorPairMap) \
V(AllocationSiteMap, allocation_site_map, AllocationSiteMap) \ V(AllocationSiteMap, allocation_site_map, AllocationSiteMap) \
V(ArraySpeciesProtector, array_species_protector, ArraySpeciesProtector) \
V(BooleanMap, boolean_map, BooleanMap) \ V(BooleanMap, boolean_map, BooleanMap) \
V(CodeMap, code_map, CodeMap) \ V(CodeMap, code_map, CodeMap) \
V(EmptyFixedArray, empty_fixed_array, EmptyFixedArray) \
V(EmptyPropertyDictionary, empty_property_dictionary, \ V(EmptyPropertyDictionary, empty_property_dictionary, \
EmptyPropertyDictionary) \ EmptyPropertyDictionary) \
V(EmptyFixedArray, empty_fixed_array, EmptyFixedArray) \
V(EmptySlowElementDictionary, empty_slow_element_dictionary, \ V(EmptySlowElementDictionary, empty_slow_element_dictionary, \
EmptySlowElementDictionary) \ EmptySlowElementDictionary) \
V(empty_string, empty_string, EmptyString) \ V(empty_string, empty_string, EmptyString) \
@ -55,12 +56,10 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
V(NoClosuresCellMap, no_closures_cell_map, NoClosuresCellMap) \ V(NoClosuresCellMap, no_closures_cell_map, NoClosuresCellMap) \
V(NullValue, null_value, Null) \ V(NullValue, null_value, Null) \
V(OneClosureCellMap, one_closure_cell_map, OneClosureCellMap) \ 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, \ V(PromiseSpeciesProtector, promise_species_protector, \
PromiseSpeciesProtector) \ PromiseSpeciesProtector) \
V(prototype_string, prototype_string, PrototypeString) \
V(SharedFunctionInfoMap, shared_function_info_map, SharedFunctionInfoMap) \
V(StoreHandler0Map, store_handler0_map, StoreHandler0Map) \ V(StoreHandler0Map, store_handler0_map, StoreHandler0Map) \
V(SymbolMap, symbol_map, SymbolMap) \ V(SymbolMap, symbol_map, SymbolMap) \
V(TheHoleValue, the_hole_value, TheHole) \ V(TheHoleValue, the_hole_value, TheHole) \
@ -68,9 +67,10 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
V(TrueValue, true_value, True) \ V(TrueValue, true_value, True) \
V(Tuple2Map, tuple2_map, Tuple2Map) \ V(Tuple2Map, tuple2_map, Tuple2Map) \
V(Tuple3Map, tuple3_map, Tuple3Map) \ V(Tuple3Map, tuple3_map, Tuple3Map) \
V(TypedArraySpeciesProtector, typed_array_species_protector, \
TypedArraySpeciesProtector) \
V(UndefinedValue, undefined_value, Undefined) \ V(UndefinedValue, undefined_value, Undefined) \
V(WeakCellMap, weak_cell_map, WeakCellMap) \ V(WeakCellMap, weak_cell_map, WeakCellMap)
V(SharedFunctionInfoMap, shared_function_info_map, SharedFunctionInfoMap)
// Returned from IteratorBuiltinsAssembler::GetIterator(). Struct is declared // Returned from IteratorBuiltinsAssembler::GetIterator(). Struct is declared
// here to simplify use in other generated builtins. // 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) { TNode<JSArray> TaggedToJSArray(TNode<Object> value, Label* fail) {
GotoIfNot(IsJSArray(value), fail); GotoIf(TaggedIsSmi(value), fail);
return UncheckedCast<JSArray>(value); 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); GotoIf(TaggedIsSmi(value), fail);
TNode<HeapObject> result = UncheckedCast<HeapObject>(value); TNode<HeapObject> result = UncheckedCast<HeapObject>(value);
GotoIfNot(IsCallableMap(LoadMap(result)), fail); GotoIfNot(IsCallable(result), fail);
return result; return CAST(result);
} }
Node* MatchesParameterMode(Node* value, ParameterMode mode); Node* MatchesParameterMode(Node* value, ParameterMode mode);
@ -217,8 +219,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST) HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST)
#undef HEAP_CONSTANT_TEST #undef HEAP_CONSTANT_TEST
Node* HashSeed(); TNode<Int32T> HashSeed();
Node* StaleRegisterConstant();
Node* IntPtrOrSmiConstant(int value, ParameterMode mode); 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> WordIsWordAligned(SloppyTNode<WordT> word);
TNode<BoolT> WordIsPowerOfTwo(SloppyTNode<IntPtrT> value); TNode<BoolT> WordIsPowerOfTwo(SloppyTNode<IntPtrT> value);
Node* IsNotTheHole(Node* value) { return Word32BinaryNot(IsTheHole(value)); }
#if DEBUG #if DEBUG
void Bind(Label* label, AssemblerDebugInfo debug_info); void Bind(Label* label, AssemblerDebugInfo debug_info);
#else #else
@ -545,7 +544,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Load a SMI and untag it. // Load a SMI and untag it.
TNode<IntPtrT> LoadAndUntagSmi(Node* base, int index); TNode<IntPtrT> LoadAndUntagSmi(Node* base, int index);
// Load a SMI root, untag it, and convert to Word32. // 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, TNode<MaybeObject> LoadMaybeWeakObjectField(SloppyTNode<HeapObject> object,
int offset) { int offset) {
@ -605,7 +604,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Load the instance descriptors of a map. // Load the instance descriptors of a map.
TNode<DescriptorArray> LoadMapDescriptors(SloppyTNode<Map> map); TNode<DescriptorArray> LoadMapDescriptors(SloppyTNode<Map> map);
// Load the prototype of a 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 // Load the prototype info of a map. The result has to be checked if it is a
// prototype info object or not. // prototype info object or not.
TNode<PrototypeInfo> LoadMapPrototypeInfo(SloppyTNode<Map> map, 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. // Load an array element from a FixedArray.
TNode<Object> LoadFixedArrayElement( 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, ParameterMode parameter_mode = INTPTR_PARAMETERS,
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe); LoadSensitivity needs_poisoning = LoadSensitivity::kSafe);
TNode<Object> LoadFixedArrayElement(SloppyTNode<Object> object, TNode<Object> LoadFixedArrayElement(SloppyTNode<HeapObject> object,
TNode<IntPtrT> index, TNode<IntPtrT> index,
LoadSensitivity needs_poisoning) { LoadSensitivity needs_poisoning) {
return LoadFixedArrayElement(object, index, 0, INTPTR_PARAMETERS, return LoadFixedArrayElement(object, index, 0, INTPTR_PARAMETERS,
@ -692,7 +691,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
} }
TNode<Object> LoadFixedArrayElement( TNode<Object> LoadFixedArrayElement(
SloppyTNode<Object> object, TNode<IntPtrT> index, SloppyTNode<HeapObject> object, TNode<IntPtrT> index,
int additional_offset = 0, int additional_offset = 0,
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) { LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
return LoadFixedArrayElement(object, index, additional_offset, return LoadFixedArrayElement(object, index, additional_offset,
@ -700,30 +699,31 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
} }
TNode<Object> LoadFixedArrayElement( 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) { LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
return LoadFixedArrayElement(object, IntPtrConstant(index), return LoadFixedArrayElement(object, IntPtrConstant(index),
additional_offset, INTPTR_PARAMETERS, additional_offset, INTPTR_PARAMETERS,
needs_poisoning); 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); return LoadFixedArrayElement(object, index, 0, SMI_PARAMETERS);
} }
// Load an array element from a FixedArray / WeakFixedArray, untag it and // Load an array element from a FixedArray / WeakFixedArray, untag it and
// return it as Word32. // return it as Word32.
TNode<Int32T> LoadAndUntagToWord32ArrayElement( 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, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS); ParameterMode parameter_mode = INTPTR_PARAMETERS);
// Load an array element from a FixedArray, untag it and return it as Word32. // Load an array element from a FixedArray, untag it and return it as Word32.
TNode<Int32T> LoadAndUntagToWord32FixedArrayElement( 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); ParameterMode parameter_mode = INTPTR_PARAMETERS);
TNode<Int32T> LoadAndUntagToWord32FixedArrayElement( TNode<Int32T> LoadAndUntagToWord32FixedArrayElement(
SloppyTNode<Object> object, int index, int additional_offset = 0) { SloppyTNode<HeapObject> object, int index, int additional_offset = 0) {
return LoadAndUntagToWord32FixedArrayElement( return LoadAndUntagToWord32FixedArrayElement(
object, IntPtrConstant(index), additional_offset, INTPTR_PARAMETERS); 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 // Check whether the map is for an object with special properties, such as a
// JSProxy or an object with interceptors. // JSProxy or an object with interceptors.
TNode<BoolT> InstanceTypeEqual(SloppyTNode<Int32T> instance_type, int type); TNode<BoolT> InstanceTypeEqual(SloppyTNode<Int32T> instance_type, int type);
Node* IsAccessorInfo(Node* object); TNode<BoolT> IsAccessorInfo(SloppyTNode<HeapObject> object);
Node* IsAccessorPair(Node* object); TNode<BoolT> IsAccessorPair(SloppyTNode<HeapObject> object);
Node* IsAllocationSite(Node* object); TNode<BoolT> IsAllocationSite(SloppyTNode<HeapObject> object);
Node* IsAnyHeapNumber(Node* object); TNode<BoolT> IsAnyHeapNumber(SloppyTNode<HeapObject> object);
Node* IsNoElementsProtectorCellInvalid(); TNode<BoolT> IsNoElementsProtectorCellInvalid();
Node* IsBigIntInstanceType(Node* instance_type); TNode<BoolT> IsBigIntInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsBigInt(Node* object); TNode<BoolT> IsBigInt(SloppyTNode<HeapObject> object);
Node* IsBoolean(Node* object); TNode<BoolT> IsBoolean(SloppyTNode<HeapObject> object);
Node* IsCallableMap(Node* map); TNode<BoolT> IsCallableMap(SloppyTNode<Map> map);
Node* IsCallable(Node* object); TNode<BoolT> IsCallable(SloppyTNode<HeapObject> object);
Node* IsCell(Node* object); TNode<BoolT> TaggedIsCallable(TNode<Object> object);
Node* IsCode(Node* object); TNode<BoolT> IsCell(SloppyTNode<HeapObject> object);
Node* IsConsStringInstanceType(Node* instance_type); TNode<BoolT> IsCode(SloppyTNode<HeapObject> object);
Node* IsConstructorMap(Node* map); TNode<BoolT> IsConsStringInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsConstructor(Node* object); TNode<BoolT> IsConstructorMap(SloppyTNode<Map> map);
Node* IsDeprecatedMap(Node* map); TNode<BoolT> IsConstructor(SloppyTNode<HeapObject> object);
Node* IsDictionary(Node* object); TNode<BoolT> IsDeprecatedMap(SloppyTNode<Map> map);
Node* IsExtensibleMap(Node* map); TNode<BoolT> IsDictionary(SloppyTNode<HeapObject> object);
Node* IsExternalStringInstanceType(Node* instance_type); TNode<BoolT> IsExtensibleMap(SloppyTNode<Map> map);
TNode<BoolT> IsExternalStringInstanceType(SloppyTNode<Int32T> instance_type);
TNode<BoolT> IsFastJSArray(SloppyTNode<Object> object, TNode<BoolT> IsFastJSArray(SloppyTNode<Object> object,
SloppyTNode<Context> context); SloppyTNode<Context> context);
TNode<BoolT> IsFastJSArrayWithNoCustomIteration( TNode<BoolT> IsFastJSArrayWithNoCustomIteration(
TNode<Object> object, TNode<Context> context, TNode<Object> object, TNode<Context> context,
TNode<Context> native_context); TNode<Context> native_context);
Node* IsFeedbackCell(Node* object); TNode<BoolT> IsFeedbackCell(SloppyTNode<HeapObject> object);
Node* IsFeedbackVector(Node* object); TNode<BoolT> IsFeedbackVector(SloppyTNode<HeapObject> object);
Node* IsContext(Node* object); TNode<BoolT> IsContext(SloppyTNode<HeapObject> object);
Node* IsFixedArray(Node* object); TNode<BoolT> IsFixedArray(SloppyTNode<HeapObject> object);
Node* IsFixedArraySubclass(Node* object); TNode<BoolT> IsFixedArraySubclass(SloppyTNode<HeapObject> object);
Node* IsFixedArrayWithKind(Node* object, ElementsKind kind); TNode<BoolT> IsFixedArrayWithKind(SloppyTNode<HeapObject> object,
Node* IsFixedArrayWithKindOrEmpty(Node* object, ElementsKind kind); ElementsKind kind);
Node* IsFixedDoubleArray(Node* object); TNode<BoolT> IsFixedArrayWithKindOrEmpty(SloppyTNode<HeapObject> object,
Node* IsFixedTypedArray(Node* object); ElementsKind kind);
Node* IsFunctionWithPrototypeSlotMap(Node* map); TNode<BoolT> IsFixedDoubleArray(SloppyTNode<HeapObject> object);
Node* IsHashTable(Node* object); TNode<BoolT> IsFixedTypedArray(SloppyTNode<HeapObject> object);
TNode<BoolT> IsHeapNumber(Node* object); TNode<BoolT> IsFunctionWithPrototypeSlotMap(SloppyTNode<Map> map);
Node* IsIndirectStringInstanceType(Node* instance_type); TNode<BoolT> IsHashTable(SloppyTNode<HeapObject> object);
Node* IsJSArrayBuffer(Node* object); TNode<BoolT> IsHeapNumber(SloppyTNode<HeapObject> object);
Node* IsJSArrayInstanceType(Node* instance_type); TNode<BoolT> IsIndirectStringInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsJSArrayMap(Node* object); TNode<BoolT> IsJSArrayBuffer(SloppyTNode<HeapObject> object);
Node* IsJSArray(Node* object); TNode<BoolT> IsJSArrayInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsJSArrayIterator(Node* object); TNode<BoolT> IsJSArrayMap(SloppyTNode<Map> map);
Node* IsJSAsyncGeneratorObject(Node* object); TNode<BoolT> IsJSArray(SloppyTNode<HeapObject> object);
Node* IsJSFunctionInstanceType(Node* instance_type); TNode<BoolT> IsJSArrayIterator(SloppyTNode<HeapObject> object);
Node* IsJSFunctionMap(Node* object); TNode<BoolT> IsJSAsyncGeneratorObject(SloppyTNode<HeapObject> object);
Node* IsJSFunction(Node* object); TNode<BoolT> IsJSFunctionInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsJSGeneratorObject(Node* object); TNode<BoolT> IsJSFunctionMap(SloppyTNode<Map> map);
Node* IsJSGlobalProxyInstanceType(Node* instance_type); TNode<BoolT> IsJSFunction(SloppyTNode<HeapObject> object);
Node* IsJSGlobalProxy(Node* object); TNode<BoolT> IsJSGeneratorObject(SloppyTNode<HeapObject> object);
Node* IsJSObjectInstanceType(Node* instance_type); TNode<BoolT> IsJSGlobalProxyInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsJSObjectMap(Node* map); TNode<BoolT> IsJSGlobalProxy(SloppyTNode<HeapObject> object);
Node* IsJSObject(Node* object); TNode<BoolT> IsJSObjectInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsJSPromiseMap(Node* map); TNode<BoolT> IsJSObjectMap(SloppyTNode<Map> map);
Node* IsJSPromise(Node* object); TNode<BoolT> IsJSObject(SloppyTNode<HeapObject> object);
Node* IsJSProxy(Node* object); TNode<BoolT> IsJSPromiseMap(SloppyTNode<Map> map);
Node* IsJSReceiverInstanceType(Node* instance_type); TNode<BoolT> IsJSPromise(SloppyTNode<HeapObject> object);
Node* IsJSReceiverMap(Node* map); TNode<BoolT> IsJSProxy(SloppyTNode<HeapObject> object);
Node* IsJSReceiver(Node* object); TNode<BoolT> IsJSReceiverInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsJSRegExp(Node* object); TNode<BoolT> IsJSReceiverMap(SloppyTNode<Map> map);
Node* IsJSTypedArray(Node* object); TNode<BoolT> IsJSReceiver(SloppyTNode<HeapObject> object);
Node* IsJSValueInstanceType(Node* instance_type); TNode<BoolT> IsJSRegExp(SloppyTNode<HeapObject> object);
Node* IsJSValueMap(Node* map); TNode<BoolT> IsJSTypedArray(SloppyTNode<HeapObject> object);
Node* IsJSValue(Node* object); TNode<BoolT> IsJSValueInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsMap(Node* object); TNode<BoolT> IsJSValueMap(SloppyTNode<Map> map);
Node* IsMutableHeapNumber(Node* object); TNode<BoolT> IsJSValue(SloppyTNode<HeapObject> object);
Node* IsName(Node* object); TNode<BoolT> IsMap(SloppyTNode<HeapObject> object);
Node* IsNativeContext(Node* object); TNode<BoolT> IsMutableHeapNumber(SloppyTNode<HeapObject> object);
Node* IsNullOrJSReceiver(Node* object); TNode<BoolT> IsName(SloppyTNode<HeapObject> object);
Node* IsNullOrUndefined(Node* object); TNode<BoolT> IsNativeContext(SloppyTNode<HeapObject> object);
Node* IsNumberDictionary(Node* object); TNode<BoolT> IsNullOrJSReceiver(SloppyTNode<HeapObject> object);
Node* IsOneByteStringInstanceType(Node* instance_type); TNode<BoolT> IsNullOrUndefined(SloppyTNode<Object> object);
Node* IsPrimitiveInstanceType(Node* instance_type); TNode<BoolT> IsNumberDictionary(SloppyTNode<HeapObject> object);
TNode<BoolT> IsPrivateSymbol(Node* object); TNode<BoolT> IsOneByteStringInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsPromiseCapability(Node* object); TNode<BoolT> IsPrimitiveInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsPropertyArray(Node* object); TNode<BoolT> IsPrivateSymbol(SloppyTNode<HeapObject> object);
Node* IsPropertyCell(Node* object); TNode<BoolT> IsPromiseCapability(SloppyTNode<HeapObject> object);
Node* IsPrototypeInitialArrayPrototype(Node* context, Node* map); 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, TNode<BoolT> IsPrototypeTypedArrayPrototype(SloppyTNode<Context> context,
SloppyTNode<Map> map); SloppyTNode<Map> map);
Node* IsSequentialStringInstanceType(Node* instance_type); TNode<BoolT> IsSequentialStringInstanceType(
Node* IsShortExternalStringInstanceType(Node* instance_type); SloppyTNode<Int32T> instance_type);
TNode<BoolT> IsShortExternalStringInstanceType(
SloppyTNode<Int32T> instance_type);
TNode<BoolT> IsSpecialReceiverInstanceType(TNode<Int32T> instance_type); TNode<BoolT> IsSpecialReceiverInstanceType(TNode<Int32T> instance_type);
TNode<BoolT> IsCustomElementsReceiverInstanceType( TNode<BoolT> IsCustomElementsReceiverInstanceType(
TNode<Int32T> instance_type); TNode<Int32T> instance_type);
Node* IsSpecialReceiverMap(Node* map); TNode<BoolT> IsSpecialReceiverMap(SloppyTNode<Map> map);
Node* IsStringInstanceType(Node* instance_type); TNode<BoolT> IsStringInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsString(Node* object); TNode<BoolT> IsString(SloppyTNode<HeapObject> object);
Node* IsSymbolInstanceType(Node* instance_type); TNode<BoolT> IsSymbolInstanceType(SloppyTNode<Int32T> instance_type);
Node* IsSymbol(Node* object); TNode<BoolT> IsSymbol(SloppyTNode<HeapObject> object);
Node* IsUndetectableMap(Node* map); TNode<BoolT> IsUndetectableMap(SloppyTNode<Map> map);
Node* IsWeakCell(Node* object); TNode<BoolT> IsWeakCell(SloppyTNode<HeapObject> object);
Node* IsZeroOrContext(Node* object); TNode<BoolT> IsZeroOrContext(SloppyTNode<Object> object);
Node* IsNotWeakFixedArraySubclass(Node* object); TNode<BoolT> IsNotWeakFixedArraySubclass(SloppyTNode<HeapObject> object);
inline Node* IsSharedFunctionInfo(Node* object) { inline Node* IsSharedFunctionInfo(Node* object) {
return IsSharedFunctionInfoMap(LoadMap(object)); return IsSharedFunctionInfoMap(LoadMap(object));
} }
Node* IsPromiseResolveProtectorCellInvalid(); TNode<BoolT> IsPromiseResolveProtectorCellInvalid();
Node* IsPromiseThenProtectorCellInvalid(); TNode<BoolT> IsPromiseThenProtectorCellInvalid();
Node* IsArraySpeciesProtectorCellInvalid(); TNode<BoolT> IsArraySpeciesProtectorCellInvalid();
Node* IsTypedArraySpeciesProtectorCellInvalid(); TNode<BoolT> IsTypedArraySpeciesProtectorCellInvalid();
Node* IsPromiseSpeciesProtectorCellInvalid(); TNode<BoolT> IsPromiseSpeciesProtectorCellInvalid();
// True iff |object| is a Smi or a HeapNumber. // True iff |object| is a Smi or a HeapNumber.
TNode<BoolT> IsNumber(SloppyTNode<Object> object); TNode<BoolT> IsNumber(SloppyTNode<Object> object);

View File

@ -1654,7 +1654,8 @@ Node* InterpreterAssembler::ImportRegisterFile(
Node* reg_index = IntPtrSub(IntPtrConstant(Register(0).ToOperand()), index); Node* reg_index = IntPtrSub(IntPtrConstant(Register(0).ToOperand()), index);
StoreRegister(value, reg_index); StoreRegister(value, reg_index);
StoreFixedArrayElement(array, index, StaleRegisterConstant()); StoreFixedArrayElement(array, index,
LoadRoot(Heap::kStaleRegisterRootIndex));
var_index.Bind(IntPtrAdd(index, IntPtrConstant(1))); var_index.Bind(IntPtrAdd(index, IntPtrConstant(1)));
Goto(&loop); Goto(&loop);