src/hotspot/share/prims/jvmtiImpl.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File open Sdiff src/hotspot/share/prims

src/hotspot/share/prims/jvmtiImpl.cpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  64     : JavaThread(start_function_wrapper) {
  65     _env = env;
  66     _start_fn = start_fn;
  67     _start_arg = start_arg;
  68 }
  69 
  70 void
  71 JvmtiAgentThread::start_function_wrapper(JavaThread *thread, TRAPS) {
  72     // It is expected that any Agent threads will be created as
  73     // Java Threads.  If this is the case, notification of the creation
  74     // of the thread is given in JavaThread::thread_main().
  75     assert(thread->is_Java_thread(), "debugger thread should be a Java Thread");
  76     assert(thread == JavaThread::current(), "sanity check");
  77 
  78     JvmtiAgentThread *dthread = (JvmtiAgentThread *)thread;
  79     dthread->call_start_function();
  80 }
  81 
  82 void
  83 JvmtiAgentThread::call_start_function() {

  84     ThreadToNativeFromVM transition(this);
  85     _start_fn(_env->jvmti_external(), jni_environment(), (void*)_start_arg);
  86 }
  87 
  88 
  89 //
  90 // class GrowableCache - private methods
  91 //
  92 
  93 void GrowableCache::recache() {
  94   int len = _elements->length();
  95 
  96   FREE_C_HEAP_ARRAY(address, _cache);
  97   _cache = NEW_C_HEAP_ARRAY(address,len+1, mtInternal);
  98 
  99   for (int i=0; i<len; i++) {
 100     _cache[i] = _elements->at(i)->getCacheValue();
 101     //
 102     // The cache entry has gone bad. Without a valid frame pointer
 103     // value, the entry is useless so we simply delete it in product


   1 /*
   2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  64     : JavaThread(start_function_wrapper) {
  65     _env = env;
  66     _start_fn = start_fn;
  67     _start_arg = start_arg;
  68 }
  69 
  70 void
  71 JvmtiAgentThread::start_function_wrapper(JavaThread *thread, TRAPS) {
  72     // It is expected that any Agent threads will be created as
  73     // Java Threads.  If this is the case, notification of the creation
  74     // of the thread is given in JavaThread::thread_main().
  75     assert(thread->is_Java_thread(), "debugger thread should be a Java Thread");
  76     assert(thread == JavaThread::current(), "sanity check");
  77 
  78     JvmtiAgentThread *dthread = (JvmtiAgentThread *)thread;
  79     dthread->call_start_function();
  80 }
  81 
  82 void
  83 JvmtiAgentThread::call_start_function() {
  84     HandleMark hm(this);
  85     ThreadToNativeFromVM transition(this);
  86     _start_fn(_env->jvmti_external(), jni_environment(), (void*)_start_arg);
  87 }
  88 
  89 
  90 //
  91 // class GrowableCache - private methods
  92 //
  93 
  94 void GrowableCache::recache() {
  95   int len = _elements->length();
  96 
  97   FREE_C_HEAP_ARRAY(address, _cache);
  98   _cache = NEW_C_HEAP_ARRAY(address,len+1, mtInternal);
  99 
 100   for (int i=0; i<len; i++) {
 101     _cache[i] = _elements->at(i)->getCacheValue();
 102     //
 103     // The cache entry has gone bad. Without a valid frame pointer
 104     // value, the entry is useless so we simply delete it in product


src/hotspot/share/prims/jvmtiImpl.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File