Ejemplo n.º 1
0
// IRS setup for dyads x op y
// a is x, w is y
// fs is the f field of the verb (the verb to be applied repeatedly) - or 0 if none
// l, r are nominal ranks of fs
// f2 is a setup verb (jtover, jtreshape, etc)
A jtirs2(J jt,A a,A w,A fs,I l,I r,AF f2){A z;I af,ar,*old=jt->rank,rv[2],wf,wr;
 // push the jt->rank (pointer to ranks) stack.  push/pop may not match, no problem
 RZ(a&&w);
 ar=AR(a); rv[0]=l=efr(ar,l); af=ar-l;  // get rank, effective rank, length of frame...
 wr=AR(w); rv[1]=r=efr(wr,r); wf=wr-r;     // ...for both args
 if(!(af||wf))R CALL2(f2,a,w,fs);   // if no frame, call setup verb and return result
 ASSERT(!ICMP(AS(a),AS(w),MIN(af,wf)),EVLENGTH);   // verify agreement
 /* if(af&&wf&&af!=wf)R rank2ex(a,w,fs,l,r,f2); */
 jt->rank=rv; z=CALL2(f2,a,w,fs); jt->rank=old;   // save ranks, call setup verb, pop rank stack
  // Not all setup verbs (*f2)() use the fs argument.  
 R z;
}
Ejemplo n.º 2
0
VOIDPTRFUNC
CP_builtin_if(){

	OBJ env = ARG(0);
	OBJ argList = ARG(1);

	OBJ condExpr, ifExpr, elseExpr = NULL;
	
	int numArgs = length(argList);
	if( numArgs == 2){
		// case 1: else-less if -> (if cond <expr>)
		elseExpr = js_nil;

	} else if( numArgs == 3){
		// case 2: regular if -> (if cond <ifExpr> <elseExpr>)
		elseExpr = CAR( CDR( CDR( argList )));
	} else {
		js_error("(if): expects 2 or 3 arguments", js_nil);
	}

	condExpr = CAR(argList); 
	ifExpr = CAR( CDR(argList));
	
	CREATE_LOCALS(2);
	SET_LOCAL(0, ifExpr);
	SET_LOCAL(1, elseExpr);
	DEBUGCODE(PRINT_STACK->state, printJStack(__FILE__,__LINE__,__FUNCTION__) );
	CALL2(CP_js_eval, env, condExpr, CP_builtin_if2);
}
Ejemplo n.º 3
0
VOIDPTRFUNC
CP_builtin_set() {
    OBJ env = ARG(0);
    OBJ argList = ARG(1);
    OBJ varName, expr;
    VOIDPTRFUNC CP_builtin_set2();

    if (!ISCONS(argList)) {
	js_error("(set!) expects 2 arguments:", argList);
    }
    varName = CAR(argList);
    argList = CDR(argList);

    if (!ISCONS(argList)) {
	js_error("(set!) expects 2 arguments:", argList);
    }
    expr = CAR(argList);
    argList = CDR(argList);
    if (argList != js_nil) {
	js_error("(set!) expects 2 arguments:", argList);
    }

    if (!ISSYMBOL(varName)) {
	js_error("(set!) non symbol variable name:", varName);
    }
    if (expr == js_nil) {
	environmentSet(env, varName, expr);
	RETURN (js_void);
    }
    CREATE_LOCALS(1);
    SET_LOCAL(0, varName);
    ASSERT(env != NULL, "bad env");
    CALL2(CP_js_eval, env, expr, CP_builtin_set2);
    // not reached
}
Ejemplo n.º 4
0
// General setup for verbs with IRS that do not go through jtirs[12]
// A verb u["n] using this function checks to see whether it has multiple cells; if so,
// it calls here, giving a callback; we split the arguents into cells and call the callback,
// which is often the same original function that called here.
A jtrank2ex(J jt,A a,A w,A fs,I lr,I rr,AF f2){PROLOG(0042);A y,y0,ya,yw,z;B ab,b,wb;
   C*u,*uu,*v,*vv;I acn,acr,af,ak,ar,*as,at,k,mn,n=1,p,q,*s,wcn,wcr,wf,wk,wr,*ws,wt,yn,yr,*ys,yt;
 RZ(a&&w);
 at=AT(a); wt=AT(w);
 if(at&SPARSE||wt&SPARSE)R sprank2(a,w,fs,lr,rr,f2);
 // ?r=rank, ?s->shape, ?cr=effective rank, ?f=#frame, ?b=relative flag, for each argument
 ar=AR(a); as=AS(a); acr=efr(ar,lr); af=ar-acr; ab=ARELATIVE(a);
 wr=AR(w); ws=AS(w); wcr=efr(wr,rr); wf=wr-wcr; wb=ARELATIVE(w);
 if(!af&&!wf)R CALL2(f2,a,w,fs);  // if there's only one cell, run on it, that's the result
 // multiple cells.  Loop through them.
 // ?cn=number of atoms in a cell, ?k=#bytes in a cell, uv point to one cell before aw data
 // Allocate y? to hold one cell of ?, with uu,vv pointing to the data of y?
 RE(acn=prod(acr,as+af)); ak=acn*bp(at); u=CAV(a)-ak; NEWYA;
 RE(wcn=prod(wcr,ws+wf)); wk=wcn*bp(wt); v=CAV(w)-wk; NEWYW;
 // b means 'w frame is larger'; p=#larger frame; q=#shorter frame; s->larger frame
 // mn=#cells in larger frame (& therefore #cells in result); n=# times to repeat each cell
 //  from shorter-frame argument
 b=af<=wf; p=b?wf:af; q=b?af:wf; s=b?ws:as; RE(mn=prod(p,s)); RE(n=prod(p-q,s+q));
 ASSERT(!ICMP(as,ws,q),EVLENGTH);  // error if frames are not same as prefix
 // Initialize y? to hold data for the first cell; but if ? is empty, set y? to a cell of fills
 if(AN(a))MOVEYA else RZ(ya=reshape(vec(INT,acr,as+af),filler(a)));
 if(AN(w))MOVEYW else RZ(yw=reshape(vec(INT,wcr,ws+wf),filler(w)));
#define VALENCE  2
#define TEMPLATE 0
#include "cr_t.h"
}
Ejemplo n.º 5
0
Archivo: cr.c Proyecto: joebo/jgplsrc
A jtirs2(J jt,A a,A w,A fs,I l,I r,AF f2) {
    A z;
    I af,ar,*old=jt->rank,rv[2],wf,wr;
    RZ(a&&w);
    ar=AR(a);
    rv[0]=l=efr(ar,l);
    af=ar-l;
    wr=AR(w);
    rv[1]=r=efr(wr,r);
    wf=wr-r;
    if(!(af||wf))R CALL2(f2,a,w,fs);
    ASSERT(!ICMP(AS(a),AS(w),MIN(af,wf)),EVLENGTH);
    /* if(af&&wf&&af!=wf)R rank2ex(a,w,fs,l,r,f2); */
    jt->rank=rv;
    z=CALL2(f2,a,w,fs);
    jt->rank=old;
    R z;
}
Ejemplo n.º 6
0
VOIDPTRFUNC
CP_builtin_define(){


	OBJ env = ARG(0);
	OBJ argList = ARG(1);

	if( !ISCONS(argList) ){
		js_error("(define): expects at least  2 arguments", js_nil);
	}
	
	OBJ arg1 = CAR(argList);
	argList = CDR(argList);

	if( !ISCONS(argList) ){
		js_error("(define): expects at least  2 arguments", js_nil);
	}

	// case 1: define SYMBOL -> (define symbol expression)
	if( ISSYMBOL(arg1)) {
		OBJ arg2 = CAR(argList);
		argList = CDR(argList);
		VOIDPTRFUNC CP_builtin_define2();

		if( argList != js_nil ){
			js_error("(define): this form expects exactly 2 arguments", js_nil);
		}
		CREATE_LOCALS(1);
		SET_LOCAL(0, arg1);
		//printJStack(__FILE__,__LINE__,__FUNCTION__);
		DEBUGCODE(PRINT_STACK->state, printJStack(__FILE__,__LINE__,__FUNCTION__) );
		CALL2(CP_js_eval, env, arg2, CP_builtin_define2);
	}
	// case 2: define CONS ( function ) -> (define (name args*) (body*) )
	if( ISCONS(arg1)){
		
		OBJ name = CAR(arg1);
		if( ISSYMBOL(name) ){
			OBJ formalArgList = CDR(arg1);
			OBJ bodyList = argList;
			OBJ newUDF;

			newUDF = newUserDefinedFunction("anonymous lambda", formalArgList, bodyList);
			newUDF->u.userDefinedFunction.numLocals = count_defines(bodyList);
			newUDF->u.userDefinedFunction.home = env;
			environmentPut(env, name, newUDF);
			//printJStack(__FILE__,__LINE__,__FUNCTION__);
			DEBUGCODE(PRINT_STACK->state, printJStack(__FILE__,__LINE__,__FUNCTION__) );
			RETURN(js_void);
		}
	}
	error("define form unimplemented", __FILE__, __LINE__);
	// NOT REACHED
	return NULL;
}
Ejemplo n.º 7
0
Archivo: cr.c Proyecto: joebo/jgplsrc
static DF2(rank2) {
    DECLF;
    A h=sv->h;
    I ar,l,r,*v=AV(h),wr;
    RZ(a&&w);
    ar=AR(a);
    l=efr(ar,v[1]);
    wr=AR(w);
    r=efr(wr,v[2]);
    R l<ar||r<wr?rank2ex(a,w,fs,l,r,f2):CALL2(f2,a,w,fs);
}
Ejemplo n.º 8
0
  @define SLICE slice
  @define STRIDE stride
@endif

int main() {
    std::cout << "\"" << str << "\" sliced to (1, 4): "
              << (CALL2(boost::adaptors::SLICE,str,1,4))
              << std::endl;
    std::cout << "\"" << str << "\" | strided(2): "
              << (CALL1(boost::adaptors::STRIDE,str,2))
              << std::endl;

    return 0;
}
Ejemplo n.º 9
0
dylan_value Kadd_newXVKdMM2I (dylan_value vector_, dylan_value object_, dylan_value Urest_, dylan_value test_) {
  dylan_value testF5;
  dylan_value T6_0;
  dylan_value T7_0;
  DWORD T8T, T8;
  dylan_value result_T, result_;
  dylan_value T10;
  dylan_value T11;
  dylan_value T12_0;
  dylan_value T13;
  DWORD T14;
  dylan_value T15;
  dylan_value T16;
  DWORD T17;
  dylan_value T18_0;

  // /opt/opendylan-2014.1/sources/dylan/vector-speed.dylan:43
  primitive_type_check(test_, &KLfunctionGVKd);
  testF5 = test_;
  T13 = SLOT_VALUE_INITD(vector_, 0);
  T14 = primitive_cast_integer_as_raw(T13);
  T8T = 1;
  result_T = &KPfalseVKi;
L0: ;
    T8 = T8T;
    result_ = result_T;
    T15 = primitive_machine_word_equalQ(T8,T14);
    if (T15 == &KPfalseVKi) {
      T16 = REPEATED_DYLAN_VALUE_SLOT_VALUE_TAGGED(vector_, 1, T8);
      if (result_ == &KPfalseVKi) {
        T17 = primitive_machine_word_add_signal_overflow(T8,4);
        T10 = CALL2(testF5, T16, object_);
        T11 = T10;
        T8T = T17;
        result_T = T11;
        goto L0;
      }
    }
  if (result_ != &KPfalseVKi) {
    T6_0 = vector_;
    T7_0 = T6_0;
  } else {
    T18_0 = KaddXVKdMM1I(vector_, object_);
    T12_0 = T18_0;
    T7_0 = T12_0;
  }
  MV_SET_COUNT(1);
  return(T7_0);
}
Ejemplo n.º 10
0
VOIDPTRFUNC
CP_jREPL(){
	
	//fprintf(stdout, "\nStack in CP_jREPL:\n");
	//printJStack(__FILE__,__LINE__,__FUNCTION__);
	DEBUGCODE(PRINT_STACK->state, printJStack(__FILE__,__LINE__,__FUNCTION__));

	OBJ inputStream = ARG(0);

	OBJ expr;
	VOIDPTRFUNC CP_jREPL2();

	if( SP > 5) prompt_off();
	if(prompt_enabled) printf(CYN "JS> " RESET);
	expr = js_read(inputStream);				// R ead
	if( expr == js_eof ) RETURN( js_void );
	CALL2( CP_js_eval,globalEnvironment, expr, CP_jREPL2);	// E val
}
Ejemplo n.º 11
0
Archivo: outbox.c Proyecto: i12345/LLLL
int outbox_addrecipient_m1(
		outbox_addrecipient_a1* state
	) {
	Message* msg;
	Task* task = task_getcurrentforthiscore();

	while (-1) {
		StreamOut* stream =
			streamout_open(state->connectionfileID);

		streamout_upgrade_crypto(&stream, state->outbox->stamps, state->recipientnodeID);


		if (cqueue_peek(state->directedmessagesqueue))
			msg = cqueue_dequeue(state->directedmessagesqueue);
		else msg = cqueue_dequeue(state->outbox->idlequeue);


		stream_write_int(stream, msg->sender);
		stream_write_int(stream, msg->type);


		// any custom serializers come in now
		ptr serializer =
			wtree_lookup(
					state
						->outbox
						->serializers,
					msg->type
				);

		// void serializer(Message**, StreamOut*)
		if (serializer)
			CALL2(serializer, &msg, stream);



		streamout_flush(stream);
		streamout_close(stream);

		release(msg); /// msg-
	}
}
Ejemplo n.º 12
0
Archivo: cr.c Proyecto: joebo/jgplsrc
A jtrank2ex(J jt,A a,A w,A fs,I lr,I rr,AF f2) {
    PROLOG;
    A y,y0,ya,yw,z;
    B ab,b,wb;
    C*u,*uu,*v,*vv;
    I acn,acr,af,ak,ar,*as,at,k,mn,n=1,p,q,*s,wcn,wcr,wf,wk,wr,*ws,wt,yn,yr,*ys,yt;
    RZ(a&&w);
    at=AT(a);
    wt=AT(w);
    if(at&SPARSE||wt&SPARSE)R sprank2(a,w,fs,lr,rr,f2);
    ar=AR(a);
    as=AS(a);
    acr=efr(ar,lr);
    af=ar-acr;
    ab=ARELATIVE(a);
    wr=AR(w);
    ws=AS(w);
    wcr=efr(wr,rr);
    wf=wr-wcr;
    wb=ARELATIVE(w);
    if(!af&&!wf)R CALL2(f2,a,w,fs);
    RE(acn=prod(acr,as+af));
    ak=acn*bp(at);
    u=CAV(a)-ak;
    NEWYA;
    RE(wcn=prod(wcr,ws+wf));
    wk=wcn*bp(wt);
    v=CAV(w)-wk;
    NEWYW;
    b=af<=wf;
    p=b?wf:af;
    q=b?af:wf;
    s=b?ws:as;
    RE(mn=prod(p,s));
    RE(n=prod(p-q,s+q));
    ASSERT(!ICMP(as,ws,q),EVLENGTH);
    if(AN(a))MOVEYA else RZ(ya=reshape(vec(INT,acr,as+af),filler(a)));
    if(AN(w))MOVEYW else RZ(yw=reshape(vec(INT,wcr,ws+wf),filler(w)));
#define VALENCE  2
#define TEMPLATE 0
#include "cr_t.h"
}
Ejemplo n.º 13
0
Archivo: a.c Proyecto: adrian17/jsource
static DF2(swap2){DECLF; R jt->rank?irs2(w,a,fs,jt->rank[1],jt->rank[0],f2):CALL2(f2,w,a,fs);}
Ejemplo n.º 14
0
static dylan_value Kanonymous_of_spy_invoke_numbered_restartF23I (dylan_value type_, dylan_value test_, dylan_value handling_function_, dylan_value init_arguments_) {
  dylan_value T4;
  dylan_value T5;
  dylan_value T6;
  dylan_value T7;
  dylan_value restart_instance_;
  dylan_value T9;
  dylan_value T10;
  dylan_value T11;
  dylan_value T12;
  dylan_value T13;
  dylan_value T14;
  dylan_value T15;
  dylan_value T16;
  _KLsimple_object_vectorGVKd_2 T17 = {&KLsimple_object_vectorGVKdW, (dylan_value) 9};
  CAPTURE_ENVIRONMENT

  // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:144
  // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:145
  T4 = CALL2(&KsubtypeQVKd, type_, &KLrestartGVKd);
  // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:145
  if (T4 != &KPfalseVKi) {
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:146
    T15 = GET_DYLAN_VALUE_CELL_VAL(CREF(0));
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:146
    T16 = primitive_idQ(T15,CREF(1));
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:146
    if (T16 != &KPfalseVKi) {
      // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:148
      T5 = CALL2(&KsubtypeQVKd, type_, &KLabortGVKd);
      // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:148
      if (T5 != &KPfalseVKi) {
        // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:149
        T6 = CALL1(&KmakeVKd, type_);
        restart_instance_ = T6;
      } else {
        // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:151
        T17.vector_element_[0] = type_;
        T17.vector_element_[1] = init_arguments_;
        // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:151
        T7 = KapplyVKdI(&KmakeVKd, &T17);
        restart_instance_ = T7;
      }
      // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:148
      // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:153
      CONGRUENT_CALL_PROLOG(&Krestart_queryVKd, 1);
      CONGRUENT_CALL1(restart_instance_);
      // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:154
      T9 = handling_function_;
      // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:154
      CALL2(T9, restart_instance_, &Kspy_restart_decline_continuationVKiMM0);
    }
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:146
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:157
    T14 = GET_DYLAN_VALUE_CELL_VAL(CREF(0));
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:157
    CONGRUENT_CALL_PROLOG(&KAVKd, 2);
    T10 = CONGRUENT_CALL2(T14, (dylan_value) 5);
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:157
    SET_DYLAN_VALUE_CELL_VAL(CREF(0), T10);
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:157
    T11 = T10;
    MV_SET_ELT(0, T10);
    MV_SET_COUNT(1);
    T13 = T11;
  } else {
    // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:145
    T12 = &KPfalseVKi;
    MV_SET_ELT(0, &KPfalseVKi);
    MV_SET_COUNT(1);
    T13 = T12;
  }
  // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:145
  // /opt/opendylan-2014.1/sources/dylan/dylan-spy.dylan:144
  return(T13);
}
Ejemplo n.º 15
0
Archivo: x.c Proyecto: troels/openj
static DF2(secf2){A h=VAV(self)->h; ASSERT(!jt->seclev,EVSECURE); R CALL2((AF)*(1+AV(h)),a,w,self);}
Ejemplo n.º 16
0
static DF2(jtfitfill2){DECLFG;A z; jt->fill=gs; z=CALL2(f2,a,w,fs); jt->fill=0; R z;}
Ejemplo n.º 17
0
bool dylan_simple_condition_p (D instance) {
  return DTRUE == CALL2(&KinstanceQVKd, instance, Lsimple_conditionGVKe);
}
Ejemplo n.º 18
0
static DF2(jtfitct2){DECLFG;A z;D old=jt->ct; jt->ct=*DAV(gs); z=CALL2(f2,a,w,fs); jt->ct=old; R z;}
Ejemplo n.º 19
0
dylan_value KmemberQVKdMM2I (dylan_value value_, dylan_value collection_, dylan_value Urest_, dylan_value test_) {
  DADDR T5;
  DWORD T6;
  dylan_value T7;
  dylan_value T8;
  dylan_value T9;
  dylan_value T10_0;
  dylan_value T11;
  dylan_value T12;
  dylan_value mm_wrapper_;
  dylan_value T14;
  DWORD T15;
  dylan_value T16;
  dylan_value T17;
  dylan_value T18;
  dylan_value T19;
  dylan_value T20;
  dylan_value T21;
  dylan_value T22;
  DWORD T23;
  dylan_value T24;
  DWORD T25;
  dylan_value T26;
  DWORD indexF27T, indexF27;
  dylan_value T28;
  dylan_value T29;
  dylan_value Utmp_;
  dylan_value T31;
  dylan_value T32;
  dylan_value T33;
  dylan_value T34;
  dylan_value T35;
  DWORD T36;
  dylan_value T37;
  DWORD indexF38T, indexF38;
  dylan_value T39;
  dylan_value T40;
  dylan_value T41;
  dylan_value T42;
  dylan_value T43;

  // /opt/opendylan-2014.1/sources/dylan/vector-speed.dylan:30
  T39 = SLOT_VALUE_INITD(collection_, 0);
  T23 = primitive_cast_integer_as_raw(T39);
  T11 = primitive_idQ(test_,&KEEVKd);
  if (T11 != &KPfalseVKi) {
    T5 = primitive_cast_pointer_as_raw(value_);
    T6 = primitive_machine_word_logand(T5,3);
    T7 = primitive_machine_word_equalQ(T6,0);
    if (T7 != &KPfalseVKi) {
      T12 = primitive_element(value_,0,0);
      mm_wrapper_ = T12;
      T14 = SLOT_VALUE_INITD(mm_wrapper_, 1);
      T15 = primitive_cast_integer_as_raw(T14);
      T16 = primitive_machine_word_logbitQ(2,T15);
      T8 = T16;
    } else {
      T8 = &KPfalseVKi;
    }
    T17 = primitive_not(T8);
    T9 = T17;
  } else {
    T9 = &KPfalseVKi;
  }
  if (T9 != &KPfalseVKi) {
    indexF27T = 1;
  L0: ;
      indexF27 = indexF27T;
      T24 = primitive_machine_word_equalQ(indexF27,T23);
      if (T24 != &KPfalseVKi) {
        T18 = &KPfalseVKi;
        MV_SET_ELT(0, &KPfalseVKi);
        MV_SET_COUNT(1);
        T22 = T18;
      } else {
        T40 = REPEATED_DYLAN_VALUE_SLOT_VALUE_TAGGED(collection_, 1, indexF27);
        T19 = primitive_idQ(T40,value_);
        if (T19 != &KPfalseVKi) {
          T20 = &KPtrueVKi;
          MV_SET_ELT(0, &KPtrueVKi);
          MV_SET_COUNT(1);
          T21 = T20;
        } else {
          T25 = primitive_machine_word_add_signal_overflow(indexF27,4);
          indexF27T = T25;
          goto L0;
          T21 = T26;
        }
        T22 = T21;
      }
    T10_0 = T22;
  } else {
    indexF38T = 1;
  L1: ;
      indexF38 = indexF38T;
      T41 = primitive_machine_word_equalQ(indexF38,T23);
      if (T41 != &KPfalseVKi) {
        T33 = &KPfalseVKi;
        MV_SET_ELT(0, &KPfalseVKi);
        MV_SET_COUNT(1);
        T34 = T33;
      } else {
        T28 = test_;
        T42 = REPEATED_DYLAN_VALUE_SLOT_VALUE_TAGGED(collection_, 1, indexF38);
        T29 = CALL2(T28, value_, T42);
        if (T29 != &KPfalseVKi) {
          Utmp_ = &KPtrueVKi;
        } else {
          Utmp_ = &KPfalseVKi;
        }
        if (Utmp_ != &KPfalseVKi) {
          // /opt/opendylan-2014.1/sources/dylan/dispatch.dylan:170
          T43 = Utmp_;
          T35 = T43;
          T31 = T35;
          MV_SET_ELT(0, T35);
          MV_SET_COUNT(1);
          T32 = T31;
        } else {
          T36 = primitive_machine_word_add_signal_overflow(indexF38,4);
          indexF38T = T36;
          goto L1;
          T32 = T37;
        }
        T34 = T32;
      }
    T10_0 = T34;
  }
  MV_SET_COUNT(1);
  return(T10_0);
}
Ejemplo n.º 20
0
dylan_value KremoveVKdMM1I (dylan_value sequence_, dylan_value value_, dylan_value Urest_, dylan_value test_, dylan_value count_) {
  dylan_value testF6;
  dylan_value countF7;
  DWORD T8T, T8;
  dylan_value T9;
  dylan_value T10;
  DWORD T11T, T11;
  dylan_value T12;
  dylan_value T13_0;
  dylan_value T14_0;
  dylan_value T15_0;
  dylan_value new_sequence_;
  dylan_value T17;
  dylan_value T18;
  dylan_value T19;
  dylan_value changedQ_;
  dylan_value T21;
  dylan_value countF22;
  dylan_value T23;
  dylan_value T24;
  dylan_value T25;
  DWORD T26;
  dylan_value T27;
  DWORD T28;
  DWORD T29;
  dylan_value T30;
  dylan_value T31;
  dylan_value T32;
  dylan_value T33;
  dylan_value T34_0;
  dylan_value T35;
  DWORD T36;
  dylan_value T37;
  dylan_value T38;
  DWORD T39;
  dylan_value T40;
  DWORD T41;
  dylan_value T42;
  dylan_value T43;
  DWORD T44;
  dylan_value T45_0;
  dylan_value T46;
  dylan_value T47;

  // /opt/opendylan-2014.1/sources/dylan/vector-speed.dylan:20
  primitive_type_check(test_, &KLfunctionGVKd);
  testF6 = test_;
  primitive_type_check(count_, &K28);
  countF7 = count_;
  new_sequence_ = &KPempty_listVKi;
  changedQ_ = &KPfalseVKi;
  if (countF7 != &KPfalseVKi) {
    T47 = countF7;
    T25 = T47;
    countF22 = T25;
    T35 = SLOT_VALUE_INITD(sequence_, 0);
    T36 = primitive_cast_integer_as_raw(T35);
    T8T = 1;
  L0: ;
      T8 = T8T;
      T37 = primitive_machine_word_equalQ(T8,T36);
      if (T37 == &KPfalseVKi) {
        T38 = REPEATED_DYLAN_VALUE_SLOT_VALUE_TAGGED(sequence_, 1, T8);
        T24 = countF22;
        T26 = primitive_cast_integer_as_raw(T24);
        T27 = primitive_machine_word_less_thanQ(1,T26);
        if (T27 != &KPfalseVKi) {
          T9 = CALL2(testF6, T38, value_);
          T10 = T9;
        } else {
          T10 = &KPfalseVKi;
        }
        if (T10 != &KPfalseVKi) {
          T23 = countF22;
          T28 = primitive_cast_integer_as_raw(T23);
          T29 = primitive_machine_word_subtract_signal_overflow(T28,4);
          T30 = primitive_cast_raw_as_integer(T29);
          countF22 = T30;
          changedQ_ = &KPtrueVKi;
        } else {
          T19 = new_sequence_;
          T31 = primitive_object_allocate_filled(3,&KLpairGVKdW,2,&KPunboundVKi,0,0,&KPunboundVKi);
          SLOT_VALUE_SETTER(T38, T31, 0);
          SLOT_VALUE_SETTER(T19, T31, 1);
          new_sequence_ = T31;
        }
        T39 = primitive_machine_word_add_signal_overflow(T8,4);
        T8T = T39;
        goto L0;
      }
  } else {
    T40 = SLOT_VALUE_INITD(sequence_, 0);
    T41 = primitive_cast_integer_as_raw(T40);
    T11T = 1;
  L1: ;
      T11 = T11T;
      T42 = primitive_machine_word_equalQ(T11,T41);
      if (T42 == &KPfalseVKi) {
        T43 = REPEATED_DYLAN_VALUE_SLOT_VALUE_TAGGED(sequence_, 1, T11);
        T12 = CALL2(testF6, T43, value_);
        if (T12 != &KPfalseVKi) {
          changedQ_ = &KPtrueVKi;
        } else {
          T18 = new_sequence_;
          T32 = primitive_object_allocate_filled(3,&KLpairGVKdW,2,&KPunboundVKi,0,0,&KPunboundVKi);
          SLOT_VALUE_SETTER(T43, T32, 0);
          SLOT_VALUE_SETTER(T18, T32, 1);
          new_sequence_ = T32;
        }
        T44 = primitive_machine_word_add_signal_overflow(T11,4);
        T11T = T44;
        goto L1;
      }
  }
  T21 = changedQ_;
  if (T21 != &KPfalseVKi) {
    T45_0 = Kobject_classVKdI(sequence_);
    T46 = T45_0;
    T17 = new_sequence_;
    T33 = KreverseXVKdMM2I(T17);
    CONGRUENT_CALL_PROLOG(&KasVKd, 2);
    T13_0 = CONGRUENT_CALL2(T46, T33);
    T34_0 = T13_0;
    T15_0 = T34_0;
  } else {
    T14_0 = sequence_;
    T15_0 = T14_0;
  }
  MV_SET_COUNT(1);
  return(T15_0);
}
Ejemplo n.º 21
0
#include "Process.class.h"
#include <TaskManager/Task.ns.h>
#include <Process.iface.h>
#include <UserManager/Usr.ns.h>
#include <VirtualTerminal.iface.h>
#include <SyscallManager/Res.ns.h>

#define ISPARENT Task::currProcess()->getPid() == m_ppid

call_t Process::m_callTable[] = {
	CALL0(PRIF_EXIT, &Process::exitSC),
	CALL2(PRIF_ALLOCPAGES, &Process::allocPagesSC),
	CALL2(PRIF_FREEPAGES, &Process::freePagesSC),
	CALL0(PRIF_GETPID, &Process::getPid),
	CALL0(PRIF_GETPPID, &Process::getPpid),
	CALL0(PRIF_GETUID, &Process::getUid),
	CALL0(PRIF_ARGC, &Process::argcSC),
	CALL1(PRIF_ARGV, &Process::argvSC),
	CALL0(PRIF_START, &Process::startSC),
	CALL1(PRIF_AUTODELETE, &Process::autoDeleteSC),
	CALL1(PRIF_PUSHARG, &Process::pushArgSC),
	CALL1(PRIF_SETOUTVT, &Process::setOutVTSC),
	CALL1(PRIF_SETINVT, &Process::setInVTSC),
	CALL2(PRIF_AUTHPW, &Process::authPWSC),
	CALL1(PRIF_AUTHNOPW, &Process::authNoPWSC),
	CALL0(0, 0)
};

u32int Process::scall(u8int wat, u32int a, u32int b, u32int c, u32int d) {
	if (wat == PRIF_SGETCPR) return Task::currProcess()->resId();
	if (wat == PRIF_SRUN) {
Ejemplo n.º 22
0
INLINE BOOL simple_condition_p (D instance) {
  return(DTRUE == CALL2(&KinstanceQVKd, instance, Lsimple_conditionGVKe));
}
Ejemplo n.º 23
0
Archivo: a.c Proyecto: adrian17/jsource
static DF1(swap1){DECLF; R jt->rank?irs2(w,w,fs,jt->rank[1],jt->rank[1],f2):CALL2(f2,w,w,fs);}