--- old/src/share/vm/code/codeCache.cpp 2017-02-06 18:13:53.390129783 +0100 +++ new/src/share/vm/code/codeCache.cpp 2017-02-06 18:13:53.222129778 +0100 @@ -417,7 +417,12 @@ CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) { assert(cb != NULL, "CodeBlob is null"); FOR_ALL_HEAPS(heap) { - if ((*heap)->contains(cb->code_begin())) { + if ((*heap)->contains(cb)) { + guarantee((char*) cb >= (*heap)->low_boundary() && (char*) cb < (*heap)->high(), + "Code blob " INTPTR_FORMAT " should be after " + "heap low boundary " INTPTR_FORMAT " " + "and before heap high boundary " INTPTR_FORMAT, + p2i(cb), p2i((*heap)->low_boundary()), p2i((*heap)->high())); return *heap; } }