Mercurial > hg > truffle
comparison src/share/vm/runtime/deoptimization.cpp @ 1692:d2ede61b7a12
6976186: integrate Shark HotSpot changes
Summary: Shark is a JIT compiler for Zero that uses the LLVM compiler infrastructure.
Reviewed-by: kvn, twisti
Contributed-by: Gary Benson <gbenson@redhat.com>
author | twisti |
---|---|
date | Wed, 11 Aug 2010 05:51:21 -0700 |
parents | c18cbe5936b8 |
children | d5d065957597 |
comparison
equal
deleted
inserted
replaced
1691:4a665be40fd3 | 1692:d2ede61b7a12 |
---|---|
252 delete list; | 252 delete list; |
253 } | 253 } |
254 | 254 |
255 } | 255 } |
256 | 256 |
257 #ifndef SHARK | |
257 // Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info. | 258 // Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info. |
258 CodeBlob* cb = stub_frame.cb(); | 259 CodeBlob* cb = stub_frame.cb(); |
259 // Verify we have the right vframeArray | 260 // Verify we have the right vframeArray |
260 assert(cb->frame_size() >= 0, "Unexpected frame size"); | 261 assert(cb->frame_size() >= 0, "Unexpected frame size"); |
261 intptr_t* unpack_sp = stub_frame.sp() + cb->frame_size(); | 262 intptr_t* unpack_sp = stub_frame.sp() + cb->frame_size(); |
268 | 269 |
269 #ifdef ASSERT | 270 #ifdef ASSERT |
270 assert(cb->is_deoptimization_stub() || cb->is_uncommon_trap_stub(), "just checking"); | 271 assert(cb->is_deoptimization_stub() || cb->is_uncommon_trap_stub(), "just checking"); |
271 Events::log("fetch unroll sp " INTPTR_FORMAT, unpack_sp); | 272 Events::log("fetch unroll sp " INTPTR_FORMAT, unpack_sp); |
272 #endif | 273 #endif |
274 #else | |
275 intptr_t* unpack_sp = stub_frame.sender(&dummy_map).unextended_sp(); | |
276 #endif // !SHARK | |
277 | |
273 // This is a guarantee instead of an assert because if vframe doesn't match | 278 // This is a guarantee instead of an assert because if vframe doesn't match |
274 // we will unpack the wrong deoptimized frame and wind up in strange places | 279 // we will unpack the wrong deoptimized frame and wind up in strange places |
275 // where it will be very difficult to figure out what went wrong. Better | 280 // where it will be very difficult to figure out what went wrong. Better |
276 // to die an early death here than some very obscure death later when the | 281 // to die an early death here than some very obscure death later when the |
277 // trail is cold. | 282 // trail is cold. |
378 // since the frame will "magically" show the original pc before the deopt | 383 // since the frame will "magically" show the original pc before the deopt |
379 // and we'd undo the deopt. | 384 // and we'd undo the deopt. |
380 | 385 |
381 frame_pcs[0] = deopt_sender.raw_pc(); | 386 frame_pcs[0] = deopt_sender.raw_pc(); |
382 | 387 |
388 #ifndef SHARK | |
383 assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc"); | 389 assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc"); |
390 #endif // SHARK | |
384 | 391 |
385 UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord, | 392 UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord, |
386 caller_adjustment * BytesPerWord, | 393 caller_adjustment * BytesPerWord, |
387 number_of_frames, | 394 number_of_frames, |
388 frame_sizes, | 395 frame_sizes, |
1071 thread->popframe_preserve_args(in_ByteSize(bytes_to_save), start_address); | 1078 thread->popframe_preserve_args(in_ByteSize(bytes_to_save), start_address); |
1072 } | 1079 } |
1073 JRT_END | 1080 JRT_END |
1074 | 1081 |
1075 | 1082 |
1076 #ifdef COMPILER2 | 1083 #if defined(COMPILER2) || defined(SHARK) |
1077 void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) { | 1084 void Deoptimization::load_class_by_index(constantPoolHandle constant_pool, int index, TRAPS) { |
1078 // in case of an unresolved klass entry, load the class. | 1085 // in case of an unresolved klass entry, load the class. |
1079 if (constant_pool->tag_at(index).is_unresolved_klass()) { | 1086 if (constant_pool->tag_at(index).is_unresolved_klass()) { |
1080 klassOop tk = constant_pool->klass_at(index, CHECK); | 1087 klassOop tk = constant_pool->klass_at(index, CHECK); |
1081 return; | 1088 return; |
1833 } | 1840 } |
1834 #undef PRINT_STAT_LINE | 1841 #undef PRINT_STAT_LINE |
1835 if (xtty != NULL) xtty->tail("statistics"); | 1842 if (xtty != NULL) xtty->tail("statistics"); |
1836 } | 1843 } |
1837 } | 1844 } |
1838 #else // COMPILER2 | 1845 #else // COMPILER2 || SHARK |
1839 | 1846 |
1840 | 1847 |
1841 // Stubs for C1 only system. | 1848 // Stubs for C1 only system. |
1842 bool Deoptimization::trap_state_is_recompiled(int trap_state) { | 1849 bool Deoptimization::trap_state_is_recompiled(int trap_state) { |
1843 return false; | 1850 return false; |
1869 int trap_state) { | 1876 int trap_state) { |
1870 jio_snprintf(buf, buflen, "#%d", trap_state); | 1877 jio_snprintf(buf, buflen, "#%d", trap_state); |
1871 return buf; | 1878 return buf; |
1872 } | 1879 } |
1873 | 1880 |
1874 #endif // COMPILER2 | 1881 #endif // COMPILER2 || SHARK |