Commit c54d6552 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

ARM: Merge redundant entries in literal pool.

This patch also clean up 64-bits literals handling.

R=bmeurer@chromium.org

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

Patch from Rodolph Perfetta <rodolph.perfetta@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17789 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5b9569b5
This diff is collapsed.
...@@ -1443,7 +1443,8 @@ class Assembler : public AssemblerBase { ...@@ -1443,7 +1443,8 @@ class Assembler : public AssemblerBase {
static const int kMaxDistToIntPool = 4*KB; static const int kMaxDistToIntPool = 4*KB;
static const int kMaxDistToFPPool = 1*KB; static const int kMaxDistToFPPool = 1*KB;
// All relocations could be integer, it therefore acts as the limit. // All relocations could be integer, it therefore acts as the limit.
static const int kMaxNumPendingRelocInfo = kMaxDistToIntPool/kInstrSize; static const int kMaxNumPending32RelocInfo = kMaxDistToIntPool/kInstrSize;
static const int kMaxNumPending64RelocInfo = kMaxDistToFPPool/kInstrSize;
// Postpone the generation of the constant pool for the specified number of // Postpone the generation of the constant pool for the specified number of
// instructions. // instructions.
...@@ -1481,11 +1482,16 @@ class Assembler : public AssemblerBase { ...@@ -1481,11 +1482,16 @@ class Assembler : public AssemblerBase {
// StartBlockConstPool to have an effect. // StartBlockConstPool to have an effect.
void EndBlockConstPool() { void EndBlockConstPool() {
if (--const_pool_blocked_nesting_ == 0) { if (--const_pool_blocked_nesting_ == 0) {
#ifdef DEBUG
// Max pool start (if we need a jump and an alignment).
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.
ASSERT((num_pending_reloc_info_ == 0) || ASSERT((num_pending_32_bit_reloc_info_ == 0) ||
(pc_offset() < (first_const_pool_use_ + kMaxDistToIntPool))); (start + num_pending_64_bit_reloc_info_ * kDoubleSize <
(first_const_pool_32_use_ + kMaxDistToIntPool)));
ASSERT((num_pending_64_bit_reloc_info_ == 0) || ASSERT((num_pending_64_bit_reloc_info_ == 0) ||
(pc_offset() < (first_const_pool_use_ + kMaxDistToFPPool))); (start < (first_const_pool_64_use_ + kMaxDistToFPPool)));
#endif
// Two cases: // Two cases:
// * no_const_pool_before_ >= next_buffer_check_ and the emission is // * no_const_pool_before_ >= next_buffer_check_ and the emission is
// still blocked // still blocked
...@@ -1534,7 +1540,8 @@ class Assembler : public AssemblerBase { ...@@ -1534,7 +1540,8 @@ class Assembler : public AssemblerBase {
// Keep track of the first instruction requiring a constant pool entry // Keep track of the first instruction requiring a constant pool entry
// since the previous constant pool was emitted. // since the previous constant pool was emitted.
int first_const_pool_use_; int first_const_pool_32_use_;
int first_const_pool_64_use_;
// Relocation info generation // Relocation info generation
// Each relocation is encoded as a variable size value // Each relocation is encoded as a variable size value
...@@ -1548,12 +1555,12 @@ class Assembler : public AssemblerBase { ...@@ -1548,12 +1555,12 @@ class Assembler : public AssemblerBase {
// If every instruction in a long sequence is accessing the pool, we need one // If every instruction in a long sequence is accessing the pool, we need one
// pending relocation entry per instruction. // pending relocation entry per instruction.
// the buffer of pending relocation info // The buffers of pending relocation info.
RelocInfo pending_reloc_info_[kMaxNumPendingRelocInfo]; RelocInfo pending_32_bit_reloc_info_[kMaxNumPending32RelocInfo];
// number of pending reloc info entries in the buffer RelocInfo pending_64_bit_reloc_info_[kMaxNumPending64RelocInfo];
int num_pending_reloc_info_; // Number of pending reloc info entries in the 32 bits buffer.
// Number of pending reloc info entries included above which also happen to int num_pending_32_bit_reloc_info_;
// be 64-bit. // Number of pending reloc info entries in the 64 bits buffer.
int num_pending_64_bit_reloc_info_; int num_pending_64_bit_reloc_info_;
// The bound position, before this we cannot do instruction elimination. // The bound position, before this we cannot do instruction elimination.
......
...@@ -372,6 +372,9 @@ class RelocInfo BASE_EMBEDDED { ...@@ -372,6 +372,9 @@ class RelocInfo BASE_EMBEDDED {
Mode rmode() const { return rmode_; } Mode rmode() const { return rmode_; }
intptr_t data() const { return data_; } intptr_t data() const { return data_; }
double data64() const { return data64_; } double data64() const { return data64_; }
uint64_t raw_data64() {
return BitCast<uint64_t>(data64_);
}
Code* host() const { return host_; } Code* host() const { return host_; }
// Apply a relocation by delta bytes // Apply a relocation by delta bytes
......
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