[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 <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49421}
This commit is contained in:
Leszek Swirski 2017-11-16 15:05:20 +00:00 committed by Commit Bot
parent 4a509b3db8
commit 024414d425
3 changed files with 5 additions and 3 deletions

View File

@ -1337,7 +1337,9 @@ Handle<SharedFunctionInfo> 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());

View File

@ -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)

View File

@ -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: