| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/eh-frame.h" | 5 #include "src/eh-frame.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 | 9 |
| 10 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_ARM) && \ | 10 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_ARM) && \ |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 static const byte kPadding[] = {nop, nop, nop, nop, nop, nop, nop, nop}; | 245 static const byte kPadding[] = {nop, nop, nop, nop, nop, nop, nop, nop}; |
| 246 DCHECK_LE(padding_size, static_cast<int>(sizeof(kPadding))); | 246 DCHECK_LE(padding_size, static_cast<int>(sizeof(kPadding))); |
| 247 WriteBytes(&kPadding[0], padding_size); | 247 WriteBytes(&kPadding[0], padding_size); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void EhFrameWriter::AdvanceLocation(int pc_offset) { | 250 void EhFrameWriter::AdvanceLocation(int pc_offset) { |
| 251 DCHECK(writer_state_ == InternalState::kInitialized); | 251 DCHECK(writer_state_ == InternalState::kInitialized); |
| 252 DCHECK_GE(pc_offset, last_pc_offset_); | 252 DCHECK_GE(pc_offset, last_pc_offset_); |
| 253 uint32_t delta = pc_offset - last_pc_offset_; | 253 uint32_t delta = pc_offset - last_pc_offset_; |
| 254 | 254 |
| 255 DCHECK_EQ(delta % EhFrameConstants::kCodeAlignmentFactor, 0); | 255 DCHECK_EQ(delta % EhFrameConstants::kCodeAlignmentFactor, 0u); |
| 256 uint32_t factored_delta = delta / EhFrameConstants::kCodeAlignmentFactor; | 256 uint32_t factored_delta = delta / EhFrameConstants::kCodeAlignmentFactor; |
| 257 | 257 |
| 258 if (factored_delta <= EhFrameConstants::kLocationMask) { | 258 if (factored_delta <= EhFrameConstants::kLocationMask) { |
| 259 WriteByte((EhFrameConstants::kLocationTag | 259 WriteByte((EhFrameConstants::kLocationTag |
| 260 << EhFrameConstants::kLocationMaskSize) | | 260 << EhFrameConstants::kLocationMaskSize) | |
| 261 (factored_delta & EhFrameConstants::kLocationMask)); | 261 (factored_delta & EhFrameConstants::kLocationMask)); |
| 262 } else if (factored_delta <= kMaxUInt8) { | 262 } else if (factored_delta <= kMaxUInt8) { |
| 263 WriteOpcode(EhFrameConstants::DwarfOpcodes::kAdvanceLoc1); | 263 WriteOpcode(EhFrameConstants::DwarfOpcodes::kAdvanceLoc1); |
| 264 WriteByte(factored_delta); | 264 WriteByte(factored_delta); |
| 265 } else if (factored_delta <= kMaxUInt16) { | 265 } else if (factored_delta <= kMaxUInt16) { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 const byte* eh_frame_hdr_start = | 620 const byte* eh_frame_hdr_start = |
| 621 fde_terminator_start + EhFrameConstants::kEhFrameTerminatorSize; | 621 fde_terminator_start + EhFrameConstants::kEhFrameTerminatorSize; |
| 622 stream << reinterpret_cast<const void*>(eh_frame_hdr_start) | 622 stream << reinterpret_cast<const void*>(eh_frame_hdr_start) |
| 623 << " .eh_frame_hdr\n"; | 623 << " .eh_frame_hdr\n"; |
| 624 } | 624 } |
| 625 | 625 |
| 626 #endif | 626 #endif |
| 627 | 627 |
| 628 } // namespace internal | 628 } // namespace internal |
| 629 } // namespace v8 | 629 } // namespace v8 |
| OLD | NEW |