Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.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 | 4a665be40fd3 |
children | 71faaa8e3ccc |
comparison
equal
deleted
inserted
replaced
1691:4a665be40fd3 | 1692:d2ede61b7a12 |
---|---|
62 } | 62 } |
63 bool nmethod::is_compiled_by_c2() const { | 63 bool nmethod::is_compiled_by_c2() const { |
64 if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing | 64 if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing |
65 if (is_native_method()) return false; | 65 if (is_native_method()) return false; |
66 return compiler()->is_c2(); | 66 return compiler()->is_c2(); |
67 } | |
68 bool nmethod::is_compiled_by_shark() const { | |
69 if (is_native_method()) return false; | |
70 assert(compiler() != NULL, "must be"); | |
71 return compiler()->is_shark(); | |
67 } | 72 } |
68 | 73 |
69 | 74 |
70 | 75 |
71 //--------------------------------------------------------------------------------- | 76 //--------------------------------------------------------------------------------- |
1351 | 1356 |
1352 if (is_speculatively_disconnected()) { | 1357 if (is_speculatively_disconnected()) { |
1353 CodeCache::remove_saved_code(this); | 1358 CodeCache::remove_saved_code(this); |
1354 } | 1359 } |
1355 | 1360 |
1361 #ifdef SHARK | |
1362 ((SharkCompiler *) compiler())->free_compiled_method(instructions_begin()); | |
1363 #endif // SHARK | |
1364 | |
1356 ((CodeBlob*)(this))->flush(); | 1365 ((CodeBlob*)(this))->flush(); |
1357 | 1366 |
1358 CodeCache::free(this); | 1367 CodeCache::free(this); |
1359 } | 1368 } |
1360 | 1369 |
1767 } | 1776 } |
1768 | 1777 |
1769 // Method that knows how to preserve outgoing arguments at call. This method must be | 1778 // Method that knows how to preserve outgoing arguments at call. This method must be |
1770 // called with a frame corresponding to a Java invoke | 1779 // called with a frame corresponding to a Java invoke |
1771 void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { | 1780 void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { |
1781 #ifndef SHARK | |
1772 if (!method()->is_native()) { | 1782 if (!method()->is_native()) { |
1773 SimpleScopeDesc ssd(this, fr.pc()); | 1783 SimpleScopeDesc ssd(this, fr.pc()); |
1774 Bytecode_invoke* call = Bytecode_invoke_at(ssd.method(), ssd.bci()); | 1784 Bytecode_invoke* call = Bytecode_invoke_at(ssd.method(), ssd.bci()); |
1775 bool has_receiver = call->has_receiver(); | 1785 bool has_receiver = call->has_receiver(); |
1776 symbolOop signature = call->signature(); | 1786 symbolOop signature = call->signature(); |
1777 fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f); | 1787 fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f); |
1778 } | 1788 } |
1789 #endif // !SHARK | |
1779 } | 1790 } |
1780 | 1791 |
1781 | 1792 |
1782 oop nmethod::embeddedOop_at(u_char* p) { | 1793 oop nmethod::embeddedOop_at(u_char* p) { |
1783 RelocIterator iter(this, p, p + oopSize); | 1794 RelocIterator iter(this, p, p + oopSize); |
2277 | 2288 |
2278 if (is_compiled_by_c1()) { | 2289 if (is_compiled_by_c1()) { |
2279 tty->print("(c1) "); | 2290 tty->print("(c1) "); |
2280 } else if (is_compiled_by_c2()) { | 2291 } else if (is_compiled_by_c2()) { |
2281 tty->print("(c2) "); | 2292 tty->print("(c2) "); |
2293 } else if (is_compiled_by_shark()) { | |
2294 tty->print("(shark) "); | |
2282 } else { | 2295 } else { |
2283 tty->print("(nm) "); | 2296 tty->print("(nm) "); |
2284 } | 2297 } |
2285 | 2298 |
2286 print_on(tty, "nmethod"); | 2299 print_on(tty, "nmethod"); |