// Returns the DEX file created using the parameters, if it could be verified. Returns nullptr if // the DEX file couldn't be verified.
ALWAYS_INLINE std::unique_ptr<StandardDexFile> VerifyDexFile(const uint8_t* data,
size_t size, const std::string& location);
// Class verification
// A class to be friends with ClassLinker and access the internal FindDexCacheDataLocked method. class FuzzerCommonHelper { public: staticconst ClassLinker::DexCacheData* GetDexCacheData(Runtime* runtime, const StandardDexFile* dex_file)
REQUIRES_SHARED(Locks::mutator_lock_);
};
// Verifies all classes within a DEX file. Returns true iff all classes could be verified.
ALWAYS_INLINE bool VerifyClasses(jobject class_loader, const StandardDexFile* dex_file);
// Registers a DEX file with the given runtime.
jobject RegisterDexFileAndGetClassLoader(Runtime* runtime, const StandardDexFile* dex_file);
// Initialization for all fuzzers that need a Runtime. void FuzzerInitialize(CompilerCallbacks* callbacks, InstructionSet isa);
// Cleans up memory after the iteration ran.
ALWAYS_INLINE void IterationCleanup(jobject class_loader, const StandardDexFile* dex_file);
// Compilation
// Storage that will fake setting the thunk code so that the fuzzer can call Emit and test that code // path. class FuzzerCompiledMethodStorage final : public CompiledCodeStorage { public:
FuzzerCompiledMethodStorage() {}
~FuzzerCompiledMethodStorage() {}
// Common code for several compiler's CompileClasses. // The compile_method_fn is called for each method that passes the filters. // Returns true if the compiler was called for this method; false otherwise. template <typename CompileMethodFn>
ALWAYS_INLINE bool CompileClassesCommon(jobject class_loader, const StandardDexFile* dex_file,
FuzzerCompilerCallbacks* callbacks,
CompileMethodFn compile_method_fn);
// Compiles all classes within a DEX file. Returns true iff at least one method called the compiler.
ALWAYS_INLINE bool CompileClasses(jobject class_loader, const StandardDexFile* dex_file,
Compiler* compiler,
FuzzerCompilerCallbacks* callbacks, bool debug_prints);
// Compiles all classes within a DEX file using the fast compiler. Returns true iff at least one // method called the compiler.
ALWAYS_INLINE bool CompileClassesFast(jobject class_loader, const StandardDexFile* dex_file,
CompilerOptions* compiler_options,
FuzzerCompilerCallbacks* callbacks, bool debug_prints);
// Creates a compiler. As part of this, creates and sets `compiler_options`.
Compiler* CreateCompiler(const CompilerOptions& compiler_options,
CompiledCodeStorage* storage);
std::unique_ptr<CompilerOptions> CreateCompilerOptions(bool is_baseline, InstructionSet isa);
// Common compiler fuzzer main logic. template <typename CompilerOrCompilerOptions, typename CompileFn>
ALWAYS_INLINE int FuzzerTestOneInputCommon( const uint8_t* data,
size_t size,
CompilerOrCompilerOptions* compiler_or_compiler_options,
FuzzerCompilerCallbacks* callbacks, int* skipped_gc_iterations, int max_skip_gc_iterations, bool debug_prints,
std::vector<std::unique_ptr<uint8_t[]>>& data_to_delete,
std::vector<std::unique_ptr<StandardDexFile>>& dex_files_to_delete,
CompileFn compile_fn);
// Baseline and Optimizing compilers
ALWAYS_INLINE int CompilerFuzzerTestOneInput( const uint8_t* data,
size_t size,
Compiler* compiler,
FuzzerCompilerCallbacks* callbacks, int* skipped_gc_iterations, int max_skip_gc_iterations, bool debug_prints,
std::vector<std::unique_ptr<uint8_t[]>>& data_to_delete,
std::vector<std::unique_ptr<StandardDexFile>>& dex_files_to_delete);
// Fast compiler
ALWAYS_INLINE int FastCompilerFuzzerTestOneInput( const uint8_t* data,
size_t size,
CompilerOptions* compiler_options,
FuzzerCompilerCallbacks* callbacks, int* skipped_gc_iterations, int max_skip_gc_iterations, bool debug_prints,
std::vector<std::unique_ptr<uint8_t[]>>& data_to_delete,
std::vector<std::unique_ptr<StandardDexFile>>& dex_files_to_delete);
} // namespace fuzzer
} // namespace art
#endif// ART_TOOLS_FUZZER_FUZZER_COMMON_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.