aload.c
1 /* 2 * Bean Java VM 3 * Copyright (C) 2005-2015 Christian Lins <christian@lins.me> 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #include <stdlib.h> 19 20 #include <vm.h> 21 22 /* Load reference from local variable. */ 23 void do_ALOAD(Thread *thread) 24 { 25 dbgmsg("Not implemented"); 26 exit(-10); 27 /*struct OperandStackFrame obj; */ 28 29 /* Load var from LocalVarArray */ 30 31 /* Push obj onto the stack */ 32 33 } 34 35 /* Pushes object reference from local vars [0] onto the stack 36 var[0] is always the reference to the local class (this). */ 37 void do_ALOADi(Thread *thread, uint8_t localVarIndex) 38 { 39 Stackframe* frame = current_frame(thread); 40 Varframe* localVar = malloc(sizeof(Varframe)); 41 42 #ifdef DEBUG 43 printf("\tALOAD_%u\n", localVarIndex); 44 #endif 45 assert(frame->localVarsLen > localVarIndex); 46 47 48 /* Values from the operand stack may be freed somewhere, so we 49 * need a deep copy of the local var array value */ 50 // *localVar = stackframe->localVars[localVarIndex]; 51 52 /* Push value to operand stack */ 53 Stack_push(&(frame->operandStack), localVar); 54 } 55 56 void do_IALOAD(Thread *thread) 57 { 58 dbgmsg("Not implemented"); 59 exit(-10); 60 } 61 62 void do_LALOAD(Thread *thread) 63 { 64 dbgmsg("Not implemented"); 65 exit(-10); 66 } 67 68 void do_FALOAD(Thread *thread) 69 { 70 dbgmsg("Not implemented"); 71 exit(-10); 72 } 73 74 void do_DALOAD(Thread *thread) 75 { 76 dbgmsg("Not implemented"); 77 exit(-10); 78 } 79 80 void do_AALOAD(Thread *thread) 81 { 82 dbgmsg("Not implemented"); 83 exit(-10); 84 } 85 86 void do_BALOAD(Thread *thread) 87 { 88 dbgmsg("Not implemented"); 89 exit(-10); 90 } 91 92 void do_CALOAD(Thread *thread) 93 { 94 dbgmsg("Not implemented"); 95 exit(-10); 96 } 97 98 void do_SALOAD(Thread *thread) 99 { 100 dbgmsg("Not implemented"); 101 exit(-10); 102 }