Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Issue 3000143002: [VM, Precompiler] PoC: Introduce an obfuscation pass. (Closed)

Created:
3 years, 4 months ago by Vyacheslav Egorov (Google)
Modified:
3 years, 3 months ago
Reviewers:
rmacnak
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

NOT FOR COMMIT [VM, Precompiler] Introduce an obfuscation pass. This pass walks and renames Classes and Functions, then it walks code and renames all discovered unliked call sites and argument descriptors. It also renames parameter names. To discover constants that require obfuscation in the constant pool those entries are annotated as such. Missing from this CL: - NoSuchMethodError._throwNew should be changed to take Symbol-s for targetName and named parameters' names instead of taking strings; - field names are not obfuscated; - library names and URIs need to be obfuscated too; - obfuscation map needs to be generated; - instead of using s%d obfuscation use 'a, b, c, ..., Z, aa, ...' names; CURRENT STATUS out/ReleaseX64/dart t/obfuscation-test.dart Too Secret! #0 SecretClassA.secretMethod3 (obfuscation-test.dart:10:5) #1 SecretClassB.secretMethod2 (obfuscation-test.dart:16:5) #2 SecretClassA.secretMethod1 (obfuscation-test.dart:4:5) #3 main (obfuscation-test.dart:40:9) #4 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265) #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151) out/ReleaseX64/dart_precompiled_runtime /tmp/aot.snapshot Too Secret! #0 s2832.s2834 (obfuscation-test.dart:10) #1 s2837.s2838 (obfuscation-test.dart:16) #2 s2832.s2833 (obfuscation-test.dart:4) #3 main (obfuscation-test.dart:40) #4 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265) #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151) TEST STATUS precomp-release: [33:36 | 100% | +13806 | - 206] BUG=

Patch Set 1 #

Patch Set 2 : revert accidental edit #

Patch Set 3 : Fix more tests #

Patch Set 4 : Fix more issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+804 lines, -125 lines) Patch
M runtime/bin/main.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/tests/vm/dart/inline_stack_frame_test.dart View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/assembler.h View 5 chunks +42 lines, -10 lines 0 comments Download
M runtime/vm/assembler.cc View 4 chunks +20 lines, -14 lines 0 comments Download
M runtime/vm/assembler_x64.h View 3 chunks +14 lines, -4 lines 0 comments Download
M runtime/vm/assembler_x64.cc View 3 chunks +25 lines, -9 lines 0 comments Download
M runtime/vm/clustered_snapshot.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/dart_entry.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/growable_array.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.h View 1 2 3 7 chunks +26 lines, -17 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 chunks +6 lines, -3 lines 0 comments Download
M runtime/vm/precompiler.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M runtime/vm/precompiler.cc View 1 2 3 6 chunks +602 lines, -27 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/raw_object.cc View 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib_2/apply_test.dart View 1 2 3 3 chunks +3 lines, -6 lines 0 comments Download
M tests/language/cyclic_type_test.dart View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M tests/language/f_bounded_quantification4_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/f_bounded_quantification5_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_generic_test.dart View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M tests/language/mixin_mixin2_test.dart View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language/mixin_mixin3_test.dart View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language/mixin_mixin4_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_mixin5_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_mixin6_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_mixin_bound2_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_mixin_bound_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_mixin_type_arguments_test.dart View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M tests/language/mixin_super_2_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tests/language/mixin_super_test.dart View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M tests/language/mixin_type_parameters_simple_test.dart View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language/regress_18713_test.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M tests/language/regress_21795_test.dart View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tests/language/runtime_type_function_test.dart View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M tests/language/stack_trace_test.dart View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/stacktrace_rethrow_error_test.dart View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M tests/language/stacktrace_rethrow_nonerror_test.dart View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (7 generated)
Vyacheslav Egorov (Google)
3 years, 4 months ago (2017-08-17 10:42:00 UTC) #6
Hi Ryan, 

Could you check this out and tell me what you think? 

Before I start cleaning this up and weeding out the last issues I would like to
hear your opinion about it.

Thanks,

Powered by Google App Engine
This is Rietveld 408576698