-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bring in 5.1 - 5.0 abi compatibility #23
Conversation
Good work! Looking at the diff from v8.h in 5.0, there is still this ABI difference remaining: @@ -7149,7 +7323,7 @@ class Internals {
1 * kApiPointerSize + kApiIntSize;
static const int kStringResourceOffset = 3 * kApiPointerSize;
- static const int kOddballKindOffset = 4 * kApiPointerSize;
+ static const int kOddballKindOffset = 5 * kApiPointerSize;
static const int kForeignAddressOffset = kApiPointerSize; |
That should be fixed now. |
Looking at some of the other include/ files, a few more differences. These should be easy to fix however: --- a/deps/v8/include/v8-debug.h
+++ b/deps/v8/include/v8-debug.h
@@ -18,13 +18,11 @@ enum DebugEvent {
Exception = 2,
NewFunction = 3,
BeforeCompile = 4,
- AfterCompile = 5,
+ AfterCompile = 5,
CompileError = 6,
- PromiseEvent = 7,
- AsyncTaskEvent = 8,
+ AsyncTaskEvent = 7,
};
--- a/deps/v8/include/v8-platform.h
+++ b/deps/v8/include/v8-platform.h
@@ -152,9 +152,9 @@ class Platform {
*/
virtual uint64_t AddTraceEvent(
char phase, const uint8_t* category_enabled_flag, const char* name,
- uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names,
- const uint8_t* arg_types, const uint64_t* arg_values,
- unsigned int flags) {
+ const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
+ const char** arg_names, const uint8_t* arg_types,
+ const uint64_t* arg_values, unsigned int flags) {
return 0;
} |
These should now be compatible. |
JS_MESSAGE_OBJECT_TYPE, | ||
JS_DATE_TYPE, | ||
JS_OBJECT_TYPE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swapping this back around will be bad for performance, since we perform range checks on LAST_SPECIAL_RECEIVER_TYPE and LAST_CUSTOM_ELEMENTS_RECEIVER. If JS_OBJECT_TYPE falls above, all JS_OBJECT_TYPE objects (most common JavaScript object) will take the slow path for e.g., .hasOwnProperty.
I added custom checks for var o = {};
for (var i = 0; i < 10000000; i++) {
Object.assign(o, { i: i });
for (var k in o) {
if (!o.hasOwnProperty(k)) {
console.log('fail');
}
}
} I observed:
|
LAST_CUSTOM_ELEMENTS_RECEIVER)), | ||
assembler->Word32NotEqual( | ||
instance_type, assembler->Int32Constant( | ||
JS_OBJECT_TYPE))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not right. JS_SPECIAL_API_OBJECT_TYPE used to be <= LAST_CUSTOM_ELEMENTS_RECEIVER before your change, but is > after your change. JS_OBJECT_TYPE is invariant here.
I think the expression you want is:
OR (
LESS_EQUAL (instance_type, LAST_CUSTOM_ELEMENTS_RECEIVER
EQUAL(instance_type, JS_SPECIAL_API_OBJECT_TYPE))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
LGTM to me. Let's get @verwaest to review as well. |
There is now v8/v8@ea5e96f in the 5.1 branch. Do you have to make changes for that? |
LGTM as well. |
I've updated the patch to support v8/v8@ea5e96f. |
LGTM. @jeisinger PTAL as well. |
LGTM |
@matthewloring If everything is ready, could you squash the commits so I can pick them up in nodejs#7016 ? |
@targos All squashed. |
The patch does not apply cleanly on my branch |
Actually this PR needs more work. Intercepted enumerator tests are failing for me. @matthewloring I think the problem is that @targos: this is not likely to be ready before next week. |
@@ -20,7 +20,8 @@ enum DebugEvent { | |||
BeforeCompile = 4, | |||
AfterCompile = 5, | |||
CompileError = 6, | |||
AsyncTaskEvent = 7, | |||
PromiseEvent = 7, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this more closely, I think the removal of PromiseEvent
was actually an API change that is missing from the official list (/cc @natorion). I think we will have bring this back as a revert of https://codereview.chromium.org/1833563002.
@@ -223,7 +223,8 @@ inline bool PrototypeHasNoElements(Isolate* isolate, JSObject* object) { | |||
HeapObject* empty = isolate->heap()->empty_fixed_array(); | |||
while (prototype != null) { | |||
Map* map = prototype->map(); | |||
if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER) return false; | |||
if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER || | |||
map->instance_type() == JS_GLOBAL_PROXY_TYPE) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: align with the previous line.
The removal of the promise debug event is an API/ABI breaking change. https://codereview.chromium.org/1833563002
LGTM from my side. Given that that the roots list was reordered; it would be good to get signoff from @verwaest or @jeisinger as well. |
lgtm |
Launched a CI: https://ci.nodejs.org/job/node-test-commit/3684/ |
The removal of the promise debug event is an API/ABI breaking change. Ref: https://codereview.chromium.org/1833563002 Ref: ofrobots#23 PR-URL: nodejs#7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Ref: ofrobots#23 PR-URL: nodejs#7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
The removal of the promise debug event is an API/ABI breaking change. Ref: https://codereview.chromium.org/1833563002 Ref: ofrobots#23 PR-URL: #7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Ref: ofrobots#23 PR-URL: #7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Closing this as it has landed in core. |
The removal of the promise debug event is an API/ABI breaking change. Ref: https://codereview.chromium.org/1833563002 Ref: #23 PR-URL: nodejs#7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Ref: #23 PR-URL: nodejs#7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
No description provided.