Commit c177666c authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

Add support for emitting DW_CFA_restore_extended

This CL enables emitting register codes that are
greater than 6 bits by encoding it as a LEB128.

Change-Id: I35675b5ef6a935f785035aa101ed4ca812af251e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2008305Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#65889}
parent 9349fb78
......@@ -338,10 +338,14 @@ void EhFrameWriter::RecordRegisterFollowsInitialRule(Register name) {
void EhFrameWriter::RecordRegisterFollowsInitialRule(int dwarf_register_code) {
DCHECK_EQ(writer_state_, InternalState::kInitialized);
DCHECK_LE(dwarf_register_code, EhFrameConstants::kFollowInitialRuleMask);
if (dwarf_register_code <= EhFrameConstants::kFollowInitialRuleMask) {
WriteByte((EhFrameConstants::kFollowInitialRuleTag
<< EhFrameConstants::kFollowInitialRuleMaskSize) |
(dwarf_register_code & EhFrameConstants::kFollowInitialRuleMask));
} else {
WriteOpcode(EhFrameConstants::DwarfOpcodes::kRestoreExtended);
WriteULeb128(dwarf_register_code);
}
}
void EhFrameWriter::Finish(int code_size) {
......
......@@ -24,6 +24,7 @@ class V8_EXPORT_PRIVATE EhFrameConstants final
kAdvanceLoc1 = 0x02,
kAdvanceLoc2 = 0x03,
kAdvanceLoc4 = 0x04,
kRestoreExtended = 0x06,
kSameValue = 0x08,
kDefCfa = 0x0c,
kDefCfaRegister = 0x0d,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment