Example #1
0
  void init_maps(int length) {
    _cp_map.initialize(length, -1);
    // Choose an initial value large enough that we don't get frequent
    // calls to grow().
    _cp_cache_map.initialize(length/2);
    // Also cache resolved objects, in another different cache.
    _reference_map.initialize(length, -1);
    _resolved_references_map.initialize(length/2);
    _invokedynamic_references_map.initialize(length/2);
    _resolved_reference_limit = -1;
    _first_iteration_cp_cache_limit = -1;

    // invokedynamic specific fields
    _invokedynamic_cp_cache_map.initialize(length/4);
    _patch_invokedynamic_bcps = new GrowableArray<address>(length/4);
    _patch_invokedynamic_refs = new GrowableArray<int>(length/4);
  }
Example #2
0
 int add_cp_cache_entry(int cp_index) {
   assert((cp_index & _secondary_entry_tag) == 0, "bad tag");
   assert(_cp_map[cp_index] == -1, "not twice on same cp_index");
   int cache_index = _cp_cache_map.append(cp_index);
   _cp_map.at_put(cp_index, cache_index);
   assert(cp_entry_to_cp_cache(cp_index) == cache_index, "");
   return cache_index;
 }
Example #3
0
void main(void) {
	int iteration = 0;

	intArray::const_iterator it;

	cur[1] = 1;	

	do {
		for ( it = cur.begin(); it != cur.end(); it++ ) {
			last[it->first] = it->second;
		}

		for ( it = last.begin(); it != last.end(); it++ ) {
			if ( it->second != 0 ) {
				cur[ it->first ]++;				
				cur[ it->second ]++;
			}			
		}

		if ( (iteration % 100) == 0 ) {
			printf("%d\n", iteration);
		}

	} while ( ++iteration < 1000 );

	for ( it = cur.begin(); it != cur.end(); it++ ) {
		if ( it->second != 0 ) {
			printf("<%d %d>, ", it->second, it->first);
		}
	}
}
Example #4
0
void constantPoolCacheOopDesc::initialize(intArray& inverse_index_map) {
  assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
  for (int i = 0; i < length(); i++) {
    ConstantPoolCacheEntry* e = entry_at(i);
    int original_index = inverse_index_map[i];
    if ((original_index & Rewriter::_secondary_entry_tag) != 0) {
      int main_index = (original_index - Rewriter::_secondary_entry_tag);
      assert(!entry_at(main_index)->is_secondary_entry(), "valid main index");
      e->initialize_secondary_entry(main_index);
    } else {
      e->initialize_entry(original_index);
    }
    assert(entry_at(i) == e, "sanity");
  }
}
Example #5
0
void constantPoolCacheOopDesc::initialize(intArray& inverse_index_map) {
  assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
  for (int i = 0; i < length(); i++) entry_at(i)->set_initial_state(inverse_index_map[i]);
}
Example #6
0
 bool has_cp_cache(int i) { return (uint)i < (uint)_cp_map.length() && _cp_map[i] >= 0; }
Example #7
0
 bool has_entry_in_resolved_references(int cp_index) const {
   return (uint)cp_index < (uint)_reference_map.length() && _reference_map[cp_index] >= 0;
 }
Example #8
0
 void init_cp_map(int length) {
   _cp_map.initialize(length, -1);
   // Choose an initial value large enough that we don't get frequent
   // calls to grow().
   _cp_cache_map.initialize(length / 2);
 }