Skip to content

Commit

Permalink
Add debugprintf about constant pool
Browse files Browse the repository at this point in the history
  • Loading branch information
luyahan authored and obycode committed Sep 17, 2020
1 parent 5f35980 commit c7bf77a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/codegen/riscv64/assembler-riscv64-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,18 @@ void Assembler::CheckBuffer() {

template <typename T>
void Assembler::EmitHelper(T x) {
DEBUG_PRINTF("%p: ", pc_);
disassembleInstr((int)x);
*reinterpret_cast<T*>(pc_) = x;
pc_ += sizeof(x);
CheckTrampolinePoolQuick();
}

void Assembler::emit(Instr x) {
if (!is_buffer_growth_blocked()) {
CheckBuffer();
}
DEBUG_PRINTF("%p: ", pc_);
disassembleInstr(x);
EmitHelper(x);
CheckTrampolinePoolQuick();
}

void Assembler::emit(ShortInstr x) {
Expand Down
3 changes: 3 additions & 0 deletions src/codegen/riscv64/assembler-riscv64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2184,16 +2184,19 @@ void Assembler::GrowBuffer() {

void Assembler::db(uint8_t data) {
if (!is_buffer_growth_blocked()) CheckBuffer();
DEBUG_PRINTF("%p: constant 0x%x\n", pc_, data);
EmitHelper(data);
}

void Assembler::dd(uint32_t data) {
if (!is_buffer_growth_blocked()) CheckBuffer();
DEBUG_PRINTF("%p: constant 0x%x\n", pc_, data);
EmitHelper(data);
}

void Assembler::dq(uint64_t data) {
if (!is_buffer_growth_blocked()) CheckBuffer();
DEBUG_PRINTF("%p: constant 0x%lx\n", pc_, data);
EmitHelper(data);
}

Expand Down

0 comments on commit c7bf77a

Please sign in to comment.