Esempio n. 1
0
static void expand_pattern(char * pat)
{
    char * prefix, * p, * name;
    int handle;
    struct _finddata_t ffblk;
    size_t i;

    handle = _findfirst(pat, &ffblk);
    if (handle == -1) {
        store_argument(pat); /* a la Bourne shell */
        return;
    }
    prefix = caml_strdup(pat);
    for (i = strlen(prefix); i > 0; i--) {
        char c = prefix[i - 1];
        if (c == '\\' || c == '/' || c == ':') {
            prefix[i] = 0;
            break;
        }
    }
    do {
        name = caml_strconcat(2, prefix, ffblk.name);
        store_argument(name);
    } while (_findnext(handle, &ffblk) != -1);
    _findclose(handle);
    caml_stat_free(prefix);
}
Esempio n. 2
0
void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
  Argument  jni_arg(jni_offset(), false);
  Register  Rtmp = O0;

#ifdef ASSERT
  if (TaggedStackInterpreter) {
    // check at least one tag is okay
    Label ok;
    __ ld_ptr(Llocals, Interpreter::local_tag_offset_in_bytes(offset() + 1), Rtmp);
    __ cmp(Rtmp, G0);
    __ brx(Assembler::equal, false, Assembler::pt, ok);
    __ delayed()->nop();
    __ stop("Native object has bad tag value");
    __ bind(ok);
  }
#endif // ASSERT

#ifdef _LP64
  __ ldx(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp);
  __ store_long_argument(Rtmp, jni_arg);
#else
  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp);
  __ store_argument(Rtmp, jni_arg);
  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset() + 0), Rtmp);
  Argument successor(jni_arg.successor());
  __ store_argument(Rtmp, successor);
#endif
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_double() {
  Argument  jni_arg(jni_offset(), false);
#ifdef _LP64
  FloatRegister  Rtmp = F0;
  __ ldf(FloatRegisterImpl::D, Llocals, -(offset() + 1) * wordSize, Rtmp);
  __ store_double_argument(Rtmp, jni_arg);
#else
  Register  Rtmp = O0;
  __ ld(Llocals, -(offset() + 1) * wordSize, Rtmp);
  __ store_argument(Rtmp, jni_arg);
  __ ld(Llocals, -offset() * wordSize, Rtmp);
  __ store_argument(Rtmp, jni_arg.successor());
#endif
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
  Argument  jni_arg(jni_offset(), false);
  Register  Rtmp = O0;

#ifdef _LP64
  __ ldx(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp);
  __ store_long_argument(Rtmp, jni_arg);
#else
  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp);
  __ store_argument(Rtmp, jni_arg);
  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset() + 0), Rtmp);
  Argument successor(jni_arg.successor());
  __ store_argument(Rtmp, successor);
#endif
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
  Argument  jni_arg(jni_offset(), false);
  Register  Rtmp = O0;
  Register  Rtmp1 = G3_scratch;

#ifdef _LP64
  __ ldx(Llocals, -(offset() + 1) * wordSize, Rtmp);
  __ store_long_argument(Rtmp, jni_arg);
#else
  __ ld(Llocals, -(offset() + 1) * wordSize, Rtmp);
  __ store_argument(Rtmp, jni_arg            );
  __ ld(Llocals, -(offset() + 0) * wordSize, Rtmp);
  __ store_argument(Rtmp, jni_arg.successor());
#endif
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_word(int size_of_arg, int offset_in_arg) {
  Argument  jni_arg(jni_offset() + offset_in_arg, false);
  Register     Rtmp = O0;
  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);

  __ store_argument(Rtmp, jni_arg);
}
Esempio n. 7
0
static void expand_argument(char * arg)
{
    char * p;

    for (p = arg; *p != 0; p++) {
        if (*p == '*' || *p == '?') {
            expand_pattern(arg);
            return;
        }
    }
    store_argument(arg);
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
  Argument  jni_arg(jni_offset(), false);
#ifdef _LP64
  FloatRegister  Rtmp = F0;
  __ ldf(FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
  __ store_float_argument(Rtmp, jni_arg);
#else
  Register     Rtmp = O0;
  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
  __ store_argument(Rtmp, jni_arg);
#endif
}
Esempio n. 9
0
static void expand_pattern(char * pat)
{
  int handle;
  struct _finddata_t ffblk;
  int preflen;

  handle = _findfirst(pat, &ffblk);
  if (handle == -1) {
    store_argument(pat); /* a la Bourne shell */
    return;
  }
  for (preflen = strlen(pat); preflen > 0; preflen--) {
    char c = pat[preflen - 1];
    if (c == '\\' || c == '/' || c == ':') break;
  }
  do {
    char * name = malloc(preflen + strlen(ffblk.name) + 1);
    if (name == NULL) out_of_memory();
    memcpy(name, pat, preflen);
    strcpy(name + preflen, ffblk.name);
    store_argument(name);
  } while (_findnext(handle, &ffblk) != -1);
  _findclose(handle);
}
Esempio n. 10
0
static void expand_argument(char * arg)
{
  char * p;

  if (arg[0] == '@') {
    expand_diversion(arg + 1);
    return;
  }
  for (p = arg; *p != 0; p++) {
    if (*p == '*' || *p == '?') {
      expand_pattern(arg);
      return;
    }
  }
  store_argument(arg);
}