Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/arm/assembler-arm.cc

Issue 555943003: ARM: Do not stack allocate big buffers in Assembler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/assembler-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « src/arm/assembler-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698