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

Unified Diff: runtime/include/dart_api.h

Issue 3003583002: [VM, Precompiler] PoC Obfuscator (Closed)
Patch Set: Fix bad refactoring in NewAtomicRename Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 9b4447797d1e31e2ebef9990b93a45095562220c..d2fd16a1f1c47bfe62bff72a57dfbd2d84037df4 100644
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -575,6 +575,12 @@ Dart_SetGcCallbacks(Dart_GcPrologueCallback prologue_callback,
*/
DART_EXPORT const char* Dart_VersionString();
+typedef struct {
+ const char* library_uri;
+ const char* class_name;
+ const char* function_name;
+} Dart_QualifiedFunctionName;
+
/**
* Isolate specific flags are set when creating a new isolate using the
* Dart_IsolateFlags structure.
@@ -583,7 +589,7 @@ DART_EXPORT const char* Dart_VersionString();
* for each part.
*/
-#define DART_FLAGS_CURRENT_VERSION (0x00000003)
+#define DART_FLAGS_CURRENT_VERSION (0x00000004)
typedef struct {
int32_t version;
@@ -594,8 +600,15 @@ typedef struct {
bool use_field_guards;
bool use_osr;
bool use_dart_frontend;
+ bool obfuscate;
+ Dart_QualifiedFunctionName* entry_points;
} Dart_IsolateFlags;
+/**
+ * Initialize Dart_IsolateFlags with correct version and default values.
+ */
+DART_EXPORT void Dart_IsolateFlagsInitialize(Dart_IsolateFlags* flags);
+
/**
* An isolate creation and initialization callback function.
*
@@ -3192,12 +3205,6 @@ DART_EXPORT Dart_Handle Dart_LoadCompilationTrace(uint8_t* buffer,
DART_EXPORT Dart_Handle Dart_SaveJITFeedback(uint8_t** buffer,
intptr_t* buffer_length);
-typedef struct {
- const char* library_uri;
- const char* class_name;
- const char* function_name;
-} Dart_QualifiedFunctionName;
-
/**
* Compiles all functions reachable from the provided entry points and marks
* the isolate to disallow future compilation.
@@ -3323,6 +3330,18 @@ DART_EXPORT Dart_Handle Dart_CreateCoreJITSnapshotAsBlobs(
uint8_t** isolate_snapshot_instructions_buffer,
intptr_t* isolate_snapshot_instructions_size);
+/**
+ * Get obfuscation map for precompiled code.
+ *
+ * Obfuscation map is encoded as a JSON array of pairs (original name,
+ * obfuscated name).
+ *
+ * \return Returns an error handler if the VM was built in a mode that does not
+ * support obfuscation.
+ */
+DART_EXPORT Dart_Handle Dart_GetObfuscationMap(uint8_t** buffer,
+ intptr_t* buffer_length);
+
/**
* Returns whether the VM only supports running from precompiled snapshots and
* not from any other kind of snapshot or from source (that is, the VM was
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698