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

Unified Diff: src/assembler.cc

Issue 446923002: Get rid of the "spare buffer" cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index 0ee20c7ee00f232a2d7fd11797b9b091888c0ec6..c35c81cc9f3f59dfbd85fc8e8ae5fba3e5095147 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -136,14 +136,7 @@ AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size)
}
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);
+ buffer = NewArray<byte>(buffer_size);
own_buffer_ = true;
} else {
// Use externally provided buffer instead.
@@ -158,15 +151,7 @@ AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size)
AssemblerBase::~AssemblerBase() {
- if (own_buffer_) {
- if (isolate() != NULL &&
- isolate()->assembler_spare_buffer() == NULL &&
- buffer_size_ == kMinimalBufferSize) {
- isolate()->set_assembler_spare_buffer(buffer_);
- } else {
- DeleteArray(buffer_);
- }
- }
+ if (own_buffer_) DeleteArray(buffer_);
}

Powered by Google App Engine
This is Rietveld 408576698