sharkRuntime.cpp revision 1879
/*
* Copyright 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "oops/klassOop.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/thread.hpp"
#include "shark/llvmHeaders.hpp"
#include "shark/sharkRuntime.hpp"
#ifdef TARGET_ARCH_zero
# include "stack_zero.inline.hpp"
#endif
using namespace llvm;
int* indexes,
int num_indexes))
for (int i = 0; i < num_indexes; i++) {
return i;
return i;
}
return -1;
if (UseBiasedLocking) {
// Retry fast entry if bias is revoked to avoid unnecessary inflation
} else {
}
}
// Make sure we are not instantiating an abstract klass
// Make sure klass is initialized
// At this point the class may not be fully initialized
// because of recursive initialization. If it is fully
// initialized & has_finalized is not set, we rewrite
// it into its fast version (Note: no locking is needed
// here since this is an atomic byte write and can be
// done more than once).
//
// Note: In case of classes with has_finalized we don't
// rewrite since that saves us an extra check in
// the fast version which then would call the
// slow version anyway (and do a call back into
// Java).
// If we have a breakpoint, then we don't rewrite
// because the _breakpoint bytecode would be lost.
int size))
int index,
int size))
int index,
int ndims,
int* dims))
const char* file,
int line))
"");
const char* file,
int line,
int index))
char msg[jintAsStringSize];
msg);
const char* file,
int line))
"");
const char* file,
int line))
"");
// Non-VM calls
// Nothing in these must ever GC!
else
}
}
// In C2, uncommon_trap_blob creates a frame, so all the various
// deoptimization functions expect to find the frame of the method
// being deopted one frame down on the stack. We create a dummy
// frame to mirror this.
// Initiate the trap
// Pop our dummy frame and the frame being deoptimized
thread->pop_zero_frame();
thread->pop_zero_frame();
// Push skeleton frames
for (int i = 0; i < number_of_frames; i++) {
}
// Push another dummy frame
// Fill in the skeleton frames
// Pop our dummy frame
thread->pop_zero_frame();
// Fall back into the interpreter
return number_of_frames;
}
return (FakeStubFrame *) fp;
}