1
1
/*
2
- * Copyright (c) 1997, 2020 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1997, 2021 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
38
38
39
39
// Optimization - Graph Style
40
40
41
- class Chaitin ;
42
41
class NamedCounter ;
43
42
class MultiNode ;
44
43
class SafePointNode ;
@@ -52,13 +51,9 @@ class CallLeafNoFPNode;
52
51
class CallNativeNode ;
53
52
class AllocateNode ;
54
53
class AllocateArrayNode ;
55
- class BoxLockNode ;
56
- class LockNode ;
57
- class UnlockNode ;
58
- class JVMState ;
59
- class State ;
60
- class StartNode ;
61
- class MachCallNode ;
54
+ class AbstractLockNode ;
55
+ class LockNode ;
56
+ class UnlockNode ;
62
57
class FastLockNode ;
63
58
64
59
// ------------------------------StartNode--------------------------------------
@@ -294,7 +289,8 @@ class JVMState : public ResourceObj {
294
289
void set_offsets (uint off) {
295
290
_locoff = _stkoff = _monoff = _scloff = _endoff = off;
296
291
}
297
- void set_map (SafePointNode *map) { _map = map; }
292
+ void set_map (SafePointNode* map) { _map = map; }
293
+ void bind_map (SafePointNode* map); // set_map() and set_jvms() for the SafePointNode
298
294
void set_sp (uint sp) { _sp = sp; }
299
295
// _reexecute is initialized to "undefined" for a new bci
300
296
void set_bci (int bci) {if (_bci != bci)_reexecute=Reexecute_Undefined; _bci = bci; }
@@ -323,9 +319,26 @@ class JVMState : public ResourceObj {
323
319
// potential code sharing) only - conceptually it is independent of
324
320
// the Node semantics.
325
321
class SafePointNode : public MultiNode {
322
+ friend JVMState;
323
+ friend class GraphKit ;
324
+ friend class VMStructs ;
325
+
326
326
virtual bool cmp ( const Node &n ) const ;
327
327
virtual uint size_of () const ; // Size is bigger
328
328
329
+ protected:
330
+ JVMState* const _jvms; // Pointer to list of JVM State objects
331
+ // Many calls take *all* of memory as input,
332
+ // but some produce a limited subset of that memory as output.
333
+ // The adr_type reports the call's behavior as a store, not a load.
334
+ const TypePtr* _adr_type; // What type of memory does this node produce?
335
+ ReplacedNodes _replaced_nodes; // During parsing: list of pair of nodes from calls to GraphKit::replace_in_map()
336
+ bool _has_ea_local_in_scope; // NoEscape or ArgEscape objects in JVM States
337
+
338
+ void set_jvms (JVMState* s) {
339
+ assert (s != nullptr , " assign NULL value to _jvms" );
340
+ *(JVMState**)&_jvms = s; // override const attribute in the accessor
341
+ }
329
342
public:
330
343
SafePointNode (uint edges, JVMState* jvms,
331
344
// A plain safepoint advertises no memory effects (NULL):
@@ -338,20 +351,7 @@ class SafePointNode : public MultiNode {
338
351
init_class_id (Class_SafePoint);
339
352
}
340
353
341
- JVMState* const _jvms; // Pointer to list of JVM State objects
342
- const TypePtr* _adr_type; // What type of memory does this node produce?
343
- ReplacedNodes _replaced_nodes; // During parsing: list of pair of nodes from calls to GraphKit::replace_in_map()
344
- bool _has_ea_local_in_scope; // NoEscape or ArgEscape objects in JVM States
345
-
346
- // Many calls take *all* of memory as input,
347
- // but some produce a limited subset of that memory as output.
348
- // The adr_type reports the call's behavior as a store, not a load.
349
-
350
- virtual JVMState* jvms () const { return _jvms; }
351
- void set_jvms (JVMState* s) {
352
- *(JVMState**)&_jvms = s; // override const attribute in the accessor
353
- }
354
-
354
+ JVMState* jvms () const { return _jvms; }
355
355
private:
356
356
void verify_input (JVMState* jvms, uint idx) const {
357
357
assert (verify_jvms (jvms), " jvms must match" );
@@ -474,8 +474,9 @@ class SafePointNode : public MultiNode {
474
474
virtual int Opcode () const ;
475
475
virtual bool pinned () const { return true ; }
476
476
virtual const Type* Value (PhaseGVN* phase) const ;
477
- virtual const Type *bottom_type () const { return Type::CONTROL; }
478
- virtual const TypePtr *adr_type () const { return _adr_type; }
477
+ virtual const Type* bottom_type () const { return Type::CONTROL; }
478
+ virtual const TypePtr* adr_type () const { return _adr_type; }
479
+ void set_adr_type (const TypePtr* adr_type) { _adr_type = adr_type; }
479
480
virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
480
481
virtual Node* Identity (PhaseGVN* phase);
481
482
virtual uint ideal_reg () const { return 0 ; }
@@ -579,8 +580,8 @@ class CallNode : public SafePointNode {
579
580
CallGenerator* _generator; // corresponding CallGenerator for some late inline calls
580
581
const char * _name; // Printable name, if _method is NULL
581
582
582
- CallNode (const TypeFunc* tf, address addr, const TypePtr* adr_type)
583
- : SafePointNode(tf->domain ()->cnt(), NULL , adr_type),
583
+ CallNode (const TypeFunc* tf, address addr, const TypePtr* adr_type, JVMState* jvms = nullptr )
584
+ : SafePointNode(tf->domain ()->cnt(), jvms , adr_type),
584
585
_tf(tf),
585
586
_entry_point(addr),
586
587
_cnt(COUNT_UNKNOWN),
@@ -787,8 +788,8 @@ class CallRuntimeNode : public CallNode {
787
788
virtual uint size_of () const ; // Size is bigger
788
789
public:
789
790
CallRuntimeNode (const TypeFunc* tf, address addr, const char * name,
790
- const TypePtr* adr_type)
791
- : CallNode(tf, addr, adr_type)
791
+ const TypePtr* adr_type, JVMState* jvms = nullptr )
792
+ : CallNode(tf, addr, adr_type, jvms )
792
793
{
793
794
init_class_id (Class_CallRuntime);
794
795
_name = name;
0 commit comments