1.1 --- a/src/share/vm/interpreter/bytecodeStream.cpp Fri May 21 02:59:24 2010 -0700 1.2 +++ b/src/share/vm/interpreter/bytecodeStream.cpp Sun May 23 01:38:26 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1997-2010 Sun Microsystems, Inc. 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 @@ -48,6 +48,25 @@ 1.11 } 1.12 } 1.13 } 1.14 - _code = code; 1.15 + _raw_code = code; 1.16 return code; 1.17 } 1.18 + 1.19 +#ifdef ASSERT 1.20 +void BaseBytecodeStream::assert_raw_index_size(int size) const { 1.21 + if (raw_code() == Bytecodes::_invokedynamic && is_raw()) { 1.22 + // in raw mode, pretend indy is "bJJ__" 1.23 + assert(size == 2, "raw invokedynamic instruction has 2-byte index only"); 1.24 + } else { 1.25 + bytecode()->assert_index_size(size, raw_code(), is_wide()); 1.26 + } 1.27 +} 1.28 + 1.29 +void BaseBytecodeStream::assert_raw_stream(bool want_raw) const { 1.30 + if (want_raw) { 1.31 + assert( is_raw(), "this function only works on raw streams"); 1.32 + } else { 1.33 + assert(!is_raw(), "this function only works on non-raw streams"); 1.34 + } 1.35 +} 1.36 +#endif //ASSERT