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

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

Issue 139983007: A64: Indicate the correct size for constant pools. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/assembler-a64.cc
diff --git a/src/a64/assembler-a64.cc b/src/a64/assembler-a64.cc
index c06fbe900bf19cd8b57cdfbdd68039d541d68aee..ddf651b059ff6f2389db55dfb5ee5b1f31c382bc 100644
--- a/src/a64/assembler-a64.cc
+++ b/src/a64/assembler-a64.cc
@@ -2384,13 +2384,18 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
return;
}
+ Label size_check;
+ bind(&size_check);
+
// Check that the code buffer is large enough before emitting the constant
- // pool (include the jump over the pool and the constant pool marker and
- // the gap to the relocation information).
+ // pool (include the jump over the pool, the constant pool marker, the
+ // constant pool guard, and the gap to the relocation information).
int jump_instr = require_jump ? kInstructionSize : 0;
- int size = jump_instr + kInstructionSize +
- num_pending_reloc_info_ * kPointerSize;
- int needed_space = size + kGap;
+ int size_pool_marker = kInstructionSize;
+ int size_pool_guard = kInstructionSize;
+ int pool_size = jump_instr + size_pool_marker + size_pool_guard +
+ num_pending_reloc_info_ * kPointerSize;
+ int needed_space = pool_size + kGap;
while (buffer_space() <= needed_space) {
GrowBuffer();
}
@@ -2399,7 +2404,7 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
// Block recursive calls to CheckConstPool.
BlockConstPoolScope block_const_pool(this);
RecordComment("[ Constant Pool");
- RecordConstPool(size);
+ RecordConstPool(pool_size);
// Emit jump over constant pool if necessary.
Label after_pool;
@@ -2451,6 +2456,9 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
// Since a constant pool was just emitted, move the check offset forward by
// the standard interval.
next_buffer_check_ = pc_offset() + kCheckPoolInterval;
+
+ ASSERT(SizeOfCodeGeneratedSince(&size_check) ==
+ static_cast<unsigned>(pool_size));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698