v8/test/mjsunit/harmony
Joyee Cheung 0753cbeaae [class] maintain private brand information on SFI
When an empty class is nested inside a class with private instance
methods, like this:

  class Outer {
    constructor() {}
    #method() {}
    factory() {
      class Inner {
        constructor() {  }
      }
      return Inner;
    }
    run(obj) {
      obj.#method();
    }
  }

The bytecode generator previously generate private brand
initialization for the constructor of Inner by mistake,
because during scope chain serialization/deserialization,
the outer scopes of Inner and factory() are not allocated
or serialized (as they are empty). In the eyes of the bytecode
generator, it then appeared as if Outer is the direct outer
scope of Inner's constructor.

In order to work around this information loss, in this patch
we rely on SharedFunctionInfo instead of the Context/ScopeInfo
chain to maintain the information about private brand initialization.
This is done by shrinking expected_nof_properties to 8 bits and
freeing 8 bits for a second bitfield on the SFI.

Design doc: https://docs.google.com/document/d/14maU596YbHcWR7XR-_iXM_ANhAAmiuRlJZysM61lqaE/edit#
Bug: v8:9839, v8:8330, v8:10098

Change-Id: I4370a0459bfc0da388052ad5a91aac59582d811d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2056889
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66575}
2020-03-03 20:25:54 +00:00
..
bigint [parser] add support for BigInt literal as property names 2020-01-13 10:51:45 +00:00
regress Remove always-true --harmony-object-from-entries runtime flag 2019-06-24 15:01:01 +00:00
weakrefs [weakrefs] Rename FinalizationGroup to FinalizationRegistry for JS 2020-02-25 22:53:20 +00:00
array-concat-array-proto-getter.js
array-concat-array-proto.js
array-concat-object-proto-dict-getter.js
array-concat-object-proto-dict.js
array-concat-object-proto-generic-dict.js
array-concat-object-proto.js
array-flat-species.js Remove always-true --harmony-array-flat runtime flag 2019-02-02 17:54:27 +00:00
array-flat.js Remove always-true --harmony-array-flat runtime flag 2019-02-02 17:54:27 +00:00
array-flatMap-species.js Remove always-true --harmony-array-flat runtime flag 2019-02-02 17:54:27 +00:00
array-flatMap.js Remove always-true --harmony-array-flat runtime flag 2019-02-02 17:54:27 +00:00
array-sort-comparefn.js
async-await-optimization.js [async-await] Refactor await optimization and include async generators 2018-10-05 13:25:56 +00:00
async-for-of-non-iterable.js
async-from-sync-iterator-next-tick-count.js [await] Add async iterator tests for await optimization 2019-04-03 17:42:51 +00:00
async-from-sync-iterator-return-tick-count.js [await] Add async iterator tests for await optimization 2019-04-03 17:42:51 +00:00
async-from-sync-iterator-throw-tick-count.js [await] Add async iterator tests for await optimization 2019-04-03 17:42:51 +00:00
async-from-sync-iterator.js Replace %RunMicrotasks with %PerformMicrotaskCheckpoint 2018-12-06 11:10:18 +00:00
async-generators-basic.js Replace %RunMicrotasks with %PerformMicrotaskCheckpoint 2018-12-06 11:10:18 +00:00
async-generators-resume-return.js [mjsunit] Move the implementation of testAsync into a separate file 2018-08-01 08:46:24 +00:00
async-generators-return.js [mjsunit] Move the implementation of testAsync into a separate file 2018-08-01 08:46:24 +00:00
async-generators-throw-caught.js Add a synthetic return for async generator functions 2020-02-24 19:33:46 +00:00
async-generators-yield.js [mjsunit] Move the implementation of testAsync into a separate file 2018-08-01 08:46:24 +00:00
async-iterators-resolve.js [await] Update async iterators to return a rejected promise on error 2019-03-18 18:32:58 +00:00
atomics-notify.js [Atomics] Add use counter for Atomics.{wake, notify} 2018-09-20 21:31:33 +00:00
atomics-value-check.js [d8] Update new Worker API to match the Web API 2018-09-20 00:10:28 +00:00
atomics.js [atomics] Make IsLockFree handle 8 bytes 2019-08-06 13:03:47 +00:00
bigintarray-keyedstore-tobigint.js Remove always-true --harmony-bigint runtime flag 2018-10-01 11:31:13 +00:00
block-lazy-compile.js [Test] Add PrepareForOptimization to some mjsunit tests. 2019-05-03 13:32:32 +00:00
dataview-accessors.js
eval-param-scoping.js Remove per-parameter position var scope 2019-12-19 10:38:00 +00:00
for-await-of.js Replace %RunMicrotasks with %PerformMicrotaskCheckpoint 2018-12-06 11:10:18 +00:00
function-tostring.js Remove always-true --harmony-function-tostring runtime flag 2018-10-03 15:04:16 +00:00
futex.js [d8] Update new Worker API to match the Web API 2018-09-20 00:10:28 +00:00
generators-reduced.js [Test] Add PrepareForOptimization to some mjsunit tests. 2019-05-03 13:32:32 +00:00
generators.js [Test] Add PrepareForOptimization to some mjsunit tests. 2019-05-03 13:32:32 +00:00
global-configurable.js Remove always-true --harmony-global runtime flag 2019-06-26 09:47:14 +00:00
global-writable.js Remove always-true --harmony-global runtime flag 2019-06-26 09:47:14 +00:00
global.js Remove always-true --harmony-global runtime flag 2019-06-26 09:47:14 +00:00
harmony-string-pad-end.js
harmony-string-pad-start.js
hashbang-eval.js Remove always-enabled --harmony-hashbang flag 2019-06-11 15:47:08 +00:00
import-from-compilation-errored.js [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
import-from-evaluation-errored.js [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
import-from-fetch-errored.js Replace %RunMicrotasks with %PerformMicrotaskCheckpoint 2018-12-06 11:10:18 +00:00
import-from-instantiation-errored.js [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
module-parsing-eval.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-1.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-2.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-3.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-4.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-5.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-6.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-7.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-8.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-9.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-10.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-11.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-12.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-13.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-14.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-15-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-15.mjs [top-level-await] Add support for top level await to d8 2019-09-20 16:04:49 +00:00
modules-import-16.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-17.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-large.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-meta.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-namespace.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-import-rqstd-order-top-level-await-1.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-2.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-3.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-4.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-5.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-6.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-7.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-rqstd-order-top-level-await-8.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-1.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-2.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-3.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-4.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-5.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-6.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-7.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-8.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-cycle.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-exception-1.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-exception-2.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-import-top-level-await-exception-3.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-rqstd-order-indirect-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-rqstd-order-indirect-unreached-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-rqstd-order-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-rqstd-order-unreached-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-rqstd-order.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-top-level-await-cycle.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-1.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-2-rqstd-order-indirect-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-2-rqstd-order-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-2-rqstd-order.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-2-top-level-await-cycle.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-2-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-2.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-3-rqstd-order-indirect-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-3-rqstd-order-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-3-rqstd-order.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-3-top-level-await-cycle.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-3-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-3.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-4-rqstd-order-indirect-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-4-rqstd-order-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-4-rqstd-order.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-4-top-level-await-cycle.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-4-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-4.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-5-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-5.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-6-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-6.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-7-top-level-await.mjs [top-level-await] Add support for parsing top level await 2019-09-24 14:01:32 +00:00
modules-skip-7.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-8.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-9.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-10.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-11.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-12.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-13.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-empty.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-export-import-meta.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-large1.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
modules-skip-large2.mjs [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
nullish.js [nullish] Add support for nullish operator 2019-08-21 15:48:34 +00:00
numeric-separator.js [harmony-numeric-separator] remove flag 2019-08-01 10:10:24 +00:00
object-fromentries.js Remove always-true --harmony-object-from-entries runtime flag 2019-06-24 15:01:01 +00:00
optional-catch-binding-breaks.js
optional-catch-binding.js
optional-chaining-this.js Fix the receiver when calling parenthesized optional chains 2019-11-29 00:44:06 +00:00
optional-chaining.js [optional-chaining] Disallow optional chaining with private names. 2019-10-21 15:18:00 +00:00
private-accessors.js [class] fix undefined private name access in computed property keys 2019-10-10 19:43:01 +00:00
private-fields-ic.js [class] Remove flags for class fields 2019-05-01 02:02:51 +00:00
private-fields-special-object.js [test] Remove module pragma in favor of .mjs 2019-06-27 13:25:48 +00:00
private-fields-static.js [class] Remove flags for class fields 2019-05-01 02:02:51 +00:00
private-fields.js [class] fix undefined private name access in computed property keys 2019-10-10 19:43:01 +00:00
private-methods-empty-inner.js [class] maintain private brand information on SFI 2020-03-03 20:25:54 +00:00
private-methods.js [class] fix undefined private name access in computed property keys 2019-10-10 19:43:01 +00:00
private-name-scopes.js [class] Fix private name scope chain 2019-09-06 00:52:07 +00:00
private-symbols.js
private.js
promise-all-settled.js [ESNext] Implement Promise.allSettled 2019-04-12 17:49:17 +00:00
promise-prototype-finally.js [mjsunit] Move the implementation of testAsync into a separate file 2018-08-01 08:46:24 +00:00
public-instance-class-fields.js [class] Remove flags for class fields 2019-05-01 02:02:51 +00:00
public-static-class-fields.js [class] Remove flags for class fields 2019-05-01 02:02:51 +00:00
regexp-change-exec.js
regexp-dotall.js
regexp-match-indices.js [regexp] Add additional test for match indices. 2019-11-25 16:32:21 +00:00
regexp-named-captures.js [regexp] Fix the order of named captures on the groups object 2019-10-16 07:37:05 +00:00
regexp-overriden-exec.js [turbofan] Brokerize reduction of RegExp.prototype.test 2019-07-17 11:40:51 +00:00
regexp-property-binary.js
regexp-property-char-class.js
regexp-property-emoji-flag-sequence-generated.js [regexp] Update RegExp property sequence data to Unicode 12 2019-03-06 10:59:12 +00:00
regexp-property-emoji-keycap-sequence-generated.js [regexp] Update RegExp property sequence data to Unicode 12 2019-03-06 10:59:12 +00:00
regexp-property-emoji-modifier-sequence-generated.js [regexp] Update RegExp property sequence data to Unicode 12 2019-03-06 10:59:12 +00:00
regexp-property-emoji-tag-sequence-generated.js [regexp] Update RegExp property sequence data to Unicode 12 2019-03-06 10:59:12 +00:00
regexp-property-emoji-zwj-sequence-generated.js [regexp] Update RegExp property sequence data to Unicode 12 2019-03-06 10:59:12 +00:00
regexp-property-enumerated.js
regexp-property-exact-match.js
regexp-property-general-category.js
regexp-property-invalid.js Reland "[regexp] implement regexp property sequence proposal" 2018-09-19 08:39:22 +00:00
regexp-property-lu-ui0.js
regexp-property-lu-ui1.js
regexp-property-lu-ui2.js
regexp-property-lu-ui3.js
regexp-property-lu-ui4.js
regexp-property-lu-ui5.js
regexp-property-lu-ui6.js
regexp-property-lu-ui7.js
regexp-property-lu-ui8.js
regexp-property-lu-ui9.js
regexp-property-lu-ui.js
regexp-property-script-extensions.js
regexp-property-scripts.js
regexp-property-sequence.js [regexp] Expand test coverage for sequence properties 2018-09-20 13:00:35 +00:00
regexp-property-special.js
regress-generators-resume.js [Test] Add PrepareForOptimization to some mjsunit tests. 2019-05-03 13:32:32 +00:00
set-prototype-of.js
sharedarraybuffer-stress.js [ubsan] Make ARM and ARM64 UBSan-clean 2019-09-16 15:03:45 +00:00
sharedarraybuffer-worker-gc-stress.js [mjsunit] Add more tests for shared array buffers / memories 2019-07-17 14:08:38 +00:00
sharedarraybuffer.js [test] Update TypedArray tests 2019-11-14 15:32:26 +00:00
static-private-methods.js [class] implement static private methods 2019-10-10 15:34:44 +00:00
string-matchAll-deleted-matchAll.js Remove always-true --harmony-string-matchall runtime flag 2019-04-25 10:46:05 +00:00
string-matchAll.js [regexp] Modify matchAll to throw on non-globals. 2019-10-16 13:34:15 +00:00
string-replaceAll.js [replaceAll] Fix replaceAll overflow with StringCompareSequence. 2019-12-26 18:47:05 +00:00
symbol-async-iterator.js
symbol-description.js Remove always-true --harmony-symbol-description runtime flag 2019-02-14 10:36:05 +00:00
to-length.js
to-name.js
to-number.js [cleanup] Remove a lot of dead intrinsics/runtime functions. 2018-09-20 12:48:57 +00:00
to-string.js Port ToString to Torque 2019-04-23 13:55:11 +00:00
trailing-commas-length.js
well-formed-json-stringify-checked.js Remove always-true --harmony-json-stringify runtime flag 2019-04-24 14:51:09 +00:00
well-formed-json-stringify-unchecked.js Remove always-true --harmony-json-stringify runtime flag 2019-04-24 14:51:09 +00:00