diff options
author | 2020-07-30 12:19:31 +0000 | |
---|---|---|
committer | 2020-08-03 10:03:16 +0000 | |
commit | e3e187f29fa4025e30c5a43decb2b6f6c584d59c (patch) | |
tree | b38e434558cc2c6d7a8153c709a9884313cd4df1 /compiler/optimizing/locations.h | |
parent | 1a277a6e5d5152b4fe4dd5717432ecf8941ec820 (diff) |
Check if VarHandle access mode is supported.
This commit checks if a VarHandle access mode is supported. If not, an
UnsupportedOperationException is raised by calling the runtime to handle it.
I added the polymorphic intrinsics case in the IntrinsicSlowPath
code generation to handle all the eventual exceptions. For now,
none of the operations are actually compiled. If the slow path is
not called, the runtime handles the operation.
Bug: b/65872996
Test: art/test.py --host -r -t 712-varhandle-invocations --32
Test: art/test.py --host --all-compiler -r
Change-Id: I5a637561549b3fdd64fa53e2d7dbf835d3ae0d64
Diffstat (limited to 'compiler/optimizing/locations.h')
-rw-r--r-- | compiler/optimizing/locations.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h index 8f5eed7afd..2a09921ba4 100644 --- a/compiler/optimizing/locations.h +++ b/compiler/optimizing/locations.h @@ -478,6 +478,23 @@ class RegisterSet : public ValueObject { return (register_set & (1 << reg)) != 0; } + bool OverlapsRegisters(Location out) { + DCHECK(out.IsRegisterKind()); + switch (out.GetKind()) { + case Location::Kind::kRegister: + return ContainsCoreRegister(out.reg()); + case Location::Kind::kFpuRegister: + return ContainsFloatingPointRegister(out.reg()); + case Location::Kind::kRegisterPair: + return ContainsCoreRegister(out.low()) || ContainsCoreRegister(out.high()); + case Location::Kind::kFpuRegisterPair: + return ContainsFloatingPointRegister(out.low()) || + ContainsFloatingPointRegister(out.high()); + default: + return false; + } + } + size_t GetNumberOfRegisters() const { return POPCOUNT(core_registers_) + POPCOUNT(floating_point_registers_); } |