1 /*
2 * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
301 virtual Node* atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
302
303 virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
304
305 virtual Node* obj_allocate(PhaseMacroExpand* macro, Node* mem, Node* toobig_false, Node* size_in_bytes,
306 Node*& i_o, Node*& needgc_ctrl,
307 Node*& fast_oop_ctrl, Node*& fast_oop_rawmem,
308 intx prefetch_lines) const;
309
310 virtual Node* ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { return nullptr; }
311
312 // These are general helper methods used by C2
313 enum ArrayCopyPhase {
314 Parsing,
315 Optimization,
316 Expansion
317 };
318
319 virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const { return false; }
320 virtual void clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const;
321
322 // Support for GC barriers emitted during parsing
323 virtual bool has_load_barrier_nodes() const { return false; }
324 virtual bool is_gc_pre_barrier_node(Node* node) const { return false; }
325 virtual bool is_gc_barrier_node(Node* node) const { return false; }
326 virtual Node* step_over_gc_barrier(Node* c) const { return c; }
327
328 // Support for macro expanded GC barriers
329 virtual void register_potential_barrier_node(Node* node) const { }
330 virtual void unregister_potential_barrier_node(Node* node) const { }
331 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
332 virtual void eliminate_gc_barrier_data(Node* node) const { }
333 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
334 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
335
336 // Allow barrier sets to have shared state that is preserved across a compilation unit.
337 // This could for example comprise macro nodes to be expanded during macro expansion.
338 virtual void* create_barrier_state(Arena* comp_arena) const { return nullptr; }
339 // If the BarrierSetC2 state has barrier nodes in its compilation
340 // unit state to be expanded later, then now is the time to do so.
|
1 /*
2 * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
301 virtual Node* atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
302
303 virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
304
305 virtual Node* obj_allocate(PhaseMacroExpand* macro, Node* mem, Node* toobig_false, Node* size_in_bytes,
306 Node*& i_o, Node*& needgc_ctrl,
307 Node*& fast_oop_ctrl, Node*& fast_oop_rawmem,
308 intx prefetch_lines) const;
309
310 virtual Node* ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { return nullptr; }
311
312 // These are general helper methods used by C2
313 enum ArrayCopyPhase {
314 Parsing,
315 Optimization,
316 Expansion
317 };
318
319 virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const { return false; }
320 virtual void clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const;
321 bool should_copy_int_prefix(PhaseMacroExpand* phase, ArrayCopyNode* ac) const;
322 MergeMemNode* arraycopy_copy_int_prefix(PhaseMacroExpand* phase, Node* ctrl, Node* mem, Node* src, Node* dst) const;
323
324 // Support for GC barriers emitted during parsing
325 virtual bool has_load_barrier_nodes() const { return false; }
326 virtual bool is_gc_pre_barrier_node(Node* node) const { return false; }
327 virtual bool is_gc_barrier_node(Node* node) const { return false; }
328 virtual Node* step_over_gc_barrier(Node* c) const { return c; }
329
330 // Support for macro expanded GC barriers
331 virtual void register_potential_barrier_node(Node* node) const { }
332 virtual void unregister_potential_barrier_node(Node* node) const { }
333 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
334 virtual void eliminate_gc_barrier_data(Node* node) const { }
335 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
336 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
337
338 // Allow barrier sets to have shared state that is preserved across a compilation unit.
339 // This could for example comprise macro nodes to be expanded during macro expansion.
340 virtual void* create_barrier_state(Arena* comp_arena) const { return nullptr; }
341 // If the BarrierSetC2 state has barrier nodes in its compilation
342 // unit state to be expanded later, then now is the time to do so.
|