Commit 5665d835 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

Reland "[compiler] Remove unused holder parameter from IF_ACCESS_FROM_HEAP(_C)"

This is a reland of ad68de6f

Reason for reland: Reverted since another CL got reverted. This cleanup
is independent though and can be relanded.

Original changes description:
> [compiler] Remove unused holder parameter from IF_ACCESS_FROM_HEAP(_C)
>
> Bug: v8:7790
> Change-Id: I44849f45d1049b8a3c794dd0558b734c1e7061fd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2362919
> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69482}

Bug: v8:7790
Change-Id: Ib650ef1701168be7a910ff51e30a90e239d5f5c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2366774
Auto-Submit: Santiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69496}
parent 41d2e5c9
...@@ -3255,7 +3255,7 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) { ...@@ -3255,7 +3255,7 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) {
#define DIRECT_HEAP_ACCESSOR_C(holder, result, name) \ #define DIRECT_HEAP_ACCESSOR_C(holder, result, name) \
result holder##Ref::name() const { return object()->name(); } result holder##Ref::name() const { return object()->name(); }
#define IF_ACCESS_FROM_HEAP_C(holder, name) \ #define IF_ACCESS_FROM_HEAP_C(name) \
if (data_->should_access_heap()) { \ if (data_->should_access_heap()) { \
CHECK(broker()->mode() == JSHeapBroker::kDisabled || \ CHECK(broker()->mode() == JSHeapBroker::kDisabled || \
ReadOnlyHeap::Contains(HeapObject::cast(*object()))); \ ReadOnlyHeap::Contains(HeapObject::cast(*object()))); \
...@@ -3266,7 +3266,7 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) { ...@@ -3266,7 +3266,7 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) {
return object()->name(); \ return object()->name(); \
} }
#define IF_ACCESS_FROM_HEAP(holder, result, name) \ #define IF_ACCESS_FROM_HEAP(result, name) \
if (data_->kind() == ObjectDataKind::kUnserializedHeapObject) { \ if (data_->kind() == ObjectDataKind::kUnserializedHeapObject) { \
AllowHandleAllocationIf handle_allocation(data_->kind(), \ AllowHandleAllocationIf handle_allocation(data_->kind(), \
broker()->mode()); \ broker()->mode()); \
...@@ -3285,7 +3285,7 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) { ...@@ -3285,7 +3285,7 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) {
// either looks into the handle or into the serialized data. // either looks into the handle or into the serialized data.
#define BIMODAL_ACCESSOR(holder, result, name) \ #define BIMODAL_ACCESSOR(holder, result, name) \
result##Ref holder##Ref::name() const { \ result##Ref holder##Ref::name() const { \
IF_ACCESS_FROM_HEAP(holder, result, name); \ IF_ACCESS_FROM_HEAP(result, name); \
ObjectData* data = ObjectRef::data()->As##holder()->name(); \ ObjectData* data = ObjectRef::data()->As##holder()->name(); \
if (data->kind() == ObjectDataKind::kUnserializedHeapObject) { \ if (data->kind() == ObjectDataKind::kUnserializedHeapObject) { \
return result##Ref(broker(), data->object()); \ return result##Ref(broker(), data->object()); \
...@@ -3297,14 +3297,14 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) { ...@@ -3297,14 +3297,14 @@ Handle<Object> JSHeapBroker::GetRootHandle(Object object) {
// Like above except that the result type is not an XYZRef. // Like above except that the result type is not an XYZRef.
#define BIMODAL_ACCESSOR_C(holder, result, name) \ #define BIMODAL_ACCESSOR_C(holder, result, name) \
result holder##Ref::name() const { \ result holder##Ref::name() const { \
IF_ACCESS_FROM_HEAP_C(holder, name); \ IF_ACCESS_FROM_HEAP_C(name); \
return ObjectRef::data()->As##holder()->name(); \ return ObjectRef::data()->As##holder()->name(); \
} }
// Like above but for BitFields. // Like above but for BitFields.
#define BIMODAL_ACCESSOR_B(holder, field, name, BitField) \ #define BIMODAL_ACCESSOR_B(holder, field, name, BitField) \
typename BitField::FieldType holder##Ref::name() const { \ typename BitField::FieldType holder##Ref::name() const { \
IF_ACCESS_FROM_HEAP_C(holder, name); \ IF_ACCESS_FROM_HEAP_C(name); \
return BitField::decode(ObjectRef::data()->As##holder()->field()); \ return BitField::decode(ObjectRef::data()->As##holder()->field()); \
} }
...@@ -3574,50 +3574,50 @@ void* JSTypedArrayRef::data_ptr() const { ...@@ -3574,50 +3574,50 @@ void* JSTypedArrayRef::data_ptr() const {
} }
bool MapRef::IsInobjectSlackTrackingInProgress() const { bool MapRef::IsInobjectSlackTrackingInProgress() const {
IF_ACCESS_FROM_HEAP_C(Map, IsInobjectSlackTrackingInProgress); IF_ACCESS_FROM_HEAP_C(IsInobjectSlackTrackingInProgress);
return Map::Bits3::ConstructionCounterBits::decode( return Map::Bits3::ConstructionCounterBits::decode(
data()->AsMap()->bit_field3()) != Map::kNoSlackTracking; data()->AsMap()->bit_field3()) != Map::kNoSlackTracking;
} }
int MapRef::constructor_function_index() const { int MapRef::constructor_function_index() const {
IF_ACCESS_FROM_HEAP_C(Map, GetConstructorFunctionIndex); IF_ACCESS_FROM_HEAP_C(GetConstructorFunctionIndex);
CHECK(IsPrimitiveMap()); CHECK(IsPrimitiveMap());
return data()->AsMap()->constructor_function_index(); return data()->AsMap()->constructor_function_index();
} }
bool MapRef::is_stable() const { bool MapRef::is_stable() const {
IF_ACCESS_FROM_HEAP_C(Map, is_stable); IF_ACCESS_FROM_HEAP_C(is_stable);
return !Map::Bits3::IsUnstableBit::decode(data()->AsMap()->bit_field3()); return !Map::Bits3::IsUnstableBit::decode(data()->AsMap()->bit_field3());
} }
bool MapRef::CanBeDeprecated() const { bool MapRef::CanBeDeprecated() const {
IF_ACCESS_FROM_HEAP_C(Map, CanBeDeprecated); IF_ACCESS_FROM_HEAP_C(CanBeDeprecated);
CHECK_GT(NumberOfOwnDescriptors(), 0); CHECK_GT(NumberOfOwnDescriptors(), 0);
return data()->AsMap()->can_be_deprecated(); return data()->AsMap()->can_be_deprecated();
} }
bool MapRef::CanTransition() const { bool MapRef::CanTransition() const {
IF_ACCESS_FROM_HEAP_C(Map, CanTransition); IF_ACCESS_FROM_HEAP_C(CanTransition);
return data()->AsMap()->can_transition(); return data()->AsMap()->can_transition();
} }
int MapRef::GetInObjectPropertiesStartInWords() const { int MapRef::GetInObjectPropertiesStartInWords() const {
IF_ACCESS_FROM_HEAP_C(Map, GetInObjectPropertiesStartInWords); IF_ACCESS_FROM_HEAP_C(GetInObjectPropertiesStartInWords);
return data()->AsMap()->in_object_properties_start_in_words(); return data()->AsMap()->in_object_properties_start_in_words();
} }
int MapRef::GetInObjectProperties() const { int MapRef::GetInObjectProperties() const {
IF_ACCESS_FROM_HEAP_C(Map, GetInObjectProperties); IF_ACCESS_FROM_HEAP_C(GetInObjectProperties);
return data()->AsMap()->in_object_properties(); return data()->AsMap()->in_object_properties();
} }
int ScopeInfoRef::ContextLength() const { int ScopeInfoRef::ContextLength() const {
IF_ACCESS_FROM_HEAP_C(ScopeInfo, ContextLength); IF_ACCESS_FROM_HEAP_C(ContextLength);
return data()->AsScopeInfo()->context_length(); return data()->AsScopeInfo()->context_length();
} }
int ScopeInfoRef::Flags() const { int ScopeInfoRef::Flags() const {
IF_ACCESS_FROM_HEAP_C(ScopeInfo, Flags); IF_ACCESS_FROM_HEAP_C(Flags);
return data()->AsScopeInfo()->flags(); return data()->AsScopeInfo()->flags();
} }
...@@ -3626,7 +3626,7 @@ bool ScopeInfoRef::HasContextExtension() const { ...@@ -3626,7 +3626,7 @@ bool ScopeInfoRef::HasContextExtension() const {
} }
bool ScopeInfoRef::HasOuterScopeInfo() const { bool ScopeInfoRef::HasOuterScopeInfo() const {
IF_ACCESS_FROM_HEAP_C(ScopeInfo, HasOuterScopeInfo); IF_ACCESS_FROM_HEAP_C(HasOuterScopeInfo);
return data()->AsScopeInfo()->has_outer_scope_info(); return data()->AsScopeInfo()->has_outer_scope_info();
} }
...@@ -3649,7 +3649,7 @@ void ScopeInfoRef::SerializeScopeInfoChain() { ...@@ -3649,7 +3649,7 @@ void ScopeInfoRef::SerializeScopeInfoChain() {
} }
bool StringRef::IsExternalString() const { bool StringRef::IsExternalString() const {
IF_ACCESS_FROM_HEAP_C(String, IsExternalString); IF_ACCESS_FROM_HEAP_C(IsExternalString);
return data()->AsString()->is_external_string(); return data()->AsString()->is_external_string();
} }
...@@ -3675,7 +3675,7 @@ const CFunctionInfo* FunctionTemplateInfoRef::c_signature() const { ...@@ -3675,7 +3675,7 @@ const CFunctionInfo* FunctionTemplateInfoRef::c_signature() const {
} }
bool StringRef::IsSeqString() const { bool StringRef::IsSeqString() const {
IF_ACCESS_FROM_HEAP_C(String, IsSeqString); IF_ACCESS_FROM_HEAP_C(IsSeqString);
return data()->AsString()->is_seq_string(); return data()->AsString()->is_seq_string();
} }
...@@ -3866,12 +3866,12 @@ base::Optional<ObjectRef> JSArrayRef::GetOwnCowElement( ...@@ -3866,12 +3866,12 @@ base::Optional<ObjectRef> JSArrayRef::GetOwnCowElement(
} }
double HeapNumberRef::value() const { double HeapNumberRef::value() const {
IF_ACCESS_FROM_HEAP_C(HeapNumber, value); IF_ACCESS_FROM_HEAP_C(value);
return data()->AsHeapNumber()->value(); return data()->AsHeapNumber()->value();
} }
uint64_t BigIntRef::AsUint64() const { uint64_t BigIntRef::AsUint64() const {
IF_ACCESS_FROM_HEAP_C(BigInt, AsUint64); IF_ACCESS_FROM_HEAP_C(AsUint64);
return data()->AsBigInt()->AsUint64(); return data()->AsBigInt()->AsUint64();
} }
...@@ -4024,7 +4024,7 @@ FixedArrayBaseRef JSObjectRef::elements() const { ...@@ -4024,7 +4024,7 @@ FixedArrayBaseRef JSObjectRef::elements() const {
} }
int FixedArrayBaseRef::length() const { int FixedArrayBaseRef::length() const {
IF_ACCESS_FROM_HEAP_C(FixedArrayBase, length); IF_ACCESS_FROM_HEAP_C(length);
return data()->AsFixedArrayBase()->length(); return data()->AsFixedArrayBase()->length();
} }
...@@ -4066,28 +4066,28 @@ bool NameRef::IsUniqueName() const { ...@@ -4066,28 +4066,28 @@ bool NameRef::IsUniqueName() const {
} }
ObjectRef JSRegExpRef::data() const { ObjectRef JSRegExpRef::data() const {
IF_ACCESS_FROM_HEAP(JSRegExp, Object, data); IF_ACCESS_FROM_HEAP(Object, data);
return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->data()); return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->data());
} }
ObjectRef JSRegExpRef::flags() const { ObjectRef JSRegExpRef::flags() const {
IF_ACCESS_FROM_HEAP(JSRegExp, Object, flags); IF_ACCESS_FROM_HEAP(Object, flags);
return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->flags()); return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->flags());
} }
ObjectRef JSRegExpRef::last_index() const { ObjectRef JSRegExpRef::last_index() const {
IF_ACCESS_FROM_HEAP(JSRegExp, Object, last_index); IF_ACCESS_FROM_HEAP(Object, last_index);
return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->last_index()); return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->last_index());
} }
ObjectRef JSRegExpRef::raw_properties_or_hash() const { ObjectRef JSRegExpRef::raw_properties_or_hash() const {
IF_ACCESS_FROM_HEAP(JSRegExp, Object, raw_properties_or_hash); IF_ACCESS_FROM_HEAP(Object, raw_properties_or_hash);
return ObjectRef(broker(), return ObjectRef(broker(),
ObjectRef::data()->AsJSRegExp()->raw_properties_or_hash()); ObjectRef::data()->AsJSRegExp()->raw_properties_or_hash());
} }
ObjectRef JSRegExpRef::source() const { ObjectRef JSRegExpRef::source() const {
IF_ACCESS_FROM_HEAP(JSRegExp, Object, source); IF_ACCESS_FROM_HEAP(Object, source);
return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->source()); return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->source());
} }
...@@ -4280,7 +4280,7 @@ SharedFunctionInfoRef::function_template_info() const { ...@@ -4280,7 +4280,7 @@ SharedFunctionInfoRef::function_template_info() const {
} }
int SharedFunctionInfoRef::context_header_size() const { int SharedFunctionInfoRef::context_header_size() const {
IF_ACCESS_FROM_HEAP_C(SharedFunctionInfo, scope_info().ContextHeaderLength); IF_ACCESS_FROM_HEAP_C(scope_info().ContextHeaderLength);
return data()->AsSharedFunctionInfo()->context_header_size(); return data()->AsSharedFunctionInfo()->context_header_size();
} }
......
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