hotspot/src/share/vm/interpreter/bytecode.cpp
changeset 2570 ecc7862946d4
parent 1 489c9b5090e2
child 3261 c7d5aae8d3f7
equal deleted inserted replaced
2569:9e8daec25638 2570:ecc7862946d4
    29 // Should eventually get rid of these functions and use ThisRelativeObj methods instead
    29 // Should eventually get rid of these functions and use ThisRelativeObj methods instead
    30 
    30 
    31 void Bytecode::set_code(Bytecodes::Code code) {
    31 void Bytecode::set_code(Bytecodes::Code code) {
    32   Bytecodes::check(code);
    32   Bytecodes::check(code);
    33   *addr_at(0) = u_char(code);
    33   *addr_at(0) = u_char(code);
    34 }
       
    35 
       
    36 
       
    37 void Bytecode::set_fast_index(int i) {
       
    38   assert(0 <= i && i < 0x10000, "illegal index value");
       
    39   Bytes::put_native_u2(addr_at(1), (jushort)i);
       
    40 }
    34 }
    41 
    35 
    42 
    36 
    43 bool Bytecode::check_must_rewrite() const {
    37 bool Bytecode::check_must_rewrite() const {
    44   assert(Bytecodes::can_rewrite(code()), "post-check only");
    38   assert(Bytecodes::can_rewrite(code()), "post-check only");
   116   return m;
   110   return m;
   117 }
   111 }
   118 
   112 
   119 
   113 
   120 int Bytecode_invoke::index() const {
   114 int Bytecode_invoke::index() const {
   121   return Bytes::get_Java_u2(bcp() + 1);
   115   // Note:  Rewriter::rewrite changes the Java_u2 of an invokedynamic to a native_u4,
       
   116   // at the same time it allocates per-call-site CP cache entries.
       
   117   if (has_giant_index())
       
   118     return Bytes::get_native_u4(bcp() + 1);
       
   119   else
       
   120     return Bytes::get_Java_u2(bcp() + 1);
   122 }
   121 }
   123 
   122 
   124 
   123 
   125 // Implementation of Bytecode_static
   124 // Implementation of Bytecode_static
   126 
   125