316 // grows negative)
317 __ br(Assembler::HS, L); // check if frame is complete
318 __ stop ("interpreter frame not set up");
319 __ bind(L);
320 }
321 #endif // ASSERT
322 // Restore bcp under the assumption that the current frame is still
323 // interpreted
324 __ restore_bcp();
325
326 // expression stack must be empty before entering the VM if an
327 // exception happened
328 __ empty_expression_stack();
329 // throw exception
330 __ call_VM(noreg,
331 CAST_FROM_FN_PTR(address,
332 InterpreterRuntime::throw_StackOverflowError));
333 return entry;
334 }
335
336 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler(
337 const char* name) {
338 address entry = __ pc();
339 // expression stack must be empty before entering the VM if an
340 // exception happened
341 __ empty_expression_stack();
342 // setup parameters
343 // ??? convention: expect aberrant index in register r1
344 __ movw(c_rarg2, r1);
345 __ mov(c_rarg1, (address)name);
346 __ call_VM(noreg,
347 CAST_FROM_FN_PTR(address,
348 InterpreterRuntime::
349 throw_ArrayIndexOutOfBoundsException),
350 c_rarg1, c_rarg2);
351 return entry;
352 }
353
354 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
355 address entry = __ pc();
356
357 // object is at TOS
358 __ pop(c_rarg1);
359
360 // expression stack must be empty before entering the VM if an
361 // exception happened
362 __ empty_expression_stack();
363
364 __ call_VM(noreg,
365 CAST_FROM_FN_PTR(address,
|
316 // grows negative)
317 __ br(Assembler::HS, L); // check if frame is complete
318 __ stop ("interpreter frame not set up");
319 __ bind(L);
320 }
321 #endif // ASSERT
322 // Restore bcp under the assumption that the current frame is still
323 // interpreted
324 __ restore_bcp();
325
326 // expression stack must be empty before entering the VM if an
327 // exception happened
328 __ empty_expression_stack();
329 // throw exception
330 __ call_VM(noreg,
331 CAST_FROM_FN_PTR(address,
332 InterpreterRuntime::throw_StackOverflowError));
333 return entry;
334 }
335
336 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler() {
337 address entry = __ pc();
338 // expression stack must be empty before entering the VM if an
339 // exception happened
340 __ empty_expression_stack();
341 // setup parameters
342
343 // ??? convention: expect aberrant index in register r1
344 __ movw(c_rarg2, r1);
345 // ??? convention: expect array in register r3
346 __ mov(c_rarg1, r3);
347 __ call_VM(noreg,
348 CAST_FROM_FN_PTR(address,
349 InterpreterRuntime::
350 throw_ArrayIndexOutOfBoundsException),
351 c_rarg1, c_rarg2);
352 return entry;
353 }
354
355 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
356 address entry = __ pc();
357
358 // object is at TOS
359 __ pop(c_rarg1);
360
361 // expression stack must be empty before entering the VM if an
362 // exception happened
363 __ empty_expression_stack();
364
365 __ call_VM(noreg,
366 CAST_FROM_FN_PTR(address,
|