src/hotspot/share/interpreter/bytecodeStream.cpp
changeset 49480 d7df2dd501ce
parent 47216 71c04702a3d5
equal deleted inserted replaced
49479:5865398439d4 49480:d7df2dd501ce
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, 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.
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "interpreter/bytecodeStream.hpp"
    26 #include "interpreter/bytecodeStream.hpp"
    27 #include "interpreter/bytecodes.hpp"
    27 #include "interpreter/bytecodes.hpp"
       
    28 #include "runtime/handles.inline.hpp"
    28 
    29 
    29 Bytecodes::Code RawBytecodeStream::raw_next_special(Bytecodes::Code code) {
    30 Bytecodes::Code RawBytecodeStream::raw_next_special(Bytecodes::Code code) {
    30   assert(!is_last_bytecode(), "should have been checked");
    31   assert(!is_last_bytecode(), "should have been checked");
    31   // set next bytecode position
    32   // set next bytecode position
    32   address bcp = RawBytecodeStream::bcp();
    33   address bcp = RawBytecodeStream::bcp();
    51   }
    52   }
    52   _raw_code = code;
    53   _raw_code = code;
    53   return code;
    54   return code;
    54 }
    55 }
    55 
    56 
       
    57 BaseBytecodeStream::BaseBytecodeStream(const methodHandle& method) : _method(method) {
       
    58   set_interval(0, _method->code_size());
       
    59   _is_raw = false;
       
    60 }
       
    61 
    56 #ifdef ASSERT
    62 #ifdef ASSERT
    57 void BaseBytecodeStream::assert_raw_index_size(int size) const {
    63 void BaseBytecodeStream::assert_raw_index_size(int size) const {
    58   if (raw_code() == Bytecodes::_invokedynamic && is_raw()) {
    64   if (raw_code() == Bytecodes::_invokedynamic && is_raw()) {
    59     // in raw mode, pretend indy is "bJJ__"
    65     // in raw mode, pretend indy is "bJJ__"
    60     assert(size == 2, "raw invokedynamic instruction has 2-byte index only");
    66     assert(size == 2, "raw invokedynamic instruction has 2-byte index only");