--- old/src/share/vm/opto/valuetypenode.hpp 2017-06-26 12:50:31.915902871 +0200 +++ new/src/share/vm/opto/valuetypenode.hpp 2017-06-26 12:50:31.831902875 +0200 @@ -49,7 +49,9 @@ // Get the klass defining the field layout of the value type ciValueKlass* value_klass() const { return type()->is_valuetype()->value_klass(); } // Initialize the value type by loading its field values from memory - void load_values(PhaseGVN& gvn, Node* mem, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0); + void load(PhaseGVN& gvn, Node* mem, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0); + // Checks if the value type is loaded from memory and if so returns the oop + Node* is_loaded(PhaseGVN* phase, const TypeValueType* t, Node* base = NULL, int holder_offset = 0); enum { Control, // Control input Oop, // Oop of TypeValueTypePtr @@ -73,16 +75,17 @@ bool has_phi_inputs(Node* region); ValueTypeNode* merge_with(PhaseGVN* gvn, const ValueTypeNode* other, int pnum, bool transform); - // Store the value type to memory if not yet allocated and returns the oop - Node* store_to_memory(GraphKit* kit); - // Store the value type to a flattened value type field or array - void store(GraphKit* kit, Node* obj, Node* ptr, ciInstanceKlass* holder = NULL, int holder_offset = 0) const; + // Store the value type as a flattened (headerless) representation + void store_flattened(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder = NULL, int holder_offset = 0) const; // Store the field values to memory - void store_values(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0) const; + void store(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass* holder, int holder_offset = 0) const; // Get oop for heap allocated value type (may be TypePtr::NULL_PTR) Node* get_oop() const { return in(Oop); } void set_oop(Node* oop) { set_req(Oop, oop); } + // Allocates the value type (if not yet allocated) and returns the oop + Node* allocate(GraphKit* kit); + bool is_allocated(PhaseGVN* phase) const; // Value type fields uint field_count() const { return req() - Values; } @@ -98,6 +101,8 @@ uint pass_fields(Node* call, int base_input, const GraphKit& kit, ciValueKlass* base_vk = NULL, int base_offset = 0); void replace_call_results(Node* call, Compile* C); + // Allocation optimizations + void remove_redundant_allocations(PhaseIterGVN* igvn, PhaseIdealLoop* phase); virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); virtual int Opcode() const;