1.1 --- a/src/share/vm/oops/methodDataOop.cpp Wed Jan 12 13:59:18 2011 -0800 1.2 +++ b/src/share/vm/oops/methodDataOop.cpp Thu Jan 13 22:15:41 2011 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -417,11 +417,11 @@ 1.11 int MultiBranchData::compute_cell_count(BytecodeStream* stream) { 1.12 int cell_count = 0; 1.13 if (stream->code() == Bytecodes::_tableswitch) { 1.14 - Bytecode_tableswitch* sw = Bytecode_tableswitch_at(stream->bcp()); 1.15 - cell_count = 1 + per_case_cell_count * (1 + sw->length()); // 1 for default 1.16 + Bytecode_tableswitch sw(stream->method()(), stream->bcp()); 1.17 + cell_count = 1 + per_case_cell_count * (1 + sw.length()); // 1 for default 1.18 } else { 1.19 - Bytecode_lookupswitch* sw = Bytecode_lookupswitch_at(stream->bcp()); 1.20 - cell_count = 1 + per_case_cell_count * (sw->number_of_pairs() + 1); // 1 for default 1.21 + Bytecode_lookupswitch sw(stream->method()(), stream->bcp()); 1.22 + cell_count = 1 + per_case_cell_count * (sw.number_of_pairs() + 1); // 1 for default 1.23 } 1.24 return cell_count; 1.25 } 1.26 @@ -434,35 +434,35 @@ 1.27 int target_di; 1.28 int offset; 1.29 if (stream->code() == Bytecodes::_tableswitch) { 1.30 - Bytecode_tableswitch* sw = Bytecode_tableswitch_at(stream->bcp()); 1.31 - int len = sw->length(); 1.32 + Bytecode_tableswitch sw(stream->method()(), stream->bcp()); 1.33 + int len = sw.length(); 1.34 assert(array_len() == per_case_cell_count * (len + 1), "wrong len"); 1.35 for (int count = 0; count < len; count++) { 1.36 - target = sw->dest_offset_at(count) + bci(); 1.37 + target = sw.dest_offset_at(count) + bci(); 1.38 my_di = mdo->dp_to_di(dp()); 1.39 target_di = mdo->bci_to_di(target); 1.40 offset = target_di - my_di; 1.41 set_displacement_at(count, offset); 1.42 } 1.43 - target = sw->default_offset() + bci(); 1.44 + target = sw.default_offset() + bci(); 1.45 my_di = mdo->dp_to_di(dp()); 1.46 target_di = mdo->bci_to_di(target); 1.47 offset = target_di - my_di; 1.48 set_default_displacement(offset); 1.49 1.50 } else { 1.51 - Bytecode_lookupswitch* sw = Bytecode_lookupswitch_at(stream->bcp()); 1.52 - int npairs = sw->number_of_pairs(); 1.53 + Bytecode_lookupswitch sw(stream->method()(), stream->bcp()); 1.54 + int npairs = sw.number_of_pairs(); 1.55 assert(array_len() == per_case_cell_count * (npairs + 1), "wrong len"); 1.56 for (int count = 0; count < npairs; count++) { 1.57 - LookupswitchPair *pair = sw->pair_at(count); 1.58 - target = pair->offset() + bci(); 1.59 + LookupswitchPair pair = sw.pair_at(count); 1.60 + target = pair.offset() + bci(); 1.61 my_di = mdo->dp_to_di(dp()); 1.62 target_di = mdo->bci_to_di(target); 1.63 offset = target_di - my_di; 1.64 set_displacement_at(count, offset); 1.65 } 1.66 - target = sw->default_offset() + bci(); 1.67 + target = sw.default_offset() + bci(); 1.68 my_di = mdo->dp_to_di(dp()); 1.69 target_di = mdo->bci_to_di(target); 1.70 offset = target_di - my_di;