diff options
Diffstat (limited to 'compiler/optimizing/intrinsics_x86.cc')
-rw-r--r-- | compiler/optimizing/intrinsics_x86.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index 3504d7a6f8..3b23798758 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -967,7 +967,15 @@ void IntrinsicCodeGeneratorX86::VisitStringEquals(HInvoke* invoke) { // All string objects must have the same type since String cannot be subclassed. // Receiver must be a string object, so its class field is equal to all strings' class fields. // If the argument is a string object, its class field must be equal to receiver's class field. + // + // As the String class is expected to be non-movable, we can read the class + // field from String.equals' arguments without read barriers. + AssertNonMovableStringClass(); + // Also, because we use the loaded class references only to compare them, we + // don't need to unpoison them. + // /* HeapReference<Class> */ ecx = str->klass_ __ movl(ecx, Address(str, class_offset)); + // if (ecx != /* HeapReference<Class> */ arg->klass_) return false __ cmpl(ecx, Address(arg, class_offset)); __ j(kNotEqual, &return_false); } |