Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: apply ABI-breaking API simplifications #46705

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions src/api/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {

auto* modify_code_generation_from_strings_callback =
ModifyCodeGenerationFromStrings;
if (s.flags & ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK &&
s.modify_code_generation_from_strings_callback) {
if (s.modify_code_generation_from_strings_callback != nullptr) {
modify_code_generation_from_strings_callback =
s.modify_code_generation_from_strings_callback;
}
Expand Down Expand Up @@ -382,18 +381,6 @@ Isolate* NewIsolate(std::shared_ptr<ArrayBufferAllocator> allocator,
settings);
}

Isolate* NewIsolate(ArrayBufferAllocator* allocator,
uv_loop_t* event_loop,
MultiIsolatePlatform* platform) {
return NewIsolate(allocator, event_loop, platform, nullptr);
}

Isolate* NewIsolate(std::shared_ptr<ArrayBufferAllocator> allocator,
uv_loop_t* event_loop,
MultiIsolatePlatform* platform) {
return NewIsolate(allocator, event_loop, platform, nullptr);
}

IsolateData* CreateIsolateData(
Isolate* isolate,
uv_loop_t* loop,
Expand All @@ -405,13 +392,6 @@ IsolateData* CreateIsolateData(
return new IsolateData(isolate, loop, platform, allocator, snapshot_data);
}

IsolateData* CreateIsolateData(Isolate* isolate,
uv_loop_t* loop,
MultiIsolatePlatform* platform,
ArrayBufferAllocator* allocator) {
return CreateIsolateData(isolate, loop, platform, allocator, nullptr);
}

void FreeIsolateData(IsolateData* isolate_data) {
delete isolate_data;
}
Expand Down
4 changes: 0 additions & 4 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1253,10 +1253,6 @@ int Start(int argc, char** argv) {
return static_cast<int>(StartInternal(argc, argv));
}

int Stop(Environment* env) {
return Stop(env, StopFlags::kNoFlags);
}

int Stop(Environment* env, StopFlags::Flags flags) {
env->ExitEnv(flags);
return 0;
Expand Down
34 changes: 10 additions & 24 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ NODE_EXTERN int Start(int argc, char* argv[]);

// Tear down Node.js while it is running (there are active handles
// in the loop and / or actively executing JavaScript code).
NODE_EXTERN int Stop(Environment* env);
NODE_EXTERN int Stop(Environment* env, StopFlags::Flags flags);
NODE_EXTERN int Stop(Environment* env,
StopFlags::Flags flags = StopFlags::kNoFlags);

// Set up per-process state needed to run Node.js. This will consume arguments
// from argv, fill exec_argv, and possibly add errors resulting from parsing
Expand Down Expand Up @@ -463,7 +463,7 @@ enum IsolateSettingsFlags {
DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1,
SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2,
SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3,
ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 1 << 4,
ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 0, /* legacy no-op */
};

struct IsolateSettings {
Expand Down Expand Up @@ -565,25 +565,17 @@ NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate);
// This is a convenience method equivalent to using SetIsolateCreateParams(),
// Isolate::Allocate(), MultiIsolatePlatform::RegisterIsolate(),
// Isolate::Initialize(), and SetIsolateUpForNode().
NODE_EXTERN v8::Isolate* NewIsolate(ArrayBufferAllocator* allocator,
struct uv_loop_s* event_loop,
MultiIsolatePlatform* platform = nullptr);
// TODO(addaleax): Merge with the function definition above.
NODE_EXTERN v8::Isolate* NewIsolate(ArrayBufferAllocator* allocator,
struct uv_loop_s* event_loop,
MultiIsolatePlatform* platform,
const EmbedderSnapshotData* snapshot_data,
const IsolateSettings& settings = {});
NODE_EXTERN v8::Isolate* NewIsolate(
std::shared_ptr<ArrayBufferAllocator> allocator,
ArrayBufferAllocator* allocator,
struct uv_loop_s* event_loop,
MultiIsolatePlatform* platform);
// TODO(addaleax): Merge with the function definition above.
MultiIsolatePlatform* platform,
const EmbedderSnapshotData* snapshot_data = nullptr,
const IsolateSettings& settings = {});
NODE_EXTERN v8::Isolate* NewIsolate(
std::shared_ptr<ArrayBufferAllocator> allocator,
struct uv_loop_s* event_loop,
MultiIsolatePlatform* platform,
const EmbedderSnapshotData* snapshot_data,
const EmbedderSnapshotData* snapshot_data = nullptr,
const IsolateSettings& settings = {});

// Creates a new context with Node.js-specific tweaks.
Expand All @@ -603,14 +595,8 @@ NODE_EXTERN IsolateData* CreateIsolateData(
v8::Isolate* isolate,
struct uv_loop_s* loop,
MultiIsolatePlatform* platform = nullptr,
ArrayBufferAllocator* allocator = nullptr);
// TODO(addaleax): Merge with the function definition above.
NODE_EXTERN IsolateData* CreateIsolateData(
v8::Isolate* isolate,
struct uv_loop_s* loop,
MultiIsolatePlatform* platform,
ArrayBufferAllocator* allocator,
const EmbedderSnapshotData* snapshot_data);
ArrayBufferAllocator* allocator = nullptr,
const EmbedderSnapshotData* snapshot_data = nullptr);
NODE_EXTERN void FreeIsolateData(IsolateData* isolate_data);

struct ThreadId {
Expand Down