|
[VM, Precompiler] Support obfuscation of the symbolic information in precompiler
Obfuscation is controlled by obfuscate flag in Dart_IsolateFlags.
Obfuscation of identifiers is performed during script tokenization - when TokenStream is generated from the source. All kIDENT and kINTERPOL_VAR tokens are renamed consistently using a persistent obfuscation map stored in ObjectStore::obfuscation_map.
Some identifiers (pseudo-keywords, arithmetic operators, builtin recognized methods and entry-points) are not renamed to keep name based lookups from breaking. All other identifiers are renamed.
Constant instances of Symbol-s (both created via literal syntax #ident and using constant constructor const Symbol("ident")) are renamed consistently with corresponding identifiers.
Script urls and Library urls and names are also obfuscated.
Obfuscation map can be dumped as a JSON array at the end of precompilation using Dart_GetObfuscationMap API.
BUG=https://github.com/dart-lang/sdk/issues/30524
R=rmacnak@google.com
Committed: https://github.com/dart-lang/sdk/commit/7d5231796ee466d2f1399dc9eb56f64c84625bd3
Total comments: 12
Total comments: 3
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1371 lines, -413 lines) |
Patch |
|
M |
runtime/bin/gen_snapshot.cc
|
View
|
1
2
3
4
|
13 chunks |
+188 lines, -239 lines |
0 comments
|
Download
|
|
M |
runtime/bin/main.cc
|
View
|
1
2
3
|
7 chunks |
+95 lines, -41 lines |
0 comments
|
Download
|
|
M |
runtime/include/dart_api.h
|
View
|
1
2
3
4
5
|
5 chunks |
+26 lines, -7 lines |
0 comments
|
Download
|
|
M |
runtime/tests/vm/vm.status
|
View
|
1
2
3
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/class_finalizer.cc
|
View
|
1
2
3
4
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/dart_api_impl.cc
|
View
|
1
2
3
4
|
2 chunks |
+45 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/intrinsifier.cc
|
View
|
1
2
3
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/isolate.h
|
View
|
1
2
3
4
|
5 chunks |
+73 lines, -64 lines |
0 comments
|
Download
|
|
M |
runtime/vm/isolate.cc
|
View
|
1
2
3
4
|
4 chunks |
+74 lines, -6 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object.h
|
View
|
1
2
3
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object.cc
|
View
|
1
2
3
|
7 chunks |
+34 lines, -9 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object_store.h
|
View
|
1
2
3
|
2 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object_store.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/parser.h
|
View
|
1
|
1 chunk |
+6 lines, -4 lines |
0 comments
|
Download
|
|
M |
runtime/vm/parser.cc
|
View
|
1
|
5 chunks |
+15 lines, -4 lines |
0 comments
|
Download
|
|
M |
runtime/vm/precompiler.h
|
View
|
1
2
3
4
5
|
2 chunks |
+208 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/precompiler.cc
|
View
|
1
2
3
4
5
6
|
6 chunks |
+524 lines, -25 lines |
0 comments
|
Download
|
|
M |
runtime/vm/raw_object.h
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
tests/co19/co19-runtime.status
|
View
|
1
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/corelib_2/corelib_2.status
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/kernel/kernel.status
|
View
|
1
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/kernel/unsorted/nsm_dispatcher_test.dart
|
View
|
1
|
1 chunk |
+6 lines, -8 lines |
0 comments
|
Download
|
|
M |
tests/language/language.status
|
View
|
1
2
3
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
|
M |
tools/testing/dart/compiler_configuration.dart
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
Total messages: 9 (3 generated)
|