src/share/vm/interpreter/rewriter.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8076112 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/rewriter.cpp

Print this page




  90                                   _invokedynamic_cp_cache_map,
  91                                   _invokedynamic_references_map, CHECK);
  92 
  93   // initialize object cache in constant pool
  94   _pool->initialize_resolved_references(loader_data, _resolved_references_map,
  95                                         _resolved_reference_limit,
  96                                         CHECK);
  97   _pool->set_cache(cache);
  98   cache->set_constant_pool(_pool());
  99 }
 100 
 101 
 102 
 103 // The new finalization semantics says that registration of
 104 // finalizable objects must be performed on successful return from the
 105 // Object.<init> constructor.  We could implement this trivially if
 106 // <init> were never rewritten but since JVMTI allows this to occur, a
 107 // more complicated solution is required.  A special return bytecode
 108 // is used only by Object.<init> to signal the finalization
 109 // registration point.  Additionally local 0 must be preserved so it's
 110 // available to pass to the registration function.  For simplicty we
 111 // require that local 0 is never overwritten so it's available as an
 112 // argument for registration.
 113 
 114 void Rewriter::rewrite_Object_init(methodHandle method, TRAPS) {
 115   RawBytecodeStream bcs(method);
 116   while (!bcs.is_last_bytecode()) {
 117     Bytecodes::Code opcode = bcs.raw_next();
 118     switch (opcode) {
 119       case Bytecodes::_return: *bcs.bcp() = Bytecodes::_return_register_finalizer; break;
 120 
 121       case Bytecodes::_istore:
 122       case Bytecodes::_lstore:
 123       case Bytecodes::_fstore:
 124       case Bytecodes::_dstore:
 125       case Bytecodes::_astore:
 126         if (bcs.get_index() != 0) continue;
 127 
 128         // fall through
 129       case Bytecodes::_istore_0:
 130       case Bytecodes::_lstore_0:




  90                                   _invokedynamic_cp_cache_map,
  91                                   _invokedynamic_references_map, CHECK);
  92 
  93   // initialize object cache in constant pool
  94   _pool->initialize_resolved_references(loader_data, _resolved_references_map,
  95                                         _resolved_reference_limit,
  96                                         CHECK);
  97   _pool->set_cache(cache);
  98   cache->set_constant_pool(_pool());
  99 }
 100 
 101 
 102 
 103 // The new finalization semantics says that registration of
 104 // finalizable objects must be performed on successful return from the
 105 // Object.<init> constructor.  We could implement this trivially if
 106 // <init> were never rewritten but since JVMTI allows this to occur, a
 107 // more complicated solution is required.  A special return bytecode
 108 // is used only by Object.<init> to signal the finalization
 109 // registration point.  Additionally local 0 must be preserved so it's
 110 // available to pass to the registration function.  For simplicity we
 111 // require that local 0 is never overwritten so it's available as an
 112 // argument for registration.
 113 
 114 void Rewriter::rewrite_Object_init(methodHandle method, TRAPS) {
 115   RawBytecodeStream bcs(method);
 116   while (!bcs.is_last_bytecode()) {
 117     Bytecodes::Code opcode = bcs.raw_next();
 118     switch (opcode) {
 119       case Bytecodes::_return: *bcs.bcp() = Bytecodes::_return_register_finalizer; break;
 120 
 121       case Bytecodes::_istore:
 122       case Bytecodes::_lstore:
 123       case Bytecodes::_fstore:
 124       case Bytecodes::_dstore:
 125       case Bytecodes::_astore:
 126         if (bcs.get_index() != 0) continue;
 127 
 128         // fall through
 129       case Bytecodes::_istore_0:
 130       case Bytecodes::_lstore_0:


src/share/vm/interpreter/rewriter.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File