summaryrefslogtreecommitdiff
path: root/runtime/verifier/method_verifier.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-12-02 11:05:11 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2025-01-09 04:52:49 -0800
commit7e2ae92b439096bea8036f5007964f8983990f8e (patch)
tree88815366151bd79d39a5822ef2452ac8e3934e82 /runtime/verifier/method_verifier.h
parentd70f5686641e24f062eb63348d814f0294ec08e9 (diff)
verifier: Speed up failure recording.
Move the failure data to the `Arena` memory. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I92b503f366286c4ad73d1e0eacc815635c86c119
Diffstat (limited to 'runtime/verifier/method_verifier.h')
-rw-r--r--runtime/verifier/method_verifier.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index 13631850b7..36c033ab64 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -156,7 +156,7 @@ class MethodVerifier {
uint32_t api_level)
REQUIRES_SHARED(Locks::mutator_lock_);
- virtual ~MethodVerifier();
+ virtual ~MethodVerifier() {}
const CodeItemDataAccessor& CodeItem() const {
return code_item_accessor_;
@@ -331,10 +331,16 @@ class MethodVerifier {
// Owned, but not unique_ptr since insn_flags_ are allocated in arenas.
ArenaUniquePtr<InstructionFlags[]> insn_flags_;
- // The types of any error that occurs.
- std::vector<VerifyError> failures_;
- // Error messages associated with failures.
- std::vector<std::ostringstream*> failure_messages_;
+ // The types of any error that occurs and associated error messages.
+ using MessageOStream =
+ std::basic_ostringstream<char, std::char_traits<char>, ArenaAllocatorAdapter<char>>;
+ struct VerifyErrorAndMessage {
+ VerifyErrorAndMessage(VerifyError e, const std::string& location, ArenaAllocatorAdapter<char> a)
+ : error(e), message(location, std::ios_base::ate, a) {}
+ VerifyError error;
+ MessageOStream message;
+ };
+ ArenaList<VerifyErrorAndMessage> failures_;
struct {
// Is there a pending hard failure?