add url and urlsearchparams classes with c bridge#107
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add URL and URLSearchParams classes
Adds
URLandURLSearchParamsas built-in classes, implemented via a new C bridge (url-bridge.c). Also fixes two CI bugs discovered during development: missing bridge artifacts in the cross-compile SDK tarball, and stage1 compiling with native CPU instructions that crash GitHub's x86-64 runners.What's new
URLURLSearchParamsImplementation
c_bridges/url-bridge.c(new) — GC-aware C bridge. URL parsing:cs_url_parse_protocol,cs_url_parse_hostname,cs_url_parse_port,cs_url_parse_pathname,cs_url_parse_search,cs_url_parse_hash. URLSearchParams:cs_urlsearch_get,cs_urlsearch_has,cs_urlsearch_set,cs_urlsearch_append,cs_urlsearch_delete,cs_urlsearch_tostring.src/codegen/stdlib/url.ts(new) — codegen forURLandURLSearchParamsconstructor and method dispatch.src/codegen/infrastructure/symbol-table.ts—defineUrl/defineUrlSearchParamsnow initialize all 17 Symbol fields. Previously only 5 were set;getConcreteClassreadssymbol.concreteClassat index 15, causing a SIGSEGV from reading past the end of the struct.scripts/build-vendor.sh,src/compiler.ts,src/native-compiler-lib.ts— build and linkurl-bridge.o.CI fixes
scripts/build-target-sdk.sh— addurl-bridge.oto the cross-compile SDK tarball. Missing bridges cause linker failures when cross-compiling macOS → Linux..github/workflows/ci.yml— addurl-bridge.oto all 4 artifact copy locations (Linux verify, Linux release, macOS verify, macOS release).tests/self-hosting.test.ts— pass--target-cpu=x86-64to both stage0 and stage1 builds. Stage1 is compiled by stage0 and inherits the same CPU target issue; without the flag it emits AVX/newer instructions that SIGILL on GitHub's baseline x86-64 runners.Commits
18 files changed, 659 insertions(+), 11 deletions(-)