Changeset 619
- Timestamp:
- 08/01/10 18:12:03 (18 months ago)
- Location:
- interpreter/trunk
- Files:
-
- 16 edited
-
backend/common/kite_compiler.c (modified) (5 diffs)
-
backend/common/kite_parser.y (modified) (4 diffs)
-
backend/common/kite_vm.c (modified) (5 diffs)
-
backend/common/kite_vm.h (modified) (7 diffs)
-
backend/kite-vm-1.0/kite_compile_bytecode.c (modified) (36 diffs)
-
backend/kite-vm-1.0/kite_execute.c (modified) (53 diffs)
-
backend/kite-vm-1.0/kite_instr.c (modified) (16 diffs)
-
backend/kite-vm-1.0/kite_opcodes.h (modified) (4 diffs)
-
modules/System.kt (modified) (1 diff)
-
modules/System/integer.c (modified) (1 diff)
-
modules/System/object.c (modified) (3 diffs)
-
objs/kite_obj_create.c (modified) (5 diffs)
-
objs/kite_obj_manip.c (modified) (1 diff)
-
objs/kite_object.h (modified) (3 diffs)
-
objs/kite_stack.c (modified) (1 diff)
-
objs/kite_symtab.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
interpreter/trunk/backend/common/kite_compiler.c
r594 r619 32 32 #include "objs/kite_object.h" 33 33 #include "kite_vm.h" 34 #include "../kite-vm-1.0/kite_opcodes.h" 34 35 35 36 typedef void* yyscan_t; … … 91 92 kite_compiler_t *compiler; 92 93 kite_object_t *ret; 94 kite_opcode_t *end_inst = kite_compile_return(); 93 95 94 96 #ifndef HAVE_GC_H … … 117 119 118 120 ret = kite_pop_stack(&compiler->obj_created); 121 COMPILE_INSTRUCTION2(thd, compiler, end_inst, 0, &ret->builtin_data.funcvalue.funcptr); 119 122 kite_destroy_stack(&compiler->obj_created); 120 123 kite_destroy_stack(&compiler->decide_exits); … … 147 150 { 148 151 kite_object_t *ret; 152 kite_opcode_t *end_inst = kite_compile_return(); 149 153 yyscan_t scanner; 150 154 kite_compiler_t *compiler; … … 178 182 179 183 ret = kite_pop_stack(&compiler->obj_created); 184 COMPILE_INSTRUCTION2(thd, compiler, end_inst, 0, &ret->builtin_data.funcvalue.funcptr); 180 185 ret->builtin_data.funcvalue.functype = FUNC_BYTECODE; 181 186 #ifndef HAVE_GC_H -
interpreter/trunk/backend/common/kite_parser.y
r597 r619 34 34 #include "objs/kite_object.h" 35 35 #include "kite_vm.h" 36 #include "../kite-vm-1.0/kite_opcodes.h" 36 37 37 38 #define YYPARSE_PARAM parm … … 200 201 kite_thread_t *thd = compiler->thd; 201 202 kite_object_t *obj = kite_top_stack(compiler->obj_created); 202 203 kite_opcode_t *opc; 204 203 205 #ifndef HAVE_GC_H 204 206 kite_funccall_info_t *fcall = (kite_funccall_info_t*)malloc(sizeof(kite_funccall_info_t)); … … 215 217 kite_push_stack(&thd->func_stack, FALSE, fcall); 216 218 219 /* Skip over import statement when executing so that the code inside 220 the import doesn't get executed twice. */ 221 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_jump_uncond(NULL), @2.first_line, &obj->builtin_data.funcvalue.funcptr); 222 opc = (void*)thd->vm->cur_text_segment - sizeof(kite_opcode_t); 223 217 224 kite_dereference_and_load(thd, $<stringValue>2); 225 226 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_nop(), @2.first_line, &obj->builtin_data.funcvalue.funcptr); 227 opc = (void*)opc + (long)thd->vm->text_segment; 228 opc->op_arg.jumpto = (void*)thd->vm->cur_text_segment - sizeof(kite_opcode_t); 229 218 230 free($<stringValue>2); 219 231 … … 635 647 636 648 optional_param_list: { 637 $<opValue>$ = (*kite_compiler_actions[COMPILE_EMPTY_PARAM_LIST])((kite_compiler_t*)yyget_extra(parm), 0);649 $<opValue>$ = (*kite_compiler_actions[COMPILE_EMPTY_PARAM_LIST])((kite_compiler_t*)yyget_extra(parm), @0.first_line); 638 650 } 639 651 | param_list { -
interpreter/trunk/backend/common/kite_vm.c
r599 r619 31 31 #include "objs/kite_gc.h" 32 32 #include "kite_vm.h" 33 #include "../kite-vm-1.0/kite_opcodes.h" 33 34 34 35 #ifdef WIN32 … … 77 78 kite_vm_t *ret; 78 79 kite_thread_t *thd; 80 pthread_mutexattr_t compile_mtx_attr; 79 81 int i = 0; 80 82 #ifdef WIN32 … … 100 102 #ifndef WIN32 101 103 pthread_mutex_init(&ret->gc_mtx, NULL); 104 pthread_mutexattr_init(&compile_mtx_attr); 105 pthread_mutexattr_settype(&compile_mtx_attr, PTHREAD_MUTEX_RECURSIVE); 106 pthread_mutex_init(&ret->compile_mtx, &compile_mtx_attr); 102 107 #else 103 108 ret->gc_mtx = CreateMutex(NULL, FALSE, NULL); 109 /* Compile mutex is automatically recursive. */ 110 ret->compile_mtx = CreateMutex(NULL, FALSE, NULL); 104 111 #endif /* WIN32 */ 105 112 … … 112 119 #endif 113 120 121 /* Initialize VM-wide text segment. */ 122 #ifndef HAVE_GC_H 123 ret->text_segment = (kite_opcode_t*)calloc(1, sizeof(kite_opcode_t)); 124 #else 125 ret->text_segment = (kite_opcode_t*)GC_malloc(sizeof(kite_opcode_t)); 126 #endif /* HAVE_GC_H */ 127 ret->text_segment_length = sizeof(kite_opcode_t); 128 ret->cur_text_segment = 0; 129 114 130 /* Force linkage of built-in modules */ 115 131 kite_module_initialize_now(thd); … … 180 196 #ifndef WIN32 181 197 pthread_mutex_destroy(&cur->gc_mtx); 198 pthread_mutex_destroy(&cur->compile_mtx); 182 199 #else 183 200 CloseHandle(cur->gc_mtx); 201 CloseHandle(cur->compile_mtx); 184 202 #endif /* WIN32 */ 185 203 -
interpreter/trunk/backend/common/kite_vm.h
r601 r619 270 270 #ifdef WIN32 271 271 HANDLE gc_mtx /*! \private */; 272 HANDLE compile_mtx /*! \private */; 272 273 #else 273 274 pthread_mutex_t gc_mtx /*! \private */; 275 pthread_mutex_t compile_mtx /*! \private */; 274 276 #endif /* WIN32 */ 275 277 #ifdef HAVE_GC_H … … 277 279 #endif /* HAVE_GC_H */ 278 280 char **args /*! \private */; 281 struct kite_opcode_t *text_segment /*! \private */; 282 size_t cur_text_segment /*! \private */; 283 size_t text_segment_length /*! \private */; 279 284 } kite_vm_t /*! Virtual machine instance object. */; 280 285 … … 293 298 kite_stack_t *obj_created /*! Currently created object. */; 294 299 kite_stack_t *decide_exits /*! \private */; /* to fix ticket #17 and short-circuiting */ 300 kite_stack_t *decide_exit_locs /*! \private */; 301 kite_stack_t *decide_begins /*! \private */; 302 kite_stack_t *func_skip_locs /*! \private */; 295 303 char *curStr /*! Current string being read. */; 296 304 } kite_compiler_t; … … 568 576 fc_entry->this = t; \ 569 577 fc_entry->locals = NULL; \ 570 fc_entry->file = ins-> common.file; \571 fc_entry->line = ins-> common.line; \578 fc_entry->file = ins->file; \ 579 fc_entry->line = ins->line; \ 572 580 fc_entry->last_deref = NULL; \ 573 581 fc_entry->last_deref_obj = NULL; \ … … 593 601 fc_entry->this = t; \ 594 602 fc_entry->locals = NULL; \ 595 fc_entry->file = ins-> common.file; \596 fc_entry->line = ins-> common.line; \603 fc_entry->file = ins->file; \ 604 fc_entry->line = ins->line; \ 597 605 fc_entry->last_deref = NULL; \ 598 606 fc_entry->last_deref_obj = NULL; \ … … 628 636 fc_entry->this = t; \ 629 637 fc_entry->locals = NULL; \ 630 fc_entry->file = ins-> common.file; \631 fc_entry->line = ins-> common.line; \638 fc_entry->file = ins->file; \ 639 fc_entry->line = ins->line; \ 632 640 fc_entry->last_deref = NULL; \ 633 641 fc_entry->last_deref_obj = NULL; \ … … 653 661 fc_entry->this = t; \ 654 662 fc_entry->locals = NULL; \ 655 fc_entry->file = ins-> common.file; \656 fc_entry->line = ins-> common.line; \663 fc_entry->file = ins->file; \ 664 fc_entry->line = ins->line; \ 657 665 fc_entry->last_deref = NULL; \ 658 666 fc_entry->last_deref_obj = NULL; \ -
interpreter/trunk/backend/kite-vm-1.0/kite_compile_bytecode.c
r602 r619 11 11 kite_thread_t *thd = compiler->thd; \ 12 12 kite_object_t *cur = (kite_object_t*)kite_top_stack(compiler->obj_created); \ 13 COMPILE_INSTRUCTION2(compiler, i, j, &cur->builtin_data.funcvalue.funcptr); \ 14 (void)thd; \ 13 COMPILE_INSTRUCTION2(thd, compiler, i, j, &cur->builtin_data.funcvalue.funcptr); \ 15 14 (void)cur; \ 16 15 } 17 16 18 void COMPILE_INSTRUCTION2(kite_ compiler_t *compiler, kite_opcode_t *inst, int lno, void **dest)17 void COMPILE_INSTRUCTION2(kite_thread_t *thd, kite_compiler_t *compiler, kite_opcode_t *inst, int lno, void **dest) 19 18 { 20 19 kite_opcode_t *fptr = *dest; 21 20 inst->file = strdup(compiler->file); 22 21 inst->line = lno; 23 kite_add_to_instruction_list( &fptr, inst);22 kite_add_to_instruction_list(thd, &fptr, inst); 24 23 *dest = fptr; 25 24 } … … 27 26 static void kite_optimize_increment(kite_compiler_t *compiler, kite_opcode_t *o1, kite_opcode_t *o2) 28 27 { 29 kite_thread_t *thd = compiler->thd;28 /*kite_thread_t *thd = compiler->thd; 30 29 kite_opcode_push *p1 = (kite_opcode_push*)o1; 31 30 kite_opcode_push *p2 = (kite_opcode_push*)o2; … … 49 48 } 50 49 } 51 } 50 }*/ 52 51 } 53 52 … … 81 80 kite_new_method_bytecode(thd, NULL, 82 81 kite_list_count(thd, param_list)); 82 83 /* Bypass declaration so we don't accidentally run the method. */ 84 COMPILE_INSTRUCTION(kite_compile_jump_uncond(NULL), line); 85 kite_push_stack(&compiler->func_skip_locs, FALSE, compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 86 83 87 kite_push_stack(&compiler->obj_created, FALSE, 84 88 method); … … 91 95 { 92 96 kite_thread_t *thd = compiler->thd; 93 kite_object_t *obj = kite_pop_stack(&compiler->obj_created); 94 kite_object_t *parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 95 96 (void)line; 97 kite_object_t *obj; 98 kite_object_t *parent; 99 void *pc; 100 kite_opcode_t *opc; 101 102 COMPILE_INSTRUCTION(kite_compile_return(), line); 103 104 obj = kite_pop_stack(&compiler->obj_created); 105 parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 106 97 107 obj->parent = kite_reference_object(parent); 98 108 kite_add_method(thd, parent, func_name, obj); 99 109 kite_set_docstring(obj, doc_string); 110 111 pc = kite_top_stack(compiler->func_skip_locs); 112 if (pc) 113 { 114 COMPILE_INSTRUCTION(kite_compile_nop(), line); 115 opc = (void*)thd->vm->text_segment + (long)pc; 116 opc->op_arg.jumpto = thd->vm->cur_text_segment - sizeof(kite_opcode_t); 117 kite_pop_stack(&compiler->func_skip_locs); 118 } 119 100 120 return NULL; 101 121 } … … 107 127 kite_new_method_bytecode(thd, NULL, 108 128 kite_list_count(thd,param_list)); 129 130 /* Bypass declaration so we don't accidentally run the method. */ 131 COMPILE_INSTRUCTION(kite_compile_jump_uncond(NULL), line); 132 kite_push_stack(&compiler->func_skip_locs, FALSE, compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 133 109 134 kite_push_stack(&compiler->obj_created, FALSE, 110 135 method); … … 116 141 static void *kite_compile_instruction_anon_func_body(kite_compiler_t *compiler, int line) 117 142 { 118 kite_object_t *obj = kite_pop_stack(&compiler->obj_created); 143 kite_object_t *obj; 144 kite_opcode_t *opc; 145 void *pc; 146 147 COMPILE_INSTRUCTION(kite_compile_return(), line); 148 obj = kite_pop_stack(&compiler->obj_created); 119 149 COMPILE_INSTRUCTION(kite_compile_push(obj), line); 150 151 pc = kite_top_stack(compiler->func_skip_locs); 152 if (pc) 153 { 154 opc = (void*)compiler->thd->vm->text_segment + (long)pc; 155 opc->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 156 kite_pop_stack(&compiler->func_skip_locs); 157 } 158 120 159 return NULL; 121 160 } … … 125 164 kite_thread_t *thd = compiler->thd; 126 165 (void)line; 166 167 /* Bypass declaration so we don't accidentally run the class. */ 168 COMPILE_INSTRUCTION(kite_compile_jump_uncond(NULL), line); 169 kite_push_stack(&compiler->func_skip_locs, FALSE, compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 170 127 171 kite_push_stack(&compiler->obj_created, FALSE, 128 172 kite_new_class(thd, NULL, name)); … … 133 177 { 134 178 kite_thread_t *thd = compiler->thd; 135 kite_object_t *obj = kite_pop_stack(&compiler->obj_created);179 kite_object_t *obj; 136 180 kite_funccall_info_t *fcall; 137 181 kite_object_t *parent; 138 182 kite_opcode_t *opc; 183 void *pc; 184 185 COMPILE_INSTRUCTION(kite_compile_return(), line); 186 obj = kite_pop_stack(&compiler->obj_created); 187 188 pc = kite_top_stack(compiler->func_skip_locs); 189 if (pc) 190 { 191 COMPILE_INSTRUCTION(kite_compile_nop(), line); 192 opc = (void*)compiler->thd->vm->text_segment + (long)pc; 193 opc->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 194 kite_pop_stack(&compiler->func_skip_locs); 195 } 196 139 197 obj->builtin_data.funcvalue.functype = FUNC_BYTECODE; 140 198 parent = (kite_object_t*)kite_top_stack(compiler->obj_created); … … 199 257 void *opc = NULL; 200 258 int idx; 201 202 259 kite_thread_t *thd = compiler->thd; 203 COMPILE_INSTRUCTION2(compiler, kite_compile_push(kite_new_ident(thd, name)), 260 int old_offset = thd->vm->cur_text_segment; 261 262 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_push(kite_new_ident(thd, name)), 204 263 line, &opc); 205 COMPILE_INSTRUCTION2(compiler, kite_compile_deref_1(TRUE), line, &opc); 206 264 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_deref_1(TRUE), line, &opc); 265 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_return(), line, &opc); 266 267 if (old_offset == 0) 268 opc -= sizeof(kite_opcode_t); 269 207 270 fcall->file = compiler->file; 208 271 fcall->line = line; … … 240 303 kite_funccall_info_t *fcall = (kite_funccall_info_t*)GC_malloc(sizeof(kite_funccall_info_t)); 241 304 #endif /* HAVE_GC_H */ 242 COMPILE_INSTRUCTION2( compiler, kite_compile_push(obj),305 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_push(obj), 243 306 line, &opc); 244 COMPILE_INSTRUCTION2( compiler, kite_compile_push(kite_new_ident(thd, name)),307 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_push(kite_new_ident(thd, name)), 245 308 line, &opc); 246 COMPILE_INSTRUCTION2(compiler, kite_compile_deref_2(), line, &opc); 247 309 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_deref_2(), line, &opc); 310 COMPILE_INSTRUCTION2(thd, compiler, kite_compile_return(), line, &opc); 311 248 312 fcall->file = compiler->file; 249 313 fcall->line = line; … … 274 338 { 275 339 kite_thread_t *thd = compiler->thd; 340 341 /* Bypass declaration so we don't accidentally run the method. */ 342 COMPILE_INSTRUCTION(kite_compile_jump_uncond(NULL), line); 343 kite_push_stack(&compiler->func_skip_locs, FALSE, compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 344 276 345 kite_push_stack(&compiler->obj_created, FALSE, 277 346 kite_new_method_bytecode(thd, NULL, … … 284 353 { 285 354 kite_thread_t *thd = compiler->thd; 286 kite_object_t *obj = kite_pop_stack(&compiler->obj_created); 287 kite_object_t *parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 288 289 (void)line; 355 kite_object_t *obj; 356 kite_object_t *parent; 357 kite_opcode_t *opc; 358 void *pc; 359 360 COMPILE_INSTRUCTION(kite_compile_return(), line); 361 362 obj = kite_pop_stack(&compiler->obj_created); 363 parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 364 290 365 obj->parent = kite_reference_object(parent); 291 366 kite_add_method(thd, parent, "__construct__", obj); 292 367 kite_set_docstring(obj, doc_str); 293 368 kite_set_arginfo(obj, func_args); 369 370 pc = kite_top_stack(compiler->func_skip_locs); 371 if (pc) 372 { 373 COMPILE_INSTRUCTION(kite_compile_nop(), line); 374 opc = (void*)compiler->thd->vm->text_segment + (long)pc; 375 opc->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 376 kite_pop_stack(&compiler->func_skip_locs); 377 } 378 294 379 return NULL; 295 380 } … … 299 384 kite_thread_t *thd = compiler->thd; 300 385 (void)line; 386 387 /* Bypass declaration so we don't accidentally run the method. */ 388 COMPILE_INSTRUCTION(kite_compile_jump_uncond(NULL), line); 389 kite_push_stack(&compiler->func_skip_locs, FALSE, compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 301 390 302 391 kite_push_stack(&compiler->obj_created, FALSE, … … 308 397 { 309 398 kite_thread_t *thd = compiler->thd; 310 kite_object_t *obj = kite_pop_stack(&compiler->obj_created); 311 kite_object_t *parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 312 (void)line; 399 kite_object_t *obj; 400 kite_object_t *parent; 401 kite_opcode_t *opc; 402 void *pc; 403 404 COMPILE_INSTRUCTION(kite_compile_return(), line); 405 406 obj = kite_pop_stack(&compiler->obj_created); 407 parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 408 409 pc = kite_top_stack(compiler->func_skip_locs); 410 if (pc) 411 { 412 COMPILE_INSTRUCTION(kite_compile_nop(), line); 413 opc = (void*)compiler->thd->vm->text_segment + (long)pc; 414 opc->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 415 kite_pop_stack(&compiler->func_skip_locs); 416 } 313 417 314 418 obj->parent = kite_reference_object(parent); … … 369 473 { 370 474 kite_thread_t *thd = compiler->thd; 475 476 /* Bypass declaration so we don't accidentally run the method. */ 477 COMPILE_INSTRUCTION(kite_compile_jump_uncond(NULL), line); 478 kite_push_stack(&compiler->func_skip_locs, FALSE, compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 479 371 480 kite_push_stack(&compiler->obj_created, FALSE, 372 481 kite_new_method_bytecode(thd, NULL, … … 380 489 { 381 490 kite_thread_t *thd = compiler->thd; 382 kite_object_t *obj = kite_pop_stack(&compiler->obj_created); 383 kite_object_t *parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 384 385 (void)line; 491 kite_object_t *obj; 492 kite_object_t *parent; 493 kite_opcode_t *opc; 494 void *pc; 495 496 COMPILE_INSTRUCTION(kite_compile_return(), line); 497 498 obj = kite_pop_stack(&compiler->obj_created); 499 parent = (kite_object_t*)kite_top_stack(compiler->obj_created); 500 386 501 kite_add_operator(thd, parent, op_type, obj); 387 502 kite_set_docstring(obj, doc_str); 388 503 504 pc = kite_top_stack(compiler->func_skip_locs); 505 if (pc) 506 { 507 COMPILE_INSTRUCTION(kite_compile_nop(), line); 508 opc = (void*)compiler->thd->vm->text_segment + (long)pc; 509 opc->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 510 kite_pop_stack(&compiler->func_skip_locs); 511 } 512 389 513 return NULL; 390 514 } … … 393 517 { 394 518 kite_object_t *cur = (kite_object_t*)kite_top_stack(compiler->obj_created); 395 kite_opcode_t *opc = cur->builtin_data.funcvalue.funcptr; 519 kite_opcode_t *opc; 520 void *pc = cur->builtin_data.funcvalue.funcptr; 396 521 (void)line; 397 522 398 while(opc->next) opc = opc->next;399 400 if (opc->opcode == ARITH_OP && ((kite_opcode_arithop*)opc)->op eration == OP_ARRAY_DEREF)401 return opc ;523 opc = (void*)compiler->thd->vm->text_segment + (long)pc + cur->builtin_data.funcvalue.length - sizeof(kite_opcode_t); 524 525 if (opc->opcode == ARITH_OP && ((kite_opcode_arithop*)opc)->op_arg.operation == OP_ARRAY_DEREF) 526 return opc - compiler->thd->vm->text_segment; 402 527 else 403 528 return NULL; … … 408 533 kite_opcode_t *op2; 409 534 410 if (op1 && op1->next && op1->next->next)535 /*if (op1 && op1->next && op1->next->next) 411 536 { 412 537 op2 = op1->next->next; 413 538 kite_optimize_increment(compiler, op1, op2); 414 } 539 }*/ 415 540 416 541 if (!orig_op2) … … 432 557 COMPILE_INSTRUCTION(kite_compile_dupe_top(FALSE), line); 433 558 COMPILE_INSTRUCTION(opc, line); 434 return opc;559 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 435 560 } 436 561 … … 444 569 445 570 COMPILE_INSTRUCTION(kite_compile_arithop(OP_OR), line); 446 ((kite_opcode_jump_true*)lhs_opc)->jumpto = opc; 447 COMPILE_INSTRUCTION(opc, line); 571 COMPILE_INSTRUCTION(opc, line); 572 lhs_opc = (void*)lhs_opc + (long)compiler->thd->vm->text_segment; 573 ((kite_opcode_jump_true*)lhs_opc)->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 448 574 449 575 return NULL; … … 461 587 COMPILE_INSTRUCTION(kite_compile_dupe_top(FALSE), line); 462 588 COMPILE_INSTRUCTION(opc, line); 463 return opc;589 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 464 590 } 465 591 … … 473 599 474 600 COMPILE_INSTRUCTION(kite_compile_arithop(OP_AND), line); 475 ((kite_opcode_jump_true*)lhs_opc)->jumpto = opc; 476 COMPILE_INSTRUCTION(opc, line); 477 601 COMPILE_INSTRUCTION(opc, line); 602 lhs_opc = (void*)lhs_opc + (long)compiler->thd->vm->text_segment; 603 ((kite_opcode_jump_true*)lhs_opc)->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 604 478 605 return NULL; 479 606 } … … 656 783 kite_opcode_t *opc = kite_compile_push(kite_new_list(thd)); 657 784 (void)line; 658 COMPILE_INSTRUCTION(opc, 0);785 COMPILE_INSTRUCTION(opc, line); 659 786 return opc; 660 787 } … … 779 906 (void)line; 780 907 kite_push_stack(&compiler->decide_exits, FALSE, kite_compile_nop()); 908 kite_push_stack(&compiler->decide_begins, FALSE, compiler->thd->vm->cur_text_segment); 781 909 return NULL; 782 910 } … … 786 914 kite_opcode_t *tmpopc = kite_pop_stack(&compiler->decide_exits); 787 915 COMPILE_INSTRUCTION(tmpopc, line); 916 void *pc; 917 void *tos = kite_pop_stack(&compiler->decide_begins); 918 919 while ((pc = kite_top_stack(compiler->decide_exit_locs)) >= tos) 920 { 921 tmpopc = (void*)compiler->thd->vm->text_segment + (long)pc; 922 tmpopc->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 923 kite_pop_stack(&compiler->decide_exit_locs); 924 } 788 925 return NULL; 789 926 } … … 793 930 kite_opcode_t *opc = kite_compile_jump_false(NULL); 794 931 COMPILE_INSTRUCTION(opc, line); 795 return opc;932 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 796 933 } 797 934 … … 799 936 { 800 937 kite_opcode_jump_false *c = (kite_opcode_jump_false*)begin_opc; 801 c->jumpto= kite_compile_nop();938 kite_opcode_t *obj = kite_compile_nop(); 802 939 803 940 COMPILE_INSTRUCTION( … … 808 945 ); 809 946 810 COMPILE_INSTRUCTION(c->jumpto, line); 947 kite_push_stack(&compiler->decide_exit_locs, FALSE, (void*)compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 948 949 COMPILE_INSTRUCTION(obj, line); 950 c = (void*)c + (long)compiler->thd->vm->text_segment; 951 c->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 952 811 953 return NULL; 812 954 } … … 834 976 kite_opcode_t *loop_bottom_cont = kite_compile_jump_uncond(opc); 835 977 kite_opcode_t *loop_bottom_end = kite_compile_nop(); 836 978 kite_opcode_t *tmpopc; 979 837 980 COMPILE_INSTRUCTION(loop_bottom_cont, line); 838 981 loop_bottom_cont = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 982 COMPILE_INSTRUCTION(loop_bottom_end, line); 983 loop_bottom_end = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 984 839 985 /* Fix jump destination */ 840 while(opc && opc != loop_bottom_cont) 986 opc = (void*)opc + (long)compiler->thd->vm->text_segment; 987 while(opc < (void*)compiler->thd->vm->text_segment + (long)loop_bottom_end) 841 988 { 842 if ((opc->opcode == JUMP_TRUE && ((kite_opcode_jump_true*)opc)-> jumpto == NULL) ||843 (opc->opcode == JUMP_FALSE && ((kite_opcode_jump_false*)opc)-> jumpto == NULL))989 if ((opc->opcode == JUMP_TRUE && ((kite_opcode_jump_true*)opc)->op_arg.jumpto == NULL) || 990 (opc->opcode == JUMP_FALSE && ((kite_opcode_jump_false*)opc)->op_arg.jumpto == NULL)) 844 991 { 845 ((kite_opcode_jump_true*)opc)-> jumpto = loop_bottom_end;992 ((kite_opcode_jump_true*)opc)->op_arg.jumpto = loop_bottom_end; 846 993 } 847 994 else if (opc->opcode == TEMP_BREAK) 848 995 { 849 996 opc->opcode = JUMP_UNCOND; 850 ((kite_opcode_jump_true*)opc)-> jumpto = loop_bottom_end;997 ((kite_opcode_jump_true*)opc)->op_arg.jumpto = loop_bottom_end; 851 998 } 852 999 else if (opc->opcode == TEMP_CONTINUE) 853 1000 { 854 1001 opc->opcode = JUMP_UNCOND; 855 ((kite_opcode_jump_true*)opc)-> jumpto = loop_bottom_cont;1002 ((kite_opcode_jump_true*)opc)->op_arg.jumpto = loop_bottom_cont; 856 1003 } 857 opc = opc->next; 858 } 859 860 COMPILE_INSTRUCTION(loop_bottom_end, line); 1004 opc++; 1005 } 1006 861 1007 return NULL; 862 1008 } … … 866 1012 kite_opcode_t *opc = kite_compile_nop(); 867 1013 COMPILE_INSTRUCTION(opc, line); 868 return opc;1014 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 869 1015 } 870 1016 … … 879 1025 kite_opcode_t *opc = kite_compile_nop(); 880 1026 COMPILE_INSTRUCTION(opc, line); 881 return opc;1027 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 882 1028 } 883 1029 … … 892 1038 kite_opcode_t *opc = kite_compile_exception_hndl(NULL); 893 1039 COMPILE_INSTRUCTION(opc, line); 894 return opc;1040 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 895 1041 } 896 1042 … … 900 1046 COMPILE_INSTRUCTION(kite_compile_push(kite_new_boolean(thd, TRUE)), line); 901 1047 COMPILE_INSTRUCTION(opc, line); 902 return opc;1048 return compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 903 1049 } 904 1050 … … 906 1052 { 907 1053 kite_opcode_t *opc = kite_compile_nop(); 908 ((kite_opcode_exception_hndl*)run_opc)->handler = opc; 909 COMPILE_INSTRUCTION(opc, line); 1054 COMPILE_INSTRUCTION(opc, line); 1055 1056 run_opc = (void*)compiler->thd->vm->text_segment + (long)run_opc; 1057 ((kite_opcode_exception_hndl*)run_opc)->op_arg.handler = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 910 1058 return NULL; 911 1059 } … … 915 1063 kite_opcode_t *opc = kite_compile_pop_exception_hndl(); 916 1064 kite_opcode_t *nop = kite_compile_nop(); 917 ((kite_opcode_jump_true*)run_opc)->jumpto = opc;1065 kite_opcode_t *jump; 918 1066 COMPILE_INSTRUCTION(kite_compile_push(kite_new_boolean(thd, TRUE)), line); 1067 919 1068 COMPILE_INSTRUCTION(kite_compile_jump_true(nop), line); 920 COMPILE_INSTRUCTION(opc, line); 1069 jump = (void*)compiler->thd->vm->text_segment + (compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t)); 1070 1071 COMPILE_INSTRUCTION(opc, line); 1072 run_opc = (void*)compiler->thd->vm->text_segment + (long)run_opc; 1073 ((kite_opcode_jump_true*)run_opc)->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 1074 921 1075 COMPILE_INSTRUCTION(nop, line); 1076 jump->op_arg.jumpto = compiler->thd->vm->cur_text_segment - sizeof(kite_opcode_t); 922 1077 return NULL; 923 1078 } -
interpreter/trunk/backend/kite-vm-1.0/kite_execute.c
r618 r619 134 134 kite_vm_execute_push(kite_thread_t *thd, kite_opcode_push *ins) 135 135 { 136 assert(ins->o bj != NULL);137 kite_vm_push(thd, ins->o bj);138 return ins ->common.next;136 assert(ins->op_arg.obj != NULL); 137 kite_vm_push(thd, ins->op_arg.obj); 138 return ins + 1; 139 139 } 140 140 … … 149 149 kite_funccall_info_t *stackentry; 150 150 int deref_array = 0; 151 assert(ins-> args != NULL);151 assert(ins->op_arg.args != NULL); 152 152 153 153 args = kite_vm_pop(thd); … … 158 158 159 159 cur_array = args; 160 cur_args = ins-> args;160 cur_args = ins->op_arg.args; 161 161 162 162 while(cur_array && cur_args) { … … 187 187 if (deref_array) kite_dereference_object(args); 188 188 assert(cur_array == NULL && cur_args == NULL); 189 return ins ->common.next;189 return ins + 1; 190 190 } 191 191 … … 218 218 kite_reference_object(found->value); 219 219 kite_push_stack(&thd->running_stack, TRUE, found); 220 return ins ->common.next;220 return ins + 1; 221 221 } else if (strcmp("this", ident_string) == 0) { 222 222 res = kite_reference_object(((kite_funccall_info_t*)cur->obj)->this); … … 273 273 } 274 274 275 if (res == NULL && ins-> create) {275 if (res == NULL && ins->op_arg.create) { 276 276 /* Create entry in symbol table */ 277 277 stackentry = (kite_funccall_info_t*)kite_top_stack(thd->func_stack); … … 290 290 kite_symtab_insert(thd, &stackentry->locals, found); 291 291 res = found->value; 292 } else if (res == NULL && !ins-> create) {292 } else if (res == NULL && !ins->op_arg.create) { 293 293 char buf[1024]; 294 294 fc = kite_top_stack(thd->func_stack); 295 PUSH_FUNC_STACK_WITH_RET_VALUE(NULL, ins ->common.next);295 PUSH_FUNC_STACK_WITH_RET_VALUE(NULL, ins + 1); 296 296 fc_entry->sys_or_user = fc->sys_or_user; 297 297 … … 302 302 kite_vm_call_method(thd, exc, "throw", kite_new_list(thd), TRUE); 303 303 POP_FUNC_STACK; 304 return ins ->common.next;304 return ins + 1; 305 305 } 306 306 … … 314 314 } 315 315 316 if (!found->value->shareable && found->value->owner_thread != thd) 317 goto thread_access_err; 316 if (found->value->type != OBJ_BOOLEAN && 317 found->value->type != OBJ_INTEGER && 318 found->value->type != OBJ_FLOAT) 319 { 320 if (!found->value->shareable && found->value->owner_thread != thd) 321 goto thread_access_err; 322 } 318 323 319 324 kite_reference_object(found->value); … … 325 330 stackentry->last_deref_ident = ident; 326 331 327 return ins ->common.next;332 return ins + 1; 328 333 } 329 334 330 335 /* Wrap it in a reference */ 331 if (!res->shareable && res->owner_thread != thd) 332 goto thread_access_err; 333 336 if (res->type != OBJ_BOOLEAN && 337 res->type != OBJ_INTEGER && 338 res->type != OBJ_FLOAT) 339 { 340 if (!res->shareable && res->owner_thread != thd) 341 goto thread_access_err; 342 } 343 334 344 kite_dereference_object(ident); 335 345 kite_vm_push(thd, res); 336 return ins ->common.next;346 return ins + 1; 337 347 338 348 thread_access_err: 339 349 { 340 PUSH_FUNC_STACK_WITH_RET_VALUE(NULL, ins ->common.next);350 PUSH_FUNC_STACK_WITH_RET_VALUE(NULL, ins + 1); 341 351 exc = 342 352 kite_new_exception( … … 347 357 kite_vm_call_method(thd, exc, "throw", kite_new_list(thd), TRUE); 348 358 } 349 return ins ->common.next;359 return ins + 1; 350 360 } 351 361 … … 386 396 387 397 kite_dereference_object(ident); 388 return ins ->common.next;398 return ins + 1; 389 399 } 390 400 … … 446 456 else kite_reference_object(entry->value); 447 457 448 if (!entry->value->shareable && entry->value->owner_thread != thd) goto thread_access_err; 458 if (entry->value->type != OBJ_BOOLEAN && 459 entry->value->type != OBJ_INTEGER && 460 entry->value->type != OBJ_FLOAT) 461 { 462 if (!entry->value->shareable && entry->value->owner_thread != thd) 463 goto thread_access_err; 464 } 449 465 450 466 kite_push_stack(&thd->running_stack, TRUE, entry); 451 467 kite_dereference_object(ident); 452 468 kite_dereference_object(obj); 453 return ins ->common.next;469 return ins + 1; 454 470 } 455 471 … … 476 492 KITE_FIND_IN_SYMTAB(entry, obj->object_data.properties, name, 0); 477 493 478 if (!entry->value->shareable && entry->value->owner_thread != thd) goto thread_access_err; 494 if (entry->value->type != OBJ_BOOLEAN && 495 entry->value->type != OBJ_INTEGER && 496 entry->value->type != OBJ_FLOAT) 497 { 498 if (!entry->value->shareable && entry->value->owner_thread != thd) 499 goto thread_access_err; 500 } 479 501 480 502 kite_push_stack(&thd->running_stack, TRUE, entry); … … 482 504 kite_dereference_object(ident); 483 505 kite_dereference_object(obj); 484 return ins ->common.next;506 return ins + 1; 485 507 } 486 508 … … 491 513 if (kite_vm_call_operator(thd, obj, OP_PROPERTY, curr, 0)) { 492 514 kite_dereference_object(curr); 493 return ins ->common.next;515 return ins + 1; 494 516 } 495 517 … … 499 521 kite_funccall_info_t *fc = 500 522 kite_top_stack(thd->func_stack); 501 PUSH_FUNC_STACK_WITH_RET_VALUE(obj, ins ->common.next);523 PUSH_FUNC_STACK_WITH_RET_VALUE(obj, ins + 1); 502 524 fc_entry->sys_or_user = fc->sys_or_user; 503 525 … … 506 528 buf); 507 529 kite_vm_call_method(thd, exc, "throw", kite_new_list(thd), TRUE); 508 return ins ->common.next;530 return ins + 1; 509 531 } 510 532 511 533 thread_access_err: 512 534 { 513 PUSH_FUNC_STACK_WITH_RET_VALUE(NULL, ins ->common.next);535 PUSH_FUNC_STACK_WITH_RET_VALUE(NULL, ins + 1); 514 536 exc = 515 537 kite_new_exception( … … 520 542 kite_vm_call_method(thd, exc, "throw", kite_new_list(thd), TRUE); 521 543 } 522 return ins ->common.next;544 return ins + 1; 523 545 } 524 546 … … 546 568 547 569 fc = kite_top_stack(thd->func_stack); 548 PUSH_FUNC_STACK_WITH_RET_VALUE(this, ins ->common.next);570 PUSH_FUNC_STACK_WITH_RET_VALUE(this, ins + 1); 549 571 fc_entry->sys_or_user = fc->sys_or_user; 550 572 … … 556 578 "Specified arguments do not match."); 557 579 kite_vm_call_method(thd, exc, "throw", kite_new_list(thd), TRUE); 558 return ins ->common.next;580 return ins + 1; 559 581 } 560 582 kite_vm_call_object(thd, this, method, args); … … 566 588 "Cannot call object as a method."); 567 589 kite_vm_call_method(thd, exc, "throw", kite_new_list(thd), TRUE); 568 return ins ->common.next;590 return ins + 1; 569 591 } 570 592 … … 572 594 kite_dereference_object(method); 573 595 574 if (thd->exception) return ins ->common.next;596 if (thd->exception) return ins + 1; 575 597 576 598 /* Remove anything other than the return value from the top of the stack */ … … 597 619 } 598 620 } 599 if (strcmp("__construct__", method->builtin_data.stringvalue.string) != 0) 621 if (method->type != OBJ_IDENT || 622 strcmp("__construct__", method->builtin_data.stringvalue.string) != 0) 600 623 { 601 624 if (ret != NULL) kite_vm_push(thd, ret); … … 605 628 } else { 606 629 POP_FUNC_STACK; 607 if (strcmp("__construct__", method->builtin_data.stringvalue.string) != 0) 630 if (method->type != OBJ_IDENT || 631 strcmp("__construct__", method->builtin_data.stringvalue.string) != 0) 608 632 { 609 633 kite_vm_push(thd, kite_new_null(thd)); 610 return ins ->common.next;611 } 612 } 613 614 return ins ->common.next;634 return ins + 1; 635 } 636 } 637 638 return ins + 1; 615 639 } 616 640 … … 628 652 kite_dereference_object(code); 629 653 630 return ins ->common.next;654 return ins + 1; 631 655 } 632 656 … … 655 679 kite_vm_push(thd, res); 656 680 kite_dereference_object(res); 657 return ins ->common.next;681 return ins + 1; 658 682 } 659 683 … … 675 699 kite_dereference_object(res); 676 700 677 return ins ->common.next;701 return ins + 1; 678 702 } 679 703 … … 693 717 kite_dereference_object(res); 694 718 695 return ins ->common.next;719 return ins + 1; 696 720 } 697 721 … … 707 731 if (thd->running_stack->stack[thd->running_stack->length - 1].reference) { 708 732 symt = (kite_symtab_t*)(thd->running_stack->stack[thd->running_stack->length - 1].obj); 709 if (!ins-> dupe_ref) kite_reference_object(symt->value);733 if (!ins->op_arg.dupe_ref) kite_reference_object(symt->value); 710 734 kite_push_stack(&thd->running_stack, TRUE, symt); 711 735 } else { … … 716 740 } 717 741 718 return ins ->common.next;742 return ins + 1; 719 743 } 720 744 … … 727 751 kite_object_t *obj, *onstack; 728 752 void *newpc; 729 assert(ins-> jumpto != NULL && thd->func_stack != NULL);753 assert(ins->op_arg.jumpto != NULL && thd->func_stack != NULL); 730 754 731 755 onstack = kite_vm_pop(thd); … … 733 757 if (obj->builtin_data.intvalue) 734 758 { 735 newpc = ins->jumpto;759 newpc = (void*)thd->vm->text_segment + (long)ins->op_arg.jumpto; 736 760 } 737 761 else 738 762 { 739 newpc = ins ->common.next;763 newpc = ins + 1; 740 764 } 741 765 kite_dereference_object(obj); … … 752 776 kite_object_t *obj, *onstack; 753 777 void *newpc; 754 assert(ins-> jumpto != NULL && thd->func_stack != NULL);778 assert(ins->op_arg.jumpto != NULL && thd->func_stack != NULL); 755 779 756 780 onstack = kite_vm_pop(thd); … … 758 782 if (!obj->builtin_data.intvalue) 759 783 { 760 newpc = ins->jumpto;784 newpc = (void*)thd->vm->text_segment + (long)ins->op_arg.jumpto; 761 785 } 762 786 else 763 787 { 764 newpc = ins ->common.next;788 newpc = ins + 1; 765 789 } 766 790 kite_dereference_object(obj); … … 775 799 kite_vm_execute_jumpuncond(kite_thread_t *thd, kite_opcode_jump_unconditional *ins) 776 800 { 777 assert(ins-> jumpto != NULL && thd->func_stack != NULL);778 return ins->jumpto;801 assert(ins->op_arg.jumpto != NULL && thd->func_stack != NULL); 802 return (void*)thd->vm->text_segment + (long)ins->op_arg.jumpto; 779 803 } 780 804 … … 790 814 kite_funccall_info_t *current; 791 815 792 kite_vm_execute_user_method(thd, ins->common.next);816 kite_vm_execute_user_method(thd, (void*)(ins + 1) - (long)thd->vm->text_segment); 793 817 if (thd->exception) 794 818 { … … 831 855 832 856 thd->exception = NULL; 833 return ins->handler;857 return (void*)thd->vm->text_segment + (long)ins->op_arg.handler; 834 858 } 835 859 … … 851 875 if (symt) kite_symtab_remove(thd, ¤t->locals, "__exc", 0); 852 876 853 return ins ->common.next;877 return ins + 1; 854 878 } 855 879 … … 861 885 kite_vm_push(thd, 862 886 ((kite_funccall_info_t*)kite_top_stack(thd->func_stack))->this); 863 return ins ->common.next;887 return ins + 1; 864 888 } 865 889 … … 1001 1025 int curstack; 1002 1026 1003 assert(ins->op eration < NUM_OPERATORS);1027 assert(ins->op_arg.operation < NUM_OPERATORS); 1004 1028 rhs = kite_vm_pop(thd); 1005 1029 1006 if (ins->op eration == OP_ARRAY_SET)1030 if (ins->op_arg.operation == OP_ARRAY_SET) 1007 1031 idx = kite_vm_pop(thd); 1008 1032 1009 1033 if (thd->running_stack->stack[thd->running_stack->length - 1].reference && 1010 ins->op eration == OP_ASSIGNMENT) {1034 ins->op_arg.operation == OP_ASSIGNMENT) { 1011 1035 kite_symtab_t *symt = 1012 1036 (kite_symtab_t*)thd->running_stack->stack[thd->running_stack->length - 1].obj; … … 1032 1056 } 1033 1057 kite_dereference_object(kite_vm_pop(thd)); 1034 return ins ->common.next;1058 return ins + 1; 1035 1059 } 1036 1060 lhs = kite_vm_pop(thd); … … 1044 1068 lhs->type == OBJ_BOOLEAN 1045 1069 ) && 1046 ins->op eration != OP_ASSIGNMENT)1047 { 1048 kite_compiled_func_t func = _operationArray[lhs->type][ins->op eration];1070 ins->op_arg.operation != OP_ASSIGNMENT) 1071 { 1072 kite_compiled_func_t func = _operationArray[lhs->type][ins->op_arg.operation]; 1049 1073 1050 1074 if (func == NULL) … … 1054 1078 KITE_FIND_ANY_IN_SYMTAB(st, 1055 1079 lhs->object_data.inherit_from->object_data.properties, 1056 OP_TO_METHOD(ins->op eration));1080 OP_TO_METHOD(ins->op_arg.operation)); 1057 1081 1058 1082 if (st) … … 1068 1092 kite_dereference_object(lhs); 1069 1093 kite_dereference_object(rhs); 1070 return ins ->common.next;1094 return ins + 1; 1071 1095 } 1072 1096 } 1073 1097 1074 1098 fc = kite_top_stack(thd->func_stack); 1075 PUSH_FUNC_STACK_WITH_RET_VALUE(lhs, ins ->common.next);1099 PUSH_FUNC_STACK_WITH_RET_VALUE(lhs, ins + 1); 1076 1100 fc_entry->sys_or_user = fc->sys_or_user; 1077 1101 … … 1081 1105 idx = kite_list_object(thd, idx); 1082 1106 kite_append_list(thd, idx, rhs); 1083 kite_vm_call_operator(thd, lhs, ins->op eration, idx, TRUE);1107 kite_vm_call_operator(thd, lhs, ins->op_arg.operation, idx, TRUE); 1084 1108 } 1085 1109 else 1086 kite_vm_call_operator(thd, lhs, ins->op eration, rhs, TRUE);1087 if (thd->exception) return ins ->common.next;1110 kite_vm_call_operator(thd, lhs, ins->op_arg.operation, rhs, TRUE); 1111 if (thd->exception) return ins + 1; 1088 1112 1089 1113 kite_dereference_object(lhs); … … 1121 1145 } 1122 1146 1123 return ins ->common.next;1147 return ins + 1; 1124 1148 } 1125 1149 … … 1131 1155 { 1132 1156 (void)thd; 1133 return ins ->common.next;1157 return ins + 1; 1134 1158 } 1135 1159 … … 1150 1174 1151 1175 fc = kite_top_stack(thd->func_stack); 1152 PUSH_FUNC_STACK_WITH_RET_VALUE(obj, ins ->common.next);1176 PUSH_FUNC_STACK_WITH_RET_VALUE(obj, ins + 1); 1153 1177 fc_entry->sys_or_user = fc->sys_or_user; 1154 1178 1155 1179 newobj = kite_new_instance_with_constructor(thd, obj, args); 1156 if (thd->exception) return ins ->common.next;1180 if (thd->exception) return ins + 1; 1157 1181 POP_FUNC_STACK; 1158 1182 … … 1166 1190 kite_vm_push(thd, newobj); 1167 1191 kite_dereference_object(newobj); 1168 return ins ->common.next;1192 return ins + 1; 1169 1193 } 1170 1194 … … 1216 1240 1217 1241 cur = cur->object_data.inherit_from; 1218 } while(cur && !res && ins-> isof);1242 } while(cur && !res && ins->op_arg.isof); 1219 1243 1220 1244 obj = kite_new_boolean(thd, res); 1221 1245 kite_vm_push(thd, obj); 1222 return ins ->common.next;1246 return ins + 1; 1223 1247 //kite_dereference_object(obj); 1224 1248 } … … 1423 1447 static void kite_vm_execute_user_method_debug(kite_thread_t *thd, void *pc) 1424 1448 { 1425 kite_opcode_t *cur = (kite_opcode_t*) pc;1449 kite_opcode_t *cur = (kite_opcode_t*)((char*)thd->vm->text_segment + (long)pc); 1426 1450 kite_funccall_info_t *fc_entry, *oldentry; 1427 1451 int old_sys; … … 1482 1506 void kite_vm_execute_user_method(kite_thread_t *thd, void *pc) 1483 1507 { 1484 kite_opcode_t *cur = (kite_opcode_t*) pc;1508 kite_opcode_t *cur = (kite_opcode_t*)((char*)thd->vm->text_segment + (long)pc); 1485 1509 kite_funccall_info_t *fc = kite_top_stack(thd->func_stack); 1486 1510 -
interpreter/trunk/backend/kite-vm-1.0/kite_instr.c
r594 r619 56 56 { 57 57 kite_opcode_arithop *op = ALLOCATE_OPCODE(kite_opcode_arithop); 58 op->op eration = operation;59 op-> common.opcode = ARITH_OP;58 op->op_arg.operation = operation; 59 op->opcode = ARITH_OP; 60 60 return (kite_opcode_t*)op; 61 61 } … … 67 67 { 68 68 kite_opcode_push *op = ALLOCATE_OPCODE(kite_opcode_push); 69 op->o bj = obj;70 op-> common.opcode = PUSH;69 op->op_arg.obj = obj; 70 op->opcode = PUSH; 71 71 return (kite_opcode_t*)op; 72 72 } … … 122 122 { 123 123 kite_opcode_deref_1 *opc = ALLOCATE_OPCODE(kite_opcode_deref_1); 124 opc-> common.opcode = DEREF_1;125 opc-> create = create;124 opc->opcode = DEREF_1; 125 opc->op_arg.create = create; 126 126 return (kite_opcode_t*)opc; 127 127 } … … 153 153 { 154 154 kite_opcode_jump_true *op = ALLOCATE_OPCODE(kite_opcode_jump_true); 155 op-> jumpto = jumpto;156 op-> common.opcode = JUMP_TRUE;155 op->op_arg.jumpto = jumpto; 156 op->opcode = JUMP_TRUE; 157 157 return (kite_opcode_t*)op; 158 158 } … … 164 164 { 165 165 kite_opcode_jump_false *op = ALLOCATE_OPCODE(kite_opcode_jump_false); 166 op-> jumpto = jumpto;167 op-> common.opcode = JUMP_FALSE;166 op->op_arg.jumpto = jumpto; 167 op->opcode = JUMP_FALSE; 168 168 return (kite_opcode_t*)op; 169 169 } … … 175 175 { 176 176 kite_opcode_jump_unconditional *op = ALLOCATE_OPCODE(kite_opcode_jump_unconditional); 177 op-> jumpto = jumpto;178 op-> common.opcode = JUMP_UNCOND;177 op->op_arg.jumpto = jumpto; 178 op->opcode = JUMP_UNCOND; 179 179 return (kite_opcode_t*)op; 180 180 } … … 187 187 kite_opcode_exception_hndl *op = 188 188 ALLOCATE_OPCODE(kite_opcode_exception_hndl); 189 op-> handler = handler;190 op-> common.opcode = EXCEPTION_HNDL;189 op->op_arg.handler = handler; 190 op->opcode = EXCEPTION_HNDL; 191 191 return (kite_opcode_t*)op; 192 192 } … … 210 210 kite_opcode_dupe_top *opc = 211 211 (kite_opcode_dupe_top*)ALLOCATE_OPCODE(kite_opcode_dupe_top); 212 opc-> common.opcode = DUPE_TOP;213 opc-> dupe_ref = dupe_ref;212 opc->opcode = DUPE_TOP; 213 opc->op_arg.dupe_ref = dupe_ref; 214 214 return (kite_opcode_t*)opc; 215 215 } … … 221 221 { 222 222 kite_opcode_funcargs *op = ALLOCATE_OPCODE(kite_opcode_funcargs); 223 op-> args = args;224 op-> common.opcode = FUNCARGS;223 op->op_arg.args = args; 224 op->opcode = FUNCARGS; 225 225 return (kite_opcode_t*)op; 226 226 } … … 282 282 { 283 283 kite_opcode_objis *op = ALLOCATE_OPCODE(kite_opcode_objis); 284 op-> isof = isof;285 op-> common.opcode = IS_ISOF;284 op->op_arg.isof = isof; 285 op->opcode = IS_ISOF; 286 286 return (kite_opcode_t*)op; 287 287 } … … 291 291 ****************************************************************************/ 292 292 kite_opcode_t * 293 kite_add_to_instruction_list(kite_opcode_t **list, kite_opcode_t *opc) 294 { 293 kite_add_to_instruction_list(kite_thread_t *thd, kite_opcode_t **list, kite_opcode_t *opc) 294 { 295 #if 0 295 296 kite_opcode_t *cur = *list; 296 297 … … 307 308 cur->next = opc; 308 309 return opc; 310 #else 311 char *insert_loc; 312 313 #ifdef WIN32 314 WaitForSingleObject(thd->vm->compile_mtx, INFINITE); 315 #else 316 pthread_mutex_lock(&thd->vm->compile_mtx); 317 #endif /* WIN32 */ 318 319 if (sizeof(kite_opcode_t) + thd->vm->cur_text_segment >= thd->vm->text_segment_length) 320 { 321 thd->vm->text_segment_length *= 2; 322 #ifndef HAVE_GC_H 323 thd->vm->text_segment = (kite_vm_t*)realloc(thd->vm->text_segment, thd->vm->text_segment_length); 324 #else 325 thd->vm->text_segment = (kite_vm_t*)GC_realloc(thd->vm->text_segment, thd->vm->text_segment_length); 326 #endif /* HAVE_GC_H */ 327 } 328 329 insert_loc = (char*)thd->vm->text_segment + thd->vm->cur_text_segment; 330 if (*list == NULL) 331 { 332 *list = insert_loc - (char*)thd->vm->text_segment; 333 } 334 335 memcpy(insert_loc, opc, sizeof(kite_opcode_t)); 336 #ifndef HAVE_GC_H 337 free(opc); 338 #endif /* HAVE_GC_H */ 339 340 thd->vm->cur_text_segment += sizeof(kite_opcode_t); 341 342 #ifdef WIN32 343 ReleaseMutex(thd->vm->compile_mtx); 344 #else 345 pthread_mutex_unlock(&thd->vm->compile_mtx); 346 #endif /* WIN32 */ 347 348 return insert_loc - (char*)thd->vm->text_segment; 349 #endif /* 0 */ 309 350 } 310 351 … … 314 355 void kite_free_instruction_list(kite_thread_t *thd, kite_opcode_t *opc) 315 356 { 357 #if 0 316 358 kite_opcode_t *tmp; 317 359 (void)thd; … … 326 368 #endif /* HAVE_GC_H */ 327 369 } 370 #endif /* 0 */ 328 371 } 329 372 … … 331 374 * Copy instruction list 332 375 ****************************************************************************/ 333 kite_opcode_t *kite_copy_instruction_list(kite_thread_t *thd, kite_opcode_t *opc) 334 { 376 kite_opcode_t *kite_copy_instruction_list(kite_thread_t *thd, kite_object_t *obj, kite_opcode_t *opc) 377 { 378 #if 0 335 379 kite_opcode_t *ret, *cur; 336 380 (void)thd; … … 373 417 374 418 return ret; 375 } 376 419 #else 420 char *insert_loc; 421 422 #ifdef WIN32 423 WaitForSingleObject(thd->vm->compile_mtx, INFINITE); 424 #else 425 pthread_mutex_lock(&thd->vm->compile_mtx); 426 #endif /* WIN32 */ 427 428 insert_loc = opc - (long)thd->vm->text_segment; 429 430 #ifdef WIN32 431 ReleaseMutex(thd->vm->compile_mtx); 432 #else 433 pthread_mutex_unlock(&thd->vm->compile_mtx); 434 #endif /* WIN32 */ 435 436 return insert_loc; 437 #endif /* 0 */ 438 } 439 -
interpreter/trunk/backend/kite-vm-1.0/kite_opcodes.h
r594 r619 28 28 ****************************************************************************/ 29 29 30 struct kite_object_t; 31 30 32 /* 31 33 * Base VM opcode object … … 35 37 unsigned int opcode; 36 38 unsigned int length; 39 union 40 { 41 unsigned int operation; /* arthop */ 42 struct kite_object_t *obj; /* push */ 43 int create; /* deref_1 */ 44 struct kite_opcode_t *jumpto; /* jump_* */ 45 struct kite_opcode_t *handler; /* exception_hndl */ 46 int dupe_ref; /* dupe_top */ 47 int isof; /* objis */ 48 struct kite_object_t *args; /* funcargs */ 49 } op_arg; 37 50 char *file; 38 int line; 39 struct kite_opcode_t *next; 51 int line; /* For alignment purposes */ 40 52 } kite_opcode_t; 41 53 … … 43 55 * VM arithmetic operation 44 56 */ 45 typedef struct kite_opcode_arithop 46 { 47 kite_opcode_t common; 48 unsigned int operation; 49 } kite_opcode_arithop; 57 typedef struct kite_opcode_t kite_opcode_arithop; 50 58 51 59 /* 52 60 * Push object onto execution stack 53 61 */ 54 struct kite_object_t; 55 typedef struct kite_opcode_push 56 { 57 kite_opcode_t common; 58 struct kite_object_t *obj; 59 } kite_opcode_push; 62 typedef struct kite_opcode_t kite_opcode_push; 60 63 61 64 /* 62 65 * Combine two elements (or an element and a list) into a single list 63 66 */ 64 typedef struct kite_opcode_list_cons 65 { 66 kite_opcode_t common; 67 } kite_opcode_list_cons; 67 typedef struct kite_opcode_t kite_opcode_list_cons; 68 68 69 69 /* 70 70 * Create an empty list. 71 71 */ 72 typedef struct kite_opcode_list_cons_0 73 { 74 kite_opcode_t common; 75 } kite_opcode_list_cons_0; 72 typedef struct kite_opcode_t kite_opcode_list_cons_0; 76 73 77 74 /* 78 75 * Make list out of a single element 79 76 */ 80 typedef struct kite_opcode_list_cons_1 81 { 82 kite_opcode_t common; 83 } kite_opcode_list_cons_1; 77 typedef struct kite_opcode_t kite_opcode_list_cons_1; 84 78 85 79 /* 86 80 * Dereference an object 87 81 */ 88 typedef struct kite_opcode_deref_1 89 { 90 kite_opcode_t common; 91 int create; 92 } kite_opcode_deref_1; 82 typedef struct kite_opcode_t kite_opcode_deref_1; 93 83 94 84 /* 95 85 * Dereference an object (and retrieve property) 96 86 */ 97 typedef struct kite_opcode_deref_2 98 { 99 kite_opcode_t common; 100 } kite_opcode_deref_2; 87 typedef struct kite_opcode_t kite_opcode_deref_2; 101 88 102 89 /* 103 90 * Call method 104 91 */ 105 typedef struct kite_opcode_call 106 { 107 kite_opcode_t common; 108 } kite_opcode_call; 92 typedef struct kite_opcode_t kite_opcode_call; 109 93 110 94 /* 111 95 * Jump if true 112 96 */ 113 typedef struct kite_opcode_jump_true 114 { 115 kite_opcode_t common; 116 kite_opcode_t *jumpto; 117 } kite_opcode_jump_true; 97 typedef struct kite_opcode_t kite_opcode_jump_true; 118 98 119 99 /* 120 100 * Jump if false 121 101 */ 122 typedef struct kite_opcode_jump_false 123 { 124 kite_opcode_t common; 125 kite_opcode_t *jumpto; 126 } kite_opcode_jump_false; 102 typedef struct kite_opcode_t kite_opcode_jump_false; 127 103 128 104 /* 129 105 * Jump unconditional 130 106 */ 131 typedef struct kite_opcode_jump_unconditional 132 { 133 kite_opcode_t common; 134 kite_opcode_t *jumpto; 135 } kite_opcode_jump_unconditional; 107 typedef struct kite_opcode_t kite_opcode_jump_unconditional; 136 108 137 109 /* 138 110 * Handle exception 139 111 */ 140 typedef struct kite_opcode_exception_hndl 141 { 142 kite_opcode_t common; 143 kite_opcode_t *handler; 144 } kite_opcode_exception_hndl; 112 typedef struct kite_opcode_t kite_opcode_exception_hndl; 145 113 146 114 /* 147 115 * Handle exception 148 116 */ 149 typedef struct kite_opcode_pop_exception_hndl 150 { 151 kite_opcode_t common; 152 } kite_opcode_pop_exception_hndl; 117 typedef struct kite_opcode_t kite_opcode_pop_exception_hndl; 153 118 154 119 /* 155 120 * Duplicate top of stack 156 121 */ 157 typedef struct kite_opcode_dupe_top 158 { 159 kite_opcode_t common; 160 int dupe_ref; 161 } kite_opcode_dupe_top; 122 typedef struct kite_opcode_t kite_opcode_dupe_top; 162 123 163 124 /* 164 125 * Create instance of object 165 126 */ 166 typedef struct kite_opcode_make 167 { 168 kite_opcode_t common; 169 } kite_opcode_make; 127 typedef struct kite_opcode_t kite_opcode_make; 170 128 171 129 /* 172 130 * is/isof evaluation 173 131 */ 174 typedef struct kite_opcode_objis 175 { 176 kite_opcode_t common; 177 int isof; 178 } kite_opcode_objis; 132 typedef struct kite_opcode_t kite_opcode_objis; 179 133 180 134 /* 181 135 * Evaluate code 182 136 */ 183 typedef struct kite_opcode_eval 184 { 185 kite_opcode_t common; 186 } kite_opcode_eval; 137 typedef struct kite_opcode_t kite_opcode_eval; 187 138 188 139 /* 189 140 * No op. 190 141 */ 191 typedef struct kite_opcode_nop 192 { 193 kite_opcode_t common; 194 } kite_opcode_nop; 142 typedef struct kite_opcode_t kite_opcode_nop; 195 143 196 144 /* 197 145 * Return 198 146 */ 199 typedef struct kite_opcode_return 200 { 201 kite_opcode_t common; 202 } kite_opcode_return; 147 typedef struct kite_opcode_t kite_opcode_return; 203 148 204 149 /* 205 150 * Put variables onto function stack 206 151 */ 207 typedef struct kite_opcode_funcargs 208 { 209 kite_opcode_t common; 210 struct kite_object_t *args; 211 } kite_opcode_funcargs; 152 typedef struct kite_opcode_t kite_opcode_funcargs; 212 153 213 154 /* 214 155 * Define property/variable. 215 156 */ 216 typedef struct kite_opcode_defprop 217 { 218 kite_opcode_t common; 219 } kite_opcode_defprop; 157 typedef struct kite_opcode_t kite_opcode_defprop; 220 158 221 159 /* 222 160 * Get "this". 223 161 */ 224 typedef struct kite_opcode_this 225 { 226 kite_opcode_t common; 227 } kite_opcode_this; 162 typedef struct kite_opcode_t kite_opcode_this; 228 163 229 164 /* … … 290 225 */ 291 226 struct kite_thread_t; 227 #if 0 292 228 KITE_EXPORT kite_opcode_t *kite_add_to_instruction_list(kite_opcode_t **, kite_opcode_t *); 293 229 void kite_free_instruction_list(struct kite_thread_t *, kite_opcode_t *); 294 230 kite_opcode_t *kite_copy_instruction_list(struct kite_thread_t *, kite_opcode_t *); 231 #else 232 KITE_EXPORT kite_opcode_t *kite_add_to_instruction_list(struct kite_thread_t *, kite_opcode_t **, kite_opcode_t *); 233 void kite_free_instruction_list(struct kite_thread_t *, kite_opcode_t *); 234 kite_opcode_t *kite_copy_instruction_list(struct kite_thread_t *, kite_object_t *, kite_opcode_t *); 235 void COMPILE_INSTRUCTION2(kite_thread_t *thd, kite_compiler_t *compiler, kite_opcode_t *inst, int lno, void **dest); 236 #endif /* 0 */ 295 237 296 238 #endif /* KITE_VM__KITE_OPCODES_H */ -
interpreter/trunk/modules/System.kt
r478 r619 38 38 import "System.object"; 39 39 import "System.string"; 40 import "System.regex"; -
interpreter/trunk/modules/System/integer.c
r594 r619 31 31 /* Common code for the integer operations */ 32 32 #define PERFORM_INTEGER_OPERATION(op) \ 33 result = this->builtin_data.intvalue op rhs->builtin_data.intvalue; \33 result = KITE_GET_INTEGER(this) op KITE_GET_INTEGER(rhs); \ 34 34 kite_vm_return(thd, kite_new_integer(thd, result)); 35 35 36 36 #define PERFORM_INTEGER_BOOLEAN_OPERATION(op) \ 37 result = this->builtin_data.intvalue op rhs->builtin_data.intvalue; \37 result = KITE_GET_INTEGER(this) op KITE_GET_INTEGER(rhs); \ 38 38 kite_vm_return(thd, kite_new_boolean(thd, result)); 39 39 -
interpreter/trunk/modules/System/object.c
r617 r619 62 62 63 63 struct kite_opcode_t; 64 extern struct kite_opcode_t *kite_copy_instruction_list(kite_thread_t *thd, struct kite_opcode_t *opc);64 extern struct kite_opcode_t *kite_copy_instruction_list(kite_thread_t *thd, kite_object_t *obj, struct kite_opcode_t *opc); 65 65 66 66 /***************************************************************************** … … 264 264 kite_object_t *rhs = args; 265 265 266 assert(rhs && this->owner_thread ->vm == rhs->owner_thread->vm);266 assert(rhs && this->owner_thread == thd); 267 267 268 268 kite_dereference_object(this->parent); … … 292 292 this->builtin_data.funcvalue.funcptr != NULL) { 293 293 this->builtin_data.funcvalue.funcptr = 294 kite_copy_instruction_list(thd, this ->builtin_data.funcvalue.funcptr);294 kite_copy_instruction_list(thd, this, this->builtin_data.funcvalue.funcptr); 295 295 } 296 296 297 297 free(this->object_data.name); 298 if (rhs->object_data.name) { 299 this->object_data.name = strdup(rhs->object_data.name); 300 } else { 301 this->object_data.name = NULL; 302 } 303 if (this->object_data.inherit_from) { 304 kite_dereference_object(this->object_data.inherit_from); 305 } 306 this->object_data.inherit_from = 307 kite_reference_object(rhs->object_data.inherit_from); 308 if (this->object_data.properties) { 309 kite_destruct_symtab(thd, &this->object_data.properties, FALSE); 310 this->object_data.properties = NULL; 311 } 312 if (rhs->object_data.properties) 313 kite_copy_symtab(&this->object_data.properties, 314 rhs->object_data.properties); 298 if (rhs->type != OBJ_INTEGER && 299 rhs->type != OBJ_FLOAT && 300 rhs->type != OBJ_BOOLEAN) 301 { 302 if (rhs->object_data.name) { 303 this->object_data.name = strdup(rhs->object_data.name); 304 } else { 305 this->object_data.name = NULL; 306 } 307 if (this->object_data.inherit_from) { 308 kite_dereference_object(this->object_data.inherit_from); 309 } 310 this->object_data.inherit_from = 311 kite_reference_object(rhs->object_data.inherit_from); 312 if (this->object_data.properties) { 313 kite_destruct_symtab(thd, &this->object_data.properties, FALSE); 314 this->object_data.properties = NULL; 315 } 316 if (rhs->object_data.properties) 317 kite_copy_symtab(&this->object_data.properties, 318 rhs->object_data.properties); 319 } 315 320 316 321 kite_vm_return(thd, this); -
interpreter/trunk/objs/kite_obj_create.c
r601 r619 49 49 * Create a new instance of a class which doesn't call destructors. 50 50 ****************************************************************************/ 51 static kite_ object_t *kite_new_instance_nodestruct(kite_thread_t *thd, kite_object_t *class) {51 static kite_basic_object_t *kite_new_instance_nodestruct(kite_thread_t *thd, kite_basic_object_t *class) { 52 52 kite_object_t *newobj = NULL; 53 53 … … 86 86 ****************************************************************************/ 87 87 kite_object_t *kite_new_integer(kite_thread_t *thd, long val) { 88 kite_object_t *newobj = NULL, *cls; 88 kite_basic_object_t *newobj = NULL; 89 kite_object_t *cls; 89 90 assert(thd != NULL); 90 91 … … 110 111 ****************************************************************************/ 111 112 kite_object_t *kite_new_float(kite_thread_t *thd, double val) { 112 kite_object_t *newobj = NULL, *cls; 113 kite_basic_object_t *newobj = NULL; 114 kite_object_t *cls; 113 115 assert(thd != NULL); 114 116 … … 226 228 ****************************************************************************/ 227 229 kite_object_t *kite_new_boolean(kite_thread_t *thd, int val) { 228 kite_object_t *newobj = NULL, *cls; 230 kite_basic_object_t *newobj = NULL; 231 kite_object_t *cls; 229 232 assert(thd != NULL); 230 233 … … 492 495 #endif /* HAVE_GC_H */ 493 496 494 if (us->parent && r) { 495 kite_dereference_object(us->parent); 496 us->parent = NULL; 497 } 498 497 if (us->type != OBJ_BOOLEAN && 498 us->type != OBJ_INTEGER && 499 us->type != OBJ_FLOAT) 500 { 501 if (us->parent && r) { 502 kite_dereference_object(us->parent); 503 us->parent = NULL; 504 } 505 } 506 499 507 /* Free list objects and string values */ 500 508 if (us->type == OBJ_LIST && r) { -
interpreter/trunk/objs/kite_obj_manip.c
r506 r619 166 166 167 167 if (entry->value) kite_dereference_object(entry->value); 168 else val->parent = kite_reference_object(obj); 168 else 169 { 170 if (val->type != OBJ_BOOLEAN && 171 val->type != OBJ_INTEGER && 172 val->type != OBJ_FLOAT) 173 { 174 val->parent = kite_reference_object(obj); 175 } 176 } 169 177 entry->value = kite_reference_object(val); 170 178 return; -
interpreter/trunk/objs/kite_object.h
r618 r619 119 119 int numargs /*! The number of arguments for the given method. */; 120 120 struct kite_object_t *arginfo /*! A Kite list with names and documentation for each argument. */; 121 size_t length /*! Length of function, in bytes. */; 121 122 } kite_function_t; 122 123 … … 912 913 * and OBJ_BOOLEAN. No error checking is performed. 913 914 */ 914 #define KITE_GET_INTEGER(v) (( v)->builtin_data.intvalue)915 #define KITE_GET_INTEGER(v) (((kite_basic_object_t*)v)->builtin_data.intvalue) 915 916 916 917 /** … … 920 921 * No error checking is performed. 921 922 */ 922 #define KITE_GET_FLOAT(v) (( v)->builtin_data.floatvalue)923 #define KITE_GET_FLOAT(v) (((kite_basic_object_t*)v)->builtin_data.floatvalue) 923 924 924 925 /** -
interpreter/trunk/objs/kite_stack.c
r601 r619 39 39 kite_stack_entry_t *entry; 40 40 41 assert(st != NULL && obj != NULL);41 assert(st != NULL && (ref == FALSE || obj != NULL)); 42 42 cur = *st; 43 43 -
interpreter/trunk/objs/kite_symtab.c
r523 r619 95 95 #endif /* HAVE_GC_H */ 96 96 kite_reference_object(newVal->value); 97 newVal->value->parent = p; 97 if (newVal->value->type != OBJ_BOOLEAN && 98 newVal->value->type != OBJ_INTEGER && 99 newVal->value->type != OBJ_FLOAT) 100 { 101 newVal->value->parent = p; 102 } 98 103 kite_reference_object(p); 99 104 kite_symtab_insert(thd, dest, newVal);
Note: See TracChangeset
for help on using the changeset viewer.
