comparison src/cpu/sparc/vm/frame_sparc.cpp @ 1200:ba263cfb7611

6917766: JSR 292 needs its own deopt handler Summary: We need to introduce a new MH deopt handler so we can easily determine if the deopt happened at a MH call site or not. Reviewed-by: never, jrose
author twisti
date Fri, 29 Jan 2010 12:13:05 +0100
parents d1605aabd0a1
children 24128c2ffa87
comparison
equal deleted inserted replaced
1199:0e14bd797dad 1200:ba263cfb7611
1 /* 1 /*
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
364 364
365 // It is important that frame be fully construct when we do this lookup 365 // It is important that frame be fully construct when we do this lookup
366 // as get_original_pc() needs correct value for unextended_sp() 366 // as get_original_pc() needs correct value for unextended_sp()
367 if (_pc != NULL) { 367 if (_pc != NULL) {
368 _cb = CodeCache::find_blob(_pc); 368 _cb = CodeCache::find_blob(_pc);
369 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { 369 address original_pc = nmethod::get_deopt_original_pc(this);
370 _pc = ((nmethod*)_cb)->get_original_pc(this); 370 if (original_pc != NULL) {
371 _pc = original_pc;
371 _deopt_state = is_deoptimized; 372 _deopt_state = is_deoptimized;
372 } else { 373 } else {
373 _deopt_state = not_deoptimized; 374 _deopt_state = not_deoptimized;
374 } 375 }
375 } 376 }
517 tty->print_cr("patch_pc at address 0x%x [0x%x -> 0x%x] ", O7_addr(), _pc, pc); 518 tty->print_cr("patch_pc at address 0x%x [0x%x -> 0x%x] ", O7_addr(), _pc, pc);
518 } 519 }
519 _cb = CodeCache::find_blob(pc); 520 _cb = CodeCache::find_blob(pc);
520 *O7_addr() = pc - pc_return_offset; 521 *O7_addr() = pc - pc_return_offset;
521 _cb = CodeCache::find_blob(_pc); 522 _cb = CodeCache::find_blob(_pc);
522 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { 523 address original_pc = nmethod::get_deopt_original_pc(this);
523 address orig = ((nmethod*)_cb)->get_original_pc(this); 524 if (original_pc != NULL) {
524 assert(orig == _pc, "expected original to be stored before patching"); 525 assert(original_pc == _pc, "expected original to be stored before patching");
525 _deopt_state = is_deoptimized; 526 _deopt_state = is_deoptimized;
526 } else { 527 } else {
527 _deopt_state = not_deoptimized; 528 _deopt_state = not_deoptimized;
528 } 529 }
529 } 530 }