comparison src/share/vm/graal/graalRuntime.cpp @ 7154:5d0bb7d52783

changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
author Doug Simon <doug.simon@oracle.com>
date Wed, 12 Dec 2012 21:36:40 +0100
parents 6c46172c04bf
children 8a3efb8c831d
comparison
equal deleted inserted replaced
7153:c421c19b7bf8 7154:5d0bb7d52783
117 // create assembler for code generation 117 // create assembler for code generation
118 GraalStubAssembler* sasm = new GraalStubAssembler(&code, name_for(id), id); 118 GraalStubAssembler* sasm = new GraalStubAssembler(&code, name_for(id), id);
119 // generate code for runtime stub 119 // generate code for runtime stub
120 OopMapSet* oop_maps; 120 OopMapSet* oop_maps;
121 oop_maps = generate_code_for(id, sasm); 121 oop_maps = generate_code_for(id, sasm);
122 assert(oop_maps == NULL || sasm->frame_size() != no_frame_size, 122 assert(oop_maps == NULL || sasm->frame_size() != GraalStubAssembler::no_frame_size,
123 "if stub has an oop map it must have a valid frame size"); 123 "if stub has an oop map it must have a valid frame size");
124 124
125 #ifdef ASSERT 125 #ifdef ASSERT
126 // Make sure that stubs that need oopmaps have them 126 // Make sure that stubs that need oopmaps have them
127 switch (id) { 127 switch (id) {
128 // These stubs don't need to have an oopmap 128 // These stubs don't need to have an oopmap
129 case graal_slow_subtype_check_id: 129 case graal_slow_subtype_check_id:
130 #if defined(SPARC) || defined(PPC) 130 #if defined(SPARC) || defined(PPC)
131 case handle_exception_nofpu_id: // Unused on sparc 131 case handle_exception_nofpu_id: // Unused on sparc
132 #endif 132 #endif
133 #ifdef GRAAL
134 case graal_verify_oop_id: 133 case graal_verify_oop_id:
135 case graal_unwind_exception_call_id: 134 case graal_unwind_exception_call_id:
136 case graal_OSR_migration_end_id: 135 case graal_OSR_migration_end_id:
137 case graal_arithmetic_frem_id: 136 case graal_arithmetic_frem_id:
138 case graal_arithmetic_drem_id: 137 case graal_arithmetic_drem_id:
139 case graal_set_deopt_info_id: 138 case graal_set_deopt_info_id:
140 #endif
141 break; 139 break;
142 140
143 // All other stubs should have oopmaps 141 // All other stubs should have oopmaps
144 default: 142 default:
145 assert(oop_maps != NULL, "must have an oopmap"); 143 assert(oop_maps != NULL, "must have an oopmap");
166 void GraalRuntime::initialize(BufferBlob* blob) { 164 void GraalRuntime::initialize(BufferBlob* blob) {
167 // generate stubs 165 // generate stubs
168 for (int id = 0; id < number_of_ids; id++) generate_blob_for(blob, (StubID)id); 166 for (int id = 0; id < number_of_ids; id++) generate_blob_for(blob, (StubID)id);
169 // printing 167 // printing
170 #ifndef PRODUCT 168 #ifndef PRODUCT
171 if (PrintSimpleStubs) { 169 if (GraalPrintSimpleStubs) {
172 ResourceMark rm; 170 ResourceMark rm;
173 for (int id = 0; id < number_of_ids; id++) { 171 for (int id = 0; id < number_of_ids; id++) {
174 _blobs[id]->print(); 172 _blobs[id]->print();
175 if (_blobs[id]->oop_maps() != NULL) { 173 if (_blobs[id]->oop_maps() != NULL) {
176 _blobs[id]->oop_maps()->print(); 174 _blobs[id]->oop_maps()->print();
467 assert(h_obj()->is_oop(), "must be NULL or an object"); 465 assert(h_obj()->is_oop(), "must be NULL or an object");
468 if (UseBiasedLocking) { 466 if (UseBiasedLocking) {
469 // Retry fast entry if bias is revoked to avoid unnecessary inflation 467 // Retry fast entry if bias is revoked to avoid unnecessary inflation
470 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK); 468 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK);
471 } else { 469 } else {
472 if (UseFastLocking) { 470 if (GraalUseFastLocking) {
473 // When using fast locking, the compiled code has already tried the fast case 471 // When using fast locking, the compiled code has already tried the fast case
474 ObjectSynchronizer::slow_enter(h_obj, lock, THREAD); 472 ObjectSynchronizer::slow_enter(h_obj, lock, THREAD);
475 } else { 473 } else {
476 ObjectSynchronizer::fast_enter(h_obj, lock, false, THREAD); 474 ObjectSynchronizer::fast_enter(h_obj, lock, false, THREAD);
477 } 475 }
498 thread->print_stack_on(tty); 496 thread->print_stack_on(tty);
499 assert(false, "invalid lock object pointer dected"); 497 assert(false, "invalid lock object pointer dected");
500 } 498 }
501 #endif 499 #endif
502 500
503 if (UseFastLocking) { 501 if (GraalUseFastLocking) {
504 // When using fast locking, the compiled code has already tried the fast case 502 // When using fast locking, the compiled code has already tried the fast case
505 ObjectSynchronizer::slow_exit(obj, lock, THREAD); 503 ObjectSynchronizer::slow_exit(obj, lock, THREAD);
506 } else { 504 } else {
507 ObjectSynchronizer::fast_exit(obj, lock, THREAD); 505 ObjectSynchronizer::fast_exit(obj, lock, THREAD);
508 } 506 }