453 // class_count - pre-checked to be greater than or equal to 0
454 // class_definitions - pre-checked for NULL
455 jvmtiError
456 JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_definitions) {
457 //TODO: add locking
458 VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
459 VMThread::execute(&op);
460 return (op.check_error());
461 } /* end RedefineClasses */
462
463
464 //
465 // Object functions
466 //
467
468 // size_ptr - pre-checked for NULL
469 jvmtiError
470 JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) {
471 oop mirror = JNIHandles::resolve_external_guard(object);
472 NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT);
473 *size_ptr = (jlong)mirror->size() * wordSize;
474 return JVMTI_ERROR_NONE;
475 } /* end GetObjectSize */
476
477 //
478 // Method functions
479 //
480
481 // prefix - NULL is a valid value, must be checked
482 jvmtiError
483 JvmtiEnv::SetNativeMethodPrefix(const char* prefix) {
484 return prefix == NULL?
485 SetNativeMethodPrefixes(0, NULL) :
486 SetNativeMethodPrefixes(1, (char**)&prefix);
487 } /* end SetNativeMethodPrefix */
488
489
490 // prefix_count - pre-checked to be greater than or equal to 0
491 // prefixes - pre-checked for NULL
492 jvmtiError
493 JvmtiEnv::SetNativeMethodPrefixes(jint prefix_count, char** prefixes) {
|
453 // class_count - pre-checked to be greater than or equal to 0
454 // class_definitions - pre-checked for NULL
455 jvmtiError
456 JvmtiEnv::RedefineClasses(jint class_count, const jvmtiClassDefinition* class_definitions) {
457 //TODO: add locking
458 VM_RedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
459 VMThread::execute(&op);
460 return (op.check_error());
461 } /* end RedefineClasses */
462
463
464 //
465 // Object functions
466 //
467
468 // size_ptr - pre-checked for NULL
469 jvmtiError
470 JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) {
471 oop mirror = JNIHandles::resolve_external_guard(object);
472 NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT);
473 *size_ptr = (jlong)Universe::heap()->obj_size(mirror) * wordSize;
474 return JVMTI_ERROR_NONE;
475 } /* end GetObjectSize */
476
477 //
478 // Method functions
479 //
480
481 // prefix - NULL is a valid value, must be checked
482 jvmtiError
483 JvmtiEnv::SetNativeMethodPrefix(const char* prefix) {
484 return prefix == NULL?
485 SetNativeMethodPrefixes(0, NULL) :
486 SetNativeMethodPrefixes(1, (char**)&prefix);
487 } /* end SetNativeMethodPrefix */
488
489
490 // prefix_count - pre-checked to be greater than or equal to 0
491 // prefixes - pre-checked for NULL
492 jvmtiError
493 JvmtiEnv::SetNativeMethodPrefixes(jint prefix_count, char** prefixes) {
|