comparison src/cpu/x86/vm/icBuffer_x86.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 f95d63e2154a
children cd3d6a6b95d9
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
42 // 32bit 11 = 10 bytes + 1 byte 42 // 32bit 11 = 10 bytes + 1 byte
43 } 43 }
44 44
45 45
46 46
47 void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, oop cached_oop, address entry_point) { 47 void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, void* cached_value, address entry_point) {
48 ResourceMark rm; 48 ResourceMark rm;
49 CodeBuffer code(code_begin, ic_stub_code_size()); 49 CodeBuffer code(code_begin, ic_stub_code_size());
50 MacroAssembler* masm = new MacroAssembler(&code); 50 MacroAssembler* masm = new MacroAssembler(&code);
51 // note: even though the code contains an embedded oop, we do not need reloc info 51 // note: even though the code contains an embedded value, we do not need reloc info
52 // because 52 // because
53 // (1) the oop is old (i.e., doesn't matter for scavenges) 53 // (1) the value is old (i.e., doesn't matter for scavenges)
54 // (2) these ICStubs are removed *before* a GC happens, so the roots disappear 54 // (2) these ICStubs are removed *before* a GC happens, so the roots disappear
55 assert(cached_oop == NULL || cached_oop->is_perm(), "must be perm oop"); 55 // assert(cached_value == NULL || cached_oop->is_perm(), "must be perm oop");
56 masm->lea(rax, OopAddress((address) cached_oop)); 56 masm->lea(rax, AddressLiteral((address) cached_value, relocInfo::metadata_type));
57 masm->jump(ExternalAddress(entry_point)); 57 masm->jump(ExternalAddress(entry_point));
58 } 58 }
59 59
60 60
61 address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) { 61 address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
63 NativeJump* jump = nativeJump_at(move->next_instruction_address()); 63 NativeJump* jump = nativeJump_at(move->next_instruction_address());
64 return jump->jump_destination(); 64 return jump->jump_destination();
65 } 65 }
66 66
67 67
68 oop InlineCacheBuffer::ic_buffer_cached_oop(address code_begin) { 68 void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
69 // creation also verifies the object 69 // creation also verifies the object
70 NativeMovConstReg* move = nativeMovConstReg_at(code_begin); 70 NativeMovConstReg* move = nativeMovConstReg_at(code_begin);
71 // Verifies the jump 71 // Verifies the jump
72 NativeJump* jump = nativeJump_at(move->next_instruction_address()); 72 NativeJump* jump = nativeJump_at(move->next_instruction_address());
73 return (oop)move->data(); 73 void* o = (void*)move->data();
74 return o;
74 } 75 }