Implement basic class/object functionality in runtime.

This commit is contained in:
Damien
2013-10-09 23:10:10 +01:00
parent 91d387de7d
commit a397776d6b
9 changed files with 273 additions and 100 deletions

View File

@@ -731,11 +731,6 @@ static void emit_native_store_attr(emit_t *emit, qstr qstr) {
assert(0);
}
static void emit_native_store_locals(emit_t *emit) {
// not supported
assert(0);
}
static void emit_native_store_subscr(emit_t *emit) {
// depends on type of subject:
// - integer, function, pointer to structure: error
@@ -749,6 +744,13 @@ static void emit_native_store_subscr(emit_t *emit) {
emit_call(emit, RT_F_STORE_SUBSCR, rt_store_subscr);
}
static void emit_native_store_locals(emit_t *emit) {
// not needed
vtype_kind_t vtype;
emit_pre_pop_reg(emit, &vtype, REG_TEMP0);
emit_post(emit);
}
static void emit_native_delete_fast(emit_t *emit, qstr qstr, int local_num) {
// not implemented
// could support for Python types, just set to None (so GC can reclaim it)
@@ -1146,8 +1148,8 @@ const emit_method_table_t EXPORT_FUN(method_table) = {
emit_native_store_global,
emit_native_store_deref,
emit_native_store_attr,
emit_native_store_locals,
emit_native_store_subscr,
emit_native_store_locals,
emit_native_delete_fast,
emit_native_delete_name,
emit_native_delete_global,