Commit 5849a1ac authored by ishell's avatar ishell Committed by Commit bot

Revert of [arm] Decrease the size of the assembler class by allocating buffers...

Revert of [arm] Decrease the size of the assembler class by allocating buffers of pending constants on the he… (patchset #2 id:20001 of https://codereview.chromium.org/1309903009/ )

Reason for revert:
Static assert failed on ARM64

Original issue's description:
> [arm] Decrease the size of the assembler class by allocating buffers of pending constants on the heap.
>
> BUG=chromium:521828
> LOG=N
>
> Committed: https://crrev.com/033af3fa511c52bc4049cd278d0623a6c6f9f9c3
> Cr-Commit-Position: refs/heads/master@{#30592}

TBR=jkummerow@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:521828

Review URL: https://codereview.chromium.org/1307863007

Cr-Commit-Position: refs/heads/master@{#30593}
parent 033af3fa
......@@ -450,8 +450,6 @@ const Instr kLdrStrInstrTypeMask = 0xffff0000;
Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size)
: AssemblerBase(isolate, buffer, buffer_size),
recorded_ast_id_(TypeFeedbackId::None()),
pending_32_bit_constants_(&pending_32_bit_constants_buffer_[0]),
pending_64_bit_constants_(&pending_64_bit_constants_buffer_[0]),
constant_pool_builder_(kLdrMaxReachBits, kVldrMaxReachBits),
positions_recorder_(this) {
reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
......@@ -469,12 +467,6 @@ Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size)
Assembler::~Assembler() {
DCHECK(const_pool_blocked_nesting_ == 0);
if (pending_32_bit_constants_ != &pending_32_bit_constants_buffer_[0]) {
delete[] pending_32_bit_constants_;
}
if (pending_64_bit_constants_ != &pending_64_bit_constants_buffer_[0]) {
delete[] pending_64_bit_constants_;
}
}
......@@ -3674,15 +3666,6 @@ ConstantPoolEntry::Access Assembler::ConstantPoolAddEntry(int position,
DCHECK(num_pending_32_bit_constants_ < kMaxNumPending32Constants);
if (num_pending_32_bit_constants_ == 0) {
first_const_pool_32_use_ = position;
} else if (num_pending_32_bit_constants_ == kMinNumPendingConstants &&
pending_32_bit_constants_ ==
&pending_32_bit_constants_buffer_[0]) {
// Inline buffer is full, switch to dynamically allocated buffer.
pending_32_bit_constants_ =
new ConstantPoolEntry[kMaxNumPending32Constants];
std::copy(&pending_32_bit_constants_buffer_[0],
&pending_32_bit_constants_buffer_[kMinNumPendingConstants],
&pending_32_bit_constants_[0]);
}
ConstantPoolEntry entry(position, value, sharing_ok);
pending_32_bit_constants_[num_pending_32_bit_constants_++] = entry;
......@@ -3703,15 +3686,6 @@ ConstantPoolEntry::Access Assembler::ConstantPoolAddEntry(int position,
DCHECK(num_pending_64_bit_constants_ < kMaxNumPending64Constants);
if (num_pending_64_bit_constants_ == 0) {
first_const_pool_64_use_ = position;
} else if (num_pending_64_bit_constants_ == kMinNumPendingConstants &&
pending_64_bit_constants_ ==
&pending_64_bit_constants_buffer_[0]) {
// Inline buffer is full, switch to dynamically allocated buffer.
pending_64_bit_constants_ =
new ConstantPoolEntry[kMaxNumPending64Constants];
std::copy(&pending_64_bit_constants_buffer_[0],
&pending_64_bit_constants_buffer_[kMinNumPendingConstants],
&pending_64_bit_constants_[0]);
}
ConstantPoolEntry entry(position, value);
pending_64_bit_constants_[num_pending_64_bit_constants_++] = entry;
......
......@@ -1465,7 +1465,6 @@ class Assembler : public AssemblerBase {
static const int kMaxDistToIntPool = 4*KB;
static const int kMaxDistToFPPool = 1*KB;
// All relocations could be integer, it therefore acts as the limit.
static const int kMinNumPendingConstants = 4;
static const int kMaxNumPending32Constants = kMaxDistToIntPool / kInstrSize;
static const int kMaxNumPending64Constants = kMaxDistToFPPool / kInstrSize;
......@@ -1599,10 +1598,8 @@ class Assembler : public AssemblerBase {
// pending relocation entry per instruction.
// The buffers of pending constant pool entries.
ConstantPoolEntry pending_32_bit_constants_buffer_[kMinNumPendingConstants];
ConstantPoolEntry pending_64_bit_constants_buffer_[kMinNumPendingConstants];
ConstantPoolEntry* pending_32_bit_constants_;
ConstantPoolEntry* pending_64_bit_constants_;
ConstantPoolEntry pending_32_bit_constants_[kMaxNumPending32Constants];
ConstantPoolEntry pending_64_bit_constants_[kMaxNumPending64Constants];
// 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.
......
......@@ -78,8 +78,6 @@ class PropertyAccessCompiler BASE_EMBEDDED {
Isolate* isolate_;
MacroAssembler masm_;
// Ensure that MacroAssembler has a reasonable size.
STATIC_ASSERT(sizeof(MacroAssembler) < KB / 2);
};
}
} // namespace v8::internal
......
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