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

deps: patch the V8 API to be forward compatible with 6.7 #19999

Closed
wants to merge 1 commit into from

Conversation

psmarshall
Copy link
Contributor

@psmarshall psmarshall commented Apr 13, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@addaleax @MylesBorins

@nodejs-github-bot nodejs-github-bot added the v8 engine Issues and PRs related to the V8 dependency. label Apr 13, 2018
@targos
Copy link
Member

targos commented Apr 13, 2018

Thanks!

Can you please:

@targos
Copy link
Member

targos commented Apr 13, 2018

Diff:

https://gist.github.com/targos/5b700e76921be024a7ea06127953cf93

Edit: to be clear, this is the output of git diff -- deps/v8/include between this PR and #19989

@targos
Copy link
Member

targos commented Apr 13, 2018

Is this part OK?

https://gist.github.com/targos/5b700e76921be024a7ea06127953cf93#file-v8-6-7-abi-patch-diff-L347-L364

@@ -6193,24 +6263,6 @@ typedef void* (*CreateHistogramCallback)(const char* name,
 
 typedef void (*AddHistogramSampleCallback)(void* histogram, int sample);
 
-// --- Memory Allocation Callback ---
-enum ObjectSpace {
-  kObjectSpaceNewSpace = 1 << 0,
-  kObjectSpaceOldSpace = 1 << 1,
-  kObjectSpaceCodeSpace = 1 << 2,
-  kObjectSpaceMapSpace = 1 << 3,
-  kObjectSpaceLoSpace = 1 << 4,
-  kObjectSpaceAll = kObjectSpaceNewSpace | kObjectSpaceOldSpace |
-                    kObjectSpaceCodeSpace | kObjectSpaceMapSpace |
-                    kObjectSpaceLoSpace
-};
-
-  enum AllocationAction {
-    kAllocationActionAllocate = 1 << 0,
-    kAllocationActionFree = 1 << 1,
-    kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
-  };
-
 // --- Enter/Leave Script Callback ---
 typedef void (*BeforeCallEnteredCallback)(Isolate*);
 typedef void (*CallCompletedCallback)(Isolate*);

@psmarshall
Copy link
Contributor Author

I amended the commit with the version number increments.

I think it's OK to leave the ObjectSpace and AllocationAction enums. They aren't actually used in the API, and if any embedder did use them, they are essentially just integers anyway, so I guess it won't cause breakage. The reason I left them is because they are actually still used internally somewhere in 6.6, so I would need to backport the removal CL rather than just delete them from the API.

@bnoordhuis
Copy link
Member

In file included from ../deps/v8/src/allocation.h:8:
../deps/v8/include/v8-platform.h:339:5: error: use of undeclared identifier 'abort'
    abort();
    ^
../deps/v8/include/v8-platform.h:364:5: error: use of undeclared identifier 'abort'
    abort();

Probably missing an #include <cstdlib>.

@psmarshall
Copy link
Contributor Author

Updated it with the include, thanks

@bnoordhuis
Copy link
Member

@targos targos added the semver-major PRs that contain breaking changes and should be released in the next major version. label Apr 13, 2018
virtual size_t NumberOfAvailableBackgroundThreads() { return 0; }
V8_DEPRECATE_SOON(
"NumberOfAvailableBackgroundThreads() is deprecated, use "
"NumberOfAvailableBackgroundThreads() instead.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to say NumberOfWorkerThreads(), right? Not that it matters much, but the message might be … confusing? 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This typo is still present in V8 master, so should be fixed there first.

@MylesBorins
Copy link
Contributor

Do we want to land this on master or on 10.x-staging?

@targos
Copy link
Member

targos commented Apr 14, 2018

Why not on master?

@addaleax
Copy link
Member

The last time around we didn’t land it on master, but I agree that I don’t really see a problem with doing so.

@jasnell
Copy link
Member

jasnell commented Apr 14, 2018

If this is going directly to 10.x-staging, please allow me to land it as part of the next round of updates that I make to that. If it lands in master, I'll cherry-pick it back.

@jasnell jasnell added this to the 10.0.0 milestone Apr 14, 2018
Copy link
Member

@hashseed hashseed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Peter!

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 15, 2018
@targos
Copy link
Member

targos commented Apr 17, 2018

@targos
Copy link
Member

targos commented Apr 17, 2018

CI is green.

I'm going to land this on master if there are no objections. That way we can immediately work on replacing our usage of deprecated APIs

@jasnell
Copy link
Member

jasnell commented Apr 17, 2018

@targos ... if you can, please land this today before noon pacific so I can make sure it is in today's 10.0.0 test build.

@targos
Copy link
Member

targos commented Apr 17, 2018

This has to land after #20105. I won't be around soon enough to do it myself.

@MylesBorins
Copy link
Contributor

landed in 8bcefd0
Thanks @psmarshall

MylesBorins pushed a commit that referenced this pull request Apr 17, 2018
PR-URL: #19999
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
jasnell pushed a commit that referenced this pull request Apr 19, 2018
PR-URL: #19999
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. semver-major PRs that contain breaking changes and should be released in the next major version. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants