mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 07:19:19 +00:00
src: apply ABI-breaking API simplifications
c566a04c86
,06bb6b42b3
and3aaeb309b3
included recent modifications of the C++ API that had mechanisms for ABI compatibility in place so that they would not be breaking changes. This commit removes these compatibility mechanisms. PR-URL: https://github.com/nodejs/node/pull/46705 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
parent
43c380e9b6
commit
e8bddac3e9
@ -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;
|
||||
}
|
||||
@ -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,
|
||||
@ -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;
|
||||
}
|
||||
|
@ -1270,10 +1270,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;
|
||||
|
34
src/node.h
34
src/node.h
@ -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
|
||||
@ -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 {
|
||||
@ -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.
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user