hotspot/src/share/vm/prims/methodHandleWalk.cpp
changeset 13282 9872915dd78d
parent 10735 67a139f9f954
equal deleted inserted replaced
13102:7342fd50f8d7 13282:9872915dd78d
     1 /*
     1 /*
     2  * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2012, 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.
  1794   // Create a new method
  1794   // Create a new method
  1795   methodHandle m;
  1795   methodHandle m;
  1796   {
  1796   {
  1797     methodOop m_oop = oopFactory::new_method(bytecode_length(),
  1797     methodOop m_oop = oopFactory::new_method(bytecode_length(),
  1798                                              accessFlags_from(flags_bits),
  1798                                              accessFlags_from(flags_bits),
  1799                                              0, 0, 0, oopDesc::IsSafeConc, CHECK_(empty));
  1799                                              0, 0, 0, 0, oopDesc::IsSafeConc, CHECK_(empty));
  1800     m = methodHandle(THREAD, m_oop);
  1800     m = methodHandle(THREAD, m_oop);
  1801   }
  1801   }
  1802 
  1802 
  1803   constantPoolHandle cpool = get_constant_pool(CHECK_(empty));
  1803   constantPoolHandle cpool = get_constant_pool(CHECK_(empty));
  1804   m->set_constants(cpool());
  1804   m->set_constants(cpool());
  1809   m->set_code((address) bytecode());
  1809   m->set_code((address) bytecode());
  1810 
  1810 
  1811   m->set_max_stack(_max_stack);
  1811   m->set_max_stack(_max_stack);
  1812   m->set_max_locals(max_locals());
  1812   m->set_max_locals(max_locals());
  1813   m->set_size_of_parameters(_num_params);
  1813   m->set_size_of_parameters(_num_params);
  1814 
       
  1815   typeArrayHandle exception_handlers(THREAD, Universe::the_empty_int_array());
       
  1816   m->set_exception_table(exception_handlers());
       
  1817 
  1814 
  1818   // Rewrite the method and set up the constant pool cache.
  1815   // Rewrite the method and set up the constant pool cache.
  1819   objArrayOop m_array = oopFactory::new_system_objArray(1, CHECK_(empty));
  1816   objArrayOop m_array = oopFactory::new_system_objArray(1, CHECK_(empty));
  1820   objArrayHandle methods(THREAD, m_array);
  1817   objArrayHandle methods(THREAD, m_array);
  1821   methods->obj_at_put(0, m());
  1818   methods->obj_at_put(0, m());