Skip to content

Commit c33f3b1

Browse files
committed
---
yaml --- r: 629 b: refs/heads/master c: b90e6b9 h: refs/heads/master i: 627: 3fbbb8a v: v3
1 parent f9b6f97 commit c33f3b1

File tree

3 files changed

+65
-40
lines changed

3 files changed

+65
-40
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: cfca901cfe0e9671569f0a77274c713b7da6d637
2+
refs/heads/master: b90e6b93c1d48d4a4816467dd489794bc2c89c9c

trunk/src/boot/be/x86.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ let emit_target_specific
315315
match cell with
316316
Il.Cell (Il.Reg (Il.Hreg hr, _)) -> hr = eax
317317
| _ -> false
318-
in
318+
in
319319
if is_eax lhs
320320
then
321321
mov rhs_ecx rhs

trunk/src/rt/rust_upcall.cpp

Lines changed: 63 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,38 @@ log_task_state(rust_task *task, maybe_proxy<rust_task> *target) {
3737
}
3838
}
3939

40-
extern "C" CDECL char const *str_buf(rust_task *task, rust_str *s);
40+
extern "C" CDECL char const *
41+
str_buf(rust_task *task, rust_str *s);
4142

42-
extern "C" void upcall_grow_task(rust_task *task, size_t n_frame_bytes) {
43+
extern "C" void
44+
upcall_grow_task(rust_task *task, size_t n_frame_bytes) {
4345
LOG_UPCALL_ENTRY(task);
4446
task->grow(n_frame_bytes);
4547
}
4648

47-
extern "C" CDECL void upcall_log_int(rust_task *task, int32_t i) {
49+
extern "C" CDECL
50+
void upcall_log_int(rust_task *task, int32_t i) {
4851
LOG_UPCALL_ENTRY(task);
4952
task->log(rust_log::UPCALL | rust_log::ULOG,
5053
"rust: %" PRId32 " (0x%" PRIx32 ")", i, i);
5154
}
5255

53-
extern "C" CDECL void upcall_log_str(rust_task *task, rust_str *str) {
56+
extern "C" CDECL void
57+
upcall_log_str(rust_task *task, rust_str *str) {
5458
LOG_UPCALL_ENTRY(task);
5559
const char *c = str_buf(task, str);
5660
task->log(rust_log::UPCALL | rust_log::ULOG, "rust: %s", c);
5761
}
5862

59-
extern "C" CDECL void upcall_trace_word(rust_task *task, uintptr_t i) {
63+
extern "C" CDECL void
64+
upcall_trace_word(rust_task *task, uintptr_t i) {
6065
LOG_UPCALL_ENTRY(task);
6166
task->log(rust_log::UPCALL | rust_log::TRACE, "trace: 0x%" PRIxPTR "", i,
6267
i, (char) i);
6368
}
6469

65-
extern "C" CDECL void upcall_trace_str(rust_task *task, char const *c) {
70+
extern "C" CDECL void
71+
upcall_trace_str(rust_task *task, char const *c) {
6672
LOG_UPCALL_ENTRY(task);
6773
task->log(rust_log::UPCALL | rust_log::TRACE, "trace: %s", c);
6874
}
@@ -77,7 +83,8 @@ upcall_new_port(rust_task *task, size_t unit_sz) {
7783
return new (dom) rust_port(task, unit_sz);
7884
}
7985

80-
extern "C" CDECL void upcall_del_port(rust_task *task, rust_port *port) {
86+
extern "C" CDECL void
87+
upcall_del_port(rust_task *task, rust_port *port) {
8188
LOG_UPCALL_ENTRY(task);
8289
task->log(rust_log::UPCALL | rust_log::MEM | rust_log::COMM,
8390
"upcall del_port(0x%" PRIxPTR ")", (uintptr_t) port);
@@ -117,7 +124,8 @@ upcall_flush_chan(rust_task *task, rust_chan *chan) {
117124
* Cannot Yield: If the task were to unwind, the dropped ref would still
118125
* appear to be live, causing modify-after-free errors.
119126
*/
120-
extern "C" CDECL void upcall_del_chan(rust_task *task, rust_chan *chan) {
127+
extern "C" CDECL
128+
void upcall_del_chan(rust_task *task, rust_chan *chan) {
121129
LOG_UPCALL_ENTRY(task);
122130

123131
task->log(rust_log::UPCALL | rust_log::MEM | rust_log::COMM,
@@ -166,13 +174,15 @@ upcall_clone_chan(rust_task *task,
166174
return new (target_task->dom) rust_chan(target_task, port);
167175
}
168176

169-
extern "C" CDECL void upcall_yield(rust_task *task) {
177+
extern "C" CDECL void
178+
upcall_yield(rust_task *task) {
170179
LOG_UPCALL_ENTRY(task);
171180
task->log(rust_log::UPCALL | rust_log::COMM, "upcall yield()");
172181
task->yield(1);
173182
}
174183

175-
extern "C" CDECL void upcall_sleep(rust_task *task, size_t time_in_us) {
184+
extern "C" CDECL void
185+
upcall_sleep(rust_task *task, size_t time_in_us) {
176186
LOG_UPCALL_ENTRY(task);
177187
task->log(rust_log::UPCALL | rust_log::TASK, "elapsed %d",
178188
task->yield_timer.get_elapsed_time());
@@ -242,8 +252,11 @@ upcall_recv(rust_task *task, uintptr_t *dptr, rust_port *port) {
242252
task->yield(3);
243253
}
244254

245-
extern "C" CDECL void upcall_fail(rust_task *task, char const *expr,
246-
char const *file, size_t line) {
255+
extern "C" CDECL void
256+
upcall_fail(rust_task *task,
257+
char const *expr,
258+
char const *file,
259+
size_t line) {
247260
LOG_UPCALL_ENTRY(task);
248261
task->log(rust_log::UPCALL | rust_log::ERR,
249262
"upcall fail '%s', %s:%" PRIdPTR, expr, file, line);
@@ -290,8 +303,7 @@ upcall_exit(rust_task *task) {
290303
}
291304

292305
extern "C" CDECL uintptr_t
293-
upcall_malloc(rust_task *task, size_t nbytes, type_desc *td)
294-
{
306+
upcall_malloc(rust_task *task, size_t nbytes, type_desc *td) {
295307
LOG_UPCALL_ENTRY(task);
296308

297309
task->dom->log(rust_log::UPCALL|rust_log::MEM,
@@ -311,8 +323,7 @@ upcall_malloc(rust_task *task, size_t nbytes, type_desc *td)
311323
* Called whenever an object's ref count drops to zero.
312324
*/
313325
extern "C" CDECL void
314-
upcall_free(rust_task *task, void* ptr, uintptr_t is_gc)
315-
{
326+
upcall_free(rust_task *task, void* ptr, uintptr_t is_gc) {
316327
LOG_UPCALL_ENTRY(task);
317328
rust_dom *dom = task->dom;
318329
dom->log(rust_log::UPCALL|rust_log::MEM,
@@ -322,8 +333,7 @@ upcall_free(rust_task *task, void* ptr, uintptr_t is_gc)
322333
}
323334

324335
extern "C" CDECL uintptr_t
325-
upcall_mark(rust_task *task, void* ptr)
326-
{
336+
upcall_mark(rust_task *task, void* ptr) {
327337
LOG_UPCALL_ENTRY(task);
328338

329339
rust_dom *dom = task->dom;
@@ -356,8 +366,7 @@ upcall_new_str(rust_task *task, char const *s, size_t fill) {
356366
}
357367

358368
extern "C" CDECL rust_vec *
359-
upcall_new_vec(rust_task *task, size_t fill, type_desc *td)
360-
{
369+
upcall_new_vec(rust_task *task, size_t fill, type_desc *td) {
361370
LOG_UPCALL_ENTRY(task);
362371
rust_dom *dom = task->dom;
363372
dom->log(rust_log::UPCALL|rust_log::MEM,
@@ -376,8 +385,10 @@ upcall_new_vec(rust_task *task, size_t fill, type_desc *td)
376385
}
377386

378387
extern "C" CDECL rust_str *
379-
upcall_vec_grow(rust_task *task, rust_vec *v, size_t n_bytes, uintptr_t is_gc)
380-
{
388+
upcall_vec_grow(rust_task *task,
389+
rust_vec *v,
390+
size_t n_bytes,
391+
uintptr_t is_gc) {
381392
LOG_UPCALL_ENTRY(task);
382393
rust_dom *dom = task->dom;
383394
task->log(rust_log::UPCALL|rust_log::MEM,
@@ -419,18 +430,25 @@ upcall_vec_grow(rust_task *task, rust_vec *v, size_t n_bytes, uintptr_t is_gc)
419430
}
420431

421432
static rust_crate_cache::c_sym *
422-
fetch_c_sym(rust_task *task, rust_crate const *curr_crate, size_t lib_num,
423-
size_t c_sym_num, char const *library, char const *symbol) {
433+
fetch_c_sym(rust_task *task,
434+
rust_crate const *curr_crate,
435+
size_t lib_num,
436+
size_t c_sym_num,
437+
char const *library,
438+
char const *symbol) {
424439
rust_crate_cache *cache = task->get_crate_cache(curr_crate);
425440
rust_crate_cache::lib *l = cache->get_lib(lib_num, library);
426441
return cache->get_c_sym(c_sym_num, l, symbol);
427442
}
428443

429-
extern "C" CDECL uintptr_t upcall_require_rust_sym(rust_task *task,
430-
rust_crate const *curr_crate, size_t lib_num, // # of lib
431-
size_t c_sym_num, // # of C sym "rust_crate" in lib
432-
size_t rust_sym_num, // # of rust sym
433-
char const *library, char const **path) {
444+
extern "C" CDECL uintptr_t
445+
upcall_require_rust_sym(rust_task *task,
446+
rust_crate const *curr_crate,
447+
size_t lib_num, // # of lib
448+
size_t c_sym_num, // # of C sym "rust_crate" in lib
449+
size_t rust_sym_num, // # of rust sym
450+
char const *library,
451+
char const **path) {
434452
LOG_UPCALL_ENTRY(task);
435453
rust_dom *dom = task->dom;
436454

@@ -469,10 +487,13 @@ extern "C" CDECL uintptr_t upcall_require_rust_sym(rust_task *task,
469487
return addr;
470488
}
471489

472-
extern "C" CDECL uintptr_t upcall_require_c_sym(rust_task *task,
473-
rust_crate const *curr_crate, size_t lib_num, // # of lib
474-
size_t c_sym_num, // # of C sym
475-
char const *library, char const *symbol) {
490+
extern "C" CDECL uintptr_t
491+
upcall_require_c_sym(rust_task *task,
492+
rust_crate const *curr_crate,
493+
size_t lib_num, // # of lib
494+
size_t c_sym_num, // # of C sym
495+
char const *library,
496+
char const *symbol) {
476497
LOG_UPCALL_ENTRY(task);
477498

478499
task->log(rust_log::UPCALL | rust_log::CACHE,
@@ -503,8 +524,7 @@ upcall_get_type_desc(rust_task *task,
503524
size_t size,
504525
size_t align,
505526
size_t n_descs,
506-
type_desc const **descs)
507-
{
527+
type_desc const **descs) {
508528
LOG_UPCALL_ENTRY(task);
509529
task->log(rust_log::UPCALL | rust_log::CACHE,
510530
"upcall get_type_desc with size=%" PRIdPTR
@@ -551,8 +571,11 @@ upcall_new_task(rust_task *spawner, const char *name) {
551571
}
552572

553573
extern "C" CDECL rust_task *
554-
upcall_start_task(rust_task *spawner, rust_task *task,
555-
uintptr_t exit_task_glue, uintptr_t spawnee_fn, size_t callsz) {
574+
upcall_start_task(rust_task *spawner,
575+
rust_task *task,
576+
uintptr_t exit_task_glue,
577+
uintptr_t spawnee_fn,
578+
size_t callsz) {
556579
LOG_UPCALL_ENTRY(spawner);
557580

558581
rust_dom *dom = spawner->dom;
@@ -590,7 +613,9 @@ upcall_new_thread(rust_task *task, const char *name) {
590613
extern "C" CDECL maybe_proxy<rust_task> *
591614
upcall_start_thread(rust_task *spawner,
592615
maybe_proxy<rust_task> *root_task_proxy,
593-
uintptr_t exit_task_glue, uintptr_t spawnee_fn, size_t callsz) {
616+
uintptr_t exit_task_glue,
617+
uintptr_t spawnee_fn,
618+
size_t callsz) {
594619
LOG_UPCALL_ENTRY(spawner);
595620

596621
rust_dom *dom = spawner->dom;

0 commit comments

Comments
 (0)