Skip to content

Commit 13068c7

Browse files
authored
Merge pull request #439 from bytecodealliance/dev/refactor_orc_jit
Merge bytecodealliance:dev/refactor_orc_jit into wenyongh:dev/refactor_orc_jit
2 parents 8b02630 + 37c9b23 commit 13068c7

Some content is hidden

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

61 files changed

+1763
-607
lines changed

.github/workflows/compilation_on_android_ubuntu_macos.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ jobs:
230230
# uncompatiable feature and platform
231231
- os: macos-latest
232232
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
233-
- os: macos-latest
234-
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
235233
# uncompatiable mode and feature
236234
# MULTI_MODULE only on INTERP mode
237235
- make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS

.github/workflows/compilation_on_windows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,10 @@ jobs:
104104
cmake .. -DWAMR_BUILD_SIMD=1
105105
cmake --build . --config Release --parallel 4
106106
cd .. && rm -force -r build
107+
- name: Build iwasm [source debugger]
108+
run: |
109+
cd product-mini/platforms/windows
110+
mkdir build && cd build
111+
cmake .. -DWAMR_BUILD_DEBUG_INTERP=1
112+
cmake --build . --config Release --parallel 4
113+
cd .. && rm -force -r build

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
/.idea
55
**/cmake-build-*/
66
**/*build/
7+
*.obj
8+
*.a
9+
*.so
10+
711
core/deps/**
812
core/shared/mem-alloc/tlsf
913
core/app-framework/wgl
@@ -12,6 +16,9 @@ wamr-sdk/out/
1216
wamr-sdk/runtime/build_runtime_sdk/
1317
test-tools/host-tool/bin/
1418
product-mini/app-samples/hello-world/test.wasm
19+
product-mini/platforms/linux-sgx/enclave-sample/App/
20+
product-mini/platforms/linux-sgx/enclave-sample/Enclave/
21+
product-mini/platforms/linux-sgx/enclave-sample/iwasm
1522

1623
build_out
1724
tests/wamr-test-suites/workspace

core/app-framework/sensor/app/sensor_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ uint32
1616
wasm_sensor_open(const char *name, int instance);
1717

1818
bool
19-
wasm_sensor_config(uint32 sensor, int interval, int bit_cfg, int delay);
19+
wasm_sensor_config(uint32 sensor, uint32 interval, int bit_cfg, uint32 delay);
2020

2121
bool
22-
wasm_sensor_config_with_attr_container(uint32 sensor, char *buffer, int len);
22+
wasm_sensor_config_with_attr_container(uint32 sensor, char *buffer, uint32 len);
2323

2424
bool
2525
wasm_sensor_close(uint32 sensor);

core/app-framework/sensor/native/runtime_sensor.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "bh_platform.h"
1010

1111
static sys_sensor_t *g_sys_sensors = NULL;
12-
static int g_sensor_id_max = 0;
12+
static uint32 g_sensor_id_max = 0;
1313

1414
static sensor_client_t *
1515
find_sensor_client(sys_sensor_t *sensor, unsigned int client_id,
@@ -85,8 +85,8 @@ wasm_sensor_callback(void *client, uint32 sensor_id, void *user_data)
8585
}
8686

8787
bool
88-
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, int interval,
89-
int bit_cfg, int delay)
88+
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, uint32 interval,
89+
int bit_cfg, uint32 delay)
9090
{
9191
wasm_module_inst_t module_inst = get_module_inst(exec_env);
9292
attr_container_t *attr_cont;
@@ -115,9 +115,9 @@ wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, int interval,
115115

116116
if (s->config != NULL) {
117117
attr_cont = attr_container_create("config sensor");
118-
attr_container_set_int(&attr_cont, "interval", interval);
118+
attr_container_set_int(&attr_cont, "interval", (int)interval);
119119
attr_container_set_int(&attr_cont, "bit_cfg", bit_cfg);
120-
attr_container_set_int(&attr_cont, "delay", delay);
120+
attr_container_set_int(&attr_cont, "delay", (int)delay);
121121
s->config(s, attr_cont);
122122
attr_container_destroy(attr_cont);
123123
}
@@ -138,7 +138,7 @@ wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance)
138138
sensor_client_t *c;
139139
sys_sensor_t *s = find_sys_sensor(name, instance);
140140
if (s == NULL)
141-
return -1;
141+
return (uint32)-1;
142142

143143
unsigned int mod_id =
144144
app_manager_get_module_id(Module_WASM_App, module_inst);
@@ -150,14 +150,14 @@ wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance)
150150
if (c) {
151151
// the app already opened this sensor
152152
os_mutex_unlock(&s->lock);
153-
return -1;
153+
return (uint32)-1;
154154
}
155155

156156
sensor_client_t *client =
157157
(sensor_client_t *)wasm_runtime_malloc(sizeof(sensor_client_t));
158158
if (client == NULL) {
159159
os_mutex_unlock(&s->lock);
160-
return -1;
160+
return (uint32)-1;
161161
}
162162

163163
memset(client, 0, sizeof(sensor_client_t));
@@ -176,7 +176,7 @@ wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance)
176176
return s->sensor_id;
177177
}
178178

179-
return -1;
179+
return (uint32)-1;
180180
}
181181

182182
bool
@@ -294,7 +294,7 @@ add_sys_sensor(char *name, char *description, int instance,
294294
}
295295

296296
g_sensor_id_max++;
297-
if (g_sensor_id_max == -1)
297+
if (g_sensor_id_max == UINT32_MAX)
298298
g_sensor_id_max++;
299299
s->sensor_id = g_sensor_id_max;
300300

@@ -366,10 +366,10 @@ find_sensor_client(sys_sensor_t *sensor, unsigned int client_id,
366366
}
367367

368368
// return the milliseconds to next check
369-
int
369+
uint32
370370
check_sensor_timers()
371371
{
372-
int ms_to_next_check = -1;
372+
uint32 ms_to_next_check = UINT32_MAX;
373373
uint32 now = (uint32)bh_get_tick_ms();
374374

375375
sys_sensor_t *s = g_sys_sensors;
@@ -395,12 +395,12 @@ check_sensor_timers()
395395

396396
s->last_read = now;
397397

398-
if (ms_to_next_check == -1 || (ms_to_next_check < s->read_interval))
398+
if (s->read_interval < ms_to_next_check)
399399
ms_to_next_check = s->read_interval;
400400
}
401401
else {
402-
int remaining = s->read_interval - elpased_ms;
403-
if (ms_to_next_check == -1 || (ms_to_next_check < remaining))
402+
uint32 remaining = s->read_interval - elpased_ms;
403+
if (remaining < ms_to_next_check)
404404
ms_to_next_check = remaining;
405405
}
406406

core/app-framework/sensor/native/runtime_sensor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ typedef struct _sys_sensor *sensor_obj_t;
1717
typedef struct _sensor_client {
1818
struct _sensor_client *next;
1919
unsigned int client_id; // the app id
20-
int interval;
20+
uint32 interval;
2121
int bit_cfg;
22-
int delay;
22+
uint32 delay;
2323
void (*client_callback)(void *client, uint32, attr_container_t *);
2424
} sensor_client_t;
2525

@@ -54,7 +54,7 @@ void
5454
refresh_read_interval(sensor_obj_t sensor);
5555
void
5656
sensor_cleanup_callback(uint32 module_id);
57-
int
57+
uint32
5858
check_sensor_timers();
5959
void
6060
reschedule_sensor_read();

core/app-framework/sensor/native/sensor_mgr_ref.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ static void
8888
thread_sensor_check(void *arg)
8989
{
9090
while (sensor_check_thread_run) {
91-
int ms_to_expiry = check_sensor_timers();
92-
if (ms_to_expiry == -1)
91+
uint32 ms_to_expiry = check_sensor_timers();
92+
if (ms_to_expiry == UINT32_MAX)
9393
ms_to_expiry = 5000;
9494
os_mutex_lock(&mutex);
9595
os_cond_reltimedwait(&cond, &mutex, ms_to_expiry * 1000);

core/app-framework/sensor/native/sensor_native_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ extern "C" {
1414
#endif
1515

1616
bool
17-
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, int interval,
18-
int bit_cfg, int delay);
17+
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, uint32 interval,
18+
int bit_cfg, uint32 delay);
1919
uint32
2020
wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance);
2121

core/iwasm/aot/aot_loader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ load_import_funcs(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
12841284
#if WASM_ENABLE_LIBC_WASI != 0
12851285
if (!strcmp(import_funcs[i].module_name, "wasi_unstable")
12861286
|| !strcmp(import_funcs[i].module_name, "wasi_snapshot_preview1"))
1287-
module->is_wasi_module = true;
1287+
module->import_wasi_api = true;
12881288
#endif
12891289
}
12901290

@@ -3008,7 +3008,7 @@ aot_load_from_comp_data(AOTCompData *comp_data, AOTCompContext *comp_ctx,
30083008
module->comp_data = comp_data;
30093009

30103010
#if WASM_ENABLE_LIBC_WASI != 0
3011-
module->is_wasi_module = comp_data->wasm_module->is_wasi_module;
3011+
module->import_wasi_api = comp_data->wasm_module->import_wasi_api;
30123012
#endif
30133013

30143014
return module;
@@ -3206,7 +3206,7 @@ aot_unload(AOTModule *module)
32063206
wasm_runtime_free(module->aux_func_indexes);
32073207
}
32083208
if (module->aux_func_names) {
3209-
wasm_runtime_free(module->aux_func_names);
3209+
wasm_runtime_free((void *)module->aux_func_names);
32103210
}
32113211
#endif
32123212

core/iwasm/aot/aot_runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ aot_instantiate(AOTModule *module, bool is_sub_inst, uint32 stack_size,
10591059

10601060
#if WASM_ENABLE_BULK_MEMORY != 0
10611061
#if WASM_ENABLE_LIBC_WASI != 0
1062-
if (!module->is_wasi_module) {
1062+
if (!module->import_wasi_api) {
10631063
#endif
10641064
/* Only execute the memory init function for main instance because
10651065
the data segments will be dropped once initialized.

0 commit comments

Comments
 (0)