Print this page
rev 1839 : 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:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/machnode.hpp
          +++ new/src/share/vm/opto/machnode.hpp
↓ open down ↓ 214 lines elided ↑ open up ↑
 215  215    // for this instruction (must be a power of 2)
 216  216    virtual int   alignment_required() const { return 1; }
 217  217  
 218  218    // Return the padding (in bytes) to be emitted before this
 219  219    // instruction to properly align it.
 220  220    virtual int   compute_padding(int current_offset) const { return 0; }
 221  221  
 222  222    // Return number of relocatable values contained in this instruction
 223  223    virtual int   reloc() const { return 0; }
 224  224  
 225      -  // Return number of words used for double constants in this instruction
 226      -  virtual int   const_size() const { return 0; }
 227      -
 228  225    // Hash and compare over operands.  Used to do GVN on machine Nodes.
 229  226    virtual uint  hash() const;
 230  227    virtual uint  cmp( const Node &n ) const;
 231  228  
 232  229    // Expand method for MachNode, replaces nodes representing pseudo
 233  230    // instructions with a set of nodes which represent real machine
 234  231    // instructions and compute the same value.
 235  232    virtual MachNode *Expand( State *, Node_List &proj_list, Node* mem ) { return this; }
 236  233  
 237  234    // Bottom_type call; value comes from operand0
↓ open down ↓ 94 lines elided ↑ open up ↑
 332  329    MachBreakpointNode( ) {}
 333  330    virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
 334  331    virtual uint size(PhaseRegAlloc *ra_) const;
 335  332  
 336  333  #ifndef PRODUCT
 337  334    virtual const char *Name() const { return "Breakpoint"; }
 338  335    virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 339  336  #endif
 340  337  };
 341  338  
      339 +//------------------------------MachConstantBaseNode--------------------------
      340 +// Machine node that represents the base address of the constant table.
      341 +class MachConstantBaseNode : public MachIdealNode {
      342 +public:
      343 +  static const RegMask& _out_RegMask;  // We need the out_RegMask statically in MachConstantNode::in_RegMask().
      344 +
      345 +public:
      346 +  MachConstantBaseNode() : MachIdealNode() {
      347 +    init_class_id(Class_MachConstantBase);
      348 +    add_req(NULL);
      349 +  }
      350 +  virtual const class Type* bottom_type() const { return TypeRawPtr::NOTNULL; }
      351 +  virtual uint ideal_reg() const { return Op_RegP; }
      352 +  virtual uint oper_input_base() const { return 1; }
      353 +
      354 +  virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const;
      355 +  virtual uint size(PhaseRegAlloc* ra_) const;
      356 +  virtual bool pinned() const { return UseRDPCForConstantTableBase; }
      357 +
      358 +  static const RegMask& static_out_RegMask() { return _out_RegMask; }
      359 +  virtual const RegMask& out_RegMask() const { return static_out_RegMask(); }
      360 +
      361 +#ifndef PRODUCT
      362 +  virtual const char* Name() const { return "MachConstantBaseNode"; }
      363 +  virtual void format(PhaseRegAlloc*, outputStream* st) const;
      364 +#endif
      365 +};
      366 +
      367 +//------------------------------MachConstantNode-------------------------------
      368 +// Machine node that holds a constant which is stored in the constant table.
      369 +class MachConstantNode : public MachNode {
      370 +protected:
      371 +  Compile::Constant _constant;  // This node's constant.
      372 +
      373 +public:
      374 +  MachConstantNode() : MachNode() {
      375 +    init_class_id(Class_MachConstant);
      376 +  }
      377 +
      378 +  virtual void eval_constant(Compile* C) {
      379 +#ifdef ASSERT
      380 +    tty->print("missing MachConstantNode eval_constant function: ");
      381 +    dump();
      382 +#endif
      383 +    ShouldNotCallThis();
      384 +  }
      385 +
      386 +  virtual const RegMask &in_RegMask(uint idx) const {
      387 +    if (idx == mach_constant_base_node_input())
      388 +      return MachConstantBaseNode::static_out_RegMask();
      389 +    return MachNode::in_RegMask(idx);
      390 +  }
      391 +
      392 +  // Input edge of MachConstantBaseNode.
      393 +  uint mach_constant_base_node_input() const { return req() - 1; }
      394 +
      395 +  int  constant_offset();
      396 +  int  constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
      397 +};
      398 +
 342  399  //------------------------------MachUEPNode-----------------------------------
 343  400  // Machine Unvalidated Entry Point Node
 344  401  class MachUEPNode : public MachIdealNode {
 345  402  public:
 346  403    MachUEPNode( ) {}
 347  404    virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
 348  405    virtual uint size(PhaseRegAlloc *ra_) const;
 349  406  
 350  407  #ifndef PRODUCT
 351  408    virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
↓ open down ↓ 479 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX