Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reinier Maas
GHC
Commits
cf756a25
Commit
cf756a25
authored
1 year ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
rts: Fix symbol references in Wasm RTS
parent
294c93a5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rts/wasm/JSFFI.c
+7
-7
7 additions, 7 deletions
rts/wasm/JSFFI.c
with
7 additions
and
7 deletions
rts/wasm/JSFFI.c
+
7
−
7
View file @
cf756a25
...
...
@@ -7,7 +7,7 @@
extern
HsBool
rts_JSFFI_flag
;
extern
HsStablePtr
rts_threadDelay_impl
;
extern
StgClosure
ghczminternal_GHCziWasmziPrimziConcziInternal_threadDelay_closure
;
extern
StgClosure
ghczminternal_GHCzi
Internalzi
WasmziPrimziConcziInternal_threadDelay_closure
;
int
__main_void
(
void
);
...
...
@@ -20,7 +20,7 @@ int __main_argc_argv(int argc, char *argv[]) {
hs_init_ghc
(
&
argc
,
&
argv
,
__conf
);
// See Note [threadDelay on wasm] for details.
rts_JSFFI_flag
=
HS_BOOL_TRUE
;
rts_threadDelay_impl
=
getStablePtr
((
StgPtr
)
&
ghczminternal_GHCziWasmziPrimziConcziInternal_threadDelay_closure
);
rts_threadDelay_impl
=
getStablePtr
((
StgPtr
)
&
ghczminternal_GHCzi
Internalzi
WasmziPrimziConcziInternal_threadDelay_closure
);
return
0
;
}
...
...
@@ -73,7 +73,7 @@ typedef __externref_t HsJSVal;
typedef
StgWord
JSValKey
;
extern
const
StgInfoTable
stg_JSVAL_info
;
extern
const
StgInfoTable
ghczminternal_GHCziWasmziPrimziTypes_JSVal_con_info
;
extern
const
StgInfoTable
ghczminternal_GHCzi
Internalzi
WasmziPrimziTypes_JSVal_con_info
;
// See Note [JSVal representation for wasm] for detailed explanation.
...
...
@@ -112,7 +112,7 @@ HaskellObj rts_mkJSVal(Capability *cap, HsJSVal v) {
}
HaskellObj
box
=
(
HaskellObj
)
allocate
(
cap
,
CONSTR_sizeW
(
3
,
0
));
SET_HDR
(
box
,
&
ghczminternal_GHCziWasmziPrimziTypes_JSVal_con_info
,
CCS_SYSTEM
);
SET_HDR
(
box
,
&
ghczminternal_GHCzi
Internalzi
WasmziPrimziTypes_JSVal_con_info
,
CCS_SYSTEM
);
box
->
payload
[
0
]
=
p
;
box
->
payload
[
1
]
=
(
HaskellObj
)
w
;
box
->
payload
[
2
]
=
NULL
;
...
...
@@ -129,7 +129,7 @@ STATIC_INLINE HsJSVal rts_getJSValzh(HaskellObj p) {
HsJSVal
rts_getJSVal
(
HaskellObj
);
HsJSVal
rts_getJSVal
(
HaskellObj
box
)
{
ASSERT
(
UNTAG_CLOSURE
(
box
)
->
header
.
info
==
&
ghczminternal_GHCziWasmziPrimziTypes_JSVal_con_info
);
ASSERT
(
UNTAG_CLOSURE
(
box
)
->
header
.
info
==
&
ghczminternal_GHCzi
Internalzi
WasmziPrimziTypes_JSVal_con_info
);
return
rts_getJSValzh
(
UNTAG_CLOSURE
(
box
)
->
payload
[
0
]);
}
...
...
@@ -140,7 +140,7 @@ INLINE_HEADER void pushClosure (StgTSO *tso, StgWord c) {
extern
const
StgInfoTable
stg_jsffi_block_info
;
extern
const
StgInfoTable
stg_scheduler_loop_info
;
extern
StgClosure
ghczminternal_GHCziWasmziPrimziImports_raiseJSException_closure
;
extern
StgClosure
ghczminternal_GHCzi
Internalzi
WasmziPrimziImports_raiseJSException_closure
;
// schedule a future round of RTS scheduler loop via setImmediate(),
// to avoid jamming the JavaScript main thread
...
...
@@ -216,7 +216,7 @@ mk_rtsPromiseResolve(Bool)
__attribute__
((
export_name
(
"rts_promiseReject"
)))
void
rts_promiseReject
(
HsStablePtr
,
HsJSVal
);
void
rts_promiseReject
(
HsStablePtr
sp
,
HsJSVal
js_err
)
mk_rtsPromiseCallback
(
rts_apply
(
cap
,
&
ghczminternal_GHCziWasmziPrimziImports_raiseJSException_closure
,
rts_mkJSVal
(
cap
,
js_err
)))
mk_rtsPromiseCallback
(
rts_apply
(
cap
,
&
ghczminternal_GHCzi
Internalzi
WasmziPrimziImports_raiseJSException_closure
,
rts_mkJSVal
(
cap
,
js_err
)))
__attribute__
((
export_name
(
"rts_freeStablePtr"
)))
void
rts_freeStablePtr
(
HsStablePtr
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment