comparison src/share/vm/shark/sharkTopLevelBlock.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 069ab3f976d3
children 2cd5e15048e6
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009, 2010 Red Hat, Inc. 3 * Copyright 2008, 2009, 2010 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * 5 *
6 * This code is free software; you can redistribute it and/or modify it 6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as 7 * under the terms of the GNU General Public License version 2 only, as
1101 } 1101 }
1102 1102
1103 Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { 1103 Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) {
1104 return builder()->CreateBitCast( 1104 return builder()->CreateBitCast(
1105 builder()->CreateInlineOop(method), 1105 builder()->CreateInlineOop(method),
1106 SharkType::methodOop_type(), 1106 SharkType::Method*_type(),
1107 "callee"); 1107 "callee");
1108 } 1108 }
1109 1109
1110 Value *SharkTopLevelBlock::get_virtual_callee(SharkValue* receiver, 1110 Value *SharkTopLevelBlock::get_virtual_callee(SharkValue* receiver,
1111 int vtable_index) { 1111 int vtable_index) {
1116 "klass"); 1116 "klass");
1117 1117
1118 return builder()->CreateLoad( 1118 return builder()->CreateLoad(
1119 builder()->CreateArrayAddress( 1119 builder()->CreateArrayAddress(
1120 klass, 1120 klass,
1121 SharkType::methodOop_type(), 1121 SharkType::Method*_type(),
1122 vtableEntry::size() * wordSize, 1122 vtableEntry::size() * wordSize,
1123 in_ByteSize(instanceKlass::vtable_start_offset() * wordSize), 1123 in_ByteSize(InstanceKlass::vtable_start_offset() * wordSize),
1124 LLVMValue::intptr_constant(vtable_index)), 1124 LLVMValue::intptr_constant(vtable_index)),
1125 "callee"); 1125 "callee");
1126 } 1126 }
1127 1127
1128 Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, 1128 Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver,
1140 "object_klass"); 1140 "object_klass");
1141 1141
1142 Value *vtable_start = builder()->CreateAdd( 1142 Value *vtable_start = builder()->CreateAdd(
1143 builder()->CreatePtrToInt(object_klass, SharkType::intptr_type()), 1143 builder()->CreatePtrToInt(object_klass, SharkType::intptr_type()),
1144 LLVMValue::intptr_constant( 1144 LLVMValue::intptr_constant(
1145 instanceKlass::vtable_start_offset() * HeapWordSize), 1145 InstanceKlass::vtable_start_offset() * HeapWordSize),
1146 "vtable_start"); 1146 "vtable_start");
1147 1147
1148 Value *vtable_length = builder()->CreateValueOfStructEntry( 1148 Value *vtable_length = builder()->CreateValueOfStructEntry(
1149 object_klass, 1149 object_klass,
1150 in_ByteSize(instanceKlass::vtable_length_offset() * HeapWordSize), 1150 in_ByteSize(InstanceKlass::vtable_length_offset() * HeapWordSize),
1151 SharkType::jint_type(), 1151 SharkType::jint_type(),
1152 "vtable_length"); 1152 "vtable_length");
1153 vtable_length = 1153 vtable_length =
1154 builder()->CreateIntCast(vtable_length, SharkType::intptr_type(), false); 1154 builder()->CreateIntCast(vtable_length, SharkType::intptr_type(), false);
1155 1155
1229 offset), 1229 offset),
1230 LLVMValue::intptr_constant( 1230 LLVMValue::intptr_constant(
1231 method->itable_index() * itableMethodEntry::size() * wordSize)), 1231 method->itable_index() * itableMethodEntry::size() * wordSize)),
1232 LLVMValue::intptr_constant( 1232 LLVMValue::intptr_constant(
1233 itableMethodEntry::method_offset_in_bytes())), 1233 itableMethodEntry::method_offset_in_bytes())),
1234 PointerType::getUnqual(SharkType::methodOop_type())), 1234 PointerType::getUnqual(SharkType::Method*_type())),
1235 "callee"); 1235 "callee");
1236 } 1236 }
1237 1237
1238 void SharkTopLevelBlock::do_call() { 1238 void SharkTopLevelBlock::do_call() {
1239 // Set frequently used booleans 1239 // Set frequently used booleans
1310 callee = get_direct_callee(call_method); 1310 callee = get_direct_callee(call_method);
1311 } 1311 }
1312 1312
1313 // Load the SharkEntry from the callee 1313 // Load the SharkEntry from the callee
1314 Value *base_pc = builder()->CreateValueOfStructEntry( 1314 Value *base_pc = builder()->CreateValueOfStructEntry(
1315 callee, methodOopDesc::from_interpreted_offset(), 1315 callee, Method::from_interpreted_offset(),
1316 SharkType::intptr_type(), 1316 SharkType::intptr_type(),
1317 "base_pc"); 1317 "base_pc");
1318 1318
1319 // Load the entry point from the SharkEntry 1319 // Load the entry point from the SharkEntry
1320 Value *entry_point = builder()->CreateLoad( 1320 Value *entry_point = builder()->CreateLoad(