Esempio n. 1
0
oop CGContextConvertSizeToUserSpace_wrap(CGContextRef c, float x, float y) {
  CGSize p = CGContextConvertSizeToUserSpace(c, CGSizeMake(x, y));
  objVectorOop r = Memory->objVectorObj->cloneSize(2);
  r->obj_at_put(0, as_floatOop(p.width),  false);
  r->obj_at_put(1, as_floatOop(p.height), false);
  return r;
}
Esempio n. 2
0
oop CGContextGetTextPosition_wrap(CGContextRef c) {
  CGPoint p = CGContextGetTextPosition(c);
  objVectorOop r = Memory->objVectorObj->cloneSize(2);
  r->obj_at_put(0, as_floatOop(p.x), false);
  r->obj_at_put(1, as_floatOop(p.y), false);
  return r;
}
Esempio n. 3
0
oop CGContextConvertPointToUserSpace_wrap(CGContextRef c, float x, float y) {
  CGPoint p = CGContextConvertPointToUserSpace(c, CGPointMake(x, y));
  objVectorOop r = Memory->objVectorObj->cloneSize(2);
  r->obj_at_put(0, as_floatOop(p.x), false);
  r->obj_at_put(1, as_floatOop(p.y), false);
  return r;
}
Esempio n. 4
0
oop CGContextConvertRectToUserSpace_wrap(CGContextRef c, float xin, float y, float w, float h) {
  CGRect x = CGContextConvertRectToUserSpace(c, CGRectMake(xin, y, w, h));
  objVectorOop r = Memory->objVectorObj->cloneSize(4);
  r->obj_at_put(0, as_floatOop(x.origin.x), false);
  r->obj_at_put(1, as_floatOop(x.origin.y), false);
  r->obj_at_put(2, as_floatOop(x.size.width), false);
  r->obj_at_put(3, as_floatOop(x.size.height), false);
  return r;
}
Esempio n. 5
0
oop CGContextGetPathBoundingBox_wrap(CGContextRef c) {
  CGRect x = CGContextGetPathBoundingBox(c);
  objVectorOop r = Memory->objVectorObj->cloneSize(4);
  r->obj_at_put(0, as_floatOop(x.origin.x), false);
  r->obj_at_put(1, as_floatOop(x.origin.y), false);
  r->obj_at_put(2, as_floatOop(x.size.width), false);
  r->obj_at_put(3, as_floatOop(x.size.height), false);
  return r;
}
Esempio n. 6
0
void node_info::fill(oop node_oop, call_graph_node* n) {
  _num++;
  FILL_SLOT(user_time, as_floatOop(n->user_time));
  FILL_SLOT(optimized, as_floatOop(n->optimized()));
  FILL_SLOT(bytes,     as_smiOop(n->bytes_allocated));
  FILL_SLOT(blocks,    as_smiOop(n->block_clones));
# if TARGET_OS_VERSION_FOR_NPROF_TIMER == SUNOS_VERSION
  FILL_SLOT(accuracy,  as_floatOop(n->accuracy()));
# endif
}
Esempio n. 7
0
oop GetEventParam_CGSize(EventRef evt, uint32* name, uint32 name_len, void* FH) {
  if (name_len != 1) failure(FH, "name length is not 1 32-bit int");
  HISize p;
  OSStatus e = GetEventParameter( evt, EndianU32_BtoN(*name), typeHISize,
                                  NULL, sizeof(p), NULL, &p);
  if (e != noErr)  return (oop)reportOSError(e, "GetEventParam_CGSize", FH);
  objVectorOop r = Memory->objVectorObj->cloneSize(2);
  r->obj_at_put(0, as_floatOop(p.width), false);
  r->obj_at_put(1, as_floatOop(p.height), false);
  return r;
}
Esempio n. 8
0
 void fill(oop node_oop, fold_edge* e, oop fold_oop) {
   _num++;
   FILL_SLOT(fold,    fold_oop);
   FILL_SLOT(average, as_floatOop(e->average()));
   FILL_SLOT(min,     as_smiOop(e->min()));
   FILL_SLOT(max,     as_smiOop(e->max()));
 }
Esempio n. 9
0
oop ATSUGetUnjustifiedBounds_wrap( ATSUTextLayout     iTextLayout, 
                                   int                iLineStart,  // uint32
                                   int                iLineLength, // uint32
                                   void*              FH ) {
  ATSUTextMeasurement oTextBefore, oTextAfter, oAscent, oDescent;
  OSStatus e = ATSUGetUnjustifiedBounds( 
   iTextLayout, (uint32)iLineStart, (uint32)iLineLength, 
   &oTextBefore, &oTextAfter, &oAscent, &oDescent );
  if (e != noErr) {
      return  (oop)reportOSError(e, "ATSUGetUnjustifiedBounds", FH);
  }
  objVectorOop r = Memory->objVectorObj->cloneSize(4);
  r->obj_at_put(0, as_floatOop(Fix2X(oTextBefore)), false);
  r->obj_at_put(1, as_floatOop(Fix2X(oAscent)),     false);
  r->obj_at_put(2, as_floatOop(Fix2X(oTextAfter)),  false);
  r->obj_at_put(3, as_floatOop(Fix2X(oDescent)),    false);
  return r;
}
Esempio n. 10
0
oop float_mod_prim(floatOop x, floatOop y) {
  CHECK_XY;
  float xv = x->value();
  float yv = y->value();
  if (yv == 0) {
    return ErrorCodes::vmString_prim_error(DIVISIONBYZEROERROR);
  }
  double res= fmod(x->value(), yv);
  return as_floatOop(res);
}
Esempio n. 11
0
oop float_div_prim(floatOop x, floatOop y) {
  CHECK_XY;
  float xv = x->value();
  float yv = y->value();
  if (yv == 0)
    return ErrorCodes::vmString_prim_error(DIVISIONBYZEROERROR);

  float quo = xv / yv;
  return as_floatOop(quo);
}
Esempio n. 12
0
oop ATSUGetGlyphBounds_wrap( ATSUTextLayout     iTextLayout, 
                             float              fTextBasePointX,
                             float              fTextBasePointY,
                             int                iBoundsCharStart,  // uint32
                             int                iBoundsCharLength, // uint32
                             uint16             iTypeOfBounds,
                             void*              FH ) {
  ATSUTextMeasurement iTextBasePointX = X2Fix(fTextBasePointX);
  ATSUTextMeasurement iTextBasePointY = X2Fix(fTextBasePointY);
  
  ATSTrapezoid b;
  ItemCount oActualNumberOfBounds;
  
  OSStatus e = ATSUGetGlyphBounds( 
    iTextLayout,
    iTextBasePointX,  iTextBasePointY,
    iBoundsCharStart, iBoundsCharLength,
    iTypeOfBounds,
    1, //   ItemCount iMaxNumberOfBounds,
    &b, &oActualNumberOfBounds);       /* can be NULL */ 

  if (e != noErr) {
      return  (oop)reportOSError(e, "ATSUGetGlyphBounds", FH);
  }
  if (oActualNumberOfBounds < 1) {
   static char buf[1000];
    sprintf(buf, "ATSUGetGlyphBounds failed: returned %d bounds instead of 1", (int)oActualNumberOfBounds);
    failure(FH, buf);
    return NULL;
  }
  float L = min((float)Fix2X(b.upperLeft.x), (float)Fix2X(b.lowerLeft.x ));
  float T = max((float)Fix2X(b.upperLeft.y), (float)Fix2X(b.upperRight.y));
  
  float R = min((float)Fix2X(b.upperRight.x), (float)Fix2X(b.lowerRight.x));
  float B = max((float)Fix2X(b.lowerLeft.y ), (float)Fix2X(b.lowerRight.y));

  objVectorOop r = Memory->objVectorObj->cloneSize(4);
  r->obj_at_put(0, as_floatOop(L), false);
  r->obj_at_put(1, as_floatOop(T), false);
  r->obj_at_put(2, as_floatOop(R), false);
  r->obj_at_put(3, as_floatOop(B), false);
  return r;
}
Esempio n. 13
0
oop CGContextGetUserSpaceToDeviceSpaceTransform_wrap(CGContextRef c) {
  CGAffineTransform ctm = CGContextGetUserSpaceToDeviceSpaceTransform(c);
  objVectorOop r = Memory->objVectorObj->cloneSize(6);
  r->obj_at_put(0, as_floatOop(ctm.a ), false);
  r->obj_at_put(1, as_floatOop(ctm.b ), false);
  r->obj_at_put(2, as_floatOop(ctm.c ), false);
  r->obj_at_put(3, as_floatOop(ctm.d ), false);
  r->obj_at_put(4, as_floatOop(ctm.tx), false);
  r->obj_at_put(5, as_floatOop(ctm.ty), false);
  return r;
}
Esempio n. 14
0
objVectorOop CGContextGetTextMatrix_wrap(CGContext* con) {
  CGAffineTransform ctm = CGContextGetTextMatrix(con);
  objVectorOop r = Memory->objVectorObj->cloneSize(6);
  r->obj_at_put(0, as_floatOop(ctm.a ), false);
  r->obj_at_put(1, as_floatOop(ctm.b ), false);
  r->obj_at_put(2, as_floatOop(ctm.c ), false);
  r->obj_at_put(3, as_floatOop(ctm.d ), false);
  r->obj_at_put(4, as_floatOop(ctm.tx), false);
  r->obj_at_put(5, as_floatOop(ctm.ty), false);
  return r;
}
Esempio n. 15
0
oop as_float_prim(smiOop x) {
  if (!x->is_smi()) return ErrorCodes::vmString_prim_error(BADTYPEERROR);
  return as_floatOop(x->as_float_prim());
}
Esempio n. 16
0
  void fill(oop node_oop, Profiler *p) {
    FILL_SLOT(runtime,        as_floatOop(p->root->user_time));

#   if  TARGET_OS_VERSION_FOR_NPROF_TIMER == SOLARIS_VERSION
    FILL_SLOT(collect,
              as_floatOop(p->collect_time.milli_secs_as_float()));
    FILL_SLOT(build,
              as_floatOop(p->prof_time.milli_secs_as_float()));
#   elif  TARGET_OS_VERSION_FOR_NPROF_TIMER ==  SUNOS_VERSION
    FILL_SLOT(collect,        as_floatOop(p->collect_timer.millisecs()));
    FILL_SLOT(build,          as_floatOop(p->prof_timer.millisecs()));
#   endif
    FILL_SLOT(monitor,        as_floatOop(p->monitor_tick_time));
    FILL_SLOT(scavenge,       as_floatOop(p->scavenging_time));
    FILL_SLOT(garbageCollect, as_floatOop(p->garbage_collection_time));

    FILL_SLOT(compile,        as_floatOop(p->compile_time));
    FILL_SLOT(recompile,      as_floatOop(p->recompile_time));
    FILL_SLOT(uncommon,       as_floatOop(p->uncommon_branch_time));

    FILL_SLOT(methodFlush,    as_floatOop(p->nmethod_flush_time));
    FILL_SLOT(methodCompact,  as_floatOop(p->nmethod_compact_time));
  }