//mark the location is not first time access if the location is assigned 
 //same register. This is called when do set_is_not_first_time_access in
 //VirtualStackFrame::set_is_not_first_time_access().
 bool set_is_not_first_time_access(Assembler::Register reg ) {
   if (!is_flushed() && in_register() && uses_register(reg) ) {
     _flags |= Value::F_IS_NOT_FIRST_TIME_ACCESS;
     return true;
   }
   return false;
 }
Beispiel #2
0
void accessor<BufferT>::enqueue_flush(const range& blk) {
    if(is_flushed()) flushlist_.push_back(blk);
    else {
        // Optimise the sequential Use-case
        auto& back = flushlist_.back();
        if(back.start + back.count == blk.start) back.count += blk.count;
        else flushlist_.push_back(blk);
    }

}
Beispiel #3
0
bool accessor<BufferT>::unmap() {
    bool success = true;
    if(buffer_ptr_->is_mapped()) {
        if(!is_flushed()) flush();
        buffer_ptr_->bind();
        success = buffer_ptr_->unmap();
        buffer_ptr_->release();
        map_start_ = INVALID_IDX; map_count_ = 0;
    }
    return success;
}
Beispiel #4
0
void RawLocation::update_cache(int index) {
  // this forces an update of the cache from memory
  // even if the location has been changed
  if (!is_flushed()) {
    // get the value for this location
    Value value(this, index);
    // read the value from memory
    if (value.in_register()) { 
      code_generator()->load_from_location(value, index);
    }
  }
}
Beispiel #5
0
void RawLocation::change_register(Assembler::Register dst,
                                  Assembler::Register src) {
  GUARANTEE(!is_flushed() && in_register(), "Sanity");
  GUARANTEE(this->value() == src || 
            (is_two_word() && next_location()->value() == src), 
            "Only called if necessary");

  if (this->value() == src) { 
    this->set_value(dst);
  }
  if (is_two_word()) { 
    RawLocation *next = next_location();
    if (next->value() == src) { 
      next->set_value(dst);
    }
  }
}
 // spill a specific register into this location if it mapped by it
 void spill_register(const Assembler::Register reg, const int index) {
   if (!is_flushed() && in_register() && uses_register(reg)) {
     flush(index);
   }
 }