view src/gpu/hsail/vm/gpu_hsail_Frame.hpp @ 15494:e20a45d17181

Move CIPrintCompilerName handling into CompileTask::print_compilation_impl
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 30 Apr 2014 11:48:13 +0200
parents a250a512434d
children 217c721b1ee1
line wrap: on
line source

#ifndef GPU_HSAIL_FRAME_HPP
#define GPU_HSAIL_FRAME_HPP

#include "graal/graalEnv.hpp"
#include "code/debugInfo.hpp"
#include "code/location.hpp"

class HSAILFrame {
  friend class VMStructs;
private:
  jint  _pc_offset;  // The HSAIL "pc_offset" where the exception happens
  jbyte _num_s_regs;
  jbyte _num_d_regs;
  jshort _num_stack_slots; 
  jbyte  _save_area[0];     // save area size can vary per kernel compilation  

public:
  // Accessors
  jint pc_offset() { return _pc_offset; }
  jint num_s_regs() {return _num_s_regs; }
  jint num_d_regs() {return _num_d_regs; }
  jint num_stack_slots() {return _num_stack_slots; }
  jlong get_d_reg(int idx) {
    int ofst = num_s_regs() * 4 + idx * 8;
    return(*(jlong *) (_save_area + ofst));
  }
  jint get_s_reg(int idx) {
    int ofst = idx * 4;
    return(*(jint *) (_save_area + ofst));
  }
  void put_d_reg(int idx, jlong val) {
    int ofst = num_s_regs() * 4 + idx * 8;
    (*(jlong *) (_save_area + ofst)) = val;
  }
  jint get_stackslot32(int stackOffset) {
    int ofst = num_s_regs() * 4 + num_d_regs() * 8 + stackOffset;
    return(*(jint *) (_save_area + ofst));
  }
  jlong get_stackslot64(int stackOffset) {
    int ofst = num_s_regs() * 4 + num_d_regs() * 8 + stackOffset;
    return(*(jlong *) (_save_area + ofst));
  }
  void put_stackslot64(int stackOffset, jlong val) {
    int ofst = num_s_regs() * 4 + num_d_regs() * 8 + stackOffset;
    (*(jlong *) (_save_area + ofst)) = val;
  }
};
  
#endif // GPU_HSAIL_FRAME_HPP