[cleanup] Make SFI::function_data a SYNCHRONIZED_ACCESSOR

We can use existing macros to define this getter/setter rather than hand
writing it -- as a side effect this ends up defining an Isolate overload
of the getter which was otherwise missing.

Bug: v8:10506
Change-Id: I0bc5a3082b5ed0416c8099a94e7d2e32a2bd363f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2199350
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67798}
This commit is contained in:
Leszek Swirski 2020-05-14 13:19:14 +02:00 committed by Commit Bot
parent 555324dadb
commit 4dabba12bc
2 changed files with 2 additions and 12 deletions

View File

@ -97,6 +97,8 @@ NEVER_READ_ONLY_SPACE_IMPL(SharedFunctionInfo)
CAST_ACCESSOR(SharedFunctionInfo)
DEFINE_DEOPT_ELEMENT_ACCESSORS(SharedFunctionInfo, Object)
SYNCHRONIZED_ACCESSORS(SharedFunctionInfo, function_data, Object,
kFunctionDataOffset)
ACCESSORS(SharedFunctionInfo, name_or_scope_info, Object,
kNameOrScopeInfoOffset)
ACCESSORS(SharedFunctionInfo, script_or_debug_info, HeapObject,
@ -168,15 +170,6 @@ AbstractCode SharedFunctionInfo::abstract_code() {
}
}
Object SharedFunctionInfo::function_data() const {
return ACQUIRE_READ_FIELD(*this, kFunctionDataOffset);
}
void SharedFunctionInfo::set_function_data(Object data, WriteBarrierMode mode) {
RELEASE_WRITE_FIELD(*this, kFunctionDataOffset, data);
CONDITIONAL_WRITE_BARRIER(*this, kFunctionDataOffset, data, mode);
}
int SharedFunctionInfo::function_token_position() const {
int offset = raw_function_token_offset();
if (offset == kFunctionTokenOutOfRange) {

View File

@ -223,9 +223,6 @@ consts_misc = [
'value': 'SimpleNumberDictionaryShape::kEntrySize' },
{ 'name': 'type_JSError__JS_ERROR_TYPE', 'value': 'JS_ERROR_TYPE' },
{ 'name': 'class_SharedFunctionInfo__function_data__Object',
'value': 'SharedFunctionInfo::kFunctionDataOffset' },
];
#