Beispiel #1
0
  void SICompiler::initialize() {
    assert(theSIC == NULL, "shouldn't have but one compiler at a time");
    theSIC = lastSIC = this;
    theAssembler = new Assembler(SICInstructionsSize, SICInstructionsSize / 2,
                                 PrintSICCompiledCode, true);
    stackLocCount = argCount = 0;
    countID = 0;
    nodeGen = new NodeGen(L, send_desc, diLink);
    topScope = NULL;
    splitSig = NULL;
    bbIterator = new BBIterator;
    /* theAllocator = */ new SICAllocator();
    if (theRecompilation && theRecompilation->recompileeVScopes) {
      vscopes = theRecompilation->recompileeVScopes;
    } else {
      vscopes = NULL; 
    }
    if (baseLookupType(L->lookupType()) == NormalBaseLookupType) {
      // ignore the receiver static bit (same nmethod covers both cases)
      L->clearReceiverStatic();
    }

    dispatchToCode();
    

    SScope::currentScopeID = 0;
    ncodes = 0;
    rec = new ScopeDescRecorder(SICScopesSize, SICPCsSize);

    initTopScope();
    initLimits();

    initializeForPlatform();
  }
Beispiel #2
0
void Compiler::initialize(RScope* remote_scope) {
  //assert(VMProcess::vm_operation() != NULL, "must be in vmProcess to compile");
  if (VMProcess::vm_operation() == NULL)
    warning("should be in vmProcess to compile"); //softened to a warning to support testing
  nofCompilations++;
#ifdef DEBUG
  messages = new stringStream(250 * K);
#endif

  if (remote_scope) {
    _uses_inlining_database = true;
    recompileeRScope = remote_scope;
  } else {
    _uses_inlining_database = false;
  }

  recompileeRScope = remote_scope;
  assert(theCompiler == NULL, "shouldn't have but one compiler at a time");
  assert(theMacroAssm == NULL, "shouldn't have an assembler yet");
  PReg::initPRegs();	// must come early (before any PReg allocation)
  initNodes();		// same here (before creating nodes)
  initLimits();
  theCompiler	= lastCompiler = this;
  _code         = new CodeBuffer(CompilerInstrsSize, CompilerInstrsSize / 2);
  countID	= -1;
  topScope	= NULL;
  bbIterator 	= new BBIterator;
  /* theAllocator = */ new RegisterAllocator();
  assert(method, "must have method");
  Scope::initialize();
  _totalNofBytes = 0;
  _special_handler_call_offset = -1;
  _entry_point_offset = -1;
  _verified_entry_point_offset = -1;
  _totalNofFloatTemporaries = -1;
  _float_section_size = 0;
  _float_section_start_offset = 0;
  rec = new ScopeDescRecorder(CompilerScopesSize, CompilerPCsSize);
  // Save dependency information in the scopeDesc recorder.
  rec->add_dependant(key);

  nlrTestPoints = new GrowableArray<NLRTestNode*>(50); 
  contextList = NULL;
  scopes = new GrowableArray<InlinedScope*>(50);
  blockClosures = new GrowableArray<BlockPReg*>(50);
  firstNode = NULL;
  reporter = new PerformanceDebugger(this);
  initTopScope();
}