Mercurial > hg > truffle
diff src/share/vm/interpreter/rewriter.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | d8041d695d19 |
children | 52b4284cb496 |
line wrap: on
line diff
--- a/src/share/vm/interpreter/rewriter.cpp Tue Apr 01 14:09:03 2014 +0200 +++ b/src/share/vm/interpreter/rewriter.cpp Tue Apr 01 13:57:07 2014 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, 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 @@ -250,8 +250,8 @@ // We will reverse the bytecode rewriting _after_ adjusting them. // Adjust the cache index by offset to the invokedynamic entries in the // cpCache plus the delta if the invokedynamic bytecodes were adjusted. - int adjustment = cp_cache_delta() + _first_iteration_cp_cache_limit; - int cp_index = invokedynamic_cp_cache_entry_pool_index(cache_index - adjustment); + cache_index = cp_cache_delta() + _first_iteration_cp_cache_limit; + int cp_index = invokedynamic_cp_cache_entry_pool_index(cache_index); assert(_pool->tag_at(cp_index).is_invoke_dynamic(), "wrong index"); // zero out 4 bytes Bytes::put_Java_u4(p, 0); @@ -453,7 +453,18 @@ return method; } -void Rewriter::rewrite_bytecodes(TRAPS) { +void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) { + ResourceMark rm(THREAD); + Rewriter rw(klass, klass->constants(), klass->methods(), CHECK); + // (That's all, folks.) +} + + +Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array<Method*>* methods, TRAPS) + : _klass(klass), + _pool(cpool), + _methods(methods) +{ assert(_pool->cache() == NULL, "constant pool cache must not be set yet"); // determine index maps for Method* rewriting @@ -497,29 +508,6 @@ // May have to fix invokedynamic bytecodes if invokestatic/InterfaceMethodref // entries had to be added. patch_invokedynamic_bytecodes(); -} - -void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) { - ResourceMark rm(THREAD); - Rewriter rw(klass, klass->constants(), klass->methods(), CHECK); - // (That's all, folks.) -} - - -Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array<Method*>* methods, TRAPS) - : _klass(klass), - _pool(cpool), - _methods(methods) -{ - - // Rewrite bytecodes - exception here exits. - rewrite_bytecodes(CHECK); - - // Stress restoring bytecodes - if (StressRewriter) { - restore_bytecodes(); - rewrite_bytecodes(CHECK); - } // allocate constant pool cache, now that we've seen all the bytecodes make_constant_pool_cache(THREAD); @@ -535,7 +523,6 @@ // so methods with jsrs in custom class lists in aren't attempted to be // rewritten in the RO section of the shared archive. // Relocated bytecodes don't have to be restored, only the cp cache entries - int len = _methods->length(); for (int i = len-1; i >= 0; i--) { methodHandle m(THREAD, _methods->at(i));