comparison src/cpu/x86/vm/frame_x86.inline.hpp @ 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 97125851f396
children 24128c2ffa87
comparison
equal deleted inserted replaced
1199:0e14bd797dad 1200:ba263cfb7611
1 /* 1 /*
2 * Copyright 1997-2009 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.
33 _fp = NULL; 33 _fp = NULL;
34 _cb = NULL; 34 _cb = NULL;
35 _deopt_state = unknown; 35 _deopt_state = unknown;
36 } 36 }
37 37
38 inline frame:: frame(intptr_t* sp, intptr_t* fp, address pc) { 38 inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) {
39 _sp = sp; 39 _sp = sp;
40 _unextended_sp = sp; 40 _unextended_sp = sp;
41 _fp = fp; 41 _fp = fp;
42 _pc = pc; 42 _pc = pc;
43 assert(pc != NULL, "no pc?"); 43 assert(pc != NULL, "no pc?");
44 _cb = CodeCache::find_blob(pc); 44 _cb = CodeCache::find_blob(pc);
45 _deopt_state = not_deoptimized; 45
46 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { 46 address original_pc = nmethod::get_deopt_original_pc(this);
47 _pc = (((nmethod*)_cb)->get_original_pc(this)); 47 if (original_pc != NULL) {
48 _pc = original_pc;
48 _deopt_state = is_deoptimized; 49 _deopt_state = is_deoptimized;
49 } else { 50 } else {
50 _deopt_state = not_deoptimized; 51 _deopt_state = not_deoptimized;
51 } 52 }
52 } 53 }
53 54
54 inline frame:: frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) { 55 inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) {
55 _sp = sp; 56 _sp = sp;
56 _unextended_sp = unextended_sp; 57 _unextended_sp = unextended_sp;
57 _fp = fp; 58 _fp = fp;
58 _pc = pc; 59 _pc = pc;
59 assert(pc != NULL, "no pc?"); 60 assert(pc != NULL, "no pc?");
60 _cb = CodeCache::find_blob(pc); 61 _cb = CodeCache::find_blob(pc);
61 _deopt_state = not_deoptimized; 62
62 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { 63 address original_pc = nmethod::get_deopt_original_pc(this);
63 _pc = (((nmethod*)_cb)->get_original_pc(this)); 64 if (original_pc != NULL) {
65 _pc = original_pc;
66 assert(((nmethod*)_cb)->code_contains(_pc), "original PC must be in nmethod");
64 _deopt_state = is_deoptimized; 67 _deopt_state = is_deoptimized;
65 } else { 68 } else {
66 _deopt_state = not_deoptimized; 69 _deopt_state = not_deoptimized;
67 } 70 }
68 } 71 }
84 // value. 87 // value.
85 // assert(_pc != NULL, "no pc?"); 88 // assert(_pc != NULL, "no pc?");
86 89
87 _cb = CodeCache::find_blob(_pc); 90 _cb = CodeCache::find_blob(_pc);
88 91
89 _deopt_state = not_deoptimized; 92 address original_pc = nmethod::get_deopt_original_pc(this);
90 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { 93 if (original_pc != NULL) {
91 _pc = (((nmethod*)_cb)->get_original_pc(this)); 94 _pc = original_pc;
92 _deopt_state = is_deoptimized; 95 _deopt_state = is_deoptimized;
93 } else { 96 } else {
94 _deopt_state = not_deoptimized; 97 _deopt_state = not_deoptimized;
95 } 98 }
96 } 99 }