Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index a5da88a0b3b2e0b5e44b17e0918d17655ea38e09..d448bcb0e124e9d45f437164e2cf4d659f291380 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -13473,6 +13473,21 @@ void Code::CopyFrom(const CodeDesc& desc) { |
CopyBytes(instruction_start(), desc.buffer, |
static_cast<size_t>(desc.instr_size)); |
+ // copy unwinding info, if any |
+ if (desc.unwinding_info && desc.unwinding_info_size > 0) { |
+ // pad to 2**3 boundary |
rmcilroy
2016/06/21 13:47:43
please write number of bytes instead of 2**3.
Stefano Sanfilippo
2016/06/23 15:23:44
Done.
|
+ static const byte padding[8] = {0}; |
+ int padding_size = ((desc.instr_size + 7) & (~7)) - desc.instr_size; |
rmcilroy
2016/06/21 13:47:43
I don't think it's necessary to copy zero's into t
Stefano Sanfilippo
2016/06/23 15:23:44
Done.
|
+ CopyBytes(instruction_end(), padding, padding_size); |
+ |
+ uint64_t unwinding_info_size = desc.unwinding_info_size; |
+ CopyBytes(RoundUp(instruction_end(), kInt64Size), |
rmcilroy
2016/06/21 13:47:43
Just use set_unwinding_size
Stefano Sanfilippo
2016/06/23 15:23:44
Done.
|
+ reinterpret_cast<byte*>(&unwinding_info_size), |
+ sizeof(unwinding_info_size)); |
+ CopyBytes(unwinding_info_start(), desc.unwinding_info, |
+ static_cast<size_t>(desc.unwinding_info_size)); |
+ } |
+ |
// copy reloc info |
CopyBytes(relocation_start(), |
desc.buffer + desc.buffer_size - desc.reloc_size, |