added two more fields into CompiledMethod. no implementation change has been made yet

This commit is contained in:
hyunghwan.chung 2019-06-29 10:46:28 +00:00
parent 20b50c7bb6
commit 92093dd23f
3 changed files with 17 additions and 6 deletions

View File

@ -314,8 +314,17 @@ class(#pointer,#final,#limited) BlockContext(Context)
class(#pointer) CompiledMethod(Object) class(#pointer) CompiledMethod(Object)
{ {
// var owner, name, preamble, preamble_data_1, preamble_data_2, ntmprs, nargs, code, source. var owner,
var owner, name, preamble, preamble_data_1, preamble_data_2, ntmprs, nargs, source. name,
preamble,
preamble_data_1,
preamble_data_2,
ntmprs,
nargs,
//code, <-- only if moo is built with MOO_USE_METHOD_TRAILER disable.
source,
source_file,
source_line.
method preamble method preamble
{ {

View File

@ -1775,8 +1775,8 @@ static int get_string (moo_t* moo, moo_ooch_t end_char, moo_ooch_t esc_char, int
/* \x, \u, \U not followed by a hexadecimal digit */ /* \x, \u, \U not followed by a hexadecimal digit */
if (digit_count == 0) if (digit_count == 0)
{ {
static moo_ooch_t rc_tab[] = { '\0', '\0', 'x', '\0', 'u', '\0', '\0', '\0', 'U' }; static moo_ooch_t esc_char_tab[] = { '\0', '\0', 'x', '\0', 'u', '\0', '\0', '\0', 'U' };
ADD_TOKEN_CHAR (moo, rc_tab[escaped]); ADD_TOKEN_CHAR (moo, esc_char_tab[escaped]);
} }
else else
{ {

View File

@ -555,9 +555,9 @@ struct moo_methsig_t
}; };
#if defined(MOO_USE_METHOD_TRAILER) #if defined(MOO_USE_METHOD_TRAILER)
# define MOO_METHOD_NAMED_INSTVARS 8 # define MOO_METHOD_NAMED_INSTVARS 10
#else #else
# define MOO_METHOD_NAMED_INSTVARS 9 # define MOO_METHOD_NAMED_INSTVARS 11
#endif #endif
typedef struct moo_method_t moo_method_t; typedef struct moo_method_t moo_method_t;
typedef struct moo_method_t* moo_oop_method_t; typedef struct moo_method_t* moo_oop_method_t;
@ -586,6 +586,8 @@ struct moo_method_t
#endif #endif
moo_oop_t source; /* TODO: what should I put? */ moo_oop_t source; /* TODO: what should I put? */
moo_oop_t source_file; /* source file that contains the definition of this method. nil if unavailable */
moo_oow_t source_line; /* line of the source file where the method definition begins. valid only if source_file is not nil */
/* == variable indexed part == */ /* == variable indexed part == */
moo_oop_t literal_frame[1]; /* it stores literals */ moo_oop_t literal_frame[1]; /* it stores literals */