comparison src/share/vm/opto/memnode.hpp @ 5121:2a667d6ef59e

8027840: C2 allows safepoint checks to leak into G1 pre-barriers Summary: Make all raw loads strictly respect control dependencies, make sure RCE doesn't move raw loads, add verification of G1 pre-barriers. Reviewed-by: kvn, roland
author iveresov
date Tue, 05 Nov 2013 01:57:18 -0800
parents be30099fbdec
children de5e8c8a9b87
comparison
equal deleted inserted replaced
42:609c8f8d86ea 43:1e7a84aa43df
202 static bool is_immutable_value(Node* adr); 202 static bool is_immutable_value(Node* adr);
203 #endif 203 #endif
204 protected: 204 protected:
205 const Type* load_array_final_field(const TypeKlassPtr *tkls, 205 const Type* load_array_final_field(const TypeKlassPtr *tkls,
206 ciKlass* klass) const; 206 ciKlass* klass) const;
207 // depends_only_on_test is almost always true, and needs to be almost always
208 // true to enable key hoisting & commoning optimizations. However, for the
209 // special case of RawPtr loads from TLS top & end, and other loads performed by
210 // GC barriers, the control edge carries the dependence preventing hoisting past
211 // a Safepoint instead of the memory edge. (An unfortunate consequence of having
212 // Safepoints not set Raw Memory; itself an unfortunate consequence of having Nodes
213 // which produce results (new raw memory state) inside of loops preventing all
214 // manner of other optimizations). Basically, it's ugly but so is the alternative.
215 // See comment in macro.cpp, around line 125 expand_allocate_common().
216 virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
217
207 }; 218 };
208 219
209 //------------------------------LoadBNode-------------------------------------- 220 //------------------------------LoadBNode--------------------------------------
210 // Load a byte (8bits signed) from memory 221 // Load a byte (8bits signed) from memory
211 class LoadBNode : public LoadNode { 222 class LoadBNode : public LoadNode {
368 : LoadNode(c,mem,adr,at,t) {} 379 : LoadNode(c,mem,adr,at,t) {}
369 virtual int Opcode() const; 380 virtual int Opcode() const;
370 virtual uint ideal_reg() const { return Op_RegP; } 381 virtual uint ideal_reg() const { return Op_RegP; }
371 virtual int store_Opcode() const { return Op_StoreP; } 382 virtual int store_Opcode() const { return Op_StoreP; }
372 virtual BasicType memory_type() const { return T_ADDRESS; } 383 virtual BasicType memory_type() const { return T_ADDRESS; }
373 // depends_only_on_test is almost always true, and needs to be almost always
374 // true to enable key hoisting & commoning optimizations. However, for the
375 // special case of RawPtr loads from TLS top & end, the control edge carries
376 // the dependence preventing hoisting past a Safepoint instead of the memory
377 // edge. (An unfortunate consequence of having Safepoints not set Raw
378 // Memory; itself an unfortunate consequence of having Nodes which produce
379 // results (new raw memory state) inside of loops preventing all manner of
380 // other optimizations). Basically, it's ugly but so is the alternative.
381 // See comment in macro.cpp, around line 125 expand_allocate_common().
382 virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
383 }; 384 };
384 385
385 386
386 //------------------------------LoadNNode-------------------------------------- 387 //------------------------------LoadNNode--------------------------------------
387 // Load a narrow oop from memory (either object or array) 388 // Load a narrow oop from memory (either object or array)
391 : LoadNode(c,mem,adr,at,t) {} 392 : LoadNode(c,mem,adr,at,t) {}
392 virtual int Opcode() const; 393 virtual int Opcode() const;
393 virtual uint ideal_reg() const { return Op_RegN; } 394 virtual uint ideal_reg() const { return Op_RegN; }
394 virtual int store_Opcode() const { return Op_StoreN; } 395 virtual int store_Opcode() const { return Op_StoreN; }
395 virtual BasicType memory_type() const { return T_NARROWOOP; } 396 virtual BasicType memory_type() const { return T_NARROWOOP; }
396 // depends_only_on_test is almost always true, and needs to be almost always
397 // true to enable key hoisting & commoning optimizations. However, for the
398 // special case of RawPtr loads from TLS top & end, the control edge carries
399 // the dependence preventing hoisting past a Safepoint instead of the memory
400 // edge. (An unfortunate consequence of having Safepoints not set Raw
401 // Memory; itself an unfortunate consequence of having Nodes which produce
402 // results (new raw memory state) inside of loops preventing all manner of
403 // other optimizations). Basically, it's ugly but so is the alternative.
404 // See comment in macro.cpp, around line 125 expand_allocate_common().
405 virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
406 }; 397 };
407 398
408 //------------------------------LoadKlassNode---------------------------------- 399 //------------------------------LoadKlassNode----------------------------------
409 // Load a Klass from an object 400 // Load a Klass from an object
410 class LoadKlassNode : public LoadPNode { 401 class LoadKlassNode : public LoadPNode {