diff options
author | Andra Danciu <andradanciu@google.com> | 2020-08-25 08:17:37 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2020-08-25 09:46:29 +0000 |
commit | 6a6cca588df43a180534db0b49475a8a5ab4c35a (patch) | |
tree | adafb795eafe8960d664ad18121004f470fb944d /compiler/optimizing/instruction_builder.cc | |
parent | 466c66be45cafea4f5339f42acd90b9f40f1ec69 (diff) |
Revert "X86: VarHandle.get() for reference type static fields."
This reverts commit a18ed1bcdb665320c901e1c07b9f92af186077d7.
Reason for revert: Fails 712-varhandle-invocations for art-heap-poisoning and art-read-barrier-heap-poisoning in master-art-host
Change-Id: I703923e2c7b5bc07c2270d0a0328bac8d02b655d
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 1993fa2512..6839292397 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -1148,10 +1148,6 @@ bool HInstructionBuilder::BuildInvokePolymorphic(uint32_t dex_pc, DCHECK_EQ(1 + ArtMethod::NumArgRegisters(shorty), operands.GetNumberOfOperands()); DataType::Type return_type = DataType::FromShorty(shorty[0]); size_t number_of_arguments = strlen(shorty); - // Other inputs are needed to propagate type information regarding the MethodType of the - // call site. We need this when generating code to check that VarHandle accessors are - // called correctly (for references). - size_t number_of_other_inputs = 0u; // We use ResolveMethod which is also used in BuildInvoke in order to // not duplicate code. As such, we need to provide is_string_constructor // even if we don't need it afterwards. @@ -1163,36 +1159,12 @@ bool HInstructionBuilder::BuildInvokePolymorphic(uint32_t dex_pc, &invoke_type, /* target_method= */ nullptr, &is_string_constructor); - - bool needs_other_inputs = - resolved_method->GetIntrinsic() == static_cast<uint32_t>(Intrinsics::kVarHandleGet) && - return_type == DataType::Type::kReference && - number_of_arguments == 1u; - if (needs_other_inputs) { - // The extra argument here is the loaded callsite return type, which needs to be checked - // against the runtime VarHandle type. - number_of_other_inputs++; - } - HInvoke* invoke = new (allocator_) HInvokePolymorphic(allocator_, number_of_arguments, - number_of_other_inputs, return_type, dex_pc, method_idx, resolved_method); - - if (needs_other_inputs) { - ScopedObjectAccess soa(Thread::Current()); - ArtMethod* referrer = graph_->GetArtMethod(); - dex::TypeIndex ret_type_index = referrer->GetDexFile()->GetProtoId(proto_idx).return_type_idx_; - HLoadClass* load_cls = BuildLoadClass(ret_type_index, dex_pc); - size_t last_index = invoke->InputCount() - 1; - - DCHECK(invoke->InputAt(last_index) == nullptr); - invoke->SetRawInputAt(last_index, load_cls); - } - return HandleInvoke(invoke, operands, shorty, /* is_unresolved= */ false); } |