| 1 | (* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh |
| 2 | * Jagannathan, and Stephen Weeks. |
| 3 | * Copyright (C) 1997-2000 NEC Research Institute. |
| 4 | * |
| 5 | * MLton is released under a BSD-style license. |
| 6 | * See the file MLton-LICENSE for details. |
| 7 | *) |
| 8 | |
| 9 | signature MULTI_STRUCTS = |
| 10 | sig |
| 11 | include SSA_TREE |
| 12 | end |
| 13 | |
| 14 | signature MULTI = |
| 15 | sig |
| 16 | include MULTI_STRUCTS |
| 17 | |
| 18 | val multi: Program.t -> |
| 19 | {(* Program has an occurence of Thread_switchTo. *) |
| 20 | usesThreadsOrConts: bool, |
| 21 | (* usesThreadsOrConts == true |
| 22 | * and the func directly or indirectly invokes |
| 23 | * Thread_copyCurrent. |
| 24 | *) |
| 25 | funcDoesThreadCopyCurrent: Func.t -> bool, |
| 26 | (* usesThreadsOrConts == true |
| 27 | * and the func may be called by two |
| 28 | * different threads during some run of the |
| 29 | * program. |
| 30 | *) |
| 31 | funcIsMultiThreaded: Func.t -> bool, |
| 32 | (* The func may be called more than once |
| 33 | * during some run of the program. |
| 34 | *) |
| 35 | funcIsMultiUsed: Func.t -> bool, |
| 36 | (* usesThreadsOrConts == true |
| 37 | * and the label's block's transfer is |
| 38 | * either Runtime {prim, ...} |
| 39 | * with prim = Thread_copyCurrent |
| 40 | * or Call {func, ...} |
| 41 | * with funcDoesThreadCopyCurrent(func) == true. |
| 42 | *) |
| 43 | labelDoesThreadCopyCurrent: Label.t -> bool, |
| 44 | (* usesTheadsOrConts == true |
| 45 | * and the label may be executed by two |
| 46 | * different threads during some run of the |
| 47 | * program. |
| 48 | *) |
| 49 | labelIsMultiThreaded: Label.t -> bool, |
| 50 | (* The label may be executed more than once |
| 51 | * during some run of the program. |
| 52 | *) |
| 53 | labelIsMultiUsed: Label.t -> bool, |
| 54 | (* The var may be defined more than once |
| 55 | * during some run of the program; |
| 56 | * i.e., varIsMultiDefed(x) = |
| 57 | * labelIsMultiUsed(label of x's def) |
| 58 | * when x is defined in a block; |
| 59 | *) |
| 60 | varIsMultiDefed: Var.t -> bool} |
| 61 | end |