Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
21865ddc
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
21865ddc
编写于
11月 17, 2011
作者:
B
Brian Anderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
intrinsics: Remove the call to get_task from task_sleep
上级
eecbc815
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
16 deletion
+18
-16
src/lib/task.rs
src/lib/task.rs
+6
-2
src/rt/intrinsics/intrinsics.cpp
src/rt/intrinsics/intrinsics.cpp
+3
-2
src/rt/intrinsics/intrinsics.i386.ll.in
src/rt/intrinsics/intrinsics.i386.ll.in
+4
-5
src/rt/intrinsics/intrinsics.x86_64.ll.in
src/rt/intrinsics/intrinsics.x86_64.ll.in
+4
-5
src/rt/rust_builtin.cpp
src/rt/rust_builtin.cpp
+1
-2
未找到文件。
src/lib/task.rs
浏览文件 @
21865ddc
...
...
@@ -53,7 +53,7 @@
#[abi
=
"rust-intrinsic"
]
native
mod
rusti
{
// these must run on the Rust stack so that they can swap stacks etc:
fn
task_sleep
(
time_in_us
:
uint
);
fn
task_sleep
(
t
ask
:
*
rust_task
,
t
ime_in_us
:
uint
);
}
#[link_name
=
"rustrt"
]
...
...
@@ -63,6 +63,7 @@
fn
pin_task
();
fn
unpin_task
();
fn
get_task_id
()
->
task_id
;
fn
rust_get_task
()
->
*
rust_task
;
fn
set_min_stack
(
stack_size
:
uint
);
...
...
@@ -142,7 +143,10 @@ fn get_task() -> task { rustrt::get_task_id() }
time_in_us - maximum number of microseconds to yield control for
*/
fn
sleep
(
time_in_us
:
uint
)
{
ret
rusti
::
task_sleep
(
time_in_us
);
}
fn
sleep
(
time_in_us
:
uint
)
{
let
task
=
rustrt
::
rust_get_task
();
ret
rusti
::
task_sleep
(
task
,
time_in_us
);
}
/*
Function: yield
...
...
src/rt/intrinsics/intrinsics.cpp
浏览文件 @
21865ddc
...
...
@@ -12,7 +12,7 @@ extern "C" CDECL void
port_recv
(
uintptr_t
*
dptr
,
rust_port
*
port
);
extern
"C"
CDECL
void
rust_task_sleep
(
size_t
time_in_us
);
rust_task_sleep
(
rust_task
*
task
,
size_t
time_in_us
);
extern
"C"
void
rust_intrinsic_vec_len
(
size_t
*
retptr
,
...
...
@@ -71,7 +71,8 @@ rust_intrinsic_get_type_desc(void **retptr,
extern
"C"
void
rust_intrinsic_task_sleep
(
void
**
retptr
,
void
*
env
,
rust_task
*
task
,
size_t
time_in_us
)
{
rust_task_sleep
(
time_in_us
);
rust_task_sleep
(
t
ask
,
t
ime_in_us
);
}
src/rt/intrinsics/intrinsics.i386.ll.in
浏览文件 @
21865ddc
...
...
@@ -27,7 +27,7 @@ target triple = "@CFG_TARGET_TRIPLE@"
%class.rust_task_list = type { %class.indexed_list, %struct.rust_scheduler*, i8* }
%class.indexed_list = type { i32 (...)**, %class.array_list.2 }
%class.array_list.2 = type { i32, %struct.rust_task**, i32 }
%struct.rust_task = type { %struct.rust_task_user, i32, %class.context, %struct.stk_seg*, i32, %struct.rust_scheduler*, %class.rust_crate_cache*, %class.rust_kernel*, i8*, %class.rust_task_list*, %struct.rust_cond*, i8*, %struct.rust_task*, i32, i32, %class.timer, i32*, i32, i32, %class.memory_region,
%"class.rust_task::wakeup_callback"*,
i8, i8, i8, %class.lock_and_signal, %class.hash_map.4, %class.rust_obstack, %"class.std::map", i32, %"class.debug::task_debug_info" }
%struct.rust_task = type { %struct.rust_task_user, i32, %class.context, %struct.stk_seg*, i32, %struct.rust_scheduler*, %class.rust_crate_cache*, %class.rust_kernel*, i8*, %class.rust_task_list*, %struct.rust_cond*, i8*, %struct.rust_task*, i32, i32, %class.timer, i32*, i32, i32, %class.memory_region, i8, i8, i8, %class.lock_and_signal, %class.hash_map.4, %class.rust_obstack, %"class.std::map", i32, %"class.debug::task_debug_info" }
%struct.rust_task_user = type { i32, i32, %struct.chan_handle, i32 }
%struct.chan_handle = type { i32, i32 }
%class.context = type { %struct.registers_t, %class.context* }
...
...
@@ -36,7 +36,6 @@ target triple = "@CFG_TARGET_TRIPLE@"
%class.rust_crate_cache = type { %struct.type_desc*, %struct.rust_scheduler*, i32 }
%struct.rust_cond = type { i8 }
%class.timer = type { i32 (...)**, i64, i64 }
%"class.rust_task::wakeup_callback" = type { i32 (...)** }
%class.hash_map.4 = type { %"struct.hash_map<int, rust_port *>::map_entry"* }
%"struct.hash_map<int, rust_port *>::map_entry" = type opaque
%class.rust_obstack = type { %struct.rust_obstack_chunk*, %struct.rust_task* }
...
...
@@ -105,12 +104,12 @@ define void @rust_intrinsic_get_type_desc(i8** nocapture %retptr, i8* nocapture
ret void
}
define void @rust_intrinsic_task_sleep(i8** nocapture %retptr, i8* nocapture %env, i32 %time_in_us) {
tail call void @rust_task_sleep(i32 %time_in_us)
define void @rust_intrinsic_task_sleep(i8** nocapture %retptr, i8* nocapture %env,
%struct.rust_task* %task,
i32 %time_in_us) {
tail call void @rust_task_sleep(
%struct.rust_task* %task,
i32 %time_in_us)
ret void
}
declare void @rust_task_sleep(i32)
declare void @rust_task_sleep(
%struct.rust_task*,
i32)
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
...
...
src/rt/intrinsics/intrinsics.x86_64.ll.in
浏览文件 @
21865ddc
...
...
@@ -27,7 +27,7 @@ target triple = "@CFG_TARGET_TRIPLE@"
%class.rust_task_list = type { %class.indexed_list, %struct.rust_scheduler*, i8* }
%class.indexed_list = type { i32 (...)**, %class.array_list.2 }
%class.array_list.2 = type { i64, %struct.rust_task**, i64 }
%struct.rust_task = type { %struct.rust_task_user, i64, %class.context, %struct.stk_seg*, i64, %struct.rust_scheduler*, %class.rust_crate_cache*, %class.rust_kernel*, i8*, %class.rust_task_list*, %struct.rust_cond*, i8*, %struct.rust_task*, i32, i64, %class.timer, i64*, i32, i32, %class.memory_region,
%"class.rust_task::wakeup_callback"*,
i8, i8, i8, %class.lock_and_signal, %class.hash_map.4, %class.rust_obstack, %"class.std::map", i32, %"class.debug::task_debug_info" }
%struct.rust_task = type { %struct.rust_task_user, i64, %class.context, %struct.stk_seg*, i64, %struct.rust_scheduler*, %class.rust_crate_cache*, %class.rust_kernel*, i8*, %class.rust_task_list*, %struct.rust_cond*, i8*, %struct.rust_task*, i32, i64, %class.timer, i64*, i32, i32, %class.memory_region, i8, i8, i8, %class.lock_and_signal, %class.hash_map.4, %class.rust_obstack, %"class.std::map", i32, %"class.debug::task_debug_info" }
%struct.rust_task_user = type { i64, i64, %struct.chan_handle, i64 }
%struct.chan_handle = type { i64, i64 }
%class.context = type { %struct.registers_t, %class.context* }
...
...
@@ -36,7 +36,6 @@ target triple = "@CFG_TARGET_TRIPLE@"
%class.rust_crate_cache = type { %struct.type_desc*, %struct.rust_scheduler*, i64 }
%struct.rust_cond = type { i8 }
%class.timer = type { i32 (...)**, i64, i64 }
%"class.rust_task::wakeup_callback" = type { i32 (...)** }
%class.hash_map.4 = type { %"struct.hash_map<long, rust_port *>::map_entry"* }
%"struct.hash_map<long, rust_port *>::map_entry" = type opaque
%class.rust_obstack = type { %struct.rust_obstack_chunk*, %struct.rust_task* }
...
...
@@ -105,12 +104,12 @@ define void @rust_intrinsic_get_type_desc(i8** nocapture %retptr, i8* nocapture
ret void
}
define void @rust_intrinsic_task_sleep(i8** nocapture %retptr, i8* nocapture %env, i64 %time_in_us) uwtable {
tail call void @rust_task_sleep(i64 %time_in_us)
define void @rust_intrinsic_task_sleep(i8** nocapture %retptr, i8* nocapture %env,
%struct.rust_task* %task,
i64 %time_in_us) uwtable {
tail call void @rust_task_sleep(
%struct.rust_task* %task,
i64 %time_in_us)
ret void
}
declare void @rust_task_sleep(i64)
declare void @rust_task_sleep(
%struct.rust_task*,
i64)
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
...
...
src/rt/rust_builtin.cpp
浏览文件 @
21865ddc
...
...
@@ -511,8 +511,7 @@ chan_id_send(type_desc *t, rust_task_id target_task_id,
// This is called by an intrinsic on the Rust stack.
// Do not call on the C stack.
extern
"C"
CDECL
void
rust_task_sleep
(
size_t
time_in_us
)
{
rust_task
*
task
=
rust_scheduler
::
get_task
();
rust_task_sleep
(
rust_task
*
task
,
size_t
time_in_us
)
{
task
->
yield
(
time_in_us
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录