Commit 88a92c47 authored by mtrofin's avatar mtrofin Committed by Commit bot

Use standard datastructures for tracking constant pool entries.

This improves maintainability. The Compile and Wasm benchmarks,
tracking compile time, show no regression.

BUG=

Review-Url: https://codereview.chromium.org/2044283003
Cr-Commit-Position: refs/heads/master@{#36834}
parent bf6ae338
This diff is collapsed.
...@@ -1570,10 +1570,10 @@ class Assembler : public AssemblerBase { ...@@ -1570,10 +1570,10 @@ class Assembler : public AssemblerBase {
// Max pool start (if we need a jump and an alignment). // Max pool start (if we need a jump and an alignment).
int start = pc_offset() + kInstrSize + 2 * kPointerSize; int start = pc_offset() + kInstrSize + 2 * kPointerSize;
// Check the constant pool hasn't been blocked for too long. // Check the constant pool hasn't been blocked for too long.
DCHECK((num_pending_32_bit_constants_ == 0) || DCHECK(pending_32_bit_constants_.empty() ||
(start + num_pending_64_bit_constants_ * kDoubleSize < (start + pending_64_bit_constants_.size() * kDoubleSize <
(first_const_pool_32_use_ + kMaxDistToIntPool))); (first_const_pool_32_use_ + kMaxDistToIntPool)));
DCHECK((num_pending_64_bit_constants_ == 0) || DCHECK(pending_64_bit_constants_.empty() ||
(start < (first_const_pool_64_use_ + kMaxDistToFPPool))); (start < (first_const_pool_64_use_ + kMaxDistToFPPool)));
#endif #endif
// Two cases: // Two cases:
...@@ -1640,14 +1640,8 @@ class Assembler : public AssemblerBase { ...@@ -1640,14 +1640,8 @@ class Assembler : public AssemblerBase {
// pending relocation entry per instruction. // pending relocation entry per instruction.
// The buffers of pending constant pool entries. // The buffers of pending constant pool entries.
ConstantPoolEntry pending_32_bit_constants_buffer_[kMinNumPendingConstants]; std::vector<ConstantPoolEntry> pending_32_bit_constants_;
ConstantPoolEntry pending_64_bit_constants_buffer_[kMinNumPendingConstants]; std::vector<ConstantPoolEntry> pending_64_bit_constants_;
ConstantPoolEntry* pending_32_bit_constants_;
ConstantPoolEntry* pending_64_bit_constants_;
// Number of pending constant pool entries in the 32 bits buffer.
int num_pending_32_bit_constants_;
// Number of pending constant pool entries in the 64 bits buffer.
int num_pending_64_bit_constants_;
ConstantPoolBuilder constant_pool_builder_; ConstantPoolBuilder constant_pool_builder_;
......
...@@ -3992,8 +3992,8 @@ CodePatcher::~CodePatcher() { ...@@ -3992,8 +3992,8 @@ CodePatcher::~CodePatcher() {
} }
// Check that we don't have any pending constant pools. // Check that we don't have any pending constant pools.
DCHECK(masm_.num_pending_32_bit_constants_ == 0); DCHECK(masm_.pending_32_bit_constants_.empty());
DCHECK(masm_.num_pending_64_bit_constants_ == 0); DCHECK(masm_.pending_64_bit_constants_.empty());
// Check that the code was patched as expected. // Check that the code was patched as expected.
DCHECK(masm_.pc_ == address_ + size_); DCHECK(masm_.pc_ == address_ + size_);
......
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