Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff adds support of NullSafe properties to the runtime (see also {D1875131}). ===Overview=== - Object property AST node support - Bytecode emitter support - Bytecode interpreter support - Bytecode verifier support - Runtime errors for mutation cases of NullSafe props - Parse time errors - JIT support ===Details== The new `QT` member code is introduced in the `CGetM` instruction: - QT:<id> - a null-safe version of PT:<id> (a litstr by an immediate id as a prop) Example: $x = null; $x?->y; Generated bytecode: Pseudo-main at 0 maxStackCells: 2 numLocals: 1 numIterators: 0 // line 3 0: Null 1: SetL 0 3: PopC // line 4 4: CGetM <L:0 QT:"y"> # note QT 20: PopC 21: Int 1 30: RetC Pseudo-main at 0 maxStackCells: 2 numLocals: 1 numIterators: 0 Runtime/parse checks that forbids several use-cases: $x?->y; // allow isset($x?->y); // allow empty($x?->y); // allow $x?->y = 1; // disallow $x?->y += 1; // disallow $x?->y++; // disallow unset($x?->y); // disallow function byRef(&x) {} byRef($x?->y); // disallow Reviewed By: @jdelong Differential Revision: D1818128
- Loading branch information
1 parent
349fd25
commit 35819cd
Showing
63 changed files
with
1,090 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.