v8/test/inspector
Joyee Cheung 4e8c62819a [class] implement static private methods
This patch refactors the declaration and allocation of the class variable, and
implements static private methods:


- The class variable is declared in the class scope with an explicit
  reference through class_scope->class_variable(). Anonymous classes
  whose class variable may be accessed transitively through static
  private method access use the dot string as the class name. Whether
  the class variable is allocated depending on whether it is used.
  Other references of the class variable in the ClassLiteral AST node
  and the ClassInfo structure are removed in favor of the reference
  through the class scope.
- Previously the class variable was always (stack- or context-)
  allocated if the class is named. Now if the class variable is only
  referenced by name, it's stack allocated. If it's used transitively
  by access to static private methods, or may be used through eval,
  it's context allocated. Therefore we now use 1 less context slots
  in the class context if it's a named class without anyone referencing
  it by name in inner scopes.
- Explicit access to static private methods or potential access to
  static private methods through eval results in forced context
  allocation of the class variables. In those cases, we save its index
  in context locals in the ScopeInfo and deserialize it later, so that
  we can check that the receiver of static private methods is the class
  constructor at run time. This flag is recorded as
  HasSavedClassVariableIndexField in the scope info.
- Classes that need the class variable to be saved due to
  access to static private methods now save a
  ShouldSaveClassVariableIndexField in the preparse data so that the
  bits on the variables can be updated during a reparse. In the case
  of anonymous classes that need the class variables to be saved,
  we also re-declare the class variable after the reparse since
  the inner functions are skipped and we need to rely on the preparse
  data flags to remember declaring it.

Design doc: https://docs.google.com/document/d/1rgGRw5RdzaRrM-GrIMhsn-DLULtADV2dmIdh_iIZxlc/edit

Bug: v8:8330
Change-Id: Idd07803f47614e97ad202de3b7faa9f71105eac5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1781011
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64219}
2019-10-10 15:34:44 +00:00
..
console Revert "[inspector] RemoteObject.description should be empty for primitive type" 2018-05-31 18:52:08 +00:00
cpu-profiler [wasm] Rename {Get,Set,Tee}Local to Local{Get,Set,Tee} 2019-10-08 14:14:40 +00:00
debugger [class] implement static private methods 2019-10-10 15:34:44 +00:00
heap-profiler [heap profiler] Plumb samples through the protocol. 2018-10-23 00:12:01 +00:00
runtime [inspector] Add "disableBreaks" parameter to "Runtime.evaluate". 2019-09-27 12:16:01 +00:00
sessions WIP: [parser] Fix arrow function name inferring 2019-01-08 08:10:03 +00:00
type-profiler [test] Remove dead flags from some tests. 2018-10-15 10:00:12 +00:00
BUILD.gn [cleanup] Improve dependency handling in gn targets 2019-02-15 21:52:32 +00:00
DEPS [inspector][roheap] Make inspector-test.cc compatible with shared ro-heap 2019-06-25 10:23:49 +00:00
inspector-test.cc [api] Add [Shared]ArrayBuffer::GetBackingStore() 2019-09-19 10:03:02 +00:00
inspector.status [inspector] Add test for getPossibleBreakpoints on embedded code 2019-04-29 07:47:56 +00:00
isolate-data.cc [inspector-test] Don't leak the ArrayBuffer::Allocator 2019-10-02 14:26:55 +00:00
isolate-data.h [inspector-test] Don't leak the ArrayBuffer::Allocator 2019-10-02 14:26:55 +00:00
json-parse-expected.txt [inspector] Refactor protocol-test.js 2017-05-19 00:35:45 +00:00
json-parse.js [inspector] Refactor protocol-test.js 2017-05-19 00:35:45 +00:00
OWNERS Use relative paths to OWNERS files 2019-08-12 13:52:52 +00:00
protocol-test.js [wasm] fix clear context group for wasm 2018-11-06 22:27:17 +00:00
task-runner.cc Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
task-runner.h [iwyu] Add missing includes of <memory> for std::unique_ptr 2019-09-13 17:13:36 +00:00
testcfg.py Reland "Reland "[test] refactor testsuite configuration"" 2019-02-06 09:02:09 +00:00