added some more code to support exception handling

This commit is contained in:
hyunghwan.chung
2016-03-28 13:25:36 +00:00
parent 2a88f5d503
commit 77f0bfad5d
7 changed files with 257 additions and 99 deletions

View File

@ -462,8 +462,10 @@ struct stix_method_t
* 4 - return false
* 5 - return index.
* 6 - return -index.
* 7 - return instvar[index]
* 7 - return instvar[index]
* 8 - do primitive[index]
* 9 - do named primitive[index]
* 10 - exception handler
*/
#define STIX_METHOD_MAKE_PREAMBLE(code,index) ((((stix_ooi_t)index) << 8) | ((stix_ooi_t)code))
#define STIX_METHOD_GET_PREAMBLE_CODE(preamble) (((stix_ooi_t)preamble) & 0xFF)
@ -479,13 +481,14 @@ struct stix_method_t
#define STIX_METHOD_PREAMBLE_RETURN_INSTVAR 7
#define STIX_METHOD_PREAMBLE_PRIMITIVE 8
#define STIX_METHOD_PREAMBLE_NAMED_PRIMITIVE 9 /* index is an index to the symbol table */
#define STIX_METHOD_PREAMBLE_EXCEPTION 10
/* the index is an 16-bit unsigned integer. */
#define STIX_METHOD_PREAMBLE_INDEX_MIN 0x0000
#define STIX_METHOD_PREAMBLE_INDEX_MAX 0xFFFF
#define STIX_OOI_IN_PREAMBLE_INDEX_RANGE(num) ((num) >= STIX_METHOD_PREAMBLE_INDEX_MIN && (num) <= STIX_METHOD_PREAMBLE_INDEX_MAX)
#define STIX_CONTEXT_NAMED_INSTVARS 10
#define STIX_CONTEXT_NAMED_INSTVARS 8
typedef struct stix_context_t stix_context_t;
typedef struct stix_context_t* stix_oop_context_t;
struct stix_context_t
@ -537,10 +540,6 @@ struct stix_context_t
* the source block context. */
stix_oop_context_t origin;
/* each even position (0, 2, 4, etc) contains an exception class
* each odd position (1, 3, 5, etc) contains an exception handler block */
stix_oop_t exception_info;
/* variable indexed part */
stix_oop_t slot[1]; /* stack */
};