hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java
changeset 37129 af29e306e50b
parent 35217 ce4b5303a813
child 40892 330a02d935ad
equal deleted inserted replaced
37128:ea9e0371b8e6 37129:af29e306e50b
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   128         if (!VM.getVM().isCore()) {
   128         if (!VM.getVM().isCore()) {
   129             virtualConstructor.addMapping("CompilerThread", CompilerThread.class);
   129             virtualConstructor.addMapping("CompilerThread", CompilerThread.class);
   130             virtualConstructor.addMapping("CodeCacheSweeperThread", CodeCacheSweeperThread.class);
   130             virtualConstructor.addMapping("CodeCacheSweeperThread", CodeCacheSweeperThread.class);
   131         }
   131         }
   132         // for now, use JavaThread itself. fix it later with appropriate class if needed
   132         // for now, use JavaThread itself. fix it later with appropriate class if needed
   133         virtualConstructor.addMapping("SurrogateLockerThread", JavaThread.class);
   133         virtualConstructor.addMapping("ReferencePendingListLockerThread", JavaThread.class);
   134         virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class);
   134         virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class);
   135         virtualConstructor.addMapping("ServiceThread", ServiceThread.class);
   135         virtualConstructor.addMapping("ServiceThread", ServiceThread.class);
   136     }
   136     }
   137 
   137 
   138     public Threads() {
   138     public Threads() {
   170             JavaThread thread = (JavaThread)virtualConstructor.instantiateWrapperFor(threadAddr);
   170             JavaThread thread = (JavaThread)virtualConstructor.instantiateWrapperFor(threadAddr);
   171             thread.setThreadPDAccess(access);
   171             thread.setThreadPDAccess(access);
   172             return thread;
   172             return thread;
   173         } catch (Exception e) {
   173         } catch (Exception e) {
   174             throw new RuntimeException("Unable to deduce type of thread from address " + threadAddr +
   174             throw new RuntimeException("Unable to deduce type of thread from address " + threadAddr +
   175             " (expected type JavaThread, CompilerThread, ServiceThread, JvmtiAgentThread, SurrogateLockerThread, or CodeCacheSweeperThread)", e);
   175             " (expected type JavaThread, CompilerThread, ServiceThread, JvmtiAgentThread, ReferencePendingListLockerThread, or CodeCacheSweeperThread)", e);
   176         }
   176         }
   177     }
   177     }
   178 
   178 
   179     /** Memory operations */
   179     /** Memory operations */
   180     public void oopsDo(AddressVisitor oopVisitor) {
   180     public void oopsDo(AddressVisitor oopVisitor) {