Skip to content

Commit

Permalink
deps: V8: fix bug in InternalPerformPromiseThen
Browse files Browse the repository at this point in the history
This fix never landed upstream as it was not longer relevant to active
V8 branches for Chromium.

Original commit message:
  [turbofan] Fix bug in InternalPerformPromiseThen

  Bug: chromium:831170
  Change-Id: I1022fc360aafdfd392d6781eb50afc87a18096fd

PR-URL: #21426
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
ofrobots authored and rvagg committed Aug 16, 2018
1 parent 9aeffab commit efe28b8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 59
#define V8_PATCH_LEVEL 60

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/builtins/builtins-promise-gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ Node* PromiseBuiltinsAssembler::InternalPerformPromiseThen(
BIND(&if_existingcallbacks);
{
Label if_singlecallback(this), if_multiplecallbacks(this);
BranchIfJSObject(existing_deferred_promise, &if_singlecallback,
&if_multiplecallbacks);
Branch(HasInstanceType(existing_deferred_promise, FIXED_ARRAY_TYPE),
&if_multiplecallbacks, &if_singlecallback);

BIND(&if_singlecallback);
{
Expand Down
21 changes: 21 additions & 0 deletions deps/v8/test/mjsunit/compiler/promise-proxy-callback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

class MyPromise extends Promise {
static get [Symbol.species]() {
return function(f) {
console.log("foo")
var a = new Promise(f);
return new Proxy(new Function(),{})
}
}
}
var p1 = new Promise(function(resolve, reject) {});
p1.__proto__ = MyPromise.prototype;
p1.then();
p1.then();

for (var i = 0; i < 0x20000; i++) {
new String()
}

0 comments on commit efe28b8

Please sign in to comment.