OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 void Assembler::GrowBuffer() { | 395 void Assembler::GrowBuffer() { |
396 DCHECK(buffer_overflow()); | 396 DCHECK(buffer_overflow()); |
397 if (!own_buffer_) FATAL("external code buffer is too small"); | 397 if (!own_buffer_) FATAL("external code buffer is too small"); |
398 | 398 |
399 // Compute new buffer size. | 399 // Compute new buffer size. |
400 CodeDesc desc; // the new buffer | 400 CodeDesc desc; // the new buffer |
401 desc.buffer_size = 2 * buffer_size_; | 401 desc.buffer_size = 2 * buffer_size_; |
402 | 402 |
403 // Some internal data structures overflow for very large buffers, | 403 // Some internal data structures overflow for very large buffers, |
404 // they must ensure that kMaximalBufferSize is not too large. | 404 // they must ensure that kMaximalBufferSize is not too large. |
405 if ((desc.buffer_size > kMaximalBufferSize) || | 405 if (desc.buffer_size > kMaximalBufferSize || |
406 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { | 406 static_cast<size_t>(desc.buffer_size) > |
| 407 isolate()->heap()->MaxOldGenerationSize()) { |
407 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); | 408 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
408 } | 409 } |
409 | 410 |
410 // Set up new buffer. | 411 // Set up new buffer. |
411 desc.buffer = NewArray<byte>(desc.buffer_size); | 412 desc.buffer = NewArray<byte>(desc.buffer_size); |
412 desc.origin = this; | 413 desc.origin = this; |
413 desc.instr_size = pc_offset(); | 414 desc.instr_size = pc_offset(); |
414 desc.reloc_size = | 415 desc.reloc_size = |
415 static_cast<int>((buffer_ + buffer_size_) - (reloc_info_writer.pos())); | 416 static_cast<int>((buffer_ + buffer_size_) - (reloc_info_writer.pos())); |
416 | 417 |
(...skipping 4338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4755 | 4756 |
4756 bool RelocInfo::IsInConstantPool() { | 4757 bool RelocInfo::IsInConstantPool() { |
4757 return false; | 4758 return false; |
4758 } | 4759 } |
4759 | 4760 |
4760 | 4761 |
4761 } // namespace internal | 4762 } // namespace internal |
4762 } // namespace v8 | 4763 } // namespace v8 |
4763 | 4764 |
4764 #endif // V8_TARGET_ARCH_X64 | 4765 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |