本文整理汇总了C++中objArrayHandle::obj_at方法的典型用法代码示例。如果您正苦于以下问题:C++ objArrayHandle::obj_at方法的具体用法?C++ objArrayHandle::obj_at怎么用?C++ objArrayHandle::obj_at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objArrayHandle
的用法示例。
在下文中一共展示了objArrayHandle::obj_at方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: relocate_and_link
void Rewriter::relocate_and_link(instanceKlassHandle this_oop,
objArrayHandle methods, TRAPS) {
int len = methods->length();
for (int i = len-1; i >= 0; i--) {
methodHandle m(THREAD, (methodOop)methods->obj_at(i));
if (m->has_jsrs()) {
m = rewrite_jsrs(m, CHECK);
// Method might have gotten rewritten.
methods->obj_at_put(i, m());
}
// Set up method entry points for compiler and interpreter .
m->link_method(m, CHECK);
// This is for JVMTI and unrelated to relocator but the last thing we do
#ifdef ASSERT
if (StressMethodComparator) {
static int nmc = 0;
for (int j = i; j >= 0 && j >= i-4; j--) {
if ((++nmc % 1000) == 0) tty->print_cr("Have run MethodComparator %d times...", nmc);
bool z = MethodComparator::methods_EMCP(m(),
(methodOop)methods->obj_at(j));
if (j == i && !z) {
tty->print("MethodComparator FAIL: "); m->print(); m->print_codes();
assert(z, "method must compare equal to itself");
}
}
}
#endif //ASSERT
}
}
示例2: ol
void ClassLoaderData::Dependencies::locked_add(objArrayHandle last_handle,
objArrayHandle new_dependency,
Thread* THREAD) {
// Have to lock and put the new dependency on the end of the dependency
// array so the card mark for CMS sees that this dependency is new.
// Can probably do this lock free with some effort.
ObjectLocker ol(Handle(THREAD, _list_head), THREAD);
oop loader_or_mirror = new_dependency->obj_at(0);
// Since the dependencies are only added, add to the end.
objArrayOop end = last_handle();
objArrayOop last = NULL;
while (end != NULL) {
last = end;
// check again if another thread added it to the end.
if (end->obj_at(0) == loader_or_mirror) {
// Don't need to add it
return;
}
end = (objArrayOop)end->obj_at(1);
}
assert (last != NULL, "dependencies should be initialized");
// fill in the first element with the oop in new_dependency.
if (last->obj_at(0) == NULL) {
last->obj_at_put(0, new_dependency->obj_at(0));
} else {
last->obj_at_put(1, new_dependency());
}
}
示例3: fill_in_frames
// Unpacks one or more frames into user-supplied buffers.
// Updates the end index, and returns the number of unpacked frames.
// Always start with the existing vfst.method and bci.
// Do not call vfst.next to advance over the last returned value.
// In other words, do not leave any stale data in the vfst.
//
// Parameters:
// mode Restrict which frames to be decoded.
// JavaFrameStream stream of javaVFrames
// max_nframes Maximum number of frames to be filled.
// start_index Start index to the user-supplied buffers.
// frames_array Buffer to store Class or StackFrame in, starting at start_index.
// frames array is a Class<?>[] array when only getting caller
// reference, and a StackFrameInfo[] array (or derivative)
// otherwise. It should never be null.
// end_index End index to the user-supplied buffers with unpacked frames.
//
// Returns the number of frames whose information was transferred into the buffers.
//
int StackWalk::fill_in_frames(jlong mode, JavaFrameStream& stream,
int max_nframes, int start_index,
objArrayHandle frames_array,
int& end_index, TRAPS) {
if (TraceStackWalk) {
tty->print_cr("fill_in_frames limit=%d start=%d frames length=%d",
max_nframes, start_index, frames_array->length());
}
assert(max_nframes > 0, "invalid max_nframes");
assert(start_index + max_nframes <= frames_array->length(), "oob");
int frames_decoded = 0;
for (; !stream.at_end(); stream.next()) {
Method* method = stream.method();
int bci = stream.bci();
if (method == NULL) continue;
if (!ShowHiddenFrames && StackWalk::skip_hidden_frames(mode)) {
if (method->is_hidden()) {
if (TraceStackWalk) {
tty->print(" hidden method: "); method->print_short_name();
tty->print("\n");
}
continue;
}
}
int index = end_index++;
if (TraceStackWalk) {
tty->print(" %d: frame method: ", index); method->print_short_name();
tty->print_cr(" bci=%d", bci);
}
// fill in StackFrameInfo and initialize MemberName
if (live_frame_info(mode)) {
assert (use_frames_array(mode), "Bad mode for get live frame");
Handle stackFrame(frames_array->obj_at(index));
fill_live_stackframe(stackFrame, method, bci, stream.java_frame(), CHECK_0);
} else if (need_method_info(mode)) {
assert (use_frames_array(mode), "Bad mode for get stack frame");
Handle stackFrame(frames_array->obj_at(index));
fill_stackframe(stackFrame, method, bci);
} else {
assert (use_frames_array(mode) == false, "Bad mode for get caller class");
frames_array->obj_at_put(index, method->method_holder()->java_mirror());
}
if (++frames_decoded >= max_nframes) break;
}
return frames_decoded;
}
示例4: fill_frame
// Fill in the StackFrameInfo at the given index in frames_array
void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array,
const methodHandle& method, TRAPS) {
if (_need_method_info) {
Handle stackFrame(THREAD, frames_array->obj_at(index));
fill_stackframe(stackFrame, method);
} else {
frames_array->obj_at_put(index, method->method_holder()->java_mirror());
}
}
示例5: check_magic
bool BaseFrameStream::check_magic(objArrayHandle frames_array) {
oop m1 = frames_array->obj_at(magic_pos);
jlong m2 = _anchor;
if (m1 == _thread->threadObj() && m2 == address_value()) return true;
return false;
}
示例6: check_magic
bool StackWalkAnchor::check_magic(objArrayHandle classes_array) {
oop m1 = classes_array->obj_at(magic_pos);
jlong m2 = _anchor;
if (m1 == _thread->threadObj() && m2 == address_value()) return true;
return false;
}