1// Copyright 2019 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_MAC_H_
6#define V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_MAC_H_
7
8#include "src/base/macros.h"
9#include "src/snapshot/embedded/platform-embedded-file-writer-base.h"
10
11namespace v8 {
12namespace internal {
13
14class PlatformEmbeddedFileWriterMac : public PlatformEmbeddedFileWriterBase {
15 public:
16  PlatformEmbeddedFileWriterMac(EmbeddedTargetArch target_arch,
17                                EmbeddedTargetOs target_os)
18      : target_arch_(target_arch), target_os_(target_os) {
19    USE(target_arch_);
20    USE(target_os_);
21    DCHECK_EQ(target_os_, EmbeddedTargetOs::kMac);
22  }
23
24  void SectionText() override;
25  void SectionData() override;
26  void SectionRoData() override;
27
28  void AlignToCodeAlignment() override;
29  void PaddingAfterCode() override;
30  void AlignToDataAlignment() override;
31
32  void DeclareUint32(const char* name, uint32_t value) override;
33  void DeclarePointerToSymbol(const char* name, const char* target) override;
34
35  void DeclareSymbolGlobal(const char* name) override;
36  void DeclareLabel(const char* name) override;
37
38  void SourceInfo(int fileid, const char* filename, int line) override;
39  void DeclareFunctionBegin(const char* name, uint32_t size) override;
40  void DeclareFunctionEnd(const char* name) override;
41
42  void Comment(const char* string) override;
43
44  void FilePrologue() override;
45  void DeclareExternalFilename(int fileid, const char* filename) override;
46  void FileEpilogue() override;
47
48  int IndentedDataDirective(DataDirective directive) override;
49
50 private:
51  const EmbeddedTargetArch target_arch_;
52  const EmbeddedTargetOs target_os_;
53};
54
55}  // namespace internal
56}  // namespace v8
57
58#endif  // V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_MAC_H_
59