feat(metadata-generator): Filter according to specified black/white lists#1246
Merged
mbektchiev merged 2 commits intomasterfrom Jan 22, 2020
Merged
feat(metadata-generator): Filter according to specified black/white lists#1246mbektchiev merged 2 commits intomasterfrom
mbektchiev merged 2 commits intomasterfrom
Conversation
…ists Each text file contains a list of patterns of the form `moduleGlob:symbolGlob`, where `?` and `*` special symbols treated as `any symbol` and `zero or more symbols`. A symbol is whitelisted if it's module name and native name pair matches a pattern in the whitelist, or if a whitelist file is not passed as an argument. All symbols which are not whitelisted or match a pattern in the blacklist are excluded from the global table of metadata symbols. * Update metadata-generator submodule * Add a `blacklist.mdg` file to TestRunner and symlink from the root (because SRCROOT of TestRunner points to the directory of the main CMakeLists.txt) * Add a unit test which checks for the correct filtering of metadata according to the rules in `blacklist.mdg`
* Add test case with function returning a struct which is blacklisted If a struct's metadata is missing it's not possible to silently ignore it and perform the call, because we don't know its size and cannot reliably allocate the stack frame for the cif. That's why we'll abort the call and throw a JS exception * Add test case with functions returning and taking as an argument objects from a blacklisted class. In this scenario the behavior is the same as with objects from private classes * Use Objective-C exceptions to propagate errors when filtered metadata is used and handle them in JSC callbacks * Update metadata generator to use native names in type encodings to allow correct discovery of interfaces and protocols when they have been filtered
vtrifonov
approved these changes
Jan 22, 2020
5 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each text file contains a list of patterns of the form
moduleGlob:symbolGlob,where
?and*special symbols treated asany symbolandzero or more symbols.A symbol is whitelisted if it's module name and native name pair matches a
pattern in the whitelist, or if a whitelist file is not passed as an argument. All
symbols which are not whitelisted or match a pattern in the blacklist are
excluded from the global table of metadata symbols.
blacklist.mdgfile to TestRunner and symlink from the root (becauseSRCROOT of TestRunner points to the directory of the main CMakeLists.txt)
the rules in
blacklist.mdgIf a struct's metadata is missing it's not possible to silently ignore it and
perform the call, because we don't know its size and cannot reliably
allocate the stack frame for the cif. That's why we'll abort the call and
throw a JS exception
objects from a blacklisted class. In this scenario the behavior is the
same as with objects from private classes
metadata is used and handle them in JSC callbacks
to allow correct discovery of interfaces and protocols when they
have been filtered
PR Checklist
What is the current behavior?
Metadata is generated for all discovered supported native symbols
What is the new behavior?
Metadata can be filtered by specifying a whitelist and/or blacklist in
two files residing in $(SRCROOT) (
blacklist.mdgandwhitelist.mdg).Each line should be of the form
module-name-pattern[:symbol-name-pattern].refs #1209