src/share/vm/shark/sharkCodeBuffer.hpp

Print this page
rev 3850 : [mq]: shark.patch


  64     return result;
  65   }
  66 
  67   // Create a unique offset in the buffer.
  68  public:
  69   int create_unique_offset() const {
  70     int offset = masm()->offset();
  71     masm()->advance(1);
  72     return offset;
  73   }
  74 
  75   // Inline an oop into the buffer and return its offset.
  76  public:
  77   int inline_oop(jobject object) const {
  78     masm()->align(BytesPerWord);
  79     int offset = masm()->offset();
  80     masm()->store_oop(object);
  81     return offset;
  82   }
  83 







  84   // Inline a block of non-oop data into the buffer and return its offset.
  85  public:
  86   int inline_data(void *src, size_t size) const {
  87     masm()->align(BytesPerWord);
  88     int offset = masm()->offset();
  89     void *dst = masm()->pc();
  90     masm()->advance(size);
  91     memcpy(dst, src, size);
  92     return offset;
  93   }
  94 };
  95 
  96 #endif // SHARE_VM_SHARK_SHARKCODEBUFFER_HPP


  64     return result;
  65   }
  66 
  67   // Create a unique offset in the buffer.
  68  public:
  69   int create_unique_offset() const {
  70     int offset = masm()->offset();
  71     masm()->advance(1);
  72     return offset;
  73   }
  74 
  75   // Inline an oop into the buffer and return its offset.
  76  public:
  77   int inline_oop(jobject object) const {
  78     masm()->align(BytesPerWord);
  79     int offset = masm()->offset();
  80     masm()->store_oop(object);
  81     return offset;
  82   }
  83 
  84   int inline_Metadata(Metadata* metadata) const {
  85     masm()->align(BytesPerWord);
  86     int offset = masm()->offset();
  87     masm()->store_Metadata(metadata);
  88     return offset;
  89   }
  90 
  91   // Inline a block of non-oop data into the buffer and return its offset.
  92  public:
  93   int inline_data(void *src, size_t size) const {
  94     masm()->align(BytesPerWord);
  95     int offset = masm()->offset();
  96     void *dst = masm()->pc();
  97     masm()->advance(size);
  98     memcpy(dst, src, size);
  99     return offset;
 100   }
 101 };
 102 
 103 #endif // SHARE_VM_SHARK_SHARKCODEBUFFER_HPP