116 if (! fnmatch(SharkOptimizationLevel, "None", 0)) { 117 tty->print_cr("Shark optimization level set to: None"); 118 builder.setOptLevel(llvm::CodeGenOpt::None); 119 } else if (! fnmatch(SharkOptimizationLevel, "Less", 0)) { 120 tty->print_cr("Shark optimization level set to: Less"); 121 builder.setOptLevel(llvm::CodeGenOpt::Less); 122 } else if (! fnmatch(SharkOptimizationLevel, "Aggressive", 0)) { 123 tty->print_cr("Shark optimization level set to: Aggressive"); 124 builder.setOptLevel(llvm::CodeGenOpt::Aggressive); 125 } // else Default is selected by, well, default :-) 126 _execution_engine = builder.create(); 127 128 if (!execution_engine()) { 129 if (!ErrorMsg.empty()) 130 printf("Error while creating Shark JIT: %s\n",ErrorMsg.c_str()); 131 else 132 printf("Unknown error while creating Shark JIT\n"); 133 exit(1); 134 } 135 136 execution_engine()->addModule( 137 _native_context->module()); 138 139 // All done 140 mark_initialized(); 141 } 142 143 void SharkCompiler::initialize() { 144 ShouldNotCallThis(); 145 } 146 147 void SharkCompiler::compile_method(ciEnv* env, 148 ciMethod* target, 149 int entry_bci) { 150 assert(is_initialized(), "should be"); 151 ResourceMark rm; 152 const char *name = methodname( 153 target->holder()->name()->as_utf8(), target->name()->as_utf8()); 154 155 // Do the typeflow analysis 156 ciTypeFlow *flow; 157 if (entry_bci == InvocationEntryBci) 158 flow = target->get_flow_analysis(); 159 else 160 flow = target->get_osr_flow_analysis(entry_bci); | 116 if (! fnmatch(SharkOptimizationLevel, "None", 0)) { 117 tty->print_cr("Shark optimization level set to: None"); 118 builder.setOptLevel(llvm::CodeGenOpt::None); 119 } else if (! fnmatch(SharkOptimizationLevel, "Less", 0)) { 120 tty->print_cr("Shark optimization level set to: Less"); 121 builder.setOptLevel(llvm::CodeGenOpt::Less); 122 } else if (! fnmatch(SharkOptimizationLevel, "Aggressive", 0)) { 123 tty->print_cr("Shark optimization level set to: Aggressive"); 124 builder.setOptLevel(llvm::CodeGenOpt::Aggressive); 125 } // else Default is selected by, well, default :-) 126 _execution_engine = builder.create(); 127 128 if (!execution_engine()) { 129 if (!ErrorMsg.empty()) 130 printf("Error while creating Shark JIT: %s\n",ErrorMsg.c_str()); 131 else 132 printf("Unknown error while creating Shark JIT\n"); 133 exit(1); 134 } 135 136 execution_engine()->addModule(_native_context->module()); 137 138 // All done 139 set_state(initialized); 140 } 141 142 void SharkCompiler::initialize() { 143 ShouldNotCallThis(); 144 } 145 146 void SharkCompiler::compile_method(ciEnv* env, 147 ciMethod* target, 148 int entry_bci) { 149 assert(is_initialized(), "should be"); 150 ResourceMark rm; 151 const char *name = methodname( 152 target->holder()->name()->as_utf8(), target->name()->as_utf8()); 153 154 // Do the typeflow analysis 155 ciTypeFlow *flow; 156 if (entry_bci == InvocationEntryBci) 157 flow = target->get_flow_analysis(); 158 else 159 flow = target->get_osr_flow_analysis(entry_bci); |