| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
package stdlib |
| 7 |
|
| 8 |
import ( |
| 9 |
"go/constant" |
| 10 |
"go/token" |
| 11 |
"reflect" |
| 12 |
"runtime" |
| 13 |
) |
| 14 |
|
| 15 |
func init() { |
| 16 |
Symbols["runtime/runtime"] = map[string]reflect.Value{ |
| 17 |
|
| 18 |
"BlockProfile": reflect.ValueOf(runtime.BlockProfile), |
| 19 |
"Breakpoint": reflect.ValueOf(runtime.Breakpoint), |
| 20 |
"CPUProfile": reflect.ValueOf(runtime.CPUProfile), |
| 21 |
"Caller": reflect.ValueOf(runtime.Caller), |
| 22 |
"Callers": reflect.ValueOf(runtime.Callers), |
| 23 |
"CallersFrames": reflect.ValueOf(runtime.CallersFrames), |
| 24 |
"Compiler": reflect.ValueOf(constant.MakeFromLiteral("\"gc\"", token.STRING, 0)), |
| 25 |
"FuncForPC": reflect.ValueOf(runtime.FuncForPC), |
| 26 |
"GC": reflect.ValueOf(runtime.GC), |
| 27 |
"GOARCH": reflect.ValueOf(runtime.GOARCH), |
| 28 |
"GOMAXPROCS": reflect.ValueOf(runtime.GOMAXPROCS), |
| 29 |
"GOOS": reflect.ValueOf(runtime.GOOS), |
| 30 |
"GOROOT": reflect.ValueOf(runtime.GOROOT), |
| 31 |
"Goexit": reflect.ValueOf(runtime.Goexit), |
| 32 |
"GoroutineProfile": reflect.ValueOf(runtime.GoroutineProfile), |
| 33 |
"Gosched": reflect.ValueOf(runtime.Gosched), |
| 34 |
"KeepAlive": reflect.ValueOf(runtime.KeepAlive), |
| 35 |
"LockOSThread": reflect.ValueOf(runtime.LockOSThread), |
| 36 |
"MemProfile": reflect.ValueOf(runtime.MemProfile), |
| 37 |
"MemProfileRate": reflect.ValueOf(&runtime.MemProfileRate).Elem(), |
| 38 |
"MutexProfile": reflect.ValueOf(runtime.MutexProfile), |
| 39 |
"NumCPU": reflect.ValueOf(runtime.NumCPU), |
| 40 |
"NumCgoCall": reflect.ValueOf(runtime.NumCgoCall), |
| 41 |
"NumGoroutine": reflect.ValueOf(runtime.NumGoroutine), |
| 42 |
"ReadMemStats": reflect.ValueOf(runtime.ReadMemStats), |
| 43 |
"ReadTrace": reflect.ValueOf(runtime.ReadTrace), |
| 44 |
"SetBlockProfileRate": reflect.ValueOf(runtime.SetBlockProfileRate), |
| 45 |
"SetCPUProfileRate": reflect.ValueOf(runtime.SetCPUProfileRate), |
| 46 |
"SetCgoTraceback": reflect.ValueOf(runtime.SetCgoTraceback), |
| 47 |
"SetFinalizer": reflect.ValueOf(runtime.SetFinalizer), |
| 48 |
"SetMutexProfileFraction": reflect.ValueOf(runtime.SetMutexProfileFraction), |
| 49 |
"Stack": reflect.ValueOf(runtime.Stack), |
| 50 |
"StartTrace": reflect.ValueOf(runtime.StartTrace), |
| 51 |
"StopTrace": reflect.ValueOf(runtime.StopTrace), |
| 52 |
"ThreadCreateProfile": reflect.ValueOf(runtime.ThreadCreateProfile), |
| 53 |
"UnlockOSThread": reflect.ValueOf(runtime.UnlockOSThread), |
| 54 |
"Version": reflect.ValueOf(runtime.Version), |
| 55 |
|
| 56 |
|
| 57 |
"BlockProfileRecord": reflect.ValueOf((*runtime.BlockProfileRecord)(nil)), |
| 58 |
"Error": reflect.ValueOf((*runtime.Error)(nil)), |
| 59 |
"Frame": reflect.ValueOf((*runtime.Frame)(nil)), |
| 60 |
"Frames": reflect.ValueOf((*runtime.Frames)(nil)), |
| 61 |
"Func": reflect.ValueOf((*runtime.Func)(nil)), |
| 62 |
"MemProfileRecord": reflect.ValueOf((*runtime.MemProfileRecord)(nil)), |
| 63 |
"MemStats": reflect.ValueOf((*runtime.MemStats)(nil)), |
| 64 |
"PanicNilError": reflect.ValueOf((*runtime.PanicNilError)(nil)), |
| 65 |
"Pinner": reflect.ValueOf((*runtime.Pinner)(nil)), |
| 66 |
"StackRecord": reflect.ValueOf((*runtime.StackRecord)(nil)), |
| 67 |
"TypeAssertionError": reflect.ValueOf((*runtime.TypeAssertionError)(nil)), |
| 68 |
|
| 69 |
|
| 70 |
"_Error": reflect.ValueOf((*_runtime_Error)(nil)), |
| 71 |
} |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
type _runtime_Error struct { |
| 76 |
IValue interface{} |
| 77 |
WError func() string |
| 78 |
WRuntimeError func() |
| 79 |
} |
| 80 |
|
| 81 |
func (W _runtime_Error) Error() string { return W.WError() } |
| 82 |
func (W _runtime_Error) RuntimeError() { W.WRuntimeError() } |