Skip to content

Commit f90970c

Browse files
committed
refactor: rm JIT code & clear CI
1 parent cd72d35 commit f90970c

142 files changed

Lines changed: 88 additions & 16343 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr-check.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ jobs:
1616
- name: Check Spell
1717
uses: crate-ci/typos@master
1818

19-
staticcheck:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Go
24-
uses: actions/setup-go@v5
25-
with:
26-
go-version: stable
27-
28-
- uses: reviewdog/action-staticcheck@v1
29-
with:
30-
github_token: ${{ secrets.github_token }}
31-
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
32-
reporter: github-pr-review
33-
# Report all results.
34-
filter_mode: nofilter
35-
# Exit with 1 when it finds at least one finding.
36-
fail_on_error: true
37-
# Set staticcheck flags
38-
# -ST1006 for fixing jit code receiver names like `self`
39-
staticcheck_flags: -checks=inherit,-SA1029, -ST1006
40-
4119
lint:
4220
runs-on: ubuntu-latest
4321
steps:
@@ -49,7 +27,7 @@ jobs:
4927

5028
- name: Golangci Lint
5129
# https://golangci-lint.run/
52-
uses: golangci/golangci-lint-action@v6
30+
uses: golangci/golangci-lint-action@v8
5331
with:
5432
version: latest
5533
only-new-issues: true

.github/workflows/tests.yml

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,14 @@ jobs:
77
strategy:
88
matrix:
99
go: [ "1.18", oldstable, stable ]
10-
runs-on: [ Linux, X64 ]
10+
runs-on: [ ubuntu-latest, macos-latest ]
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Set up Go
1414
uses: actions/setup-go@v5
1515
with:
1616
go-version: ${{ matrix.go }}
17-
cache: false # don't use cache for self-hosted runners
18-
- name: Test packages # only tests reflect pkg, JIT pkgs is not supported
19-
run: go test -race ./internal/reflect
17+
- name: Test packages
18+
run: go test -race ./...
2019
- name: Test ./tests & Benchmark
2120
run: cd tests && go test -bench=. -benchmem -benchtime=100ms
22-
23-
unittest-arm64:
24-
strategy:
25-
matrix:
26-
go: [ "1.18", oldstable, stable ]
27-
runs-on: [ ARM64 ] # It's OK under Linux or macOS
28-
steps:
29-
- uses: actions/checkout@v4
30-
- name: Set up Go
31-
uses: actions/setup-go@v5
32-
with:
33-
go-version: ${{ matrix.go }}
34-
cache: false # don't use cache for self-hosted runners
35-
- name: Test packages # only tests reflect pkg, JIT pkgs is not supported
36-
run: go test -race ./internal/reflect
37-
- name: Test ./tests & Benchmark
38-
run: cd tests && go test -bench=. -benchmem -benchtime=100ms
39-
40-
unittest-legacy:
41-
strategy:
42-
matrix:
43-
go: [ "1.18", "1.23" ] # jit works <= 1.23
44-
runs-on: [ Linux, X64 ]
45-
steps:
46-
- uses: actions/checkout@v4
47-
- name: Set up Go
48-
uses: actions/setup-go@v5
49-
with:
50-
go-version: ${{ matrix.go }}
51-
cache: false # don't use cache for self-hosted runners
52-
- name: Build with frugal_jit
53-
run: go build -v -tags=frugal_jit ./...
54-
- name: Test with frugal_jit
55-
run: go test -tags=frugal_jit ./...

.golangci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
issues:
2-
exclude-dirs:
3-
- internal/jit
1+
version: "2"

debug/debug.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ type CacheStats struct {
3838
Miss int
3939
Size int
4040
}
41+
42+
// GetStats ...
43+
//
44+
// Deprecated: It was for IT
45+
func GetStats() Stats { return Stats{} }

debug/debug_jit.go

Lines changed: 0 additions & 43 deletions
This file was deleted.

debug/debug_nojit.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

frugal.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,29 @@ import (
2525

2626
// EncodedSize measures the encoded size of val.
2727
func EncodedSize(val interface{}) int {
28-
if nojit {
29-
return reflect.EncodedSize(val)
30-
}
31-
return jitEncodedSize(val)
28+
return reflect.EncodedSize(val)
3229
}
3330

3431
// EncodeObject serializes val into buf with Thrift Binary Protocol, with optional Zero-Copy thrift.NocopyWriter.
3532
// buf must be large enough to contain the entire serialization result.
3633
func EncodeObject(buf []byte, w thrift.NocopyWriter, val interface{}) (int, error) {
37-
if nojit {
38-
ret, err := reflect.Append(buf[:0], val)
39-
if len(ret) > len(buf) {
40-
return 0, fmt.Errorf("index out of range [%d] with length %d.\n"+
41-
"Please make sure the input will not be changed after calling EncodedSize or during EncodeObject(concurrency issues).",
42-
len(ret), len(buf))
43-
}
44-
return len(ret), err
34+
ret, err := reflect.Append(buf[:0], val)
35+
if len(ret) > len(buf) {
36+
return 0, fmt.Errorf("index out of range [%d] with length %d.\n"+ //nolint:staticcheck // ST1005: newlines
37+
"Please make sure the input will not be changed after calling EncodedSize or during EncodeObject(concurrency issues).",
38+
len(ret), len(buf))
4539
}
46-
return jitEncodeObject(buf, w, val)
40+
return len(ret), err
4741
}
4842

4943
// DecodeObject deserializes buf into val with Thrift Binary Protocol.
5044
func DecodeObject(buf []byte, val interface{}) (int, error) {
51-
if nojit {
52-
return reflect.Decode(buf, val)
53-
}
54-
return jitDecodeObject(buf, val)
45+
return reflect.Decode(buf, val)
46+
}
47+
48+
// Pretouch ...
49+
//
50+
// Deprecated: It was for JIT
51+
func Pretouch(vt any, options ...Option) error {
52+
return nil
5553
}

frugal_jit.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

frugal_nojit.go

Lines changed: 0 additions & 45 deletions
This file was deleted.

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ go 1.18
44

55
require (
66
github.com/cloudwego/gopkg v0.1.2
7-
github.com/cloudwego/iasm v0.2.0
87
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
98
github.com/stretchr/testify v1.9.0
10-
golang.org/x/arch v0.2.0
119
)
1210

1311
require (

0 commit comments

Comments
 (0)