mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd957102c0 | |||
| 559ba98319 | |||
| c4219439eb | |||
| 7a9c649268 | |||
| 213d10838f | |||
| b573ef3813 | |||
| 854f91ecf2 |
@@ -40,7 +40,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Restore LLVM source cache
|
- name: Restore LLVM source cache
|
||||||
uses: actions/cache/restore@v5
|
uses: actions/cache/restore@v5
|
||||||
@@ -131,7 +131,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Build TinyGo (LLVM ${{ matrix.version }})
|
- name: Build TinyGo (LLVM ${{ matrix.version }})
|
||||||
run: go install -tags=llvm${{ matrix.version }}
|
run: go install -tags=llvm${{ matrix.version }}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Run go mod tidy
|
- name: Run go mod tidy
|
||||||
run: go mod tidy
|
run: go mod tidy
|
||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
# statically linked binary.
|
# statically linked binary.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.27rc2-alpine
|
image: golang:1.27rc3-alpine
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
@@ -160,7 +160,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Install wasmtime
|
- name: Install wasmtime
|
||||||
uses: bytecodealliance/actions/wasmtime/setup@v1
|
uses: bytecodealliance/actions/wasmtime/setup@v1
|
||||||
@@ -204,7 +204,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
@@ -323,7 +323,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Restore LLVM source cache
|
- name: Restore LLVM source cache
|
||||||
uses: actions/cache/restore@v5
|
uses: actions/cache/restore@v5
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Restore cached LLVM source
|
- name: Restore cached LLVM source
|
||||||
uses: actions/cache/restore@v5
|
uses: actions/cache/restore@v5
|
||||||
@@ -129,7 +129,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Download TinyGo build
|
- name: Download TinyGo build
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
@@ -150,7 +150,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Download TinyGo build
|
- name: Download TinyGo build
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
@@ -176,7 +176,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.27.0-rc.2'
|
go-version: '1.27.0-rc.3'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Download TinyGo build
|
- name: Download TinyGo build
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v8
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
# tinygo-llvm stage obtains the llvm source for TinyGo
|
# tinygo-llvm stage obtains the llvm source for TinyGo
|
||||||
FROM golang:1.27rc2 AS tinygo-llvm
|
FROM golang:1.27rc3 AS tinygo-llvm
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y apt-utils make cmake clang-17 ninja-build && \
|
apt-get install -y apt-utils make cmake clang-17 ninja-build && \
|
||||||
@@ -33,7 +33,7 @@ RUN cd /tinygo/ && \
|
|||||||
|
|
||||||
# tinygo-compiler copies the compiler build over to a base Go container (without
|
# tinygo-compiler copies the compiler build over to a base Go container (without
|
||||||
# all the build tools etc).
|
# all the build tools etc).
|
||||||
FROM golang:1.27rc2 AS tinygo-compiler
|
FROM golang:1.27rc3 AS tinygo-compiler
|
||||||
|
|
||||||
# Copy tinygo build.
|
# Copy tinygo build.
|
||||||
COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo
|
COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo
|
||||||
|
|||||||
+1
-1
@@ -349,7 +349,6 @@ TEST_PACKAGES_FAST = \
|
|||||||
encoding \
|
encoding \
|
||||||
encoding/ascii85 \
|
encoding/ascii85 \
|
||||||
errors \
|
errors \
|
||||||
encoding/asn1 \
|
|
||||||
encoding/base32 \
|
encoding/base32 \
|
||||||
encoding/base64 \
|
encoding/base64 \
|
||||||
encoding/csv \
|
encoding/csv \
|
||||||
@@ -392,6 +391,7 @@ TEST_PACKAGES_FAST = \
|
|||||||
# crypto/des fails on wasi, needs panic()/recover()
|
# crypto/des fails on wasi, needs panic()/recover()
|
||||||
# crypto/hmac fails on wasi, it exits with a "slice out of range" panic
|
# crypto/hmac fails on wasi, it exits with a "slice out of range" panic
|
||||||
# debug/plan9obj requires os.ReadAt, which is not yet supported on windows
|
# debug/plan9obj requires os.ReadAt, which is not yet supported on windows
|
||||||
|
# encoding/asn1 due to https://github.com/golang/go/commit/6a6d115f9a7422b2fa081ba6f567eefb4a099462
|
||||||
# encoding/xml takes a minute on linux and gives a stack overflow on wasi
|
# encoding/xml takes a minute on linux and gives a stack overflow on wasi
|
||||||
# image fails on wasi, needs panic()/recover()
|
# image fails on wasi, needs panic()/recover()
|
||||||
# io/ioutil requires os.ReadDir, which is not yet supported on windows or wasi
|
# io/ioutil requires os.ReadDir, which is not yet supported on windows or wasi
|
||||||
|
|||||||
@@ -177,8 +177,15 @@ func Build(pkgName, outpath string, config *compileopts.Config) error {
|
|||||||
// Pick a default output path based on the main directory.
|
// Pick a default output path based on the main directory.
|
||||||
outpath = filepath.Base(result.MainDir) + config.DefaultBinaryExtension()
|
outpath = filepath.Base(result.MainDir) + config.DefaultBinaryExtension()
|
||||||
}
|
}
|
||||||
|
} else if fi, statErr := os.Stat(outpath); statErr == nil && fi.IsDir() {
|
||||||
|
var name string
|
||||||
|
if strings.HasSuffix(pkgName, ".go") {
|
||||||
|
name = filepath.Base(pkgName[:len(pkgName)-3]) + config.DefaultBinaryExtension()
|
||||||
|
} else {
|
||||||
|
name = filepath.Base(result.MainDir) + config.DefaultBinaryExtension()
|
||||||
|
}
|
||||||
|
outpath = filepath.Join(outpath, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.Rename(result.Binary, outpath); err != nil {
|
if err := os.Rename(result.Binary, outpath); err != nil {
|
||||||
// Moving failed. Do a file copy.
|
// Moving failed. Do a file copy.
|
||||||
inf, err := os.Open(result.Binary)
|
inf, err := os.Open(result.Binary)
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ func realloc(ptr unsafe.Pointer, size uintptr) unsafe.Pointer {
|
|||||||
lastBlock := firstBlock.findHead()
|
lastBlock := firstBlock.findHead()
|
||||||
|
|
||||||
// Calculate the size of the original allocation body.
|
// Calculate the size of the original allocation body.
|
||||||
oldSize := uintptr(lastBlock-firstBlock)*blocksPerStateByte + (bytesPerBlock - unsafe.Sizeof(objHeader{}))
|
oldSize := uintptr(lastBlock-firstBlock)*bytesPerBlock + (bytesPerBlock - unsafe.Sizeof(objHeader{}))
|
||||||
|
|
||||||
if size <= oldSize {
|
if size <= oldSize {
|
||||||
// The requested size is less than the old size.
|
// The requested size is less than the old size.
|
||||||
|
|||||||
@@ -47,8 +47,14 @@ func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer {
|
|||||||
gcTotalAlloc += uint64(size)
|
gcTotalAlloc += uint64(size)
|
||||||
gcMallocs++
|
gcMallocs++
|
||||||
heapptr += size
|
heapptr += size
|
||||||
for heapptr >= heapEnd {
|
if heapptr < addr {
|
||||||
|
// The allocation size overflowed the heap pointer.
|
||||||
|
runtimePanic("out of memory")
|
||||||
|
}
|
||||||
|
for heapptr > heapEnd {
|
||||||
// Try to increase the heap and check again.
|
// Try to increase the heap and check again.
|
||||||
|
// Use > instead of >= because an allocation that exactly
|
||||||
|
// ends at heapEnd is still within heap boundaries.
|
||||||
if growHeap() {
|
if growHeap() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,12 @@ func gcMarkReachable() {
|
|||||||
gcPauseCore(i)
|
gcPauseCore(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Busy-wait until all the other cores are ready.
|
||||||
|
for gcScanState.Load() != numCPU {
|
||||||
|
spinLoopWait()
|
||||||
|
}
|
||||||
|
gcScanState.Store(0)
|
||||||
|
|
||||||
// Scan the stack(s) of the current core.
|
// Scan the stack(s) of the current core.
|
||||||
scanCurrentStack()
|
scanCurrentStack()
|
||||||
if !task.OnSystemStack() {
|
if !task.OnSystemStack() {
|
||||||
@@ -53,13 +59,6 @@ func gcMarkReachable() {
|
|||||||
// Scan globals.
|
// Scan globals.
|
||||||
findGlobals(markRoots)
|
findGlobals(markRoots)
|
||||||
|
|
||||||
// Busy-wait until all the other cores are ready. They certainly should be,
|
|
||||||
// after the scanning we did above.
|
|
||||||
for gcScanState.Load() != numCPU {
|
|
||||||
spinLoopWait()
|
|
||||||
}
|
|
||||||
gcScanState.Store(0)
|
|
||||||
|
|
||||||
// Signal each core in turn that they can scan the stack.
|
// Signal each core in turn that they can scan the stack.
|
||||||
for i := uint32(0); i < numCPU; i++ {
|
for i := uint32(0); i < numCPU; i++ {
|
||||||
if i == core {
|
if i == core {
|
||||||
|
|||||||
@@ -807,13 +807,13 @@ func hashmapInterfaceHash(itf interface{}, seed uintptr) uint32 {
|
|||||||
case reflectlite.Array:
|
case reflectlite.Array:
|
||||||
var hash uint32
|
var hash uint32
|
||||||
for i := 0; i < x.Len(); i++ {
|
for i := 0; i < x.Len(); i++ {
|
||||||
hash ^= hashmapInterfaceHash(valueInterfaceUnsafe(x.Index(i)), seed)
|
hash = (hash * 31) ^ hashmapInterfaceHash(valueInterfaceUnsafe(x.Index(i)), seed)
|
||||||
}
|
}
|
||||||
return hash
|
return hash
|
||||||
case reflectlite.Struct:
|
case reflectlite.Struct:
|
||||||
var hash uint32
|
var hash uint32
|
||||||
for i := 0; i < x.NumField(); i++ {
|
for i := 0; i < x.NumField(); i++ {
|
||||||
hash ^= hashmapInterfaceHash(valueInterfaceUnsafe(x.Field(i)), seed)
|
hash = (hash * 31) ^ hashmapInterfaceHash(valueInterfaceUnsafe(x.Field(i)), seed)
|
||||||
}
|
}
|
||||||
return hash
|
return hash
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user