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

Side by Side Diff: src/arm/assembler-arm.cc

Issue 446933003: We should never allocate a 0-sized buffer, so never grow from 0. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Restore 0 as indication that you want kMinimalBufferSize 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 3184 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 // code. 3195 // code.
3196 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); 3196 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
3197 } 3197 }
3198 3198
3199 3199
3200 void Assembler::GrowBuffer() { 3200 void Assembler::GrowBuffer() {
3201 if (!own_buffer_) FATAL("external code buffer is too small"); 3201 if (!own_buffer_) FATAL("external code buffer is too small");
3202 3202
3203 // Compute new buffer size. 3203 // Compute new buffer size.
3204 CodeDesc desc; // the new buffer 3204 CodeDesc desc; // the new buffer
3205 if (buffer_size_ == 0) { 3205 if (buffer_size_ < 1 * MB) {
3206 desc.buffer_size = kMinimalBufferSize;
3207 } else if (buffer_size_ < 1*MB) {
3208 desc.buffer_size = 2*buffer_size_; 3206 desc.buffer_size = 2*buffer_size_;
3209 } else { 3207 } else {
3210 desc.buffer_size = buffer_size_ + 1*MB; 3208 desc.buffer_size = buffer_size_ + 1*MB;
3211 } 3209 }
3212 CHECK_GT(desc.buffer_size, 0); // no overflow 3210 CHECK_GT(desc.buffer_size, 0); // no overflow
3213 3211
3214 // Set up new buffer. 3212 // Set up new buffer.
3215 desc.buffer = NewArray<byte>(desc.buffer_size); 3213 desc.buffer = NewArray<byte>(desc.buffer_size);
3216 3214
3217 desc.instr_size = pc_offset(); 3215 desc.instr_size = pc_offset();
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
3763 assm->instr_at_put( 3761 assm->instr_at_put(
3764 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); 3762 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset));
3765 } 3763 }
3766 } 3764 }
3767 } 3765 }
3768 3766
3769 3767
3770 } } // namespace v8::internal 3768 } } // namespace v8::internal
3771 3769
3772 #endif // V8_TARGET_ARCH_ARM 3770 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698