summaryrefslogtreecommitdiff
path: root/compiler/optimizing/locations.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2023-10-31 10:02:46 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2023-11-09 15:27:28 +0000
commitaf06af4b126455a0050ff6447ad700ea073d3dc7 (patch)
tree1c437f576fe17cae20416890d566a0f4d001f88e /compiler/optimizing/locations.h
parentb3564e613cb4ea438ffacf9bb2b8001dc54fc797 (diff)
riscv64: Implement VarHandle.compareAndSet/-Exchange intrinsics.
Test: testrunner.py --target --64 --ndebug --optimizing Bug: 283082089 Change-Id: I8016cb046d1fbaa5ffe71917a4cce685dfc65f02
Diffstat (limited to 'compiler/optimizing/locations.h')
-rw-r--r--compiler/optimizing/locations.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index 7ee076f442..20099ebbc2 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -79,7 +79,7 @@ class Location : public ValueObject {
kUnallocated = 11,
};
- Location() : ValueObject(), value_(kInvalid) {
+ constexpr Location() : ValueObject(), value_(kInvalid) {
// Verify that non-constant location kinds do not interfere with kConstant.
static_assert((kInvalid & kLocationConstantMask) != kConstant, "TagError");
static_assert((kUnallocated & kLocationConstantMask) != kConstant, "TagError");
@@ -95,7 +95,7 @@ class Location : public ValueObject {
DCHECK(!IsValid());
}
- Location(const Location& other) = default;
+ constexpr Location(const Location& other) = default;
Location& operator=(const Location& other) = default;
@@ -126,24 +126,24 @@ class Location : public ValueObject {
}
// Empty location. Used if there the location should be ignored.
- static Location NoLocation() {
+ static constexpr Location NoLocation() {
return Location();
}
// Register locations.
- static Location RegisterLocation(int reg) {
+ static constexpr Location RegisterLocation(int reg) {
return Location(kRegister, reg);
}
- static Location FpuRegisterLocation(int reg) {
+ static constexpr Location FpuRegisterLocation(int reg) {
return Location(kFpuRegister, reg);
}
- static Location RegisterPairLocation(int low, int high) {
+ static constexpr Location RegisterPairLocation(int low, int high) {
return Location(kRegisterPair, low << 16 | high);
}
- static Location FpuRegisterPairLocation(int low, int high) {
+ static constexpr Location FpuRegisterPairLocation(int low, int high) {
return Location(kFpuRegisterPair, low << 16 | high);
}
@@ -423,7 +423,7 @@ class Location : public ValueObject {
explicit Location(uintptr_t value) : value_(value) {}
- Location(Kind kind, uintptr_t payload)
+ constexpr Location(Kind kind, uintptr_t payload)
: value_(KindField::Encode(kind) | PayloadField::Encode(payload)) {}
uintptr_t GetPayload() const {