Commit 68a58016 authored by Daniel Clifford's avatar Daniel Clifford Committed by Commit Bot

[csa] Add IsArrayProtectorCellInvalid utility method

Change-Id: I8ecca14e1d65aeed59cd55626e41f9863d58be50
Reviewed-on: https://chromium-review.googlesource.com/589431
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46955}
parent de9b0a07
......@@ -2230,10 +2230,7 @@ TF_BUILTIN(ArrayIteratorPrototypeNext, CodeStubAssembler) {
BIND(&holey_object_values);
{
// Check the array_protector cell, and take the slow path if it's invalid.
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kArrayProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
GotoIf(WordEqual(cell_value, invalid), &generic_values);
GotoIf(IsArrayProtectorCellInvalid(), &generic_values);
var_value.Bind(UndefinedConstant());
Node* value = LoadFixedArrayElement(elements, index, 0, SMI_PARAMETERS);
......@@ -2245,10 +2242,7 @@ TF_BUILTIN(ArrayIteratorPrototypeNext, CodeStubAssembler) {
BIND(&holey_double_values);
{
// Check the array_protector cell, and take the slow path if it's invalid.
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kArrayProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
GotoIf(WordEqual(cell_value, invalid), &generic_values);
GotoIf(IsArrayProtectorCellInvalid(), &generic_values);
var_value.Bind(UndefinedConstant());
Node* value = LoadFixedDoubleArrayElement(
......
......@@ -3405,6 +3405,13 @@ Node* CodeStubAssembler::IsUndetectableMap(Node* map) {
return IsSetWord32(LoadMapBitField(map), 1 << Map::kIsUndetectable);
}
Node* CodeStubAssembler::IsArrayProtectorCellInvalid() {
Node* invalid = SmiConstant(Isolate::kProtectorInvalid);
Node* cell = LoadRoot(Heap::kArrayProtectorRootIndex);
Node* cell_value = LoadObjectField(cell, PropertyCell::kValueOffset);
return WordEqual(cell_value, invalid);
}
Node* CodeStubAssembler::IsCallable(Node* object) {
return IsCallableMap(LoadMap(object));
}
......
......@@ -877,6 +877,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* IsUnseededNumberDictionary(Node* object);
Node* IsWeakCell(Node* object);
Node* IsUndetectableMap(Node* map);
Node* IsArrayProtectorCellInvalid();
// True iff |object| is a Smi or a HeapNumber.
Node* IsNumber(Node* object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment