funcdata.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2013 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package objabi
  5. // This file defines the IDs for PCDATA and FUNCDATA instructions
  6. // in Go binaries.
  7. //
  8. // These must agree with ../../../runtime/funcdata.h and
  9. // ../../../runtime/symtab.go.
  10. const (
  11. PCDATA_RegMapIndex = 0 // if !go115ReduceLiveness
  12. PCDATA_UnsafePoint = 0 // if go115ReduceLiveness
  13. PCDATA_StackMapIndex = 1
  14. PCDATA_InlTreeIndex = 2
  15. FUNCDATA_ArgsPointerMaps = 0
  16. FUNCDATA_LocalsPointerMaps = 1
  17. FUNCDATA_RegPointerMaps = 2 // if !go115ReduceLiveness
  18. FUNCDATA_StackObjects = 3
  19. FUNCDATA_InlTree = 4
  20. FUNCDATA_OpenCodedDeferInfo = 5
  21. // ArgsSizeUnknown is set in Func.argsize to mark all functions
  22. // whose argument size is unknown (C vararg functions, and
  23. // assembly code without an explicit specification).
  24. // This value is generated by the compiler, assembler, or linker.
  25. ArgsSizeUnknown = -0x80000000
  26. )
  27. // Special PCDATA values.
  28. const (
  29. // PCDATA_RegMapIndex values.
  30. //
  31. // Only if !go115ReduceLiveness.
  32. PCDATA_RegMapUnsafe = PCDATA_UnsafePointUnsafe // Unsafe for async preemption
  33. // PCDATA_UnsafePoint values.
  34. PCDATA_UnsafePointSafe = -1 // Safe for async preemption
  35. PCDATA_UnsafePointUnsafe = -2 // Unsafe for async preemption
  36. // PCDATA_Restart1(2) apply on a sequence of instructions, within
  37. // which if an async preemption happens, we should back off the PC
  38. // to the start of the sequence when resuming.
  39. // We need two so we can distinguish the start/end of the sequence
  40. // in case that two sequences are next to each other.
  41. PCDATA_Restart1 = -3
  42. PCDATA_Restart2 = -4
  43. // Like PCDATA_Restart1, but back to function entry if async preempted.
  44. PCDATA_RestartAtEntry = -5
  45. )