| Index: src/compiler/x64/unwinding-info-writer-x64.h
|
| diff --git a/src/compiler/x64/unwinding-info-writer-x64.h b/src/compiler/x64/unwinding-info-writer-x64.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..23702534eb9841711c232c795fd595f45855d82c
|
| --- /dev/null
|
| +++ b/src/compiler/x64/unwinding-info-writer-x64.h
|
| @@ -0,0 +1,60 @@
|
| +// Copyright 2016 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef V8_COMPILER_X64_UNWINDING_INFO_WRITER_H_
|
| +#define V8_COMPILER_X64_UNWINDING_INFO_WRITER_H_
|
| +
|
| +#include <unordered_map>
|
| +#include "src/eh-frame.h"
|
| +
|
| +namespace v8 {
|
| +namespace internal {
|
| +namespace compiler {
|
| +
|
| +class InstructionBlock;
|
| +
|
| +class UnwindingInfoWriter {
|
| + public:
|
| + UnwindingInfoWriter() : tracking_fp_(false), block_will_exit_(false) {}
|
| +
|
| + void MaybeIncreaseFrameBaseOffsetAt(int pc_offset, int base_delta) {
|
| + if (!tracking_fp_) {
|
| + eh_frame_writer_.AdvanceLocation(pc_offset);
|
| + eh_frame_writer_.IncreaseBaseAddressOffset(base_delta);
|
| + }
|
| + }
|
| +
|
| + void BeginInstructionBlock(int pc_offset, const InstructionBlock* block);
|
| + void EndInstructionBlock(const InstructionBlock* block);
|
| +
|
| + void MarkFrameConstructed(int pc_base);
|
| + void MarkFrameDeconstructed(int pc_base);
|
| +
|
| + void MarkBlockWillExit() { block_will_exit_ = true; }
|
| +
|
| + void Finish(int code_size) { eh_frame_writer_.Finish(code_size); }
|
| +
|
| + EhFrameWriter* eh_frame_writer() { return &eh_frame_writer_; }
|
| +
|
| + private:
|
| + EhFrameWriter eh_frame_writer_;
|
| +
|
| + struct BlockInitialState {
|
| + Register register_;
|
| + int offset_;
|
| + bool tracking_fp_;
|
| + };
|
| +
|
| + bool tracking_fp_;
|
| + bool block_will_exit_;
|
| +
|
| + std::unordered_map<int, BlockInitialState> block_initial_states_;
|
| + static_assert(kIntSize >= kInt32Size, "int too small to encode a RpoNumber");
|
| +};
|
| +
|
| +} // namespace compiler
|
| +} // namespace internal
|
| +} // namespace v8
|
| +
|
| +#endif
|
|
|