diff options
author | Vladimir Marko <vmarko@google.com> | 2018-06-22 02:16:08 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-06-22 02:16:08 -0700 |
commit | 5f7748b6ec5b51afe8314f2c169f99a1f93a2053 (patch) | |
tree | 25879b7002fd0601f9ed0ac9b6ef0b7d84134f55 /compiler/optimizing/intrinsics.h | |
parent | 0ad09c4b396d37f57eecca8b1f841fb99a1a0baf (diff) | |
parent | 077cc1c59c32f08c752c603bf991160c22eae9bb (diff) |
Merge "Implement Integer.valueOf() intrinsic for PIC." am: ccfc88af4a am: 8e73527acf
am: 077cc1c59c
Change-Id: If3a8ed8679e4fa8ef851b0c92e303473ef74a910
Diffstat (limited to 'compiler/optimizing/intrinsics.h')
-rw-r--r-- | compiler/optimizing/intrinsics.h | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h index 30cffac0157..f2b78239d6d 100644 --- a/compiler/optimizing/intrinsics.h +++ b/compiler/optimizing/intrinsics.h @@ -126,33 +126,32 @@ class IntrinsicVisitor : public ValueObject { Location return_location, Location first_argument_location); - // Temporary data structure for holding Integer.valueOf useful data. We only - // use it if the mirror::Class* are in the boot image, so it is fine to keep raw - // mirror::Class pointers in this structure. + // Temporary data structure for holding Integer.valueOf data for generating code. + // We only use it if the boot image contains the IntegerCache objects. struct IntegerValueOfInfo { - IntegerValueOfInfo() - : integer_cache(nullptr), - integer(nullptr), - cache(nullptr), - low(0), - high(0), - value_offset(0) {} - - // The java.lang.IntegerCache class. - mirror::Class* integer_cache; - // The java.lang.Integer class. - mirror::Class* integer; - // Value of java.lang.IntegerCache#cache. - mirror::ObjectArray<mirror::Object>* cache; - // Value of java.lang.IntegerCache#low. + IntegerValueOfInfo(); + + // Boot image offset of java.lang.Integer for allocating an instance. + uint32_t integer_boot_image_offset; + // Offset of the Integer.value field for initializing a newly allocated instance. + uint32_t value_offset; + // The low value in the cache. int32_t low; - // Value of java.lang.IntegerCache#high. - int32_t high; - // The offset of java.lang.Integer.value. - int32_t value_offset; + // The length of the cache array. + uint32_t length; + + union { + // Boot image offset of the target Integer object for constant input in the cache range. + // If the input is out of range, this is set to 0u and the code must allocate a new Integer. + uint32_t value_boot_image_offset; + + // Boot image offset of the cache array data used for non-constant input in the cache range. + // If the input is out of range, the code must allocate a new Integer. + uint32_t array_data_boot_image_offset; + }; }; - static IntegerValueOfInfo ComputeIntegerValueOfInfo(); + static IntegerValueOfInfo ComputeIntegerValueOfInfo(HInvoke* invoke); protected: IntrinsicVisitor() {} |