comparison src/share/vm/opto/memnode.hpp @ 164:c436414a719e

6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions Summary: Add LoadNKlass and CMoveN nodes, use CmpN and ConN nodes to generate narrow oops compare instructions. Reviewed-by: never, rasbold
author kvn
date Wed, 21 May 2008 13:46:23 -0700
parents 885ed790ecf0
children 9148c65abefc
comparison
equal deleted inserted replaced
163:885ed790ecf0 164:c436414a719e
159 159
160 // Compute a new Type for this node. Basically we just do the pre-check, 160 // Compute a new Type for this node. Basically we just do the pre-check,
161 // then call the virtual add() to set the type. 161 // then call the virtual add() to set the type.
162 virtual const Type *Value( PhaseTransform *phase ) const; 162 virtual const Type *Value( PhaseTransform *phase ) const;
163 163
164 // Common methods for LoadKlass and LoadNKlass nodes.
165 const Type *klass_value_common( PhaseTransform *phase ) const;
166 Node *klass_identity_common( PhaseTransform *phase );
167
164 virtual uint ideal_reg() const; 168 virtual uint ideal_reg() const;
165 virtual const Type *bottom_type() const; 169 virtual const Type *bottom_type() const;
166 // Following method is copied from TypeNode: 170 // Following method is copied from TypeNode:
167 void set_type(const Type* t) { 171 void set_type(const Type* t) {
168 assert(t != NULL, "sanity"); 172 assert(t != NULL, "sanity");
360 364
361 //------------------------------LoadKlassNode---------------------------------- 365 //------------------------------LoadKlassNode----------------------------------
362 // Load a Klass from an object 366 // Load a Klass from an object
363 class LoadKlassNode : public LoadPNode { 367 class LoadKlassNode : public LoadPNode {
364 public: 368 public:
365 LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk = TypeKlassPtr::OBJECT ) 369 LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk )
366 : LoadPNode(c,mem,adr,at,tk) {} 370 : LoadPNode(c,mem,adr,at,tk) {}
367 virtual int Opcode() const; 371 virtual int Opcode() const;
368 virtual const Type *Value( PhaseTransform *phase ) const; 372 virtual const Type *Value( PhaseTransform *phase ) const;
369 virtual Node *Identity( PhaseTransform *phase ); 373 virtual Node *Identity( PhaseTransform *phase );
370 virtual bool depends_only_on_test() const { return true; } 374 virtual bool depends_only_on_test() const { return true; }
371 }; 375
376 // Polymorphic factory method:
377 static Node* make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at,
378 const TypeKlassPtr *tk = TypeKlassPtr::OBJECT );
379 };
380
381 //------------------------------LoadNKlassNode---------------------------------
382 // Load a narrow Klass from an object.
383 class LoadNKlassNode : public LoadNNode {
384 public:
385 LoadNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowOop *tk )
386 : LoadNNode(c,mem,adr,at,tk) {}
387 virtual int Opcode() const;
388 virtual uint ideal_reg() const { return Op_RegN; }
389 virtual int store_Opcode() const { return Op_StoreN; }
390 virtual BasicType memory_type() const { return T_NARROWOOP; }
391
392 virtual const Type *Value( PhaseTransform *phase ) const;
393 virtual Node *Identity( PhaseTransform *phase );
394 virtual bool depends_only_on_test() const { return true; }
395 };
396
372 397
373 //------------------------------LoadSNode-------------------------------------- 398 //------------------------------LoadSNode--------------------------------------
374 // Load a short (16bits signed) from memory 399 // Load a short (16bits signed) from memory
375 class LoadSNode : public LoadNode { 400 class LoadSNode : public LoadNode {
376 public: 401 public: