equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. 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. |
68 return false; // the rewrite is not done by the interpreter |
68 return false; // the rewrite is not done by the interpreter |
69 |
69 |
70 case Bytecodes::_new: |
70 case Bytecodes::_new: |
71 // (Could actually look at the class here, but the profit would be small.) |
71 // (Could actually look at the class here, but the profit would be small.) |
72 return false; // the rewrite is not always done |
72 return false; // the rewrite is not always done |
|
73 |
|
74 default: |
|
75 // No other special cases. |
|
76 return true; |
73 } |
77 } |
74 |
|
75 // No other special cases. |
|
76 return true; |
|
77 } |
78 } |
78 |
79 |
79 Bytecodes::Code Bytecodes::code_at(Method* method, int bci) { |
80 Bytecodes::Code Bytecodes::code_at(Method* method, int bci) { |
80 return code_at(method, method->bcp_from(bci)); |
81 return code_at(method, method->bcp_from(bci)); |
81 } |
82 } |
117 jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize; |
118 jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize; |
118 // only return len if it can be represented as a positive int; |
119 // only return len if it can be represented as a positive int; |
119 // return -1 otherwise |
120 // return -1 otherwise |
120 return (len > 0 && len == (int)len) ? len : -1; |
121 return (len > 0 && len == (int)len) ? len : -1; |
121 } |
122 } |
|
123 default: |
|
124 // Note: Length functions must return <=0 for invalid bytecodes. |
|
125 return 0; |
122 } |
126 } |
123 // Note: Length functions must return <=0 for invalid bytecodes. |
|
124 return 0; |
|
125 } |
127 } |
126 |
128 |
127 // At a breakpoint instruction, this returns the breakpoint's length, |
129 // At a breakpoint instruction, this returns the breakpoint's length, |
128 // otherwise, it's the same as special_length_at(). This is used by |
130 // otherwise, it's the same as special_length_at(). This is used by |
129 // the RawByteCodeStream, which wants to see the actual bytecode |
131 // the RawByteCodeStream, which wants to see the actual bytecode |