Index: src/arm/assembler-arm.cc |
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc |
index 96f28f968391a8021e4e5b2b69a78ba0c9cf50c7..95e410dfafff1c370b8df6f6de74fadff0a0ecea 100644 |
--- a/src/arm/assembler-arm.cc |
+++ b/src/arm/assembler-arm.cc |
@@ -474,11 +474,19 @@ Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) |
last_bound_pos_ = 0; |
constant_pool_available_ = !FLAG_enable_ool_constant_pool; |
ClearRecordedAstId(); |
+ max_num_32_bit_reloc_info_ = |
Rodolph Perfetta
2014/09/18 14:03:24
This may not work. kMaxNumPending[32|64]RelocInfo
|
+ Min(kMaxNumPending32RelocInfo, buffer_size_ / kInstrSize); |
+ max_num_64_bit_reloc_info_ = |
+ Min(kMaxNumPending64RelocInfo, buffer_size_ / kInstrSize); |
+ pending_32_bit_reloc_info_ = NewArray<RelocInfo>(max_num_32_bit_reloc_info_); |
+ pending_64_bit_reloc_info_ = NewArray<RelocInfo>(max_num_64_bit_reloc_info_); |
} |
Assembler::~Assembler() { |
DCHECK(const_pool_blocked_nesting_ == 0); |
+ DeleteArray(pending_32_bit_reloc_info_); |
+ DeleteArray(pending_64_bit_reloc_info_); |
} |
@@ -3363,13 +3371,13 @@ ConstantPoolArray::LayoutSection Assembler::ConstantPoolAddEntry( |
return constant_pool_builder_.AddEntry(this, rinfo); |
} else { |
if (rinfo.rmode() == RelocInfo::NONE64) { |
- DCHECK(num_pending_64_bit_reloc_info_ < kMaxNumPending64RelocInfo); |
+ DCHECK(num_pending_64_bit_reloc_info_ < max_num_64_bit_reloc_info_); |
if (num_pending_64_bit_reloc_info_ == 0) { |
first_const_pool_64_use_ = pc_offset(); |
} |
pending_64_bit_reloc_info_[num_pending_64_bit_reloc_info_++] = rinfo; |
} else { |
- DCHECK(num_pending_32_bit_reloc_info_ < kMaxNumPending32RelocInfo); |
+ DCHECK(num_pending_32_bit_reloc_info_ < max_num_32_bit_reloc_info_); |
if (num_pending_32_bit_reloc_info_ == 0) { |
first_const_pool_32_use_ = pc_offset(); |
} |