[cleanup] Remove is_constructor param from NewSFI
This param is no longer used to construct the SFI. Bug: v8:7503 Change-Id: Ic93c91ce0ad9acf84da7f382c9a170c732db7176 Reviewed-on: https://chromium-review.googlesource.com/977926 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#52205}
This commit is contained in:
parent
5fed509b9e
commit
bba9ace3f6
@ -356,27 +356,21 @@ void Bootstrapper::DetachGlobal(Handle<Context> env) {
|
||||
|
||||
namespace {
|
||||
|
||||
// Non-construct case.
|
||||
V8_NOINLINE Handle<SharedFunctionInfo> SimpleCreateSharedFunctionInfo(
|
||||
Isolate* isolate, Builtins::Name builtin_id, Handle<String> name, int len) {
|
||||
const bool kNotConstructor = false;
|
||||
Handle<SharedFunctionInfo> shared =
|
||||
isolate->factory()->NewSharedFunctionInfoForBuiltin(
|
||||
name, builtin_id, kNotConstructor, kNormalFunction);
|
||||
isolate->factory()->NewSharedFunctionInfoForBuiltin(name, builtin_id,
|
||||
kNormalFunction);
|
||||
shared->set_internal_formal_parameter_count(len);
|
||||
shared->set_length(len);
|
||||
return shared;
|
||||
}
|
||||
|
||||
// Construct case.
|
||||
V8_NOINLINE Handle<SharedFunctionInfo>
|
||||
SimpleCreateConstructorSharedFunctionInfo(Isolate* isolate,
|
||||
Builtins::Name builtin_id,
|
||||
Handle<String> name, int len) {
|
||||
const bool kIsConstructor = true;
|
||||
V8_NOINLINE Handle<SharedFunctionInfo> SimpleCreateBuiltinSharedFunctionInfo(
|
||||
Isolate* isolate, Builtins::Name builtin_id, Handle<String> name, int len) {
|
||||
Handle<SharedFunctionInfo> shared =
|
||||
isolate->factory()->NewSharedFunctionInfoForBuiltin(
|
||||
name, builtin_id, kIsConstructor, kNormalFunction);
|
||||
isolate->factory()->NewSharedFunctionInfoForBuiltin(name, builtin_id,
|
||||
kNormalFunction);
|
||||
shared->SetConstructStub(*BUILTIN_CODE(isolate, JSBuiltinsConstructStub));
|
||||
shared->set_internal_formal_parameter_count(len);
|
||||
shared->set_length(len);
|
||||
@ -2245,7 +2239,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
|
||||
}
|
||||
|
||||
{
|
||||
Handle<SharedFunctionInfo> info = SimpleCreateConstructorSharedFunctionInfo(
|
||||
Handle<SharedFunctionInfo> info = SimpleCreateBuiltinSharedFunctionInfo(
|
||||
isolate, Builtins::kPromiseGetCapabilitiesExecutor,
|
||||
factory->empty_string(), 2);
|
||||
native_context()->set_promise_get_capabilities_executor_shared_fun(*info);
|
||||
|
@ -1618,8 +1618,7 @@ Handle<JSFunction> Factory::NewFunction(const NewFunctionArgs& args) {
|
||||
Handle<Context> context(isolate()->native_context());
|
||||
Handle<Map> map = args.GetMap(isolate());
|
||||
Handle<SharedFunctionInfo> info = NewSharedFunctionInfo(
|
||||
args.name_, args.maybe_code_, args.maybe_builtin_id_,
|
||||
map->is_constructor(), kNormalFunction);
|
||||
args.name_, args.maybe_code_, args.maybe_builtin_id_, kNormalFunction);
|
||||
|
||||
// Proper language mode in shared function info will be set later.
|
||||
DCHECK(is_sloppy(info->language_mode()));
|
||||
@ -2549,7 +2548,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfoForLiteral(
|
||||
FunctionLiteral* literal, Handle<Script> script) {
|
||||
FunctionKind kind = literal->kind();
|
||||
Handle<SharedFunctionInfo> shared = NewSharedFunctionInfoForBuiltin(
|
||||
literal->name(), Builtins::kCompileLazy, IsConstructable(kind), kind);
|
||||
literal->name(), Builtins::kCompileLazy, kind);
|
||||
SharedFunctionInfo::InitFromFunctionLiteral(shared, literal);
|
||||
SharedFunctionInfo::SetScript(shared, script, false);
|
||||
return shared;
|
||||
@ -2577,22 +2576,20 @@ Handle<JSMessageObject> Factory::NewJSMessageObject(
|
||||
|
||||
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfoForApiFunction(
|
||||
MaybeHandle<String> maybe_name,
|
||||
Handle<FunctionTemplateInfo> function_template_info, bool is_constructor,
|
||||
FunctionKind kind) {
|
||||
Handle<FunctionTemplateInfo> function_template_info, FunctionKind kind) {
|
||||
return NewSharedFunctionInfo(maybe_name, function_template_info,
|
||||
Builtins::kNoBuiltinId, is_constructor, kind);
|
||||
Builtins::kNoBuiltinId, kind);
|
||||
}
|
||||
|
||||
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfoForBuiltin(
|
||||
MaybeHandle<String> maybe_name, int builtin_index, bool is_constructor,
|
||||
FunctionKind kind) {
|
||||
MaybeHandle<String> maybe_name, int builtin_index, FunctionKind kind) {
|
||||
return NewSharedFunctionInfo(maybe_name, MaybeHandle<Code>(), builtin_index,
|
||||
is_constructor, kind);
|
||||
kind);
|
||||
}
|
||||
|
||||
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
|
||||
MaybeHandle<String> maybe_name, MaybeHandle<HeapObject> maybe_function_data,
|
||||
int maybe_builtin_index, bool is_constructor, FunctionKind kind) {
|
||||
int maybe_builtin_index, FunctionKind kind) {
|
||||
// Function names are assumed to be flat elsewhere. Must flatten before
|
||||
// allocating SharedFunctionInfo to avoid GC seeing the uninitialized SFI.
|
||||
Handle<String> shared_name;
|
||||
|
@ -798,11 +798,10 @@ class V8_EXPORT_PRIVATE Factory final {
|
||||
// Allocates a new SharedFunctionInfo object.
|
||||
Handle<SharedFunctionInfo> NewSharedFunctionInfoForApiFunction(
|
||||
MaybeHandle<String> maybe_name,
|
||||
Handle<FunctionTemplateInfo> function_template_info, bool is_constructor,
|
||||
FunctionKind kind);
|
||||
Handle<FunctionTemplateInfo> function_template_info, FunctionKind kind);
|
||||
|
||||
Handle<SharedFunctionInfo> NewSharedFunctionInfoForBuiltin(
|
||||
MaybeHandle<String> name, int builtin_index, bool is_constructor,
|
||||
MaybeHandle<String> name, int builtin_index,
|
||||
FunctionKind kind = kNormalFunction);
|
||||
|
||||
Handle<SharedFunctionInfo> NewSharedFunctionInfoForLiteral(
|
||||
@ -916,8 +915,7 @@ class V8_EXPORT_PRIVATE Factory final {
|
||||
|
||||
Handle<SharedFunctionInfo> NewSharedFunctionInfo(
|
||||
MaybeHandle<String> name, MaybeHandle<HeapObject> maybe_function_data,
|
||||
int maybe_builtin_index, bool is_constructor,
|
||||
FunctionKind kind = kNormalFunction);
|
||||
int maybe_builtin_index, FunctionKind kind = kNormalFunction);
|
||||
};
|
||||
|
||||
// Utility class to simplify argument handling around JSFunction creation.
|
||||
|
@ -1219,8 +1219,8 @@ Handle<SharedFunctionInfo> FunctionTemplateInfo::GetOrCreateSharedFunctionInfo(
|
||||
function_kind = kNormalFunction;
|
||||
}
|
||||
Handle<SharedFunctionInfo> result =
|
||||
isolate->factory()->NewSharedFunctionInfoForApiFunction(
|
||||
name_string, info, is_constructor, function_kind);
|
||||
isolate->factory()->NewSharedFunctionInfoForApiFunction(name_string, info,
|
||||
function_kind);
|
||||
if (is_constructor) {
|
||||
result->SetConstructStub(*BUILTIN_CODE(isolate, JSConstructStubApi));
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ Handle<FeedbackVector> NewFeedbackVector(Isolate* isolate, Spec* spec) {
|
||||
Handle<FeedbackMetadata> metadata = FeedbackMetadata::New(isolate, spec);
|
||||
Handle<SharedFunctionInfo> shared =
|
||||
isolate->factory()->NewSharedFunctionInfoForBuiltin(
|
||||
isolate->factory()->empty_string(), Builtins::kIllegal, false);
|
||||
isolate->factory()->empty_string(), Builtins::kIllegal);
|
||||
shared->set_feedback_metadata(*metadata);
|
||||
return FeedbackVector::New(isolate, shared);
|
||||
}
|
||||
|
@ -1521,8 +1521,7 @@ TEST(ReconfigureDataFieldAttribute_DataConstantToDataFieldAfterTargetMap) {
|
||||
Handle<Map> sloppy_map =
|
||||
Map::CopyInitialMap(isolate->sloppy_function_map());
|
||||
Handle<SharedFunctionInfo> info =
|
||||
factory->NewSharedFunctionInfoForBuiltin(
|
||||
name, Builtins::kIllegal, sloppy_map->is_constructor());
|
||||
factory->NewSharedFunctionInfoForBuiltin(name, Builtins::kIllegal);
|
||||
function_type_ = FieldType::Class(sloppy_map, isolate);
|
||||
CHECK(sloppy_map->is_stable());
|
||||
|
||||
@ -2660,8 +2659,8 @@ TEST(TransitionDataConstantToAnotherDataConstant) {
|
||||
Factory* factory = isolate->factory();
|
||||
Handle<String> name = factory->empty_string();
|
||||
Handle<Map> sloppy_map = Map::CopyInitialMap(isolate->sloppy_function_map());
|
||||
Handle<SharedFunctionInfo> info = factory->NewSharedFunctionInfoForBuiltin(
|
||||
name, Builtins::kIllegal, sloppy_map->is_constructor());
|
||||
Handle<SharedFunctionInfo> info =
|
||||
factory->NewSharedFunctionInfoForBuiltin(name, Builtins::kIllegal);
|
||||
Handle<FieldType> function_type = FieldType::Class(sloppy_map, isolate);
|
||||
CHECK(sloppy_map->is_stable());
|
||||
|
||||
|
@ -106,7 +106,7 @@ class JSCallReducerTest : public TypedGraphTest {
|
||||
Handle<FeedbackMetadata> metadata = FeedbackMetadata::New(isolate(), &spec);
|
||||
Handle<SharedFunctionInfo> shared =
|
||||
isolate()->factory()->NewSharedFunctionInfoForBuiltin(
|
||||
isolate()->factory()->empty_string(), Builtins::kIllegal, false);
|
||||
isolate()->factory()->empty_string(), Builtins::kIllegal);
|
||||
shared->set_feedback_metadata(*metadata);
|
||||
Handle<FeedbackVector> vector = FeedbackVector::New(isolate(), shared);
|
||||
VectorSlotPair feedback(vector, FeedbackSlot(0));
|
||||
|
@ -37,7 +37,7 @@ Handle<SharedFunctionInfo> CreateSharedFunctionInfo(
|
||||
Handle<SharedFunctionInfo> shared =
|
||||
isolate->factory()->NewSharedFunctionInfoForBuiltin(
|
||||
isolate->factory()->NewStringFromAsciiChecked("f"),
|
||||
Builtins::kCompileLazy, false);
|
||||
Builtins::kCompileLazy);
|
||||
shared->set_raw_end_position(source->length());
|
||||
shared->set_outer_scope_info(ScopeInfo::Empty(isolate));
|
||||
shared->set_function_literal_id(1);
|
||||
|
Loading…
Reference in New Issue
Block a user