Пример #1
0
static void bc_escape_analysis_dirty(bc_escape_analysis_t *be, s4 local) {
	op_stack_slot_t adr_param;

	if (0 <= local && local < be->local_to_adr_param_size) {
		adr_param = be->local_to_adr_param[local];
		if (op_stack_slot_is_param(adr_param)) {
			bit_vector_set(be->adr_param_dirty, adr_param.index);
		}
	}
}
Пример #2
0
static void bc_escape_analysis_returned(bc_escape_analysis_t *be, op_stack_slot_t value) {
	if (op_stack_slot_is_param(value)) {
		/* A parameter is returned, mark it as being returned. */
		bit_vector_set(be->adr_param_returned, value.index);
		/* The escape state of the return value will be adjusted later. */
	} else {
		/* Adjust escape state of return value. */
		if (be->method->parseddesc->returntype.type == TYPE_ADR) {
			be->param_escape[-1] = escape_state_to_u1(ESCAPE_GLOBAL);
		}
		bc_escape_analysis_adjust_state(be, value, ESCAPE_GLOBAL);
	}
}
Пример #3
0
int main(int argc, char **argv) {
    const int limit = 50 * 1000 * 1000;
    int sieve_limit;
    sieve *s;
    bit_vector *solutions;
    int x, y, z, sum;

    (void) argc;
    (void) argv;

    sieve_limit = (int) ceil(sqrt((double) limit));
    s = sieve_create(sieve_limit);
    solutions = bit_vector_create(limit);

    x = 2;
    while (x > 0 && x * x < limit) {
        y = 2;
        while (y > 0 && x * x + y * y * y < limit) {
            z = 2;
            sum = x * x + y * y * y + z * z * z * z;
            while (z > 0 && sum < limit) {
                if (sum < limit) {
                    bit_vector_set(solutions, sum, 1);
                }
                z = sieve_next_prime(s, z);
                sum = x * x + y * y * y + z * z * z * z;
            }
            y = sieve_next_prime(s, y);
        }
        x = sieve_next_prime(s, x);
    }

    printf("solutions = %d\n", bit_vector_popcount(solutions));

    sieve_free(s);
    bit_vector_free(solutions);
    return 0;
}