Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
45 lines (39 loc) · 1.42 KB

File metadata and controls

45 lines (39 loc) · 1.42 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef _CJavaScriptKit_WasmGlobalMacros_h
#define _CJavaScriptKit_WasmGlobalMacros_h
// Define an inline getter for a Wasm global
#define WASM_GLOBAL_DEFINE_INLINE_GETTER(name, core_type, c_type) \
static inline c_type name##_get(void) { \
c_type val; \
__asm__( \
".globaltype " #name ", " #core_type "\n" \
"global.get " #name "\n" \
"local.set %0\n" \
: "=r"(val)); \
return val; \
}
// Define an inline setter for a Wasm global
#define WASM_GLOBAL_DEFINE_INLINE_SETTER(name, core_type, c_type) \
static inline void name##_set(c_type val) { \
__asm__( \
".globaltype " #name ", " #core_type "\n" \
"local.get %0\n" \
"global.set " #name "\n" \
: : "r"(val)); \
}
// Define an inline getter and setter for a Wasm global
#define WASM_GLOBAL_DEFINE_INLINE_ACCESSORS(name, core_type, c_type) \
WASM_GLOBAL_DEFINE_INLINE_GETTER(name, core_type, c_type) \
WASM_GLOBAL_DEFINE_INLINE_SETTER(name, core_type, c_type)
// Define a Wasm global storage
#define WASM_GLOBAL_DEFINE_STORAGE(name, core_type) \
__asm__( \
".globaltype " #name ", " #core_type "\n" \
".global " #name "\n" \
#name ":\n" \
);
// Define an export name for a Wasm value
#define WASM_EXPORT_NAME(name, export_name) \
__asm__( \
".export_name " #name ", " #export_name "\n" \
);
#endif
Morty Proxy This is a proxified and sanitized view of the page, visit original site.