Mercurial > hg > truffle
diff src/share/vm/opto/parseHelper.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 9a28ddfc1f4a |
children | e626685e9f6c |
line wrap: on
line diff
--- a/src/share/vm/opto/parseHelper.cpp Fri Aug 31 16:39:35 2012 -0700 +++ b/src/share/vm/opto/parseHelper.cpp Sat Sep 01 13:25:18 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -46,7 +46,7 @@ Node* thread = _gvn.transform( new (C, 1) ThreadLocalNode() ); // Get method - const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0); + const TypePtr* method_type = TypeMetadataPtr::make(method); Node *method_node = _gvn.transform( ConNode::make(C, method_type) ); kill_dead_locals(); @@ -220,7 +220,7 @@ _gvn.set_type(merge, Type::CONTROL); Node* kls = makecon(TypeKlassPtr::make(klass)); - Node* init_thread_offset = _gvn.MakeConX(in_bytes(instanceKlass::init_thread_offset())); + Node* init_thread_offset = _gvn.MakeConX(in_bytes(InstanceKlass::init_thread_offset())); Node* adr_node = basic_plus_adr(kls, kls, init_thread_offset); Node* init_thread = make_load(NULL, adr_node, TypeRawPtr::BOTTOM, T_ADDRESS); Node *tst = Bool( CmpP( init_thread, cur_thread), BoolTest::eq); @@ -228,12 +228,12 @@ set_control(IfTrue(iff)); merge->set_req(1, IfFalse(iff)); - Node* init_state_offset = _gvn.MakeConX(in_bytes(instanceKlass::init_state_offset())); + Node* init_state_offset = _gvn.MakeConX(in_bytes(InstanceKlass::init_state_offset())); adr_node = basic_plus_adr(kls, kls, init_state_offset); - // Use T_BOOLEAN for instanceKlass::_init_state so the compiler + // Use T_BOOLEAN for InstanceKlass::_init_state so the compiler // can generate code to load it as unsigned byte. Node* init_state = make_load(NULL, adr_node, TypeInt::UBYTE, T_BOOLEAN); - Node* being_init = _gvn.intcon(instanceKlass::being_initialized); + Node* being_init = _gvn.intcon(InstanceKlass::being_initialized); tst = Bool( CmpI( init_state, being_init), BoolTest::eq); iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN); set_control(IfTrue(iff)); @@ -336,13 +336,13 @@ void Parse::increment_and_test_invocation_counter(int limit) { if (!count_invocations()) return; - // Get the methodOop node. - const TypePtr* adr_type = TypeOopPtr::make_from_constant(method()); - Node *methodOop_node = makecon(adr_type); + // Get the Method* node. + const TypePtr* adr_type = TypeMetadataPtr::make(method()); + Node *method_node = makecon(adr_type); - // Load the interpreter_invocation_counter from the methodOop. - int offset = methodOopDesc::interpreter_invocation_counter_offset_in_bytes(); - Node* adr_node = basic_plus_adr(methodOop_node, methodOop_node, offset); + // Load the interpreter_invocation_counter from the Method*. + int offset = Method::interpreter_invocation_counter_offset_in_bytes(); + Node* adr_node = basic_plus_adr(method_node, method_node, offset); Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); test_counter_against_threshold(cnt, limit); @@ -354,8 +354,8 @@ //----------------------------method_data_addressing--------------------------- Node* Parse::method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) { - // Get offset within methodDataOop of the data array - ByteSize data_offset = methodDataOopDesc::data_offset(); + // Get offset within MethodData* of the data array + ByteSize data_offset = MethodData::data_offset(); // Get cell offset of the ProfileData within data array int cell_offset = md->dp_to_di(data->dp()); @@ -363,7 +363,7 @@ // Add in counter_offset, the # of bytes into the ProfileData of counter or flag int offset = in_bytes(data_offset) + cell_offset + in_bytes(counter_offset); - const TypePtr* adr_type = TypeOopPtr::make_from_constant(md); + const TypePtr* adr_type = TypeMetadataPtr::make(md); Node* mdo = makecon(adr_type); Node* ptr = basic_plus_adr(mdo, mdo, offset);