Commit 3c2e3797 authored by ishell's avatar ishell Committed by Commit bot

[stubs] Remove CSA::AssertInstanceType() in favour of CSA_ASSERT(HasInstanceType()).

... because the latter unlike the former records meaningful position.

BUG=

Review-Url: https://codereview.chromium.org/2456193005
Cr-Commit-Position: refs/heads/master@{#40640}
parent ae249928
...@@ -1602,7 +1602,7 @@ compiler::Node* ReplaceGlobalCallableFastPath( ...@@ -1602,7 +1602,7 @@ compiler::Node* ReplaceGlobalCallableFastPath(
Node* const res_length = a->LoadJSArrayLength(res); Node* const res_length = a->LoadJSArrayLength(res);
Node* const res_elems = a->LoadElements(res); Node* const res_elems = a->LoadElements(res);
a->AssertInstanceType(res_elems, FIXED_ARRAY_TYPE); a->CSA_ASSERT(a->HasInstanceType(res_elems, FIXED_ARRAY_TYPE));
CodeStubAssembler::ParameterMode mode = CodeStubAssembler::INTPTR_PARAMETERS; CodeStubAssembler::ParameterMode mode = CodeStubAssembler::INTPTR_PARAMETERS;
Node* const num_capture_registers = a->LoadFixedArrayElement( Node* const num_capture_registers = a->LoadFixedArrayElement(
...@@ -1725,7 +1725,7 @@ compiler::Node* ReplaceGlobalCallableFastPath( ...@@ -1725,7 +1725,7 @@ compiler::Node* ReplaceGlobalCallableFastPath(
// elem must be an Array. // elem must be an Array.
// Use the apply argument as backing for global RegExp properties. // Use the apply argument as backing for global RegExp properties.
a->AssertInstanceType(elem, JS_ARRAY_TYPE); a->CSA_ASSERT(a->HasInstanceType(elem, JS_ARRAY_TYPE));
// TODO(jgruber): Remove indirection through Call->ReflectApply. // TODO(jgruber): Remove indirection through Call->ReflectApply.
Callable call_callable = CodeFactory::Call(isolate); Callable call_callable = CodeFactory::Call(isolate);
......
...@@ -1000,11 +1000,6 @@ Node* CodeStubAssembler::HasInstanceType(Node* object, ...@@ -1000,11 +1000,6 @@ Node* CodeStubAssembler::HasInstanceType(Node* object,
return Word32Equal(LoadInstanceType(object), Int32Constant(instance_type)); return Word32Equal(LoadInstanceType(object), Int32Constant(instance_type));
} }
void CodeStubAssembler::AssertInstanceType(Node* object,
InstanceType instance_type) {
CSA_ASSERT(HasInstanceType(object, instance_type));
}
Node* CodeStubAssembler::LoadProperties(Node* object) { Node* CodeStubAssembler::LoadProperties(Node* object) {
return LoadObjectField(object, JSObject::kPropertiesOffset); return LoadObjectField(object, JSObject::kPropertiesOffset);
} }
...@@ -4455,7 +4450,7 @@ Node* CodeStubAssembler::CallGetterIfAccessor(Node* value, Node* details, ...@@ -4455,7 +4450,7 @@ Node* CodeStubAssembler::CallGetterIfAccessor(Node* value, Node* details,
GotoIf(Word32Equal(LoadInstanceType(accessor_pair), GotoIf(Word32Equal(LoadInstanceType(accessor_pair),
Int32Constant(ACCESSOR_INFO_TYPE)), Int32Constant(ACCESSOR_INFO_TYPE)),
if_bailout); if_bailout);
AssertInstanceType(accessor_pair, ACCESSOR_PAIR_TYPE); CSA_ASSERT(HasInstanceType(accessor_pair, ACCESSOR_PAIR_TYPE));
Node* getter = LoadObjectField(accessor_pair, AccessorPair::kGetterOffset); Node* getter = LoadObjectField(accessor_pair, AccessorPair::kGetterOffset);
Node* getter_map = LoadMap(getter); Node* getter_map = LoadMap(getter);
Node* instance_type = LoadMapInstanceType(getter_map); Node* instance_type = LoadMapInstanceType(getter_map);
...@@ -4610,7 +4605,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map, ...@@ -4610,7 +4605,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
} }
Bind(&if_isfaststringwrapper); Bind(&if_isfaststringwrapper);
{ {
AssertInstanceType(object, JS_VALUE_TYPE); CSA_ASSERT(HasInstanceType(object, JS_VALUE_TYPE));
Node* string = LoadJSValueValue(object); Node* string = LoadJSValueValue(object);
CSA_ASSERT(IsStringInstanceType(LoadInstanceType(string))); CSA_ASSERT(IsStringInstanceType(LoadInstanceType(string)));
Node* length = LoadStringLength(string); Node* length = LoadStringLength(string);
...@@ -4619,7 +4614,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map, ...@@ -4619,7 +4614,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
} }
Bind(&if_isslowstringwrapper); Bind(&if_isslowstringwrapper);
{ {
AssertInstanceType(object, JS_VALUE_TYPE); CSA_ASSERT(HasInstanceType(object, JS_VALUE_TYPE));
Node* string = LoadJSValueValue(object); Node* string = LoadJSValueValue(object);
CSA_ASSERT(IsStringInstanceType(LoadInstanceType(string))); CSA_ASSERT(IsStringInstanceType(LoadInstanceType(string)));
Node* length = LoadStringLength(string); Node* length = LoadStringLength(string);
...@@ -6232,11 +6227,11 @@ void CodeStubAssembler::LoadGlobalIC(const LoadICParameters* p) { ...@@ -6232,11 +6227,11 @@ void CodeStubAssembler::LoadGlobalIC(const LoadICParameters* p) {
Label try_handler(this), miss(this); Label try_handler(this), miss(this);
Node* weak_cell = Node* weak_cell =
LoadFixedArrayElement(p->vector, p->slot, 0, SMI_PARAMETERS); LoadFixedArrayElement(p->vector, p->slot, 0, SMI_PARAMETERS);
AssertInstanceType(weak_cell, WEAK_CELL_TYPE); CSA_ASSERT(HasInstanceType(weak_cell, WEAK_CELL_TYPE));
// Load value or try handler case if the {weak_cell} is cleared. // Load value or try handler case if the {weak_cell} is cleared.
Node* property_cell = LoadWeakCellValue(weak_cell, &try_handler); Node* property_cell = LoadWeakCellValue(weak_cell, &try_handler);
AssertInstanceType(property_cell, PROPERTY_CELL_TYPE); CSA_ASSERT(HasInstanceType(property_cell, PROPERTY_CELL_TYPE));
Node* value = LoadObjectField(property_cell, PropertyCell::kValueOffset); Node* value = LoadObjectField(property_cell, PropertyCell::kValueOffset);
GotoIf(WordEqual(value, TheHoleConstant()), &miss); GotoIf(WordEqual(value, TheHoleConstant()), &miss);
...@@ -6250,7 +6245,7 @@ void CodeStubAssembler::LoadGlobalIC(const LoadICParameters* p) { ...@@ -6250,7 +6245,7 @@ void CodeStubAssembler::LoadGlobalIC(const LoadICParameters* p) {
&miss); &miss);
// In this case {handler} must be a Code object. // In this case {handler} must be a Code object.
AssertInstanceType(handler, CODE_TYPE); CSA_ASSERT(HasInstanceType(handler, CODE_TYPE));
LoadWithVectorDescriptor descriptor(isolate()); LoadWithVectorDescriptor descriptor(isolate());
Node* native_context = LoadNativeContext(p->context); Node* native_context = LoadNativeContext(p->context);
Node* receiver = Node* receiver =
...@@ -8722,7 +8717,7 @@ compiler::Node* CodeStubAssembler::AllocateJSArrayIterator( ...@@ -8722,7 +8717,7 @@ compiler::Node* CodeStubAssembler::AllocateJSArrayIterator(
} }
compiler::Node* CodeStubAssembler::IsDetachedBuffer(compiler::Node* buffer) { compiler::Node* CodeStubAssembler::IsDetachedBuffer(compiler::Node* buffer) {
AssertInstanceType(buffer, JS_ARRAY_BUFFER_TYPE); CSA_ASSERT(HasInstanceType(buffer, JS_ARRAY_BUFFER_TYPE));
Node* buffer_bit_field = LoadObjectField( Node* buffer_bit_field = LoadObjectField(
buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32()); buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32());
......
...@@ -247,8 +247,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -247,8 +247,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
compiler::Node* LoadInstanceType(compiler::Node* object); compiler::Node* LoadInstanceType(compiler::Node* object);
// Compare the instance the type of the object against the provided one. // Compare the instance the type of the object against the provided one.
compiler::Node* HasInstanceType(compiler::Node* object, InstanceType type); compiler::Node* HasInstanceType(compiler::Node* object, InstanceType type);
// Checks that given heap object has given instance type.
void AssertInstanceType(compiler::Node* object, InstanceType instance_type);
// Load the properties backing store of a JSObject. // Load the properties backing store of a JSObject.
compiler::Node* LoadProperties(compiler::Node* object); compiler::Node* LoadProperties(compiler::Node* object);
// Load the elements backing store of a JSObject. // Load the elements backing store of a JSObject.
......
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