1.1 --- a/src/share/vm/interpreter/rewriter.cpp Tue Jun 01 11:48:33 2010 -0700 1.2 +++ b/src/share/vm/interpreter/rewriter.cpp Wed Jun 02 22:45:42 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -103,16 +103,15 @@ 1.11 1.12 1.13 // Rewrite a classfile-order CP index into a native-order CPC index. 1.14 -int Rewriter::rewrite_member_reference(address bcp, int offset) { 1.15 +void Rewriter::rewrite_member_reference(address bcp, int offset) { 1.16 address p = bcp + offset; 1.17 int cp_index = Bytes::get_Java_u2(p); 1.18 int cache_index = cp_entry_to_cp_cache(cp_index); 1.19 Bytes::put_native_u2(p, cache_index); 1.20 - return cp_index; 1.21 } 1.22 1.23 1.24 -void Rewriter::rewrite_invokedynamic(address bcp, int offset, int delete_me) { 1.25 +void Rewriter::rewrite_invokedynamic(address bcp, int offset) { 1.26 address p = bcp + offset; 1.27 assert(p[-1] == Bytecodes::_invokedynamic, ""); 1.28 int cp_index = Bytes::get_Java_u2(p); 1.29 @@ -178,7 +177,7 @@ 1.30 case Bytecodes::_lookupswitch : { 1.31 #ifndef CC_INTERP 1.32 Bytecode_lookupswitch* bc = Bytecode_lookupswitch_at(bcp); 1.33 - bc->set_code( 1.34 + (*bcp) = ( 1.35 bc->number_of_pairs() < BinarySwitchThreshold 1.36 ? Bytecodes::_fast_linearswitch 1.37 : Bytecodes::_fast_binaryswitch 1.38 @@ -197,7 +196,7 @@ 1.39 rewrite_member_reference(bcp, prefix_length+1); 1.40 break; 1.41 case Bytecodes::_invokedynamic: 1.42 - rewrite_invokedynamic(bcp, prefix_length+1, int(sizeof"@@@@DELETE ME")); 1.43 + rewrite_invokedynamic(bcp, prefix_length+1); 1.44 break; 1.45 case Bytecodes::_jsr : // fall through 1.46 case Bytecodes::_jsr_w : nof_jsrs++; break; 1.47 @@ -308,5 +307,19 @@ 1.48 1.49 // Set up method entry points for compiler and interpreter. 1.50 m->link_method(m, CHECK); 1.51 + 1.52 +#ifdef ASSERT 1.53 + if (StressMethodComparator) { 1.54 + static int nmc = 0; 1.55 + for (int j = i; j >= 0 && j >= i-4; j--) { 1.56 + if ((++nmc % 1000) == 0) tty->print_cr("Have run MethodComparator %d times...", nmc); 1.57 + bool z = MethodComparator::methods_EMCP(m(), (methodOop)_methods->obj_at(j)); 1.58 + if (j == i && !z) { 1.59 + tty->print("MethodComparator FAIL: "); m->print(); m->print_codes(); 1.60 + assert(z, "method must compare equal to itself"); 1.61 + } 1.62 + } 1.63 + } 1.64 +#endif //ASSERT 1.65 } 1.66 }