Index: src/mips/assembler-mips.cc |
diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc |
index 4ce924d3fd8c5537905421b234a0a7900bab445b..e7506206c98eb436ed4d9bc65f54b24cfe2d76e3 100644 |
--- a/src/mips/assembler-mips.cc |
+++ b/src/mips/assembler-mips.cc |
@@ -267,44 +267,11 @@ const Instr kLwSwInstrArgumentMask = ~kLwSwInstrTypeMask; |
const Instr kLwSwOffsetMask = kImm16Mask; |
-// Spare buffer. |
-static const int kMinimalBufferSize = 4 * KB; |
- |
- |
-Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) |
- : AssemblerBase(arg_isolate), |
+Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) |
+ : AssemblerBase(isolate, buffer, buffer_size), |
recorded_ast_id_(TypeFeedbackId::None()), |
positions_recorder_(this) { |
- if (buffer == NULL) { |
- // Do our own buffer management. |
- if (buffer_size <= kMinimalBufferSize) { |
- buffer_size = kMinimalBufferSize; |
- |
- if (isolate()->assembler_spare_buffer() != NULL) { |
- buffer = isolate()->assembler_spare_buffer(); |
- isolate()->set_assembler_spare_buffer(NULL); |
- } |
- } |
- if (buffer == NULL) { |
- buffer_ = NewArray<byte>(buffer_size); |
- } else { |
- buffer_ = static_cast<byte*>(buffer); |
- } |
- buffer_size_ = buffer_size; |
- own_buffer_ = true; |
- |
- } else { |
- // Use externally provided buffer instead. |
- ASSERT(buffer_size > 0); |
- buffer_ = static_cast<byte*>(buffer); |
- buffer_size_ = buffer_size; |
- own_buffer_ = false; |
- } |
- |
- // Set up buffer pointers. |
- ASSERT(buffer_ != NULL); |
- pc_ = buffer_; |
- reloc_info_writer.Reposition(buffer_ + buffer_size, pc_); |
+ reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); |
last_trampoline_pool_end_ = 0; |
no_trampoline_pool_before_ = 0; |
@@ -323,18 +290,6 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) |
} |
-Assembler::~Assembler() { |
- if (own_buffer_) { |
- if (isolate()->assembler_spare_buffer() == NULL && |
- buffer_size_ == kMinimalBufferSize) { |
- isolate()->set_assembler_spare_buffer(buffer_); |
- } else { |
- DeleteArray(buffer_); |
- } |
- } |
-} |
- |
- |
void Assembler::GetCode(CodeDesc* desc) { |
ASSERT(pc_ <= reloc_info_writer.pos()); // No overlap. |
// Set up code descriptor. |