< prev index next >

src/cpu/zero/vm/stack_zero.hpp

Print this page




  71     _sp = new_sp;
  72   }
  73 
  74   int total_words() const {
  75     return _top - _base;
  76   }
  77   int available_words() const {
  78     return _sp - _base;
  79   }
  80 
  81   void push(intptr_t value) {
  82     assert(_sp > _base, "stack overflow");
  83     *(--_sp) = value;
  84   }
  85   intptr_t pop() {
  86     assert(_sp < _top, "stack underflow");
  87     return *(_sp++);
  88   }
  89 
  90   void *alloc(size_t size) {
  91     int count = align_size_up(size, wordSize) >> LogBytesPerWord;
  92     assert(count <= available_words(), "stack overflow");
  93     return _sp -= count;
  94   }
  95 
  96   int shadow_pages_size() const {
  97     return _shadow_pages_size;
  98   }
  99   int abi_stack_available(Thread *thread) const;
 100 
 101  public:
 102   void overflow_check(int required_words, TRAPS);
 103   static void handle_overflow(TRAPS);
 104 
 105  public:
 106   void zap(int c) PRODUCT_RETURN;
 107 
 108  public:
 109   static ByteSize base_offset() {
 110     return byte_offset_of(ZeroStack, _base);
 111   }




  71     _sp = new_sp;
  72   }
  73 
  74   int total_words() const {
  75     return _top - _base;
  76   }
  77   int available_words() const {
  78     return _sp - _base;
  79   }
  80 
  81   void push(intptr_t value) {
  82     assert(_sp > _base, "stack overflow");
  83     *(--_sp) = value;
  84   }
  85   intptr_t pop() {
  86     assert(_sp < _top, "stack underflow");
  87     return *(_sp++);
  88   }
  89 
  90   void *alloc(size_t size) {
  91     int count = align_up(size, wordSize) >> LogBytesPerWord;
  92     assert(count <= available_words(), "stack overflow");
  93     return _sp -= count;
  94   }
  95 
  96   int shadow_pages_size() const {
  97     return _shadow_pages_size;
  98   }
  99   int abi_stack_available(Thread *thread) const;
 100 
 101  public:
 102   void overflow_check(int required_words, TRAPS);
 103   static void handle_overflow(TRAPS);
 104 
 105  public:
 106   void zap(int c) PRODUCT_RETURN;
 107 
 108  public:
 109   static ByteSize base_offset() {
 110     return byte_offset_of(ZeroStack, _base);
 111   }


< prev index next >