summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/art.go4
-rw-r--r--runtime/mirror/string-inl.h9
2 files changed, 13 insertions, 0 deletions
diff --git a/build/art.go b/build/art.go
index 3f598da00a..58df11ca5e 100644
--- a/build/art.go
+++ b/build/art.go
@@ -103,6 +103,10 @@ func globalFlags(ctx android.BaseContext) ([]string, []string) {
asflags = append(asflags, "-DART_MIPS32_CHECK_ALIGNMENT")
}
+ if envTrue(ctx, "USE_D8_DESUGAR") {
+ cflags = append(cflags, "-DUSE_D8_DESUGAR=1")
+ }
+
return cflags, asflags
}
diff --git a/runtime/mirror/string-inl.h b/runtime/mirror/string-inl.h
index 84587c871c..24c75ec0d8 100644
--- a/runtime/mirror/string-inl.h
+++ b/runtime/mirror/string-inl.h
@@ -35,7 +35,16 @@ namespace art {
namespace mirror {
inline uint32_t String::ClassSize(PointerSize pointer_size) {
+#ifdef USE_D8_DESUGAR
+ // Two lambdas in CharSequence:
+ // lambda$chars$0$CharSequence
+ // lambda$codePoints$1$CharSequence
+ // which were virtual functions in standalone desugar, becomes
+ // direct functions with D8 desugaring.
+ uint32_t vtable_entries = Object::kVTableLength + 54;
+#else
uint32_t vtable_entries = Object::kVTableLength + 56;
+#endif
return Class::ComputeClassSize(true, vtable_entries, 0, 0, 0, 1, 2, pointer_size);
}