Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalRuntime.cpp @ 7226:8a3efb8c831d
Merge.
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Fri, 14 Dec 2012 13:02:49 +0100 |
parents | 720925633b3a 5d0bb7d52783 |
children | a6bd253a770f |
comparison
equal
deleted
inserted
replaced
7225:31c4d9f9e922 | 7226:8a3efb8c831d |
---|---|
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(); |
470 assert(h_obj()->is_oop(), "must be NULL or an object"); | 468 assert(h_obj()->is_oop(), "must be NULL or an object"); |
471 if (UseBiasedLocking) { | 469 if (UseBiasedLocking) { |
472 // Retry fast entry if bias is revoked to avoid unnecessary inflation | 470 // Retry fast entry if bias is revoked to avoid unnecessary inflation |
473 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK); | 471 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK); |
474 } else { | 472 } else { |
475 if (UseFastLocking) { | 473 if (GraalUseFastLocking) { |
476 // When using fast locking, the compiled code has already tried the fast case | 474 // When using fast locking, the compiled code has already tried the fast case |
477 ObjectSynchronizer::slow_enter(h_obj, lock, THREAD); | 475 ObjectSynchronizer::slow_enter(h_obj, lock, THREAD); |
478 } else { | 476 } else { |
479 ObjectSynchronizer::fast_enter(h_obj, lock, false, THREAD); | 477 ObjectSynchronizer::fast_enter(h_obj, lock, false, THREAD); |
480 } | 478 } |
501 thread->print_stack_on(tty); | 499 thread->print_stack_on(tty); |
502 assert(false, "invalid lock object pointer dected"); | 500 assert(false, "invalid lock object pointer dected"); |
503 } | 501 } |
504 #endif | 502 #endif |
505 | 503 |
506 if (UseFastLocking) { | 504 if (GraalUseFastLocking) { |
507 // When using fast locking, the compiled code has already tried the fast case | 505 // When using fast locking, the compiled code has already tried the fast case |
508 ObjectSynchronizer::slow_exit(obj, lock, THREAD); | 506 ObjectSynchronizer::slow_exit(obj, lock, THREAD); |
509 } else { | 507 } else { |
510 ObjectSynchronizer::fast_exit(obj, lock, THREAD); | 508 ObjectSynchronizer::fast_exit(obj, lock, THREAD); |
511 } | 509 } |