本文整理汇总了C++中pc函数的典型用法代码示例。如果您正苦于以下问题:C++ pc函数的具体用法?C++ pc怎么用?C++ pc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void run( const int N, const int M, const int L, const int hyper_threads, const int vector_lanes,
const int nx, const int ny, const int nz, const int ichunk,
const int nang, const int noct, const int ng, const int nmom, const int cmom,
const vector<diag_c>& diag )
{
typedef typename Kokkos::DefaultExecutionSpace device_t;
typedef TeamPolicy<device_t> team_policy_t;
typedef View<double*, device_t> view_1d_t;
typedef View<double**, Kokkos::LayoutLeft, device_t> view_2d_t;
typedef View<double***, Kokkos::LayoutLeft, device_t> view_3d_t;
typedef View<double****, Kokkos::LayoutLeft, device_t> view_4d_t;
typedef View<double*****, Kokkos::LayoutLeft, device_t> view_5d_t;
typedef View<double******, Kokkos::LayoutLeft, device_t> view_6d_t;
typedef View<double*******, Kokkos::LayoutLeft, device_t> view_7d_t;
int id = 1;
int ich = 1;
int jlo = 0;
int jhi = ny-1;
int jst = 1;
int jd = 2;
int klo = 0;
int khi = nz-1;
int kst = 1;
int kd = 2;
double hi = c1;
Kokkos::initialize();
Kokkos::DefaultExecutionSpace::print_configuration(cout);
view_4d_t psii( "psii", nang, ny, nz, ng );
view_4d_t psij( "psij", nang, ichunk, nz, ng );
view_4d_t psik( "psik", nang, ichunk, ny, ng );
view_4d_t jb_in( "jb_in", nang, ichunk, ny, ng ); // jb_in(nang,ichunk,nz,ng)
view_4d_t kb_in( "kb_in", nang, ichunk, ny, ng ); // kb_in(nang,ichunk,nz,ng)
view_6d_t qim( "qim", nang, nx, ny, nz, noct, ng ); // qim(nang,nx,ny,nz,noct,ng)
view_5d_t qtot( "qtot", cmom, nx, ny, nx, ng ); // qtot(cmom,nx,ny,nz,ng)
view_2d_t ec( "ec", nang, cmom ); // ec(nang,cmom)
view_1d_t mu( "mu", nang ); // mu(nang)
view_1d_t w( "w", nang ); // w(nang)
view_1d_t wmu( "wmu", nang ); // wmu(nang)
view_1d_t weta( "weta", nang ); // weta(nang)
view_1d_t wxi( "wxi", nang ); // wxi(nang)
view_1d_t hj( "hj", nang ); // hj(nang)
view_1d_t hk( "hk", nang ); // hk(nang)
view_1d_t vdelt( "vdelt", ng ); // vdelt(ng)
view_6d_t ptr_in( "ptr_in", nang, nx, ny, nz, noct, ng ); // ptr_in(nang,nx,ny,nz,noct,ng)
view_6d_t ptr_out( "ptr_out", nang, nx, ny, nz, noct, ng ); // ptr_out(nang,nx,ny,nz,noct,ng)
view_4d_t flux( "flux", nx, ny, nz, ng ); // flux(nx,ny,nz,ng)
view_5d_t fluxm( "fluxm", cmom-1, nx, ny, nz, ng ); //fluxm(cmom-1,nx,ny,nz,ng)
view_2d_t psi( "psi", nang, M );
view_2d_t pc( "pc", nang, M );
view_4d_t jb_out( "jb_out", nang, ichunk, nz, ng );
view_4d_t kb_out( "kb_out", nang, ichunk, ny, ng );
view_4d_t flkx( "flkx", nx+1, ny, nz, ng );
view_4d_t flky( "flky", nx, ny+1, nz, ng );
view_4d_t flkz( "flkz", nx, ny, nz+1, ng );
view_3d_t hv( "hv", nang, 4, M ); // hv(nang,4,M)
view_3d_t fxhv( "fxhv", nang, 4, M ); // fxhv(nang,4,M)
view_5d_t dinv( "dinv", nang, nx, ny, nz, ng ); // dinv(nang,nx,ny,nz,ng)
view_2d_t den( "den", nang, M ); // den(nang,M)
view_4d_t t_xs( "t_xs", nx, ny, nz, ng ); // t_xs(nx,ny,nz,ng)
const team_policy_t policy( N, hyper_threads, vector_lanes );
for (int ii = 0; ii < n_test_iter; ii++) {
Kokkos::Impl::Timer timer;
for (int oct = 0; oct < noct; oct++) {
parallel_for( policy, dim3_sweep2< team_policy_t,
view_1d_t, view_2d_t, view_3d_t, view_4d_t,
view_5d_t, view_6d_t, view_7d_t >
( M, L,
ng, cmom, noct,
nx, ny, nz, ichunk,
diag,
id, ich, oct,
jlo, jhi, jst, jd,
klo, khi, kst, kd,
psii, psij, psik,
jb_in, kb_in,
qim, qtot, ec,
mu, w,
wmu, weta, wxi,
hi, hj, hk,
vdelt, ptr_in, ptr_out,
flux, fluxm, psi, pc,
jb_out, kb_out,
flkx, flky, flkz,
hv, fxhv, dinv,
den, t_xs ) );
}// end noct
std::cout << " ii " << ii << " elapsed time " << timer.seconds() << std::endl;
} // end n_test_iter
Kokkos::finalize();
}
示例2: pc
void
DropDownListClientWKC::hide(WebCore::PopupMenuClient *client)
{
PopupMenuClientPrivate pc(client);
m_appClient->hide(&pc.wkc());
}
示例3: main
int main(int argc, char **args)
{
// Test variable.
int success_test = 1;
if (argc < 2) error("Not enough parameters.");
// Load the mesh.
Mesh mesh;
H3DReader mloader;
if (!mloader.load(args[1], &mesh)) error("Loading mesh file '%s'.", args[1]);
// Initialize the space.
int mx = 2;
Ord3 order(mx, mx, mx);
H1Space space(&mesh, bc_types, NULL, order);
#if defined LIN_DIRICHLET || defined NLN_DIRICHLET
space.set_essential_bc_values(essential_bc_values);
#endif
// Initialize the weak formulation.
WeakForm wf;
wf.add_vector_form(form_0<double, scalar>, form_0<Ord, Ord>);
#if defined LIN_NEUMANN || defined LIN_NEWTON
wf.add_vector_form_surf(form_0_surf<double, scalar>, form_0_surf<Ord, Ord>);
#endif
#if defined LIN_DIRICHLET || defined NLN_DIRICHLET
// preconditioner
wf.add_matrix_form(precond_0_0<double, scalar>, precond_0_0<Ord, Ord>, HERMES_SYM);
#endif
// Initialize the FE problem.
DiscreteProblem fep(&wf, &space);
#if defined LIN_DIRICHLET || defined NLN_DIRICHLET
// use ML preconditioner to speed-up things
MlPrecond pc("sa");
pc.set_param("max levels", 6);
pc.set_param("increasing or decreasing", "decreasing");
pc.set_param("aggregation: type", "MIS");
pc.set_param("coarse: type", "Amesos-KLU");
#endif
NoxSolver solver(&fep);
#if defined LIN_DIRICHLET || defined NLN_DIRICHLET
// solver.set_precond(&pc);
#endif
info("Solving.");
Solution sln(&mesh);
if(solver.solve()) Solution::vector_to_solution(solver.get_solution(), &space, &sln);
else error ("Matrix solver failed.\n");
Solution ex_sln(&mesh);
ex_sln.set_exact(exact_solution);
// Calculate exact error.
info("Calculating exact error.");
Adapt *adaptivity = new Adapt(&space, HERMES_H1_NORM);
bool solutions_for_adapt = false;
double err_exact = adaptivity->calc_err_exact(&sln, &ex_sln, solutions_for_adapt, HERMES_TOTAL_ERROR_ABS);
if (err_exact > EPS)
// Calculated solution is not precise enough.
success_test = 0;
if (success_test) {
info("Success!");
return ERR_SUCCESS;
}
else {
info("Failure!");
return ERR_FAILURE;
}
}
示例4: countPaths
std::string countPaths(S& spec, bool fast = false) {
PathCounter<S> pc(spec);
return fast ? pc.countFast() : pc.count();
}
示例5: is_interpreted_frame
bool frame::is_interpreted_frame() const {
return Interpreter::contains(pc());
}
示例6: approxSurface
Py::Object approxSurface(const Py::Tuple& args, const Py::Dict& kwds)
{
PyObject *o;
// spline parameters
int uDegree = 3;
int vDegree = 3;
int uPoles = 6;
int vPoles = 6;
// smoothing
PyObject* smooth = Py_True;
double weight = 0.1;
double grad = 1.0; //0.5
double bend = 0.0; //0.2
// other parameters
int iteration = 5;
PyObject* correction = Py_True;
double factor = 1.0;
static char* kwds_approx[] = {"Points", "UDegree", "VDegree", "NbUPoles", "NbVPoles",
"Smooth", "Weight", "Grad", "Bend",
"Iterations", "Correction", "PatchFactor", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O|iiiiO!dddiO!d",kwds_approx,
&o,&uDegree,&vDegree,&uPoles,&vPoles,
&PyBool_Type,&smooth,&weight,&grad,&bend,
&iteration,&PyBool_Type,&correction,&factor))
throw Py::Exception();
double curvdiv = 1.0 - (grad + bend);
int uOrder = uDegree + 1;
int vOrder = vDegree + 1;
// error checking
if (grad < 0.0 || grad > 1.0) {
throw Py::ValueError("Value of Grad out of range [0,1]");
}
if (bend < 0.0 || bend > 1.0) {
throw Py::ValueError("Value of Bend out of range [0,1]");
}
if (curvdiv < 0.0 || curvdiv > 1.0) {
throw Py::ValueError("Sum of Grad and Bend out of range [0,1]");
}
if (uDegree < 1 || uOrder > uPoles) {
throw Py::ValueError("Value of uDegree out of range [1,NbUPoles-1]");
}
if (vDegree < 1 || vOrder > vPoles) {
throw Py::ValueError("Value of vDegree out of range [1,NbVPoles-1]");
}
try {
Py::Sequence l(o);
TColgp_Array1OfPnt clPoints(0, l.size()-1);
if (clPoints.Length() < uPoles * vPoles) {
throw Py::ValueError("Too less data points for the specified number of poles");
}
int index=0;
for (Py::Sequence::iterator it = l.begin(); it != l.end(); ++it) {
Py::Tuple t(*it);
clPoints(index++) = gp_Pnt(
(double)Py::Float(t.getItem(0)),
(double)Py::Float(t.getItem(1)),
(double)Py::Float(t.getItem(2)));
}
Reen::BSplineParameterCorrection pc(uOrder,vOrder,uPoles,vPoles);
Handle_Geom_BSplineSurface hSurf;
pc.EnableSmoothing(PyObject_IsTrue(smooth) ? true : false, weight, grad, bend, curvdiv);
hSurf = pc.CreateSurface(clPoints, iteration, PyObject_IsTrue(correction) ? true : false, factor);
if (!hSurf.IsNull()) {
return Py::asObject(new Part::BSplineSurfacePy(new Part::GeomBSplineSurface(hSurf)));
}
throw Py::RuntimeError("Computation of B-Spline surface failed");
}
catch (Standard_Failure &e) {
std::string str;
Standard_CString msg = e.GetMessageString();
str += typeid(e).name();
str += " ";
if (msg) {str += msg;}
else {str += "No OCCT Exception Message";}
throw Py::RuntimeError(str);
}
catch (const Base::Exception &e) {
throw Py::RuntimeError(e.what());
}
catch (...) {
throw Py::RuntimeError("Unknown C++ exception");
}
}
示例7: code_section
void MacroAssembler::store_oop(jobject obj) {
code_section()->relocate(pc(), oop_Relocation::spec_for_immediate());
emit_address((address) obj);
}
示例8: pc
address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) {
// rbx,: Method*
// rcx: scratrch
// r13: sender sp
if (!InlineIntrinsics) return NULL; // Generate a vanilla entry
address entry_point = __ pc();
// These don't need a safepoint check because they aren't virtually
// callable. We won't enter these intrinsics from compiled code.
// If in the future we added an intrinsic which was virtually callable
// we'd have to worry about how to safepoint so that this code is used.
// mathematical functions inlined by compiler
// (interpreter must provide identical implementation
// in order to avoid monotonicity bugs when switching
// from interpreter to compiler in the middle of some
// computation)
//
// stack: [ ret adr ] <-- rsp
// [ lo(arg) ]
// [ hi(arg) ]
//
// Note: For JDK 1.2 StrictMath doesn't exist and Math.sin/cos/sqrt are
// native methods. Interpreter::method_kind(...) does a check for
// native methods first before checking for intrinsic methods and
// thus will never select this entry point. Make sure it is not
// called accidentally since the SharedRuntime entry points will
// not work for JDK 1.2.
//
// We no longer need to check for JDK 1.2 since it's EOL'ed.
// The following check existed in pre 1.6 implementation,
// if (Universe::is_jdk12x_version()) {
// __ should_not_reach_here();
// }
// Universe::is_jdk12x_version() always returns false since
// the JDK version is not yet determined when this method is called.
// This method is called during interpreter_init() whereas
// JDK version is only determined when universe2_init() is called.
// Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are
// java methods. Interpreter::method_kind(...) will select
// this entry point for the corresponding methods in JDK 1.3.
// get argument
if (kind == Interpreter::java_lang_math_sqrt) {
__ sqrtsd(xmm0, Address(rsp, wordSize));
} else {
__ fld_d(Address(rsp, wordSize));
switch (kind) {
case Interpreter::java_lang_math_sin :
__ trigfunc('s');
break;
case Interpreter::java_lang_math_cos :
__ trigfunc('c');
break;
case Interpreter::java_lang_math_tan :
__ trigfunc('t');
break;
case Interpreter::java_lang_math_abs:
__ fabs();
break;
case Interpreter::java_lang_math_log:
__ flog();
break;
case Interpreter::java_lang_math_log10:
__ flog10();
break;
case Interpreter::java_lang_math_pow:
__ fld_d(Address(rsp, 3*wordSize)); // second argument (one
// empty stack slot)
__ pow_with_fallback(0);
break;
case Interpreter::java_lang_math_exp:
__ exp_with_fallback(0);
break;
default :
ShouldNotReachHere();
}
// return double result in xmm0 for interpreter and compilers.
__ subptr(rsp, 2*wordSize);
// Round to 64bit precision
__ fstp_d(Address(rsp, 0));
__ movdbl(xmm0, Address(rsp, 0));
__ addptr(rsp, 2*wordSize);
}
__ pop(rax);
__ mov(rsp, r13);
__ jmp(rax);
return entry_point;
}
示例9: glReadPixels
//.........这里部分代码省略.........
int x2 = x1, y2 = y1;
int x,y,x0=W/2,y0=H/2;
int min, max;
float z = 1;
while ( z == 1 ) {
// top edge of rectangle
if ( y1 >= 0 ) {
y = y1;
min = x1 < 0 ? 0 : x1;
max = x2 >= W ? W-1 : x2;
for ( x = min; x <= max; ++x )
if ( zbuffer[ y*W + x ] < z ) {
z = zbuffer[ y*W + x ];
x0 = x;
y0 = y;
}
}
// bottom edge of rectangle
if ( y2 < H ) {
y = y2;
min = x1 < 0 ? 0 : x1;
max = x2 >= W ? W-1 : x2;
for ( x = min; x <= max; ++x )
if ( zbuffer[ y*W + x ] < z ) {
z = zbuffer[ y*W + x ];
x0 = x;
y0 = y;
}
}
// left edge of rectangle
if ( x1 >= 0 ) {
x = x1;
min = y1 < 0 ? 0 : y1;
max = y2 >= H ? H-1 : y2;
for ( y = min; y <= max; ++y )
if ( zbuffer[ y*W + x ] < z ) {
z = zbuffer[ y*W + x ];
x0 = x;
y0 = y;
}
}
// right edge of rectangle
if ( x2 < W ) {
x = x2;
min = y1 < 0 ? 0 : y1;
max = y2 >= H ? H-1 : y2;
for ( y = min; y <= max; ++y )
if ( zbuffer[ y*W + x ] < z ) {
z = zbuffer[ y*W + x ];
x0 = x;
y0 = y;
}
}
// grow the rectangle
--x1; --y1;
++x2; ++y2;
// is there nothing left to search ?
if ( y1 < 0 && y2 >= H && x1 < 0 && x2 >= W )
break;
}
if ( z < 1 ) {
// compute point in clipping space
#ifdef OPENGL_CENTRE_BASED
Point3 pc( 2*x0/(float)(W-1)-1, 2*y0/(float)(H-1)-1, 2*z-1 );
#else
// The +0.5f here is to convert from centre-based coordinates
// to edge-based coordinates.
Point3 pc( 2*(x0+0.5f)/(float)W-1, 2*(y0+0.5f)/(float)H-1, 2*z-1 );
#endif
// compute inverse view transform
Matrix M;
M.setToLookAt( _position, _target, _up, true );
// compute inverse perspective transform
Matrix M2;
M2.setToFrustum(
- 0.5 * _viewport_width, 0.5 * _viewport_width, // left, right
- 0.5 * _viewport_height, 0.5 * _viewport_height, // bottom, top
_near_plane, _far_plane,
true
);
// compute inverse of light transform
M = M * M2;
// compute point in world space
Point3 t0 = M * pc;
Point3 t( t0.x()/t0.w(), t0.y()/t0.w(), t0.z()/t0.w() );
lookAt( t );
}
delete [] zbuffer;
zbuffer = 0;
}
示例10: sp
inline bool frame::equal(frame other) const {
return sp() == other.sp()
&& fp() == other.fp()
&& pc() == other.pc();
}
示例11: pc
boost::shared_ptr<PointCloud> CloudList::addCloud(const char* filename) {
boost::shared_ptr<PointCloud> pc(new PointCloud());
pc->load_ptx(filename);
return addCloud(pc);
}
示例12: TEST_F
TEST_F(LoadPlanningModelsPr2, PoseConstraintSamplerManager)
{
robot_state::RobotState ks(kmodel);
ks.setToDefaultValues();
ks.update();
robot_state::RobotState ks_const(kmodel);
ks_const.setToDefaultValues();
ks_const.update();
kinematic_constraints::PositionConstraint pc(kmodel);
moveit_msgs::PositionConstraint pcm;
pcm.link_name = "l_wrist_roll_link";
pcm.target_point_offset.x = 0;
pcm.target_point_offset.y = 0;
pcm.target_point_offset.z = 0;
pcm.constraint_region.primitives.resize(1);
pcm.constraint_region.primitives[0].type = shape_msgs::SolidPrimitive::SPHERE;
pcm.constraint_region.primitives[0].dimensions.resize(1);
pcm.constraint_region.primitives[0].dimensions[0] = 0.001;
pcm.header.frame_id = kmodel->getModelFrame();
pcm.constraint_region.primitive_poses.resize(1);
pcm.constraint_region.primitive_poses[0].position.x = 0.55;
pcm.constraint_region.primitive_poses[0].position.y = 0.2;
pcm.constraint_region.primitive_poses[0].position.z = 1.25;
pcm.constraint_region.primitive_poses[0].orientation.x = 0.0;
pcm.constraint_region.primitive_poses[0].orientation.y = 0.0;
pcm.constraint_region.primitive_poses[0].orientation.z = 0.0;
pcm.constraint_region.primitive_poses[0].orientation.w = 1.0;
pcm.weight = 1.0;
moveit_msgs::OrientationConstraint ocm;
ocm.link_name = "l_wrist_roll_link";
ocm.header.frame_id = kmodel->getModelFrame();
ocm.orientation.x = 0.0;
ocm.orientation.y = 0.0;
ocm.orientation.z = 0.0;
ocm.orientation.w = 1.0;
ocm.absolute_x_axis_tolerance = 0.2;
ocm.absolute_y_axis_tolerance = 0.1;
ocm.absolute_z_axis_tolerance = 0.4;
ocm.weight = 1.0;
// test the automatic construction of constraint sampler
moveit_msgs::Constraints c;
c.position_constraints.push_back(pcm);
c.orientation_constraints.push_back(ocm);
constraint_samplers::ConstraintSamplerPtr s = constraint_samplers::ConstraintSamplerManager::selectDefaultSampler(ps, "left_arm", c);
EXPECT_TRUE(s.get() != NULL);
constraint_samplers::IKConstraintSampler* iks = dynamic_cast<constraint_samplers::IKConstraintSampler*>(s.get());
ASSERT_TRUE(iks);
ASSERT_TRUE(iks->getPositionConstraint());
ASSERT_TRUE(iks->getOrientationConstraint());
static const int NT = 100;
int succ = 0;
for (int t = 0 ; t < NT ; ++t)
{
EXPECT_TRUE(s->sample(ks, ks_const, 100));
EXPECT_TRUE(iks->getPositionConstraint()->decide(ks).satisfied);
EXPECT_TRUE(iks->getOrientationConstraint()->decide(ks).satisfied);
if (s->sample(ks, ks_const, 1))
succ++;
}
ROS_INFO("Success rate for IK Constraint Sampler with position & orientation constraints for one arm: %lf", (double)succ / (double)NT);
//add additional ocm with smaller volume
ocm.absolute_x_axis_tolerance = 0.1;
c.orientation_constraints.push_back(ocm);
s = constraint_samplers::ConstraintSamplerManager::selectDefaultSampler(ps, "left_arm", c);
EXPECT_TRUE(s.get() != NULL);
iks = dynamic_cast<constraint_samplers::IKConstraintSampler*>(s.get());
ASSERT_TRUE(iks);
ASSERT_TRUE(iks->getOrientationConstraint());
EXPECT_NEAR(iks->getOrientationConstraint()->getXAxisTolerance(),.1, .0001);
}
示例13: main
//.........这里部分代码省略.........
boost::program_options::store(parse_config_file(cfgfile, cfgfile_options, true), vm);
cfgfile.close();
boost::program_options::notify(vm); // throws on error, so do after help in case
// there are any problems
} catch (boost::program_options::error& e) {
std::cerr << "ERROR: " << e.what() << std::endl << std::endl;
graceful_exit(idir, ERROR_COMMAND_LINE);
}
try {
if (vm.count("log.file"))
sLogFile = (const std::string&) vm["log.file"].as<std::string>();
if (vm.count("log.filter"))
sLogFilter = (const std::string&) vm["log.filter"].as<std::string>();
if (vm.count("log.rotationsize"))
iLogRotationSize = (int) vm["log.rotationsize"].as<int>();
if (vm.count("log.format"))
sLogFormat = (const std::string&) vm["log.format"].as<std::string>();
if (vm.count("debian.location"))
sDebianLocation = (const std::string&) vm["debian.location"].as<std::string>();
if (vm.count("debian.type"))
sDebianType = (const std::string&) vm["debian.type"].as<std::string>();
if (vm.count("ros.version"))
sRosVersion = (const std::string&) vm["ros.version"].as<std::string>();
if (sPackageName.empty()) {
std::cout << "Execution of this utility requires a package name" << std::endl;
graceful_exit(idir, ERROR_COMMAND_LINE);
}
if (sArchitecture.empty()) {
sPackageControlFile = sWorkingDir + "/pkgcontrol/"
+ sPackageName + ".pkgctl";
} else {
sPackageControlFile = sWorkingDir + "/pkgcontrol/" + sPackageName +
"." + sArchitecture + ".pkgctl";
}
if (vm.count("database.host"))
sDBHost = (const std::string&) vm["database.host"].as<std::string>();
if (vm.count("database.database"))
sDBDatabase = (const std::string&) vm["database.database"].as<std::string>();
if (vm.count("database.port"))
uiDBPort = (unsigned int) vm["database.port"].as<int>();
if (vm.count("database.user"))
sDBUser = (const std::string&) vm["database.user"].as<std::string>();
if (vm.count("database.password"))
sDBPassword = (const std::string&) vm["database.password"].as<std::string>();
} catch (std::exception& e) {
std::cerr << "Unhandled Exception reached after applying all options: "
<< e.what() << ", application will now exit" << std::endl;
graceful_exit(idir, ERROR_UNHANDLED_EXCEPTION);
}
/* Ready to run the utility
*
*/
ur::PackageControl pc(sPackageControlFile);
pc.readControlFile();
pc.setStageBase(sStageDir);
ur::PackageXML px;
px.readFile(pc.getPackageXML());
if(bTest) {
graceful_exit(idir, EXEC_SUCCESS);
}
ur::DebianPackage pkg(pc, px,
sArchitecture,
sSection,
sDebianType,
sDebianLocation,
sDBHost,
sDBDatabase,
sDBUser,
sDBPassword,
uiDBPort);
pkg.createStageDirectory();
pkg.stageManifest();
pkg.writeDebianControleFile();
pkg.generateChecksums();
pkg.generateDebianPackage();
pkg.moveDebianPackage();
pkg.deleteStaging();
return (EXEC_SUCCESS);
}
示例14: sizeof
void MetaspaceShared::generate_vtable_methods(void** vtbl_list,
void** vtable,
char** md_top,
char* md_end,
char** mc_top,
char* mc_end) {
intptr_t vtable_bytes = (num_virtuals * vtbl_list_size) * sizeof(void*);
*(intptr_t *)(*md_top) = vtable_bytes;
*md_top += sizeof(intptr_t);
void** dummy_vtable = (void**)*md_top;
*vtable = dummy_vtable;
*md_top += vtable_bytes;
// Get ready to generate dummy methods.
CodeBuffer cb((unsigned char*)*mc_top, mc_end - *mc_top);
MacroAssembler* masm = new MacroAssembler(&cb);
Label common_code;
for (int i = 0; i < vtbl_list_size; ++i) {
for (int j = 0; j < num_virtuals; ++j) {
dummy_vtable[num_virtuals * i + j] = (void*)masm->pc();
// Load rax, with a value indicating vtable/offset pair.
// -- bits[ 7..0] (8 bits) which virtual method in table?
// -- bits[12..8] (5 bits) which virtual method table?
// -- must fit in 13-bit instruction immediate field.
__ movl(rax, (i << 8) + j);
__ jmp(common_code);
}
}
__ bind(common_code);
#ifdef WIN32
// Expecting to be called with "thiscall" conventions -- the arguments
// are on the stack, except that the "this" pointer is in rcx.
#else
// Expecting to be called with Unix conventions -- the arguments
// are on the stack, including the "this" pointer.
#endif
// In addition, rax was set (above) to the offset of the method in the
// table.
#ifdef WIN32
__ push(rcx); // save "this"
#endif
__ mov(rcx, rax);
__ shrptr(rcx, 8); // isolate vtable identifier.
__ shlptr(rcx, LogBytesPerWord);
Address index(noreg, rcx, Address::times_1);
ExternalAddress vtbl((address)vtbl_list);
__ movptr(rdx, ArrayAddress(vtbl, index)); // get correct vtable address.
#ifdef WIN32
__ pop(rcx); // restore "this"
#else
__ movptr(rcx, Address(rsp, BytesPerWord)); // fetch "this"
#endif
__ movptr(Address(rcx, 0), rdx); // update vtable pointer.
__ andptr(rax, 0x00ff); // isolate vtable method index
__ shlptr(rax, LogBytesPerWord);
__ addptr(rax, rdx); // address of real method pointer.
__ jmp(Address(rax, 0)); // get real method pointer.
__ flush();
*mc_top = (char*)__ pc();
}
示例15: pc
bool InterruptedContext::in_system_trap() {
if (scp == &dummy_scp)
return false;
// system call, sysenter instruction
return pc()[0] == '\x0f' && pc()[1] == '\x34';
}