diff options
| author | Graydon Hoare <[email protected]> | 2011-03-25 15:48:00 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-25 15:48:00 -0700 |
| commit | 661f1c541e86305a714ea2a27ec7b40ca241aa01 (patch) | |
| tree | f6a87a5c08b43cdb27d03c0dab57940153ecc5fa /src/comp/back | |
| parent | Another go at changing compile-command, this time using RBUILD env var. (diff) | |
| download | rust-661f1c541e86305a714ea2a27ec7b40ca241aa01.tar.xz rust-661f1c541e86305a714ea2a27ec7b40ca241aa01.zip | |
Trans nomenclature tidy-up: upcall vs. native vs. extern.
Diffstat (limited to 'src/comp/back')
| -rw-r--r-- | src/comp/back/abi.rs | 8 | ||||
| -rw-r--r-- | src/comp/back/x86.rs | 35 |
2 files changed, 22 insertions, 21 deletions
diff --git a/src/comp/back/abi.rs b/src/comp/back/abi.rs index 836969ef..95958814 100644 --- a/src/comp/back/abi.rs +++ b/src/comp/back/abi.rs @@ -58,7 +58,7 @@ const int closure_elt_ty_params = 3; const int worst_case_glue_call_args = 7; -const int n_upcall_glues = 7; +const int n_native_glues = 7; const int abi_x86_rustboot_cdecl = 1; const int abi_x86_rustc_fastcall = 2; @@ -75,11 +75,11 @@ fn vec_append_glue_name() -> str { ret "rust_vec_append_glue"; } -fn upcall_glue_name(int n, bool pass_task) -> str { +fn native_glue_name(int n, bool pass_task) -> str { if (pass_task) { - ret "rust_upcall_rust_" + util.common.istr(n); + ret "rust_native_rust_" + util.common.istr(n); } - ret "rust_upcall_cdecl_" + util.common.istr(n); + ret "rust_native_cdecl_" + util.common.istr(n); } fn activate_glue_name() -> str { diff --git a/src/comp/back/x86.rs b/src/comp/back/x86.rs index b961b474..e35af621 100644 --- a/src/comp/back/x86.rs +++ b/src/comp/back/x86.rs @@ -90,7 +90,7 @@ fn rust_activate_glue() -> vec[str] { * start doing whatever the first instruction says. Probably * saving registers and starting to establish a frame. Harmless * stuff, doesn't look at task->rust_sp again except when it - * clobbers it during a later upcall. + * clobbers it during a later native call. * * * 2. We are resuming a task that was descheduled by the yield glue @@ -100,8 +100,9 @@ fn rust_activate_glue() -> vec[str] { * "esp <- task->rust_sp" * * this is the first instruction we 'ret' to after this glue, - * because it is the first instruction following *any* upcall, - * and the task we are activating was descheduled mid-upcall. + * because it is the first instruction following *any* native + * call, and the task we are activating was descheduled + * mid-native-call. * * Unfortunately for us, we have already restored esp from * task->rust_sp and are about to eat the 5 words off the top of @@ -132,7 +133,7 @@ fn rust_activate_glue() -> vec[str] { /* * In most cases, the function we're returning to (activating) - * will have saved any caller-saves before it yielded via upcalling, + * will have saved any caller-saves before it yielded via native call, * so no work to do here. With one exception: when we're initially * activating, the task needs to be in the fastcall 2nd parameter * expected by the rust main function. That's edx. @@ -145,14 +146,14 @@ fn rust_activate_glue() -> vec[str] { /* More glue code, this time the 'bottom half' of yielding. * - * We arrived here because an upcall decided to deschedule the - * running task. So the upcall's return address got patched to the + * We arrived here because an native call decided to deschedule the + * running task. So the native call's return address got patched to the * first instruction of this glue code. * - * When the upcall does 'ret' it will come here, and its esp will be + * When the native call does 'ret' it will come here, and its esp will be * pointing to the last argument pushed on the C stack before making - * the upcall: the 0th argument to the upcall, which is always the - * task ptr performing the upcall. That's where we take over. + * the native call: the 0th argument to the native call, which is always + * the task ptr performing the native call. That's where we take over. * * Our goal is to complete the descheduling * @@ -179,7 +180,7 @@ fn rust_yield_glue() -> vec[str] { + vec("ret"); } -fn upcall_glue(int n_args, bool pass_task) -> vec[str] { +fn native_glue(int n_args, bool pass_task) -> vec[str] { /* * 0, 4, 8, 12 are callee-saves @@ -242,11 +243,11 @@ fn decl_glue(int align, str prefix, str name, vec[str] insns) -> str { } -fn decl_upcall_glue(int align, str prefix, bool pass_task, uint n) -> str { +fn decl_native_glue(int align, str prefix, bool pass_task, uint n) -> str { let int i = n as int; ret decl_glue(align, prefix, - abi.upcall_glue_name(i, pass_task), - upcall_glue(i, pass_task)); + abi.native_glue_name(i, pass_task), + native_glue(i, pass_task)); } fn get_symbol_prefix() -> str { @@ -272,10 +273,10 @@ fn get_module_asm() -> str { abi.yield_glue_name(), rust_yield_glue())) - + _vec.init_fn[str](bind decl_upcall_glue(align, prefix, true, _), - (abi.n_upcall_glues + 1) as uint) - + _vec.init_fn[str](bind decl_upcall_glue(align, prefix, false, _), - (abi.n_upcall_glues + 1) as uint); + + _vec.init_fn[str](bind decl_native_glue(align, prefix, true, _), + (abi.n_native_glues + 1) as uint) + + _vec.init_fn[str](bind decl_native_glue(align, prefix, false, _), + (abi.n_native_glues + 1) as uint); ret _str.connect(glues, "\n\n"); |