Compiler intrinsics
Add intrinsic support. Some of these appear to be of
limited value, so we may end up removing a few. In general,
the instrinsics provide small, but measurable, gains.
Only Arm is currently supported, but most of these should
work for our other targets as well.
This is an interim solution. My plan is to the intrinsic
recognition action up into the basic block building phase once
we start doing inlining.
Change-Id: Ia2913f2cdecaa4e80469caf69dbf8e2f61d4506a
diff --git a/src/object.h b/src/object.h
index cfea1c9..61d0965 100644
--- a/src/object.h
+++ b/src/object.h
@@ -2179,16 +2179,28 @@
// C++ mirror of java.lang.String
class MANAGED String : public Object {
public:
+
+ static MemberOffset CountOffset() {
+ return OFFSET_OF_OBJECT_MEMBER(String, count_);
+ }
+
+ static MemberOffset ValueOffset() {
+ return OFFSET_OF_OBJECT_MEMBER(String, array_);
+ }
+
+ static MemberOffset OffsetOffset() {
+ return OFFSET_OF_OBJECT_MEMBER(String, offset_);
+ }
+
const CharArray* GetCharArray() const {
const CharArray* result = GetFieldObject<const CharArray*>(
- OFFSET_OF_OBJECT_MEMBER(String, array_), false);
+ ValueOffset(), false);
DCHECK(result != NULL);
return result;
}
int32_t GetOffset() const {
- int32_t result = GetField32(
- OFFSET_OF_OBJECT_MEMBER(String, offset_), false);
+ int32_t result = GetField32(OffsetOffset(), false);
DCHECK_LE(0, result);
return result;
}