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: update V8 to 5.7 #11752

Merged
merged 10 commits into from
Mar 25, 2017
Merged

deps: update V8 to 5.7 #11752

merged 10 commits into from
Mar 25, 2017

Conversation

targos
Copy link
Member

@targos targos commented Mar 8, 2017

Marking in-progress because Chrome 57 is still in beta.
I'm also waiting on https://codereview.chromium.org/2736873005/ to drop the gyp patches.

Notable changes (source):

  • faster promises and async functions
  • faster spread operator, destructuring and generators
  • faster RegExps
  • new String methods: padStart and padEnd
  • new Intl method: Intl.DateTimeFormat.prototype.formatToParts
  • WebAssembly enabled by default
  • PromiseHook C++ API (cc @trevnorris)
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

/cc @nodejs/v8

@targos targos added wip Issues and PRs that are still a work in progress. 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. labels Mar 8, 2017
@nodejs-github-bot nodejs-github-bot added the v8 engine Issues and PRs related to the V8 dependency. label Mar 8, 2017
@targos
Copy link
Member Author

targos commented Mar 8, 2017

@targos
Copy link
Member Author

targos commented Mar 8, 2017

This is actually blocked on three issues that I forgot about:

@targos targos added the blocked PRs that are blocked by other issues or PRs. label Mar 8, 2017
@jasnell
Copy link
Member

jasnell commented Mar 9, 2017

@targos ... just an update, I'll be cutting the 8.x branch next monday with an eye towards cutting the first release candidate on April 4th.

@Trott
Copy link
Member

Trott commented Mar 9, 2017

first release candidate on April 4th

You mean beta, right? Like, is there actually a chance that what you cut on April 4 will basically end up being the release?

@jasnell
Copy link
Member

jasnell commented Mar 9, 2017

First beta will be next week after I cut the branch. The goal is to start stabilizing everything as quickly as possible with no more majors landing without CTC review after April 4th. Release candidate may be too strong but it should be more stable than beta. I'm going to be limiting minors also unless they've been in a 7.x release.

@bnoordhuis
Copy link
Member

I'd say a little pragmatism is needed when it comes to V8 because we'll be stuck with that particular version for a long time. A glitch or two in the initial 8.0.0. release is perfectly okay if it means easier longer-term maintenance.

Also, WASM seems like a relevant enough addition for a LTS release.

Also also, I don't fancy fielding bug reports about the spread operator slowing down someone's script for the next couple of years.

@jasnell
Copy link
Member

jasnell commented Mar 9, 2017

Oh indeed. The discussion on the ctc call today was that we would definitely land with 5.7 and hopefully with 5.8.

@bricss
Copy link

bricss commented Mar 9, 2017

It would be awesome if it would be V8 5.8, the whole world count on this. 🤓

@targos
Copy link
Member Author

targos commented Mar 9, 2017

@bricss What feature(s) from V8 5.8 do you count on?

@bricss
Copy link

bricss commented Mar 9, 2017

WebAssembly should be enabled by default in V8 5.8 as I know.

@targos
Copy link
Member Author

targos commented Mar 9, 2017

Yes, it is in 5.7:

$ ./node
> process.versions.v8
'5.7.492.63'
> WebAssembly.
WebAssembly.__defineGetter__      WebAssembly.__defineSetter__      WebAssembly.__lookupGetter__      WebAssembly.__lookupSetter__      WebAssembly.__proto__             WebAssembly.constructor           WebAssembly.hasOwnProperty        WebAssembly.isPrototypeOf
WebAssembly.propertyIsEnumerable  WebAssembly.toLocaleString        WebAssembly.toString              WebAssembly.valueOf               

WebAssembly.CompileError          WebAssembly.Instance              WebAssembly.LinkError             WebAssembly.Memory                WebAssembly.Module                WebAssembly.RuntimeError          WebAssembly.Table                 WebAssembly.compile
WebAssembly.instantiate           WebAssembly.validate              

@bricss
Copy link

bricss commented Mar 9, 2017

Great, but also V8 5.8 would have performance improvements (new compilation pipeline) to deliver.

@targos targos added this to the 8.0.0 milestone Mar 9, 2017
@NawarA
Copy link

NawarA commented Mar 9, 2017

+1 on delaying the Node v8.0.0 <Carbon?> by one week or two week, to include V8 5.8.

We delayed Node v6 Boron by a tiny bit, so we could include V8 5.1, which included Orinoco and major performance boosts (like Fast For-In loops) when compared to V8 5.0. This future proofed v6 LTS during its life-cycle.

I recommend we combine the Node LTS April release with the April release of V8 5.8 to do the same kind of future proofing. I believe V8 5.8 is stable around April 25th

@jasnell
Copy link
Member

jasnell commented Mar 10, 2017

The 8.0.0 release will definitely go out in April. The current plan is the last week in April. If 5.8 is not ready by then, it won't make it. Hopefully it will be.

@fhinkel
Copy link
Member

fhinkel commented Mar 10, 2017

We removed the legacy JSON debugger protocol in V8 5.8. Not sure if including 5.8 in Node 8 would give people enough time to not rely on on the JSON protocol anymore.

@NawarA
Copy link

NawarA commented Mar 10, 2017

@fhinkel its a semMAJOR update, so devs expect a breaking change.

@jasnell thanks! With 6 LTS, we pushed 5.1 into the branch after release it was released. If we can't get 5.8 in by release date, can we expect it to be released into 8 LTS, when its ready? We did this with 6 LTS, so there is precedent, so I imagine its an option here as well. Is this an option?

@jasnell
Copy link
Member

jasnell commented Mar 10, 2017

There are no guarantees but we can try. As @fhinkel points out, dropping the debugger is a significant change and we need to give users a proper deprecation cycle to transition to the new --inspect. We also need to make sure there are no ABI breaking changes (which we currently do not expect but we'll need to see for sure). The CTC would be looking at it and making a decision.

And while semver-major releases allow for breaking changes, our preference -- and the preference of many users -- is for those breaking changes to be kept to a minimum as much as possible. The runtime deprecation warning for --debug only just landed in v7.x within the past week or two. It really is important that we give users an opportunity to transition.

@icambron
Copy link

@jasnell I'm confused.

There are no guarantees but we can try.

That sounds like "if it's ready on time we can do it", whereas,

It really is important that we give users an opportunity to transition.

Sounds like "no, that is too abrupt, we need cut 8.0.0 without it regardless of its readiness". Can you clarify?

@jasnell
Copy link
Member

jasnell commented Mar 11, 2017 via email

addaleax and others added 7 commits March 25, 2017 09:44
Refs: nodejs#11048

Below is the list of commits:

deps: cherry-pick 78c0be52d from V8 upstream

Original commit message:

  ValueSerializer: Promote scheduled exceptions from wasm::ErrorThrower.

  wasm::ErrorThrower doesn't actually throw exceptions, it just schedules them.
  As a result, this exception isn't handled properly by code which expects
  ValueDeserializer to actually throw. For instance, the unit tests use a
  TryCatch to catch and handle expected exceptions in unit tests.

  Before this patch, I see local unit test failures because a wasm decode test
  schedules one, but it isn't caught (and instead causes Context::New to fail
  at the beginning of the next test).

  BUG=685713

  Review-Url: https://codereview.chromium.org/2659483004
  Cr-Commit-Position: refs/heads/master@{nodejs#42718}

deps: cherry-pick 966355585 from V8 upstream

Original commit message:

  [d8] Use ValueSerializer for postMessage (instead of ad-hoc serializer)

  Review-Url: https://codereview.chromium.org/2643723010
  Cr-Commit-Position: refs/heads/master@{nodejs#42749}

deps: cherry-pick bf511b426 from V8 upstream

Original commit message:

  ValueSerializer: Support efficiently reading and writing one-byte strings.

  memcpy is faster than UTF-8 encoding/decoding. This yields 10-20% wins on
  serializing and deserializing long ASCII strings, according to
  blink_perf.bindings -- and these are already in a fast path where the entire
  string is known to be ASCII (but this has to be checked). The win may be
  larger for strings in Latin-1 but not ASCII (though I suspect this is an
  uncommon case).

  A change is also made to make ValueSerializerTest.EncodeTwoByteStringUsesPadding
  survive wire format version number changes.

  This is the first of a series of wire format changes from the previous Blink
  format. The deserializer continues to be able to read the old format, but
  Chromium M56 will no longer be able to read the messages written by this, in M58.

  BUG=chromium:686159

  Review-Url: https://codereview.chromium.org/2658793004
  Cr-Commit-Position: refs/heads/master@{nodejs#42753}

deps: cherry-pick 6f1639ed1 from V8 upstream

Original commit message:

  ValueSerializer: Distinguish between 'undefined' and an absent property.

  Dealing with this case requires a wire format change. It is possible that an
  element can be absent even in an array where the dense format was chosen
  (because the array initially had no holes), if the elements are modified while
  they are being serialized. In this case, a new tag for the "hole" is emitted.

  The logic to treat undefined in dense arrays as an absent property is restricted
  to versions of the wire format that this tag did not exist.

  BUG=chromium:686159,chromium:665820

  Review-Url: https://codereview.chromium.org/2660093002
  Cr-Original-Commit-Position: refs/heads/master@{nodejs#42784}
  Committed: https://chromium.googlesource.com/v8/v8/+/dc85f4c8338c1c824af4f7ee3274dc9f95d14e49
  Review-Url: https://codereview.chromium.org/2660093002
  Cr-Commit-Position: refs/heads/master@{nodejs#42800}

deps: cherry-pick c3856de37 from V8 upstream

Original commit message:

  ValueSerializer: Check for zero length before casting to FixedDoubleArray.

  Even though the elements kind is FAST_DOUBLE_ELEMENTS, if length is zero
  the isolate's empty_fixed_array is used. It's illegal to cast this to
  FixedDoubleArray, so we avoid the cast.

  BUG=chromium:686479

  Review-Url: https://codereview.chromium.org/2665313003
  Cr-Commit-Position: refs/heads/master@{nodejs#42867}

deps: cherry-pick 591cc0b4c from V8 upstream

Original commit message:

  ValueSerializer: Share string encoding code with String and RegExp objects.

  This avoids the need to pull in the UTF-8 encoding code from the public API,
  and allows it to take advantage of any supported way that i::String can be
  encoded (one- or two-byte).

  Backward compatibility is maintained, but this is the behavior beginning
  with this version.

  BUG=chromium:686159

  Review-Url: https://codereview.chromium.org/2665653004
  Cr-Commit-Position: refs/heads/master@{nodejs#42872}

deps: cherry-pick 79837f5f6 from V8 upstream

Original commit message:

  Improve ValueSerializer perf regression after 96635558

  BUG=687196
  R=jbroman@chromium.org

  Review-Url: https://codereview.chromium.org/2674613002
  Cr-Commit-Position: refs/heads/master@{nodejs#42938}

deps: cherry-pick 8990399dc from V8 upstream

Original commit message:

  ValueDeserializer: Only allow valid keys when deserializing object properties.

  The serializer won't ever write a more complex object. Not validating this
  allows other things to be used as keys, and converted to string when the
  property set actually occurs. It turns out this gives an opportunity to trigger
  OOM by giving an object a key which is a very large sparse array (whose string
  representation is very large).

  This case is now rejected by the deserializer.

  BUG=chromium:686511

  Review-Url: https://codereview.chromium.org/2697023002
  Cr-Commit-Position: refs/heads/master@{nodejs#43249}

deps: cherry-pick 68960eeb7 from V8 upstream

Original commit message:

  ValueDeserializer: Make sure that an exception is the legacy path.

  The entry points to the deserializer are responsible for ensuring that an
  exception is pending by the time they return. Some failures throw exceptions
  themselves, while others (like errors in the format) are exceptions caused by
  the deserializer, not coming from the runtime.

  Like the non-legacy path, a default deserialization exception should be thrown
  in such cases.

  BUG=chromium:693411

  Review-Url: https://codereview.chromium.org/2712713002
  Cr-Commit-Position: refs/heads/master@{nodejs#43390}

deps: cherry-pick 3b15d950e from V8 upstream

Original commit message:
  ValueSerializer: Add SetTreatArrayBufferViewsAsHostObjects() flag

  Add `ValueSerializer::SetTreatArrayBufferViewsAsHostObjects()` which
  instructs the `ValueSerializer` to treat ArrayBufferView objects as
  host objects.

  BUG=v8:5926

  Review-Url: https://codereview.chromium.org/2696133007
  Cr-Commit-Position: refs/heads/master@{nodejs#43281}

deps: cherry-pick 654351997 from V8 upstream

Original commit message:

  ValueSerializer: Add an explicit tag for host objects.

  This makes it no longer necessary to ensure that V8 and Blink have non-colliding
  tags, which makes it easier for them to evolve independently, and also makes
  the wire format more suitable for other V8 embedders, who would not
  necessarily be surveyed before V8 introduced a new tag that might collide
  with theirs.

  BUG=chromium:686159

  Review-Url: https://codereview.chromium.org/2709023003
  Cr-Commit-Position: refs/heads/master@{nodejs#43466}

PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Original commit message:

  [ValueSerializer] Allow wire format versions beginning with 13 to be deserialized in non-legacy mode.

  As of version 13, delegates do not need to worry about colliding tags with the
  tags reserved by v8, since v8 inserts a "host object" prefix beforehand. Thus
  the format is now suitable for more general use, without opting into the "legacy"
  mode that had this caveat.

  Review-Url: https://codereview.chromium.org/2722213002
  Cr-Commit-Position: refs/heads/master@{nodejs#43521}

PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Original commit message:
  [api] Fix DescriptorInterceptor with access check.

  The DescriptorInterceptor should intercept all
  Object.getOwnPropertyDescriptor calls. This CL fixes
  the interceptor's behavior if the iterator state is
  ACCESS_CHECK.

  BUG=

  Review-Url: https://codereview.chromium.org/2707263002
  Cr-Commit-Position: refs/heads/master@{nodejs#43417}

PR-URL: nodejs#11712
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Original commit message:

    [build] Fix gyp files for building inspector

    This patch fixes compilation of V8 with inspector on Windows as well as
    cross-compilation of the V8 inspector.

    BUG=

    Refs: nodejs#10992
    Review-Url: https://codereview.chromium.org/2705423003
    Cr-Commit-Position: refs/heads/master@{nodejs#43533}

PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This is an almost clean cherry-pick of the original commit. The only
conflict was related to a rename of an internal class.

Original commit message:

    [async-await] (simpler) fix for Return in try/finally in async functions

    Alternative approach to https://codereview.chromium.org/2667983004/, which
    does not depend on implicit control flow changes from
    https://codereview.chromium.org/2664083002

    - Remove handling for `async function` from Parser::RewriteReturn(). This functionality
    is moved to BytecodeGenerator::BuildAsyncReturn(). This ensures that promise resolution
    is deferred until all finally blocks are evaluated fully.

    - Add a new deferred command (CMD_ASYNC_RETURN), which instructs ControlScope to
    generate return code using BuildAsyncReturn rather than BuildReturn.

    - Parser has a new `NewReturnStatement()` helper which determines what type of return
    statement to generate based on the type of function.

    BUG=v8:5896, v8:4483
    R=littledan@chromium.org, neis@chromium.org, rmcilroy@chromium.org, adamk@chromium.org, gsathya@chromium.org

    Review-Url: https://codereview.chromium.org/2685683002
    Cr-Commit-Position: refs/heads/master@{nodejs#43104}

Fixes: nodejs#11960
PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This fixes a build failure on Windows.

Original commit message:

    Rename TypeFeedbackVector to FeedbackVector.

    ... and TypeFeedbackMetadata to FeedbackMetadata.

    BUG=

    Change-Id: I2556d1c2a8f37b8cf3d532cc98d973b6dc7e9e6c
    Reviewed-on: https://chromium-review.googlesource.com/439244
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
    Reviewed-by: Michael Stanton <mvstanton@chromium.org>
    Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Reviewed-by: Hannes Payer <hpayer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#42999}

Refs: nodejs/v8#4
PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@targos targos merged commit ed12ea3 into nodejs:master Mar 25, 2017
@jasnell jasnell mentioned this pull request Apr 4, 2017
targos pushed a commit to targos/node that referenced this pull request May 6, 2017
Original commit message:

  [ValueSerializer] Allow wire format versions beginning with 13 to be deserialized in non-legacy mode.

  As of version 13, delegates do not need to worry about colliding tags with the
  tags reserved by v8, since v8 inserts a "host object" prefix beforehand. Thus
  the format is now suitable for more general use, without opting into the "legacy"
  mode that had this caveat.

  Review-Url: https://codereview.chromium.org/2722213002
  Cr-Commit-Position: refs/heads/master@{nodejs#43521}

PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
targos pushed a commit that referenced this pull request May 6, 2017
Original commit message:

  [ValueSerializer] Allow wire format versions beginning with 13 to be deserialized in non-legacy mode.

  As of version 13, delegates do not need to worry about colliding tags with the
  tags reserved by v8, since v8 inserts a "host object" prefix beforehand. Thus
  the format is now suitable for more general use, without opting into the "legacy"
  mode that had this caveat.

  Review-Url: https://codereview.chromium.org/2722213002
  Cr-Commit-Position: refs/heads/master@{#43521}

PR-URL: #11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
anchnk pushed a commit to anchnk/node that referenced this pull request May 19, 2017
Original commit message:

  [ValueSerializer] Allow wire format versions beginning with 13 to be deserialized in non-legacy mode.

  As of version 13, delegates do not need to worry about colliding tags with the
  tags reserved by v8, since v8 inserts a "host object" prefix beforehand. Thus
  the format is now suitable for more general use, without opting into the "legacy"
  mode that had this caveat.

  Review-Url: https://codereview.chromium.org/2722213002
  Cr-Commit-Position: refs/heads/master@{nodejs#43521}

PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@targos targos deleted the v8-5.7 branch June 1, 2017 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.