예제 #1
0
void Compiler::initTopScope() {
  if (recompileeRScope == NULL) {
    if (TypeFeedback) {
      recompileeRScope = 
        recompilee ?
	  (RScope*) RNonDummyScope::constructRScopes(recompilee) : 
	  (RScope*) new RInterpretedScope(NULL, -1, key, method, 0, true);
    } else {
      recompileeRScope = new RNullScope;
    }
  }
  if (PrintRScopes) recompileeRScope->printTree(0, 0);

  countID = Universe::code->nextNMethodID(); 
  Scope* parentScope = NULL;
  SendInfo* info = new SendInfo(NULL, key, NULL);
  InlinedScope* sender = NULL;	// no sender -- top scope in nmethod
    
  if (is_block_compile()) {
    // block method
    assert(parentNMethod != NULL, "parentNMethod must be set for block compile");
    assert(blockScope->parent() != NULL, "must know parent");
    parentScope = new_OutlinedScope(parentNMethod, blockScope->parent());
    topScope = BlockScope::new_BlockScope(method, parentScope->methodHolder(), parentScope, sender, recompileeRScope, info);
  } else {
    // normal method
    klassOop methodHolder = key->klass()->klass_part()->lookup_method_holder_for(method);
    topScope = MethodScope::new_MethodScope(method, methodHolder, sender, recompileeRScope, info);
  }
  // make sure home exists always
  assert(topScope->home() != NULL, "no home");
}
예제 #2
0
OutlinedBlockScope::OutlinedBlockScope(nmethod* nm, ScopeDesc* sc) : OutlinedScope(nm, sc) {
  ScopeDesc* parent = sc->parent(true);
  if (parent) {
    _parent = new_OutlinedScope(nm, parent);
  } else {
    _parent = NULL;
  }
}