| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |