Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8bddac

Browse files
authored
src: apply ABI-breaking API simplifications
c566a04,06bb6b4 and3aaeb30 included recentmodifications of the C++ API that had mechanisms for ABI compatibilityin place so that they would not be breaking changes.This commit removes these compatibility mechanisms.PR-URL:#46705Reviewed-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>
1 parent43c380e commite8bddac

File tree

3 files changed

+11
-49
lines changed

3 files changed

+11
-49
lines changed

‎src/api/environment.cc

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
269269

270270
auto* modify_code_generation_from_strings_callback =
271271
ModifyCodeGenerationFromStrings;
272-
if (s.flags & ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK &&
273-
s.modify_code_generation_from_strings_callback) {
272+
if (s.modify_code_generation_from_strings_callback !=nullptr) {
274273
modify_code_generation_from_strings_callback =
275274
s.modify_code_generation_from_strings_callback;
276275
}
@@ -382,18 +381,6 @@ Isolate* NewIsolate(std::shared_ptr<ArrayBufferAllocator> allocator,
382381
settings);
383382
}
384383

385-
Isolate*NewIsolate(ArrayBufferAllocator* allocator,
386-
uv_loop_t* event_loop,
387-
MultiIsolatePlatform* platform) {
388-
returnNewIsolate(allocator, event_loop, platform,nullptr);
389-
}
390-
391-
Isolate*NewIsolate(std::shared_ptr<ArrayBufferAllocator> allocator,
392-
uv_loop_t* event_loop,
393-
MultiIsolatePlatform* platform) {
394-
returnNewIsolate(allocator, event_loop, platform,nullptr);
395-
}
396-
397384
IsolateData*CreateIsolateData(
398385
Isolate* isolate,
399386
uv_loop_t* loop,
@@ -405,13 +392,6 @@ IsolateData* CreateIsolateData(
405392
returnnewIsolateData(isolate, loop, platform, allocator, snapshot_data);
406393
}
407394

408-
IsolateData*CreateIsolateData(Isolate* isolate,
409-
uv_loop_t* loop,
410-
MultiIsolatePlatform* platform,
411-
ArrayBufferAllocator* allocator) {
412-
returnCreateIsolateData(isolate, loop, platform, allocator,nullptr);
413-
}
414-
415395
voidFreeIsolateData(IsolateData* isolate_data) {
416396
delete isolate_data;
417397
}

‎src/node.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,10 +1270,6 @@ int Start(int argc, char** argv) {
12701270
returnstatic_cast<int>(StartInternal(argc, argv));
12711271
}
12721272

1273-
intStop(Environment* env) {
1274-
returnStop(env, StopFlags::kNoFlags);
1275-
}
1276-
12771273
intStop(Environment* env, StopFlags::Flags flags) {
12781274
env->ExitEnv(flags);
12791275
return0;

‎src/node.h

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ NODE_EXTERN int Start(int argc, char* argv[]);
317317

318318
// Tear down Node.js while it is running (there are active handles
319319
// in the loop and / or actively executing JavaScript code).
320-
NODE_EXTERNintStop(Environment* env);
321-
NODE_EXTERNintStop(Environment* env,StopFlags::Flags flags);
320+
NODE_EXTERNintStop(Environment* env,
321+
StopFlags::Flags flags = StopFlags::kNoFlags);
322322

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

469469
structIsolateSettings {
@@ -565,25 +565,17 @@ NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate);
565565
// This is a convenience method equivalent to using SetIsolateCreateParams(),
566566
// Isolate::Allocate(), MultiIsolatePlatform::RegisterIsolate(),
567567
// Isolate::Initialize(), and SetIsolateUpForNode().
568-
NODE_EXTERN v8::Isolate*NewIsolate(ArrayBufferAllocator* allocator,
569-
structuv_loop_s* event_loop,
570-
MultiIsolatePlatform* platform =nullptr);
571-
// TODO(addaleax): Merge with the function definition above.
572-
NODE_EXTERN v8::Isolate*NewIsolate(ArrayBufferAllocator* allocator,
573-
structuv_loop_s* event_loop,
574-
MultiIsolatePlatform* platform,
575-
const EmbedderSnapshotData* snapshot_data,
576-
const IsolateSettings& settings = {});
577568
NODE_EXTERN v8::Isolate*NewIsolate(
578-
std::shared_ptr<ArrayBufferAllocator> allocator,
569+
ArrayBufferAllocator* allocator,
579570
structuv_loop_s* event_loop,
580-
MultiIsolatePlatform* platform);
581-
// TODO(addaleax): Merge with the function definition above.
571+
MultiIsolatePlatform* platform,
572+
const EmbedderSnapshotData* snapshot_data =nullptr,
573+
const IsolateSettings& settings = {});
582574
NODE_EXTERN v8::Isolate*NewIsolate(
583575
std::shared_ptr<ArrayBufferAllocator> allocator,
584576
structuv_loop_s* event_loop,
585577
MultiIsolatePlatform* platform,
586-
const EmbedderSnapshotData* snapshot_data,
578+
const EmbedderSnapshotData* snapshot_data =nullptr,
587579
const IsolateSettings& settings = {});
588580

589581
// Creates a new context with Node.js-specific tweaks.
@@ -603,14 +595,8 @@ NODE_EXTERN IsolateData* CreateIsolateData(
603595
v8::Isolate* isolate,
604596
structuv_loop_s* loop,
605597
MultiIsolatePlatform* platform =nullptr,
606-
ArrayBufferAllocator* allocator =nullptr);
607-
// TODO(addaleax): Merge with the function definition above.
608-
NODE_EXTERN IsolateData*CreateIsolateData(
609-
v8::Isolate* isolate,
610-
structuv_loop_s* loop,
611-
MultiIsolatePlatform* platform,
612-
ArrayBufferAllocator* allocator,
613-
const EmbedderSnapshotData* snapshot_data);
598+
ArrayBufferAllocator* allocator =nullptr,
599+
const EmbedderSnapshotData* snapshot_data =nullptr);
614600
NODE_EXTERNvoidFreeIsolateData(IsolateData* isolate_data);
615601

616602
structThreadId {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp