Commit e43668a5 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC: Add ConstantPoolBuilder dtor to fix DCHECK error

When a failing compilation occur, constant pool may not be emitted but
linked (at the starting of code sequence). When CodeGenerator
destructor is called, Assembler, ConstantPoolBuilder destructor are
also called, which lead to calling the destructor of the emitted_label_,
and then DCHECK fails because it's linked.

Bug: v8:8785
Change-Id: I8926baa2fd7c16c462eef0c146d92ac7bf355396
Reviewed-on: https://chromium-review.googlesource.com/c/1452350Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#59371}
parent ea4412ad
......@@ -88,6 +88,14 @@ class ConstantPoolBuilder {
public:
ConstantPoolBuilder(int ptr_reach_bits, int double_reach_bits);
#ifdef DEBUG
~ConstantPoolBuilder() {
// Unused labels to prevent DCHECK failures.
emitted_label_.Unuse();
emitted_label_.UnuseNear();
}
#endif
// Add pointer-sized constant to the embedded constant pool
ConstantPoolEntry::Access AddEntry(int position, intptr_t value,
bool sharing_ok) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment