Home | History | Annotate | Download | only in interp

Lines Matching refs:shadowSpace

37 /* Allocate space for per-thread ShadowSpace data structures */
40 self->shadowSpace = (ShadowSpace*) calloc(1, sizeof(ShadowSpace));
41 if (self->shadowSpace == NULL)
44 self->shadowSpace->registerSpaceSize = REG_SPACE;
45 self->shadowSpace->registerSpace =
46 (int*) calloc(self->shadowSpace->registerSpaceSize, sizeof(int));
48 return self->shadowSpace->registerSpace;
51 /* Free per-thread ShadowSpace data structures */
54 free(self->shadowSpace->registerSpace);
55 free(self->shadowSpace);
66 ShadowSpace *shadowSpace = self->shadowSpace;
73 if (shadowSpace->selfVerificationState != kSVSIdle) {
75 self->threadId, shadowSpace->selfVerificationState);
79 shadowSpace->selfVerificationState = kSVSStart;
96 if (preBytes + postBytes > shadowSpace->registerSpaceSize * sizeof(u4)) {
97 free(shadowSpace->registerSpace);
98 shadowSpace->registerSpaceSize = (preBytes + postBytes) / sizeof(u4);
99 shadowSpace->registerSpace =
100 (int*) calloc(shadowSpace->registerSpaceSize, sizeof(u4));
104 shadowSpace->startPC = pc;
105 shadowSpace->fp = fp;
106 shadowSpace->glue = interpState;
111 shadowSpace->method = interpState->method;
112 shadowSpace->shadowFP = shadowSpace->registerSpace +
113 shadowSpace->registerSpaceSize - postBytes/4;
116 memcpy(&(shadowSpace->interpState), interpState, sizeof(InterpState));
117 shadowSpace->interpState.fp = shadowSpace->shadowFP;
118 shadowSpace->interpState.interpStackEnd = (u1*)shadowSpace->registerSpace;
121 memcpy(((char*)shadowSpace->shadowFP)-preBytes, ((char*)fp)-preBytes,
125 shadowSpace->heapSpaceTail = shadowSpace->heapSpace;
128 shadowSpace->traceLength = 0;
130 return shadowSpace;
141 ShadowSpace *shadowSpace = self->shadowSpace;
143 InterpState *realGlue = shadowSpace->glue;
144 shadowSpace->endPC = pc;
145 shadowSpace->endShadowFP = fp;
146 shadowSpace->jitExitState = exitState;
149 // self->threadId, (int)shadowSpace->startPC, (int)shadowSpace->fp,
152 if (shadowSpace->selfVerificationState != kSVSStart) {
154 self->threadId, shadowSpace->selfVerificationState);
156 LOGD("Dalvik PC: 0x%x endPC: 0x%x", (int)shadowSpace->startPC,
157 (int)shadowSpace->endPC);
158 LOGD("Interp FP: 0x%x", (int)shadowSpace->fp);
159 LOGD("Shadow FP: 0x%x endFP: 0x%x", (int)shadowSpace->shadowFP,
160 (int)shadowSpace->endShadowFP);
166 realGlue->jitResumeNPC = shadowSpace->interpState.jitResumeNPC;
167 realGlue->jitResumeDPC = shadowSpace->interpState.jitResumeDPC;
174 if (exitState == kSVSPunt && pc == shadowSpace->startPC) {
175 shadowSpace->selfVerificationState = kSVSIdle;
176 } else if (exitState == kSVSBackwardBranch && pc < shadowSpace->startPC) {
186 * instruction in the loop, pc is equal to shadowSpace->startPC and
198 shadowSpace->selfVerificationState = kSVSNormal;
200 shadowSpace->selfVerificationState = exitState;
203 return shadowSpace;
216 /* Print values maintained in shadowSpace */
219 ShadowSpace* shadowSpace = self->shadowSpace;
221 int frameBytes = (int) shadowSpace->registerSpace +
222 shadowSpace->registerSpaceSize*4 -
223 (int) shadowSpace->shadowFP;
226 if (self->curFrame < shadowSpace->fp) {
229 frameBytes2 = (int) shadowSpace->fp - (int) self->curFrame - localRegs;
234 LOGD("Class: %s", shadowSpace->method->clazz->descriptor);
235 LOGD("Method: %s", shadowSpace->method->name);
236 LOGD("Dalvik PC: 0x%x endPC: 0x%x", (int)shadowSpace->startPC,
237 (int)shadowSpace->endPC);
238 LOGD("Interp FP: 0x%x endFP: 0x%x", (int)shadowSpace->fp,
240 LOGD("Shadow FP: 0x%x endFP: 0x%x", (int)shadowSpace->shadowFP,
241 (int)shadowSpace->endShadowFP);
244 LOGD("Trace length: %d State: %d", shadowSpace->traceLength,
245 shadowSpace->selfVerificationState);
251 ShadowSpace* shadowSpace = self->shadowSpace;
257 for (i = 0; i < shadowSpace->traceLength; i++) {
258 addr = shadowSpace->trace[i].addr;
260 decInsn = &(shadowSpace->trace[i].decInsn);
268 static void selfVerificationSpinLoop(ShadowSpace *shadowSpace)
270 const u2 *startPC = shadowSpace->startPC;
287 ShadowSpace *shadowSpace = self->shadowSpace;
288 SelfVerificationState state = shadowSpace->selfVerificationState;
294 // self->threadId, (int)pc, (int)shadowSpace->endPC, state,
295 // shadowSpace->traceLength, dexGetOpcodeName(decInsn.opCode));
308 if ((state == kSVSBackwardBranch && pc == shadowSpace->endPC) ||
310 shadowSpace->selfVerificationState = kSVSDebugInterp;
315 pc == shadowSpace->endPC) {
317 shadowSpace->selfVerificationState = kSVSIdle;
320 int frameBytes = (int) shadowSpace->registerSpace +
321 shadowSpace->registerSpaceSize*4 -
322 (int) shadowSpace->shadowFP;
323 if (memcmp(shadowSpace->fp, shadowSpace->shadowFP, frameBytes)) {
328 (int)shadowSpace->fp, frameBytes);
329 selfVerificationPrintRegisters((int*)shadowSpace->fp,
330 (int*)shadowSpace->shadowFP,
333 (int)shadowSpace->shadowFP, frameBytes);
334 selfVerificationPrintRegisters((int*)shadowSpace->shadowFP,
335 (int*)shadowSpace->fp,
337 selfVerificationSpinLoop(shadowSpace);
340 if (self->curFrame < shadowSpace->fp) {
344 int frameBytes2 = (int) shadowSpace->fp -
347 ((char*)shadowSpace->endShadowFP)+localRegs, frameBytes2)) {
355 (int*)shadowSpace->endShadowFP,
358 (int)shadowSpace->endShadowFP, localRegs, frameBytes2);
359 selfVerificationPrintRegisters((int*)shadowSpace->endShadowFP,
362 selfVerificationSpinLoop(shadowSpace);
369 for (heapSpacePtr = shadowSpace->heapSpace;
370 heapSpacePtr != shadowSpace->heapSpaceTail; heapSpacePtr++) {
381 if (memDiff) selfVerificationSpinLoop(shadowSpace);
393 } else if (shadowSpace->traceLength >= JIT_MAX_TRACE_LEN) {
396 (int)shadowSpace->startPC, (int)shadowSpace->endPC, (int)pc);
399 selfVerificationSpinLoop(shadowSpace);
404 shadowSpace->trace[shadowSpace
405 shadowSpace->trace[shadowSpace->traceLength].decInsn = decInsn;
406 shadowSpace->traceLength++;