|
1 | 1 | /* |
2 | | - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
@@ -395,29 +395,24 @@ public PacketStream send() { |
395 | 395 | } catch (JDWPException exc) { |
396 | 396 | switch (exc.errorCode()) { |
397 | 397 | case JDWP.Error.OPAQUE_FRAME: |
398 | | - if (thread.isVirtual()) { |
399 | | - // We first need to find out if the current frame is native, or if the |
400 | | - // previous frame is native, in which case we throw NativeMethodException |
401 | | - for (int i = 0; i < 2; i++) { |
402 | | - StackFrameImpl sf; |
403 | | - try { |
404 | | - sf = (StackFrameImpl)thread.frame(i); |
405 | | - } catch (IndexOutOfBoundsException e) { |
406 | | - // This should never happen, but we need to check for it. |
407 | | - break; |
408 | | - } |
409 | | - sf.validateStackFrame(); |
410 | | - MethodImpl meth = (MethodImpl)sf.location().method(); |
411 | | - if (meth.isNative()) { |
412 | | - throw new NativeMethodException(); |
413 | | - } |
| 398 | + // We first need to find out if the current frame is native, or if the |
| 399 | + // previous frame is native, in which case we throw NativeMethodException |
| 400 | + for (int i = 0; i < 2; i++) { |
| 401 | + StackFrame sf; |
| 402 | + try { |
| 403 | + sf = thread.frame(i); |
| 404 | + } catch (IndexOutOfBoundsException e) { |
| 405 | + // This should never happen, but we need to check for it. |
| 406 | + break; |
| 407 | + } |
| 408 | + Method meth = sf.location().method(); |
| 409 | + if (meth.isNative()) { |
| 410 | + throw new NativeMethodException(); |
414 | 411 | } |
415 | | - // No native frames involved. Must have been due to thread |
416 | | - // not being mounted. |
417 | | - throw new OpaqueFrameException(); |
418 | | - } else { |
419 | | - throw new NativeMethodException(); |
420 | 412 | } |
| 413 | + // No native frames involved. Must have been due to virtual thread |
| 414 | + // not being mounted or some other reason such as failure to deopt. |
| 415 | + throw new OpaqueFrameException(); |
421 | 416 | case JDWP.Error.THREAD_NOT_SUSPENDED: |
422 | 417 | throw new IncompatibleThreadStateException( |
423 | 418 | "Thread not current or suspended"); |
|
0 commit comments