comparison src/share/vm/opto/machnode.hpp @ 2008:2f644f85485d

6961690: load oops from constant table on SPARC Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence. Reviewed-by: never, kvn
author twisti
date Fri, 03 Dec 2010 01:34:31 -0800
parents f95d63e2154a
children 3d42f82cd811
comparison
equal deleted inserted replaced
2007:5ddfcf4b079e 2008:2f644f85485d
229 virtual int compute_padding(int current_offset) const { return 0; } 229 virtual int compute_padding(int current_offset) const { return 0; }
230 230
231 // Return number of relocatable values contained in this instruction 231 // Return number of relocatable values contained in this instruction
232 virtual int reloc() const { return 0; } 232 virtual int reloc() const { return 0; }
233 233
234 // Return number of words used for double constants in this instruction
235 virtual int const_size() const { return 0; }
236
237 // Hash and compare over operands. Used to do GVN on machine Nodes. 234 // Hash and compare over operands. Used to do GVN on machine Nodes.
238 virtual uint hash() const; 235 virtual uint hash() const;
239 virtual uint cmp( const Node &n ) const; 236 virtual uint cmp( const Node &n ) const;
240 237
241 // Expand method for MachNode, replaces nodes representing pseudo 238 // Expand method for MachNode, replaces nodes representing pseudo
344 341
345 #ifndef PRODUCT 342 #ifndef PRODUCT
346 virtual const char *Name() const { return "Breakpoint"; } 343 virtual const char *Name() const { return "Breakpoint"; }
347 virtual void format( PhaseRegAlloc *, outputStream *st ) const; 344 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
348 #endif 345 #endif
346 };
347
348 //------------------------------MachConstantBaseNode--------------------------
349 // Machine node that represents the base address of the constant table.
350 class MachConstantBaseNode : public MachIdealNode {
351 public:
352 static const RegMask& _out_RegMask; // We need the out_RegMask statically in MachConstantNode::in_RegMask().
353
354 public:
355 MachConstantBaseNode() : MachIdealNode() {
356 init_class_id(Class_MachConstantBase);
357 }
358 virtual const class Type* bottom_type() const { return TypeRawPtr::NOTNULL; }
359 virtual uint ideal_reg() const { return Op_RegP; }
360 virtual uint oper_input_base() const { return 1; }
361
362 virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const;
363 virtual uint size(PhaseRegAlloc* ra_) const;
364 virtual bool pinned() const { return UseRDPCForConstantTableBase; }
365
366 static const RegMask& static_out_RegMask() { return _out_RegMask; }
367 virtual const RegMask& out_RegMask() const { return static_out_RegMask(); }
368
369 #ifndef PRODUCT
370 virtual const char* Name() const { return "MachConstantBaseNode"; }
371 virtual void format(PhaseRegAlloc*, outputStream* st) const;
372 #endif
373 };
374
375 //------------------------------MachConstantNode-------------------------------
376 // Machine node that holds a constant which is stored in the constant table.
377 class MachConstantNode : public MachNode {
378 protected:
379 Compile::Constant _constant; // This node's constant.
380
381 public:
382 MachConstantNode() : MachNode() {
383 init_class_id(Class_MachConstant);
384 }
385
386 virtual void eval_constant(Compile* C) {
387 #ifdef ASSERT
388 tty->print("missing MachConstantNode eval_constant function: ");
389 dump();
390 #endif
391 ShouldNotCallThis();
392 }
393
394 virtual const RegMask &in_RegMask(uint idx) const {
395 if (idx == mach_constant_base_node_input())
396 return MachConstantBaseNode::static_out_RegMask();
397 return MachNode::in_RegMask(idx);
398 }
399
400 // Input edge of MachConstantBaseNode.
401 uint mach_constant_base_node_input() const { return req() - 1; }
402
403 int constant_offset();
404 int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
349 }; 405 };
350 406
351 //------------------------------MachUEPNode----------------------------------- 407 //------------------------------MachUEPNode-----------------------------------
352 // Machine Unvalidated Entry Point Node 408 // Machine Unvalidated Entry Point Node
353 class MachUEPNode : public MachIdealNode { 409 class MachUEPNode : public MachIdealNode {