Index: src/ia32/assembler-ia32.cc |
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc |
index 06fc4118fafff5bb34225a819a2d9da273967617..1f90e1ac1e04f083bc108308e77f557b0f2cccaa 100644 |
--- a/src/ia32/assembler-ia32.cc |
+++ b/src/ia32/assembler-ia32.cc |
@@ -312,47 +312,19 @@ Register Operand::reg() const { |
static void InitCoverageLog(); |
#endif |
-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), |
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; |
- } |
- |
// Clear the buffer in debug mode unless it was provided by the |
// caller in which case we can't be sure it's okay to overwrite |
// existing code in it; see CodePatcher::CodePatcher(...). |
#ifdef DEBUG |
if (own_buffer_) { |
- memset(buffer_, 0xCC, buffer_size); // int3 |
+ memset(buffer_, 0xCC, buffer_size_); // int3 |
} |
#endif |
- // 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_); |
#ifdef GENERATED_CODE_COVERAGE |
InitCoverageLog(); |
@@ -360,18 +332,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) { |
// Finalize code (at this point overflow() may be true, but the gap ensures |
// that we are still not overlapping instructions and relocation info). |