From 024414d4250b3fa2a04de70ea0f521500904b820 Mon Sep 17 00:00:00 2001 From: Leszek Swirski Date: Thu, 16 Nov 2017 15:05:20 +0000 Subject: [PATCH] [cleanup] Make SFI::instance_class_name a String Make the accessors of SharedFunctionInfo instance_class_name take and return String rather than Object, since it's always a String anyway. Change-Id: Ic5dacccf3835550e3533356fe7ded37ea107d720 Reviewed-on: https://chromium-review.googlesource.com/774882 Reviewed-by: Ross McIlroy Commit-Queue: Leszek Swirski Cr-Commit-Position: refs/heads/master@{#49421} --- src/objects.cc | 4 +++- src/objects/shared-function-info-inl.h | 2 +- src/objects/shared-function-info.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index 221dc6ae37..7491e3193b 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -1337,7 +1337,9 @@ Handle FunctionTemplateInfo::GetOrCreateSharedFunctionInfo( } result->set_length(info->length()); - if (class_name->IsString()) result->set_instance_class_name(*class_name); + if (class_name->IsString()) { + result->set_instance_class_name(String::cast(*class_name)); + } result->set_api_func_data(*info); result->DontAdaptArguments(); DCHECK(result->IsApiFunction()); diff --git a/src/objects/shared-function-info-inl.h b/src/objects/shared-function-info-inl.h index 0f80917a35..aa6bf319e9 100644 --- a/src/objects/shared-function-info-inl.h +++ b/src/objects/shared-function-info-inl.h @@ -27,7 +27,7 @@ ACCESSORS(SharedFunctionInfo, raw_name, Object, kNameOffset) ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) ACCESSORS(SharedFunctionInfo, feedback_metadata, FeedbackMetadata, kFeedbackMetadataOffset) -ACCESSORS(SharedFunctionInfo, instance_class_name, Object, +ACCESSORS(SharedFunctionInfo, instance_class_name, String, kInstanceClassNameOffset) ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) diff --git a/src/objects/shared-function-info.h b/src/objects/shared-function-info.h index 82423c3ac6..669a47d457 100644 --- a/src/objects/shared-function-info.h +++ b/src/objects/shared-function-info.h @@ -137,7 +137,7 @@ class SharedFunctionInfo : public HeapObject { #endif // [instance class name]: class name for instances. - DECL_ACCESSORS(instance_class_name, Object) + DECL_ACCESSORS(instance_class_name, String) // [function data]: This field holds some additional data for function. // Currently it has one of: