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