1
// +build go1.16,!go1.17
4
* Copyright 2021 ByteDance Inc.
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
27
`github.com/bytedance/sonic/internal/jit`
31
debugSyncGC = os.Getenv("SONIC_SYNC_GC") != ""
32
debugAsyncGC = os.Getenv("SONIC_NO_ASYNC_GC") == ""
36
_Instr_End _Instr = newInsOp(_OP_null)
38
_F_gc = jit.Func(runtime.GC)
39
_F_force_gc = jit.Func(debug.FreeOSMemory)
40
_F_println = jit.Func(println_wrapper)
43
func println_wrapper(i int, op1 int, op2 int){
44
println(i, " Intrs ", op1, _OpNames[op1], "next: ", op2, _OpNames[op2])
47
func (self *_Assembler) force_gc() {
49
self.call_go(_F_force_gc)
52
func (self *_Assembler) debug_instr(i int, v *_Instr) {
54
if (i+1 == len(self.p)) {
55
self.print_gc(i, v, &_Instr_End)
57
next := &(self.p[i+1])
58
self.print_gc(i, v, next)
59
name := _OpNames[next.op()]
60
if strings.Contains(name, "save") {