72 int field_offset(uint index) const;
73 uint field_index(int offset) const;
74 ciType* field_type(uint index) const;
75 bool field_is_flattened(uint index) const;
76 bool field_is_flattenable(uint index) const;
77
78 // Replace ValueTypeNodes in debug info at safepoints with SafePointScalarObjectNodes
79 void make_scalar_in_safepoints(PhaseIterGVN* igvn);
80
81 // Store the value type as a flattened (headerless) representation
82 void store_flattened(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder = NULL, int holder_offset = 0, DecoratorSet decorators = IN_HEAP | MO_UNORDERED) const;
83 // Store the field values to memory
84 void store(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0, DecoratorSet decorators = IN_HEAP | MO_UNORDERED) const;
85 // Initialize the value type by loading its field values from memory
86 void load(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0, DecoratorSet decorators = IN_HEAP | MO_UNORDERED);
87
88 // Allocates the value type (if not yet allocated)
89 ValueTypeBaseNode* allocate(GraphKit* kit, bool safe_for_replace = true);
90 bool is_allocated(PhaseGVN* phase) const;
91
92 void replace_call_results(GraphKit* kit, Node* call, Compile* C);
93
94 // Allocate all non-flattened value type fields
95 Node* allocate_fields(GraphKit* kit);
96 };
97
98 //------------------------------ValueTypeNode-------------------------------------
99 // Node representing a value type in C2 IR
100 class ValueTypeNode : public ValueTypeBaseNode {
101 friend class ValueTypeBaseNode;
102 friend class ValueTypePtrNode;
103 private:
104 ValueTypeNode(ciValueKlass* vk, Node* oop)
105 : ValueTypeBaseNode(TypeValueType::make(vk), Values + vk->nof_declared_nonstatic_fields()) {
106 init_class_id(Class_ValueType);
107 init_req(Oop, oop);
108 }
109
110 // Checks if the value type is loaded from memory and if so returns the oop
111 Node* is_loaded(PhaseGVN* phase, ciValueKlass* vk = NULL, Node* base = NULL, int holder_offset = 0);
|
72 int field_offset(uint index) const;
73 uint field_index(int offset) const;
74 ciType* field_type(uint index) const;
75 bool field_is_flattened(uint index) const;
76 bool field_is_flattenable(uint index) const;
77
78 // Replace ValueTypeNodes in debug info at safepoints with SafePointScalarObjectNodes
79 void make_scalar_in_safepoints(PhaseIterGVN* igvn);
80
81 // Store the value type as a flattened (headerless) representation
82 void store_flattened(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder = NULL, int holder_offset = 0, DecoratorSet decorators = IN_HEAP | MO_UNORDERED) const;
83 // Store the field values to memory
84 void store(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0, DecoratorSet decorators = IN_HEAP | MO_UNORDERED) const;
85 // Initialize the value type by loading its field values from memory
86 void load(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0, DecoratorSet decorators = IN_HEAP | MO_UNORDERED);
87
88 // Allocates the value type (if not yet allocated)
89 ValueTypeBaseNode* allocate(GraphKit* kit, bool safe_for_replace = true);
90 bool is_allocated(PhaseGVN* phase) const;
91
92 // Ensure that writes to base are comitted before a subsequent store.
93 void ready_to_publish(GraphKit* kit, Node* base) const;
94
95 void replace_call_results(GraphKit* kit, Node* call, Compile* C);
96
97 // Allocate all non-flattened value type fields
98 Node* allocate_fields(GraphKit* kit);
99 };
100
101 //------------------------------ValueTypeNode-------------------------------------
102 // Node representing a value type in C2 IR
103 class ValueTypeNode : public ValueTypeBaseNode {
104 friend class ValueTypeBaseNode;
105 friend class ValueTypePtrNode;
106 private:
107 ValueTypeNode(ciValueKlass* vk, Node* oop)
108 : ValueTypeBaseNode(TypeValueType::make(vk), Values + vk->nof_declared_nonstatic_fields()) {
109 init_class_id(Class_ValueType);
110 init_req(Oop, oop);
111 }
112
113 // Checks if the value type is loaded from memory and if so returns the oop
114 Node* is_loaded(PhaseGVN* phase, ciValueKlass* vk = NULL, Node* base = NULL, int holder_offset = 0);
|