This repository was archived by the owner on Feb 13, 2025. It is now read-only.
forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 61
implement switching using the Stackman submodule #230
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2260bcd
implement switching using the Stackman submodule
kristjanvalur 5537847
update stackman for correct ARM code
kristjanvalur e4e9cc8
change submodule to https
kristjanvalur 7e82df2
Merge branch 'stackman' of ssh://github.com/kristjanvalur/stackless i…
kristjanvalur e312dc8
Merge branch 'main-slp' into stackman
8f36251
Use stackman from https://github.com/stackless-dev/stackman.git
8bac0cd
Update submodule stackman to the latest version
d7704ee
Fix #include statements
af23038
prepare for a merge with main-slp
504edea
Merge branch 'main-slp' into stackman
7d85c37
Readd the stackman submodule
e981179
Adapt the patch to upstream changes.
7e1bb4a
Change "make clean" to not remove static library files from stackman.
20657c4
Merge branch 'main-slp' into stackman
55e8946
Add configure options --with-stackman=dir and --without-stackman
7772ab7
Update create_source_archive.sh to include Stackman.
2f8a7e2
Merge branch 'main-slp' into stackman
8f6a3df
Detect Stackman abiname and link the appropriate libstackman.a
a20298b
remove superfluous tabs
553ab3d
Merge remote-tracking branch 'origin/main-slp' into stackman
c5bea11
Fix the usage of SLP_SAVE_STATE.
ab0c29a
Integrate Stackman into the windows build infrastructure.
bb897f8
Add documentation and build instructions.
0022882
merge main-slp into branch stackman
ac479bd
Add support for ARM and ARM64
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "Stackless/platf/stackman"] | ||
path = Stackless/stackman | ||
url = https://github.com/stackless-dev/stackman.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* this is the internal transfer function, using | ||
* the stackman platform library. | ||
* We create a wrapper callback that employs the existing | ||
* stack macros. | ||
* At some later point in time, the callback could be | ||
* written directly. | ||
* | ||
*/ | ||
|
||
#define SLP_STACK_REFPLUS 1 | ||
|
||
#ifdef SLP_EVAL | ||
#define SLP_STACK_MAGIC 0 | ||
|
||
|
||
/* need a special function arount SLP_SAVE_STATE() because | ||
* the macro has a built-in return of 0 or -1. Must catch | ||
* that. | ||
*/ | ||
static int slp_stackman_cb_save(void *sp, intptr_t *pdiff) | ||
{ | ||
intptr_t diff; | ||
/* first argument must be a pointer to a "stack word", not a void* */ | ||
SLP_SAVE_STATE(((intptr_t *)sp), diff); | ||
*pdiff = diff; | ||
return 1; | ||
} | ||
|
||
static void *slp_stackman_cb(void *_ctxt, int opcode, void *sp) | ||
{ | ||
int *error = (int*)_ctxt; | ||
intptr_t stsizediff; | ||
if (opcode == STACKMAN_OP_SAVE) | ||
{ | ||
int ret = slp_stackman_cb_save(sp, &stsizediff); | ||
if (ret == 1) { | ||
/* regular switch */ | ||
return (void*)((char*)sp + stsizediff); | ||
} | ||
if (ret == -1) | ||
{ | ||
*error = -1; | ||
} | ||
/* error or save only, no change in sp */ | ||
return sp; | ||
} | ||
else | ||
{ | ||
if (*error != -1) | ||
SLP_RESTORE_STATE(); | ||
return sp; | ||
} | ||
} | ||
|
||
static int | ||
slp_switch(void) | ||
{ | ||
/* this can be on the stack, because if there isn't a switch | ||
* then it is intact. (error or save only) */ | ||
int error = 0; | ||
stackman_switch(&slp_stackman_cb, &error); | ||
return error; | ||
} | ||
|
||
#include "stackman/stackman_impl.h" | ||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kristjanvalur : Currently this is required on x86. Otherwise I get the error message:
stackman.lib(switch_x86_msvc.obj) : error LNK2026: module unsafe for SAFESEH image. [C:\build\stackless38\PCbuild\pythoncore.vcxproj] Creating library C:\build\stackless38\PCbuild\win32\python38_d.lib and object C:\build\stackless38\PCbuild\win32\python38_d.exp C:\build\stackless38\PCbuild\win32\python38_d.dll : fatal error LNK1281: Unable to generate SAFESEH image.[C:\build\stackless38\PCbuild\pythoncore.vcxproj]