--- a/hotspot/src/share/vm/interpreter/bytecodeStream.cpp Tue Jun 01 11:48:33 2010 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.cpp Wed Jun 02 22:45:42 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. 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