85 // grows negative)
86 __ jcc(Assembler::aboveEqual, L); // check if frame is complete
87 __ stop ("interpreter frame not set up");
88 __ bind(L);
89 }
90 #endif // ASSERT
91 // Restore bcp under the assumption that the current frame is still
92 // interpreted
93 __ restore_bcp();
94
95 // expression stack must be empty before entering the VM if an
96 // exception happened
97 __ empty_expression_stack();
98 // throw exception
99 __ call_VM(noreg,
100 CAST_FROM_FN_PTR(address,
101 InterpreterRuntime::throw_StackOverflowError));
102 return entry;
103 }
104
105 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler(
106 const char* name) {
107 address entry = __ pc();
108 // expression stack must be empty before entering the VM if an
109 // exception happened
110 __ empty_expression_stack();
111 // setup parameters
112 // ??? convention: expect aberrant index in register ebx
113 Register rarg = NOT_LP64(rax) LP64_ONLY(c_rarg1);
114 __ lea(rarg, ExternalAddress((address)name));
115 __ call_VM(noreg,
116 CAST_FROM_FN_PTR(address,
117 InterpreterRuntime::
118 throw_ArrayIndexOutOfBoundsException),
119 rarg, rbx);
120 return entry;
121 }
122
123 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
124 address entry = __ pc();
125
126 // object is at TOS
127 Register rarg = NOT_LP64(rax) LP64_ONLY(c_rarg1);
128 __ pop(rarg);
129
130 // expression stack must be empty before entering the VM if an
131 // exception happened
132 __ empty_expression_stack();
133
134 __ call_VM(noreg,
|
85 // grows negative)
86 __ jcc(Assembler::aboveEqual, L); // check if frame is complete
87 __ stop ("interpreter frame not set up");
88 __ bind(L);
89 }
90 #endif // ASSERT
91 // Restore bcp under the assumption that the current frame is still
92 // interpreted
93 __ restore_bcp();
94
95 // expression stack must be empty before entering the VM if an
96 // exception happened
97 __ empty_expression_stack();
98 // throw exception
99 __ call_VM(noreg,
100 CAST_FROM_FN_PTR(address,
101 InterpreterRuntime::throw_StackOverflowError));
102 return entry;
103 }
104
105 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler() {
106 address entry = __ pc();
107 // expression stack must be empty before entering the VM if an
108 // exception happened
109 __ empty_expression_stack();
110 // setup parameters
111 // ??? convention: expect aberrant index in register ebx
112 Register rarg = NOT_LP64(rax) LP64_ONLY(c_rarg1);
113 // Pass array to create more detailed exceptions.
114 __ call_VM(noreg,
115 CAST_FROM_FN_PTR(address,
116 InterpreterRuntime::
117 throw_ArrayIndexOutOfBoundsException),
118 rarg, rbx);
119 return entry;
120 }
121
122 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
123 address entry = __ pc();
124
125 // object is at TOS
126 Register rarg = NOT_LP64(rax) LP64_ONLY(c_rarg1);
127 __ pop(rarg);
128
129 // expression stack must be empty before entering the VM if an
130 // exception happened
131 __ empty_expression_stack();
132
133 __ call_VM(noreg,
|