/*
* Copyright 2009 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 "ci/ciMethod.hpp"
#include "shark/llvmHeaders.hpp"
#include "shark/sharkIntrinsics.hpp"
#include "shark/sharkState.hpp"
#include "shark/sharkValue.hpp"
#include "shark/shark_globals.hpp"
using namespace llvm;
switch (target->intrinsic_id()) {
case vmIntrinsics::_none:
return false;
// java.lang.Math
case vmIntrinsics::_min:
case vmIntrinsics::_max:
case vmIntrinsics::_dabs:
case vmIntrinsics::_dsin:
case vmIntrinsics::_dcos:
case vmIntrinsics::_dtan:
case vmIntrinsics::_datan2:
case vmIntrinsics::_dsqrt:
case vmIntrinsics::_dlog:
case vmIntrinsics::_dlog10:
case vmIntrinsics::_dpow:
case vmIntrinsics::_dexp:
return true;
// java.lang.Object
case vmIntrinsics::_getClass:
return true;
// java.lang.System
case vmIntrinsics::_currentTimeMillis:
return true;
// java.lang.Thread
case vmIntrinsics::_currentThread:
return true;
// sun.misc.Unsafe
case vmIntrinsics::_compareAndSwapInt:
return true;
default:
if (SharkPerformanceWarnings) {
"unhandled intrinsic vmIntrinsic::%s",
}
}
return false;
}
}
switch (target()->intrinsic_id()) {
// java.lang.Math
case vmIntrinsics::_min:
break;
case vmIntrinsics::_max:
break;
case vmIntrinsics::_dabs:
break;
case vmIntrinsics::_dsin:
break;
case vmIntrinsics::_dcos:
break;
case vmIntrinsics::_dtan:
break;
case vmIntrinsics::_datan2:
break;
case vmIntrinsics::_dsqrt:
break;
case vmIntrinsics::_dlog:
break;
case vmIntrinsics::_dlog10:
break;
case vmIntrinsics::_dpow:
break;
case vmIntrinsics::_dexp:
break;
// java.lang.Object
case vmIntrinsics::_getClass:
break;
// java.lang.System
case vmIntrinsics::_currentTimeMillis:
break;
// java.lang.Thread
case vmIntrinsics::_currentThread:
break;
// sun.misc.Unsafe
case vmIntrinsics::_compareAndSwapInt:
break;
default:
}
}
// Pop the arguments
// Perform the test
// Push the result
phi,
}
builder()->CreateCall(
}
}
"klass");
"java_mirror"),
true));
}
false));
}
"threadObj"),
true));
}
// Pop the arguments
// Convert the offset
offset);
// Locate the field
"addr");
// Perform the operation
// Push the result
builder()->CreateIntCast(
false));
}