src/share/vm/code/nmethod.cpp

Print this page
rev 4267 : 8009981: nashorn tests fail with -XX:+VerifyStack
Summary: nmethod::preserve_callee_argument_oops() must take appendix into account.
Reviewed-by:


1940                   (intptr_t)(*p), (intptr_t)p);
1941     (*p)->print();
1942   }
1943 #endif //PRODUCT
1944 };
1945 
1946 bool nmethod::detect_scavenge_root_oops() {
1947   DetectScavengeRoot detect_scavenge_root;
1948   NOT_PRODUCT(if (TraceScavenge)  detect_scavenge_root._print_nm = this);
1949   oops_do(&detect_scavenge_root);
1950   return detect_scavenge_root.detected_scavenge_root();
1951 }
1952 
1953 // Method that knows how to preserve outgoing arguments at call. This method must be
1954 // called with a frame corresponding to a Java invoke
1955 void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
1956 #ifndef SHARK
1957   if (!method()->is_native()) {
1958     SimpleScopeDesc ssd(this, fr.pc());
1959     Bytecode_invoke call(ssd.method(), ssd.bci());
1960     // compiled invokedynamic call sites have an implicit receiver at
1961     // resolution time, so make sure it gets GC'ed.
1962     bool has_receiver = !call.is_invokestatic();
1963     Symbol* signature = call.signature();
1964     fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f);
1965   }
1966 #endif // !SHARK
1967 }
1968 
1969 
1970 oop nmethod::embeddedOop_at(u_char* p) {
1971   RelocIterator iter(this, p, p + 1);
1972   while (iter.next())
1973     if (iter.type() == relocInfo::oop_type) {
1974       return iter.oop_reloc()->oop_value();
1975     }
1976   return NULL;
1977 }
1978 
1979 
1980 inline bool includes(void* p, void* from, void* to) {
1981   return from <= p && p < to;
1982 }
1983 
1984 




1940                   (intptr_t)(*p), (intptr_t)p);
1941     (*p)->print();
1942   }
1943 #endif //PRODUCT
1944 };
1945 
1946 bool nmethod::detect_scavenge_root_oops() {
1947   DetectScavengeRoot detect_scavenge_root;
1948   NOT_PRODUCT(if (TraceScavenge)  detect_scavenge_root._print_nm = this);
1949   oops_do(&detect_scavenge_root);
1950   return detect_scavenge_root.detected_scavenge_root();
1951 }
1952 
1953 // Method that knows how to preserve outgoing arguments at call. This method must be
1954 // called with a frame corresponding to a Java invoke
1955 void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
1956 #ifndef SHARK
1957   if (!method()->is_native()) {
1958     SimpleScopeDesc ssd(this, fr.pc());
1959     Bytecode_invoke call(ssd.method(), ssd.bci());
1960     bool has_receiver = call.has_receiver();
1961     bool has_appendix = call.has_appendix();

1962     Symbol* signature = call.signature();
1963     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
1964   }
1965 #endif // !SHARK
1966 }
1967 
1968 
1969 oop nmethod::embeddedOop_at(u_char* p) {
1970   RelocIterator iter(this, p, p + 1);
1971   while (iter.next())
1972     if (iter.type() == relocInfo::oop_type) {
1973       return iter.oop_reloc()->oop_value();
1974     }
1975   return NULL;
1976 }
1977 
1978 
1979 inline bool includes(void* p, void* from, void* to) {
1980   return from <= p && p < to;
1981 }
1982 
1983