hotspot/src/share/vm/interpreter/rewriter.cpp
changeset 15799 6aa92f9debd2
parent 15099 b31d40895bbb
child 15928 f9d5c6e4107f
equal deleted inserted replaced
15798:cea39eefa98e 15799:6aa92f9debd2
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2013, 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.
    46       case JVM_CONSTANT_Fieldref          : // fall through
    46       case JVM_CONSTANT_Fieldref          : // fall through
    47       case JVM_CONSTANT_Methodref         : // fall through
    47       case JVM_CONSTANT_Methodref         : // fall through
    48         add_cp_cache_entry(i);
    48         add_cp_cache_entry(i);
    49         break;
    49         break;
    50       case JVM_CONSTANT_String:
    50       case JVM_CONSTANT_String:
    51       case JVM_CONSTANT_Object:
       
    52       case JVM_CONSTANT_MethodHandle      : // fall through
    51       case JVM_CONSTANT_MethodHandle      : // fall through
    53       case JVM_CONSTANT_MethodType        : // fall through
    52       case JVM_CONSTANT_MethodType        : // fall through
    54         add_resolved_references_entry(i);
    53         add_resolved_references_entry(i);
    55         break;
    54         break;
    56       case JVM_CONSTANT_Utf8:
    55       case JVM_CONSTANT_Utf8:
   236   if (!reverse) {
   235   if (!reverse) {
   237     assert((*bcp) == (is_wide ? Bytecodes::_ldc_w : Bytecodes::_ldc), "not ldc bytecode");
   236     assert((*bcp) == (is_wide ? Bytecodes::_ldc_w : Bytecodes::_ldc), "not ldc bytecode");
   238     address p = bcp + offset;
   237     address p = bcp + offset;
   239     int cp_index = is_wide ? Bytes::get_Java_u2(p) : (u1)(*p);
   238     int cp_index = is_wide ? Bytes::get_Java_u2(p) : (u1)(*p);
   240     constantTag tag = _pool->tag_at(cp_index).value();
   239     constantTag tag = _pool->tag_at(cp_index).value();
   241     if (tag.is_method_handle() || tag.is_method_type() || tag.is_string() || tag.is_object()) {
   240     if (tag.is_method_handle() || tag.is_method_type() || tag.is_string()) {
   242       int ref_index = cp_entry_to_resolved_references(cp_index);
   241       int ref_index = cp_entry_to_resolved_references(cp_index);
   243       if (is_wide) {
   242       if (is_wide) {
   244         (*bcp) = Bytecodes::_fast_aldc_w;
   243         (*bcp) = Bytecodes::_fast_aldc_w;
   245         assert(ref_index == (u2)ref_index, "index overflow");
   244         assert(ref_index == (u2)ref_index, "index overflow");
   246         Bytes::put_native_u2(p, ref_index);
   245         Bytes::put_native_u2(p, ref_index);