/*
* 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 "shark/llvmHeaders.hpp"
#include "shark/sharkFunction.hpp"
#include "shark/sharkNativeWrapper.hpp"
#include "shark/sharkStack.hpp"
#include "shark/sharkType.hpp"
using namespace llvm;
// Update the stack pointer
if (setup_sp_and_method)
// Create the frame
"frame");
int offset = 0;
// Expression stack
offset += stack_words;
// Monitors
offset += monitor_words;
// Temporary oop slot
// Method pointer
if (setup_sp_and_method) {
builder()->CreateStore(
}
// Unextended SP
// PC
_pc_slot_offset = offset++;
// Frame header
builder()->CreateStore(
// Local variables
offset += locals_words;
// Push the frame
}
// This function should match ZeroStack::overflow_check
// Check the Zero stack
builder()->CreateCondBr(
// Check the ABI stack
thread(),
SharkType::intptr_type(),
"abi_base"),
thread(),
SharkType::intptr_type(),
"abi_size"));
builder()->CreateGetFrameAddress(),
SharkType::intptr_type(),
"abi_sp"),
builder()->CreateCondBr(
builder()->CreateICmpULT(
// Handle overflows
}
fp,
builder()->CreateLoad(
return sp;
}
const char* name) const {
if (needs_cast) {
}
return result;
}
// The bits that differentiate stacks with normal and native frames on top
}
}
// For normal frames, the stack pointer and the method slot will
// be set during each decache, so it is not necessary to do them
// at the time the frame is created. However, we set them for
// non-PRODUCT builds to make crash dumps easier to understand.
}
}
}
}
return function()->max_locals();
}
}
}
return 0;
}
return function()->max_monitors();
}
}
}
}
}
}
#ifndef PRODUCT
#ifdef ASSERT
builder()->CreateCondBr(
builder()->CreateICmpEQ(
LLVMValue::intptr_constant(0)),
builder()->CreateUnreachable();
#endif // ASSERT
}
#endif // !PRODUCT