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

Side by Side Diff: src/arm64/assembler-arm64.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 | « src/arm/assembler-arm.cc ('k') | src/assembler.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 2764
2765 return true; 2765 return true;
2766 } 2766 }
2767 2767
2768 2768
2769 void Assembler::GrowBuffer() { 2769 void Assembler::GrowBuffer() {
2770 if (!own_buffer_) FATAL("external code buffer is too small"); 2770 if (!own_buffer_) FATAL("external code buffer is too small");
2771 2771
2772 // Compute new buffer size. 2772 // Compute new buffer size.
2773 CodeDesc desc; // the new buffer 2773 CodeDesc desc; // the new buffer
2774 if (buffer_size_ == 0) { 2774 if (buffer_size_ < 1 * MB) {
2775 desc.buffer_size = kMinimalBufferSize;
2776 } else if (buffer_size_ < 1 * MB) {
2777 desc.buffer_size = 2 * buffer_size_; 2775 desc.buffer_size = 2 * buffer_size_;
2778 } else { 2776 } else {
2779 desc.buffer_size = buffer_size_ + 1 * MB; 2777 desc.buffer_size = buffer_size_ + 1 * MB;
2780 } 2778 }
2781 CHECK_GT(desc.buffer_size, 0); // No overflow. 2779 CHECK_GT(desc.buffer_size, 0); // No overflow.
2782 2780
2783 byte* buffer = reinterpret_cast<byte*>(buffer_); 2781 byte* buffer = reinterpret_cast<byte*>(buffer_);
2784 2782
2785 // Set up new buffer. 2783 // Set up new buffer.
2786 desc.buffer = NewArray<byte>(desc.buffer_size); 2784 desc.buffer = NewArray<byte>(desc.buffer_size);
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
3116 movz(scratch, (target_offset >> 16) & 0xFFFF, 16); 3114 movz(scratch, (target_offset >> 16) & 0xFFFF, 16);
3117 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); 3115 movk(scratch, (target_offset >> 32) & 0xFFFF, 32);
3118 DCHECK((target_offset >> 48) == 0); 3116 DCHECK((target_offset >> 48) == 0);
3119 add(rd, rd, scratch); 3117 add(rd, rd, scratch);
3120 } 3118 }
3121 3119
3122 3120
3123 } } // namespace v8::internal 3121 } } // namespace v8::internal
3124 3122
3125 #endif // V8_TARGET_ARCH_ARM64 3123 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698