angular/packages/core/test/render3/jit
Paul Gschwendtner 1d95a832e3 refactor(core): detect signal inputs at runtime using input flags (#53571)
This commit introduces a new enum for capturing additional metadata
about inputs. Called `InputFlags`. These will be built up at compile
time and then propagated into the runtime logic, in a way that does
not require additional lookup dictionaries data structures, or
additional memory allocations for "common inputs" that do not have any flags.

The flags will incorporate information on whether an input is signal
based. This can then be used to avoid megamorphic accesses when such
input is set- as we'd not need to check the input field value. This also
avoids cases where an input signal may be used as initial value for an
input (as we'd not incorrectly detect the input as a signal input then).

The new metadata emit will be useful for incorporating additional
metadata for inputs, such as whether they are required etc (although
required inputs are a build-time only construct right now- but this is a
good illustration of why input flags can be useful). An alternative
could have been to have an additional boolean entry for signal inputs,
but allocating a number with more flexible input flags seems more future
proof and more reasonable andreadable.

More information on the megamorphic access when updating an input
signal
https://docs.google.com/document/d/1FpnFruviKb6BFTQfMAP2AMEqEB0FI7z-3mT_qm7lzX8/edit.

PR Close #53571
2024-01-04 12:07:13 -08:00
..
declare_classmetadata_spec.ts refactor(compiler-cli): introduce declaration function to declare class metadata (#41200) 2021-04-12 10:41:17 -07:00
declare_component_spec.ts refactor(core): detect signal inputs at runtime using input flags (#53571) 2024-01-04 12:07:13 -08:00
declare_directive_spec.ts refactor(compiler): required inputs prerequisite refactors (#49333) 2023-03-14 09:27:49 -07:00
declare_factory_spec.ts test(core): unit tests for the injector profiler and injector debugging APIs (#48639) 2023-08-01 11:44:40 -07:00
declare_injectable_spec.ts test(core): unit tests for the injector profiler and injector debugging APIs (#48639) 2023-08-01 11:44:40 -07:00
declare_injector_spec.ts refactor(compiler-cli): implement ɵɵngDeclareNgModule and ɵɵngDeclareInjector (#41080) 2021-03-15 13:26:51 -07:00
declare_ng_module_spec.ts ci: add lint error for files with missing trailing new-line (#42478) 2021-06-04 13:31:03 -07:00
declare_pipe_spec.ts fix(compiler): ensure JIT compilation of ɵɵngDeclarePipe() works (#40929) 2021-02-24 15:07:08 -08:00
directive_spec.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
matcher.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00