comparison src/share/vm/interpreter/interpreterRuntime.cpp @ 3464:be4ca325525a

Merge.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Jul 2011 17:32:44 -0700
parents 5ca1332171c8 38fa55e5e792
children 04b9a2566eec
comparison
equal deleted inserted replaced
3239:7c4b4daac19b 3464:be4ca325525a
137 assert(bytecode == Bytecodes::_fast_aldc || 137 assert(bytecode == Bytecodes::_fast_aldc ||
138 bytecode == Bytecodes::_fast_aldc_w, "wrong bc"); 138 bytecode == Bytecodes::_fast_aldc_w, "wrong bc");
139 ResourceMark rm(thread); 139 ResourceMark rm(thread);
140 methodHandle m (thread, method(thread)); 140 methodHandle m (thread, method(thread));
141 Bytecode_loadconstant ldc(m, bci(thread)); 141 Bytecode_loadconstant ldc(m, bci(thread));
142 oop result = ldc.resolve_constant(THREAD); 142 oop result = ldc.resolve_constant(CHECK);
143 DEBUG_ONLY(ConstantPoolCacheEntry* cpce = m->constants()->cache()->entry_at(ldc.cache_index())); 143 #ifdef ASSERT
144 assert(result == cpce->f1(), "expected result for assembly code"); 144 {
145 // The bytecode wrappers aren't GC-safe so construct a new one
146 Bytecode_loadconstant ldc2(m, bci(thread));
147 ConstantPoolCacheEntry* cpce = m->constants()->cache()->entry_at(ldc2.cache_index());
148 assert(result == cpce->f1(), "expected result for assembly code");
149 }
150 #endif
145 } 151 }
146 IRT_END 152 IRT_END
147 153
148 154
149 //------------------------------------------------------------------------------------------------------------------------ 155 //------------------------------------------------------------------------------------------------------------------------
353 } 359 }
354 360
355 // create exception 361 // create exception
356 THROW_MSG(vmSymbols::java_lang_ClassCastException(), message); 362 THROW_MSG(vmSymbols::java_lang_ClassCastException(), message);
357 IRT_END 363 IRT_END
358
359 // required can be either a MethodType, or a Class (for a single argument)
360 // actual (if not null) can be either a MethodHandle, or an arbitrary value (for a single argument)
361 IRT_ENTRY(void, InterpreterRuntime::throw_WrongMethodTypeException(JavaThread* thread,
362 oopDesc* required,
363 oopDesc* actual)) {
364 ResourceMark rm(thread);
365 char* message = SharedRuntime::generate_wrong_method_type_message(thread, required, actual);
366
367 if (ProfileTraps) {
368 note_trap(thread, Deoptimization::Reason_constraint, CHECK);
369 }
370
371 // create exception
372 THROW_MSG(vmSymbols::java_lang_invoke_WrongMethodTypeException(), message);
373 }
374 IRT_END
375
376
377 364
378 // exception_handler_for_exception(...) returns the continuation address, 365 // exception_handler_for_exception(...) returns the continuation address,
379 // the exception oop (via TLS) and sets the bci/bcp for the continuation. 366 // the exception oop (via TLS) and sets the bci/bcp for the continuation.
380 // The exception oop is returned to make sure it is preserved over GC (it 367 // The exception oop is returned to make sure it is preserved over GC (it
381 // is only on the stack if the exception was thrown explicitly via athrow). 368 // is only on the stack if the exception was thrown explicitly via athrow).