v8/test
Georg Schmid 1d9a5d88b0 [torque] Add Generic Structs
This CL introduces generic Torque structs. Generics are grounded early in the Torque compilation pipeline, meaning that every instantiation of a generic struct with concrete types will be turned into a distinct StructType.

As an example, consider a Tuple of types T1, T2:

  struct Tuple<T1: type, T2: type> {
    const fst: T1;
    const snd: T2;
  }

which can be manipulated using generic macros, such as

  macro Swap<T1: type, T2: type>(tuple: Tuple<T1, T2>): Tuple<T2, T1> {
    return Tuple<T2, T1>{fst: tuple.snd, snd: tuple.fst};
  }

Currently there is no type inference for struct instantiation sites, so type arguments have to be provided explicitly:

  const intptrAndSmi = Tuple<intptr, Smi>{fst: 1, snd: 2};

R=sigurds@chromium.org, tebbi@chromium.org

Change-Id: I43111561cbe53144db473dc844a478045644ef6c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1714868
Commit-Queue: Georg Schmid <gsps@google.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62878}
2019-07-23 15:26:16 +00:00
..
benchmarks [test] Skip flaky test on predictable mode 2019-05-07 13:57:18 +00:00
cctest [torque] Add Generic Structs 2019-07-23 15:26:16 +00:00
common [asm.js] Propagate language mode to exported functions. 2019-07-19 11:47:48 +00:00
debugger [debugger] Fix debug-evaluate for context-allocated this. 2019-07-05 12:14:35 +00:00
fuzzer [cleanup] Unify exports handling in WasmModuleBuilder 2019-07-11 15:50:30 +00:00
inspector Debugger: expose local scope for class member initializer 2019-07-18 14:26:12 +00:00
intl [Intl] Fix crash bug of formatToParts and -0 2019-07-22 17:28:20 +00:00
js-perf-test [test] Add micro-benchmark tests for calls with local vars 2019-07-12 16:54:01 +00:00
memory [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
message Reland "Reland "Let all early errors be SyntaxErrors."" 2019-07-08 10:15:46 +00:00
mjsunit Revert "[d8] Cleanup message queues" 2019-07-23 14:25:38 +00:00
mkgrokdump [roheap] Move read_only_heap() from heap to isolate 2019-07-05 14:25:00 +00:00
mozilla [regexp] Add missing case for EscapeRegExpPattern 2019-07-09 08:11:51 +00:00
preparser Add OWNERS files for src and test 2019-05-30 04:51:21 +00:00
test262 [test262] Triage weakref tests status 2019-07-23 15:05:05 +00:00
torque [torque] Add Generic Structs 2019-07-23 15:26:16 +00:00
unittests [ptr-compr] Add CheckedInt32ToCompressedSigned and use it 2019-07-23 13:19:55 +00:00
wasm-api-tests [wasm-c-api] Drop Isolate::Enter/Exit calls... 2019-07-12 18:51:32 +00:00
wasm-js [testrunner] generalize test loader to accept multiple extensions 2019-06-25 12:12:11 +00:00
wasm-spec-tests PPC: [wasm][tests] Add proposal tests to the wasm spec tests 2019-07-22 16:54:20 +00:00
webkit [regexp] Add missing case for EscapeRegExpPattern 2019-07-09 08:11:51 +00:00
BUILD.gn [wasm-c-api] Add tests and fixes 2019-05-28 09:57:04 +00:00
OWNERS [owners] Make test/ owned by COMMON_OWNERS 2019-06-06 20:56:09 +00:00