Skip to content

Commit b996ccc

Browse files
committed
8259373: c1 and jvmci runtime code use ResetNoHandleMark incorrectly
Reviewed-by: kvn
1 parent 555641e commit b996ccc

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

src/hotspot/share/c1/c1_Runtime1.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -640,7 +640,7 @@ address Runtime1::exception_handler_for_pc(JavaThread* thread) {
640640
oop exception = thread->exception_oop();
641641
address pc = thread->exception_pc();
642642
// Still in Java mode
643-
DEBUG_ONLY(ResetNoHandleMark rnhm);
643+
DEBUG_ONLY(NoHandleMark nhm);
644644
nmethod* nm = NULL;
645645
address continuation = NULL;
646646
{
@@ -1307,7 +1307,6 @@ int Runtime1::move_klass_patching(JavaThread* thread) {
13071307
debug_only(NoHandleMark nhm;)
13081308
{
13091309
// Enter VM mode
1310-
13111310
ResetNoHandleMark rnhm;
13121311
patch_code(thread, load_klass_patching_id);
13131312
}
@@ -1326,7 +1325,6 @@ int Runtime1::move_mirror_patching(JavaThread* thread) {
13261325
debug_only(NoHandleMark nhm;)
13271326
{
13281327
// Enter VM mode
1329-
13301328
ResetNoHandleMark rnhm;
13311329
patch_code(thread, load_mirror_patching_id);
13321330
}
@@ -1345,7 +1343,6 @@ int Runtime1::move_appendix_patching(JavaThread* thread) {
13451343
debug_only(NoHandleMark nhm;)
13461344
{
13471345
// Enter VM mode
1348-
13491346
ResetNoHandleMark rnhm;
13501347
patch_code(thread, load_appendix_patching_id);
13511348
}
@@ -1365,14 +1362,14 @@ int Runtime1::move_appendix_patching(JavaThread* thread) {
13651362
// assembly code in the cpu directories.
13661363
//
13671364
int Runtime1::access_field_patching(JavaThread* thread) {
1368-
//
1369-
// NOTE: we are still in Java
1370-
//
1371-
Thread* THREAD = thread;
1372-
debug_only(NoHandleMark nhm;)
1365+
//
1366+
// NOTE: we are still in Java
1367+
//
1368+
// Handles created in this function will be deleted by the
1369+
// HandleMarkCleaner in the transition to the VM.
1370+
NoHandleMark nhm;
13731371
{
13741372
// Enter VM mode
1375-
13761373
ResetNoHandleMark rnhm;
13771374
patch_code(thread, access_field_patching_id);
13781375
}

src/hotspot/share/code/compiledMethod.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -703,8 +703,6 @@ address CompiledMethod::continuation_for_implicit_exception(address pc, bool for
703703
#ifdef ASSERT
704704
if (cont_offset == 0) {
705705
Thread* thread = Thread::current();
706-
ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
707-
HandleMark hm(thread);
708706
ResourceMark rm(thread);
709707
CodeBlob* cb = CodeCache::find_blob(pc);
710708
assert(cb != NULL && cb == this, "");

src/hotspot/share/jvmci/jvmciRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -368,7 +368,7 @@ address JVMCIRuntime::exception_handler_for_pc(JavaThread* thread) {
368368
oop exception = thread->exception_oop();
369369
address pc = thread->exception_pc();
370370
// Still in Java mode
371-
DEBUG_ONLY(ResetNoHandleMark rnhm);
371+
DEBUG_ONLY(NoHandleMark nhm);
372372
CompiledMethod* cm = NULL;
373373
address continuation = NULL;
374374
{

0 commit comments

Comments
 (0)