group x64 blocks together under the same symbol for profiling

This commit is contained in:
Anthony Pesch 2016-01-18 02:04:09 -08:00
parent 4c8c48086b
commit 3c5d1526b9
3 changed files with 11 additions and 4 deletions

View File

@ -46,13 +46,20 @@ const Register x64_registers[] = {
{"xmm10", ir::VALUE_FLOAT_MASK}, {"xmm11", ir::VALUE_FLOAT_MASK}};
const int x64_num_registers = sizeof(x64_registers) / sizeof(Register);
// this will break down if running two instances of the x64 backend, but it's
// extremely useful when profiling to group JITd blocks of code with an actual
// symbol name
static const size_t x64_codegen_size = 1024 * 1024 * 8;
static uint8_t x64_codegen[x64_codegen_size];
}
}
}
}
X64Backend::X64Backend(Memory &memory)
: Backend(memory), emitter_(1024 * 1024 * 8) {}
: Backend(memory), emitter_(x64_codegen, x64_codegen_size) {}
X64Backend::~X64Backend() {}

View File

@ -116,8 +116,8 @@ static X64Emit x64_emitters[NUM_OPCODES];
} x64_##op##_init; \
void op(X64Emitter &e, const Instr *instr)
X64Emitter::X64Emitter(size_t max_size)
: CodeGenerator(max_size),
X64Emitter::X64Emitter(void *buffer, size_t buffer_size)
: CodeGenerator(buffer_size, buffer),
arena_(1024),
source_map_(nullptr),
memory_(nullptr),

View File

@ -35,7 +35,7 @@ enum {
class X64Emitter : public Xbyak::CodeGenerator {
public:
X64Emitter(size_t max_size);
X64Emitter(void *buffer, size_t buffer_size);
~X64Emitter();
Xbyak::Label &epilog_label() { return *epilog_label_; }