diff -r b862d1f189bd -r 9052dc91ea67 hotspot/src/share/vm/interpreter/bytecodeStream.cpp --- a/hotspot/src/share/vm/interpreter/bytecodeStream.cpp Fri May 21 02:59:24 2010 -0700 +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.cpp Sun May 23 01:38:26 2010 -0700 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,6 +48,25 @@ } } } - _code = code; + _raw_code = code; return code; } + +#ifdef ASSERT +void BaseBytecodeStream::assert_raw_index_size(int size) const { + if (raw_code() == Bytecodes::_invokedynamic && is_raw()) { + // in raw mode, pretend indy is "bJJ__" + assert(size == 2, "raw invokedynamic instruction has 2-byte index only"); + } else { + bytecode()->assert_index_size(size, raw_code(), is_wide()); + } +} + +void BaseBytecodeStream::assert_raw_stream(bool want_raw) const { + if (want_raw) { + assert( is_raw(), "this function only works on raw streams"); + } else { + assert(!is_raw(), "this function only works on non-raw streams"); + } +} +#endif //ASSERT