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/intrinsics_utils.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/intrinsics_utils.h')
-rw-r--r-- | compiler/optimizing/intrinsics_utils.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/optimizing/intrinsics_utils.h b/compiler/optimizing/intrinsics_utils.h index 29f815c1be..4b8a8e743d 100644 --- a/compiler/optimizing/intrinsics_utils.h +++ b/compiler/optimizing/intrinsics_utils.h @@ -65,15 +65,18 @@ class IntrinsicSlowPath : public TSlowPathCode { DCHECK_NE(invoke_static_or_direct->GetCodePtrLocation(), HInvokeStaticOrDirect::CodePtrLocation::kCallCriticalNative); codegen->GenerateStaticOrDirectCall(invoke_static_or_direct, method_loc, this); - } else { + } else if (invoke_->IsInvokeVirtual()) { codegen->GenerateVirtualCall(invoke_->AsInvokeVirtual(), method_loc, this); + } else { + DCHECK(invoke_->IsInvokePolymorphic()); + codegen->GenerateInvokePolymorphicCall(invoke_->AsInvokePolymorphic(), this); } // Copy the result back to the expected output. Location out = invoke_->GetLocations()->Out(); if (out.IsValid()) { - DCHECK(out.IsRegister()); // TODO: Replace this when we support output in memory. - DCHECK(!invoke_->GetLocations()->GetLiveRegisters()->ContainsCoreRegister(out.reg())); + DCHECK(out.IsRegisterKind()); // TODO: Replace this when we support output in memory. + DCHECK(!invoke_->GetLocations()->GetLiveRegisters()->OverlapsRegisters(out)); codegen->MoveFromReturnRegister(out, invoke_->GetType()); } |