Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2088282 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Add dalvik.vm.dex2oat-resolve-startup-strings feature flag

Mapped to the corresponding dex2oat option:
--resolve-startup-const-strings=true|false

Bug: 116059983
Test: setprop dalvik.vm.dex2oat-resolve-startup-strings true
Test: compile an app

(cherry picked from commit 1b2bb04c)

Merged-In: I128436c6b8d3d9ebcc3dbb49160c732b061ba008
Change-Id: I8d2cd1c4f69c01bb8f4dbe1402fcee8f85c243af
parent 369e0148
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -287,6 +287,8 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
                             (strcmp(vold_decrypt, "1") == 0)));
                             (strcmp(vold_decrypt, "1") == 0)));


    bool generate_debug_info = property_get_bool("debug.generate-debug-info", false);
    bool generate_debug_info = property_get_bool("debug.generate-debug-info", false);
    const bool resolve_startup_strings =
            property_get_bool("dalvik.vm.dex2oat-resolve-startup-strings", false);


    char app_image_format[kPropertyValueMax];
    char app_image_format[kPropertyValueMax];
    char image_format_arg[strlen("--image-format=") + kPropertyValueMax];
    char image_format_arg[strlen("--image-format=") + kPropertyValueMax];
@@ -442,7 +444,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
    // supported.
    // supported.
    const bool disable_cdex = !generate_compact_dex || (input_vdex_fd == output_vdex_fd);
    const bool disable_cdex = !generate_compact_dex || (input_vdex_fd == output_vdex_fd);


    const char* argv[9  // program name, mandatory arguments and the final NULL
    const char* argv[10  // program name, mandatory arguments and the final NULL
                     + (have_dex2oat_isa_variant ? 1 : 0)
                     + (have_dex2oat_isa_variant ? 1 : 0)
                     + (have_dex2oat_isa_features ? 1 : 0)
                     + (have_dex2oat_isa_features ? 1 : 0)
                     + (have_dex2oat_Xms_flag ? 2 : 0)
                     + (have_dex2oat_Xms_flag ? 2 : 0)
@@ -475,6 +477,8 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd
    argv[i++] = oat_fd_arg;
    argv[i++] = oat_fd_arg;
    argv[i++] = oat_location_arg;
    argv[i++] = oat_location_arg;
    argv[i++] = instruction_set_arg;
    argv[i++] = instruction_set_arg;
    argv[i++] = resolve_startup_strings ? "--resolve-startup-const-strings=true" :
            "--resolve-startup-const-strings=false";
    if (have_dex2oat_isa_variant) {
    if (have_dex2oat_isa_variant) {
        argv[i++] = instruction_set_variant_arg;
        argv[i++] = instruction_set_variant_arg;
    }
    }