< prev index next >

src/hotspot/share/ci/ciEnv.hpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 37,10 ***
--- 37,12 ---
  #include "oops/methodData.hpp"
  #include "runtime/javaThread.hpp"
  
  class CompileTask;
  class OopMapSet;
+ class SCCEntry;
+ class SCCReader;
  
  // ciEnv
  //
  // This class is the top level broker for requests from the compiler
  // to the VM.

*** 289,10 ***
--- 291,16 ---
    static bool is_in_vm();
  
    // Helper routine for determining the validity of a compilation with
    // respect to method dependencies (e.g. concurrent class loading).
    void validate_compile_task_dependencies(ciMethod* target);
+ 
+   // Helper rountimes to factor out common code used by routines that register a method
+   // i.e. register_aot_method() and register_method()
+   bool is_compilation_valid(JavaThread* thread, ciMethod* target, bool preload, bool install_code, CodeBuffer* code_buffer, SCCEntry* scc_entry);
+   void make_code_usable(JavaThread* thread, ciMethod* target, bool preload, int entry_bci, SCCEntry* scc_entry, nmethod* nm);
+ 
  public:
    enum {
      MethodCompilable,
      MethodCompilable_not_at_tier,
      MethodCompilable_never

*** 361,10 ***
--- 369,28 ---
  
    // Handy forwards to the task:
    int comp_level();   // task()->comp_level()
    int compile_id();  // task()->compile_id()
  
+   // Register method loaded from AOT code cache
+   void register_aot_method(JavaThread* thread,
+                            ciMethod* target,
+                            AbstractCompiler* compiler,
+                            nmethod* archived_nm,
+                            address reloc_data,
+                            GrowableArray<Handle>& oop_list,
+                            GrowableArray<Metadata*>& metadata_list,
+                            ImmutableOopMapSet* oopmaps,
+                            address immutable_data,
+                            GrowableArray<Handle>& reloc_imm_oop_list,
+                            GrowableArray<Metadata*>& reloc_imm_metadata_list,
+ #ifndef PRODUCT
+                            AsmRemarks& asm_remarks,
+                            DbgStrings& dbg_strings,
+ #endif /* PRODUCT */
+                            SCCReader* scc_reader);
+ 
    // Register the result of a compilation.
    void register_method(ciMethod*                 target,
                         int                       entry_bci,
                         CodeOffsets*              offsets,
                         int                       orig_pc_offset,

*** 372,15 ***
                         int                       frame_words,
                         OopMapSet*                oop_map_set,
                         ExceptionHandlerTable*    handler_table,
                         ImplicitExceptionTable*   inc_table,
                         AbstractCompiler*         compiler,
                         bool                      has_unsafe_access,
                         bool                      has_wide_vectors,
                         bool                      has_monitors,
                         bool                      has_scoped_access,
!                        int                       immediate_oops_patched);
  
    // Access to certain well known ciObjects.
  #define VM_CLASS_FUNC(name, ignore_s) \
    ciInstanceKlass* name() { \
      return _##name;\
--- 398,19 ---
                         int                       frame_words,
                         OopMapSet*                oop_map_set,
                         ExceptionHandlerTable*    handler_table,
                         ImplicitExceptionTable*   inc_table,
                         AbstractCompiler*         compiler,
+                        bool                      has_clinit_barriers,
+                        bool                      for_preload,
                         bool                      has_unsafe_access,
                         bool                      has_wide_vectors,
                         bool                      has_monitors,
                         bool                      has_scoped_access,
!                        int                       immediate_oops_patched,
+                        bool                      install_code,
+                        SCCEntry*                 entry = nullptr);
  
    // Access to certain well known ciObjects.
  #define VM_CLASS_FUNC(name, ignore_s) \
    ciInstanceKlass* name() { \
      return _##name;\

*** 466,10 ***
--- 496,17 ---
    void record_out_of_memory_failure();
  
    // RedefineClasses support
    void metadata_do(MetadataClosure* f) { _factory->metadata_do(f); }
  
+ private:
+   SCCEntry* _scc_clinit_barriers_entry;
+ 
+ public:
+   void  set_scc_clinit_barriers_entry(SCCEntry* entry) { _scc_clinit_barriers_entry = entry; }
+   SCCEntry* scc_clinit_barriers_entry()          const { return _scc_clinit_barriers_entry; }
+ 
    // Replay support
  private:
    static int klass_compare(const InstanceKlass* const &ik1, const InstanceKlass* const &ik2) {
      if (ik1 > ik2) {
        return 1;

*** 510,8 ***
--- 547,12 ---
    void record_call_site_obj(Thread* thread, oop obj);
    void record_call_site_method(Thread* thread, Method* adapter);
    void process_invokedynamic(const constantPoolHandle &cp, int index, JavaThread* thread);
    void process_invokehandle(const constantPoolHandle &cp, int index, JavaThread* thread);
    void find_dynamic_call_sites();
+ 
+   bool is_precompiled();
+   bool is_fully_initialized(InstanceKlass* ik);
+   InstanceKlass::ClassState compute_init_state_for_precompiled(InstanceKlass* ik);
  };
  
  #endif // SHARE_CI_CIENV_HPP
< prev index next >