Reviewers: Jakob,

Message:
Created Revert of [arm] Decrease the size of the assembler class by allocating
buffers of pending constants on the he...

Description:
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=jkumme...@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:521828

Please review this at https://codereview.chromium.org/1307863007/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+2, -33 lines):
  M src/arm/assembler-arm.h
  M src/arm/assembler-arm.cc
  M src/ic/access-compiler.h


Index: src/arm/assembler-arm.h
diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
index c54e51df78cb57c146f1f9f815214ca899057e49..d0fcac206e0b7916995c3c9cf09482769273ea91 100644
--- a/src/arm/assembler-arm.h
+++ b/src/arm/assembler-arm.h
@@ -1465,7 +1465,6 @@
   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 @@
   // 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.
Index: src/arm/assembler-arm.cc
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc
index 24f757ac12919267e2010015fb7322ba313f71c3..633b5d12c076b46e04343c9f2612928b21e46fd8 100644
--- a/src/arm/assembler-arm.cc
+++ b/src/arm/assembler-arm.cc
@@ -448,8 +448,6 @@
 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_);
@@ -467,12 +465,6 @@

 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_;
-  }
 }


@@ -3672,15 +3664,6 @@
     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;
@@ -3701,15 +3684,6 @@
     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;
Index: src/ic/access-compiler.h
diff --git a/src/ic/access-compiler.h b/src/ic/access-compiler.h
index b168624d0f1b469eb34da008c24646d07508fc9e..61567a2224b14132e57a1bdd90f143a595d01f17 100644
--- a/src/ic/access-compiler.h
+++ b/src/ic/access-compiler.h
@@ -81,8 +81,6 @@

   Isolate* isolate_;
   MacroAssembler masm_;
-  // Ensure that MacroAssembler has a reasonable size.
-  STATIC_ASSERT(sizeof(MacroAssembler) < KB / 2);
 };
 }
 }  // namespace v8::internal


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to