summaryrefslogtreecommitdiff
path: root/compiler/optimizing/locations.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2025-02-25 07:51:06 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2025-02-28 00:27:12 -0800
commit94f4f3c764ce5d6c076bd012f8728d0e11f8202c (patch)
tree5c79f3ab2f81870bd490dd747036fdd3c5763960 /compiler/optimizing/locations.h
parent225ed9282e8676f13ec0b69786052684881596c3 (diff)
Optimizing: Reduce size of `LocationSummary`.
This reduces `sizeof(LocationSummary)` from 128B down to 88B on 64-bit architectures. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I24a35fb433e89533727f6c786eb1253178cc05bf
Diffstat (limited to 'compiler/optimizing/locations.h')
-rw-r--r--compiler/optimizing/locations.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index 2209f05c0b..b8fe29c621 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -19,6 +19,7 @@
#include "base/arena_containers.h"
#include "base/arena_object.h"
+#include "base/array_ref.h"
#include "base/bit_field.h"
#include "base/bit_utils.h"
#include "base/bit_vector.h"
@@ -39,7 +40,7 @@ std::ostream& operator<<(std::ostream& os, const Location& location);
*/
class Location : public ValueObject {
public:
- enum OutputOverlap {
+ enum OutputOverlap : uint8_t {
// The liveness of the output overlaps the liveness of one or
// several input(s); the register allocator cannot reuse an
// input's location for the output's location.
@@ -534,7 +535,7 @@ static constexpr bool kIntrinsified = true;
*/
class LocationSummary : public ArenaObject<kArenaAllocLocationSummary> {
public:
- enum CallKind {
+ enum CallKind : uint8_t {
kNoCall,
kCallOnMainAndSlowPath,
kCallOnSlowPath,
@@ -713,8 +714,13 @@ class LocationSummary : public ArenaObject<kArenaAllocLocationSummary> {
bool intrinsified,
ArenaAllocator* allocator);
- ArenaVector<Location> inputs_;
+ ArrayRef<Location> inputs_;
ArenaVector<Location> temps_;
+ Location output_;
+
+ // Mask of objects that live in the stack.
+ BitVector* stack_mask_;
+
const CallKind call_kind_;
// Whether these are locations for an intrinsified call.
const bool intrinsified_;
@@ -723,10 +729,6 @@ class LocationSummary : public ArenaObject<kArenaAllocLocationSummary> {
// Whether the output overlaps with any of the inputs. If it overlaps, then it cannot
// share the same register as the inputs.
Location::OutputOverlap output_overlaps_;
- Location output_;
-
- // Mask of objects that live in the stack.
- BitVector* stack_mask_;
// Mask of objects that live in register.
uint32_t register_mask_;
@@ -734,7 +736,8 @@ class LocationSummary : public ArenaObject<kArenaAllocLocationSummary> {
// Registers that are in use at this position.
RegisterSet live_registers_;
- // Custom slow path caller saves. Valid only if indicated by slow_path_calling_convention_.
+ // Custom slow path caller saves. Valid only if indicated by
+ // `has_custom_slow_path_calling_convention_`.
RegisterSet custom_slow_path_caller_saves_;
ART_FRIEND_TEST(RegisterAllocatorTest, ExpectedInRegisterHint);