diff options
author | samuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-20 10:17:44 +0000 |
---|---|---|
committer | samuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-20 10:17:44 +0000 |
commit | 0b5e1442f5425490f9c9d249683d05fe72b29ea9 (patch) | |
tree | 3f5601767fcc34fd5b8b4560c2d7e3b436fef6e5 /coroutine/win32 | |
parent | d97c9280671444215da845bb71c2d624a08be4df (diff) | |
download | ruby-0b5e1442f5425490f9c9d249683d05fe72b29ea9.tar.gz |
Initial support for x64-mingw32
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'coroutine/win32')
-rw-r--r-- | coroutine/win32/Context.asm | 2 | ||||
-rw-r--r-- | coroutine/win32/Context.h | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/coroutine/win32/Context.asm b/coroutine/win32/Context.asm index b024b22fc7..22b56c0568 100644 --- a/coroutine/win32/Context.asm +++ b/coroutine/win32/Context.asm @@ -9,6 +9,8 @@ .code +assume fs:nothing + ; Using fastcall is a big win (and it's the same has how x64 works). ; In coroutine transfer, the arguments are passed in ecx and edx. We don't need ; to touch these in order to pass them to the destination coroutine. diff --git a/coroutine/win32/Context.h b/coroutine/win32/Context.h index ba6b1fd07b..95b4ccdba1 100644 --- a/coroutine/win32/Context.h +++ b/coroutine/win32/Context.h @@ -24,7 +24,7 @@ struct coroutine_context void **stack_pointer; }; -typedef COROUTINE(* coroutine_start)(coroutine_context *from, coroutine_context *self); +typedef void(__fastcall * coroutine_start)(coroutine_context *from, coroutine_context *self); static inline void coroutine_initialize( coroutine_context *context, @@ -40,12 +40,12 @@ static inline void coroutine_initialize( return; } + *--context->stack_pointer = (void*)start; + /* Windows Thread Information Block */ *--context->stack_pointer = 0; /* fs:[0] */ - *--context->stack_pointer = stack_pointer + stack_size; /* fs:[4] */ - *--context->stack_pointer = (void*)stack_pointer; /* fs:[8] */ - - *--context->stack_pointer = (void*)start; + *--context->stack_pointer = (void*)stack_pointer; /* fs:[4] */ + *--context->stack_pointer = (void*)((char *)stack_pointer - stack_size); /* fs:[8] */ context->stack_pointer -= COROUTINE_REGISTERS; memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS); |