Mercurial > hg > truffle
comparison src/share/vm/code/icBuffer.hpp @ 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 | b31471cdc53e |
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. |
55 int size() const { return _size; } | 55 int size() const { return _size; } |
56 static int code_size_to_size(int code_size) { return round_to(sizeof(ICStub), CodeEntryAlignment) + code_size; } | 56 static int code_size_to_size(int code_size) { return round_to(sizeof(ICStub), CodeEntryAlignment) + code_size; } |
57 | 57 |
58 public: | 58 public: |
59 // Creation | 59 // Creation |
60 void set_stub(CompiledIC *ic, oop cached_value, address dest_addr); | 60 void set_stub(CompiledIC *ic, void* cached_value, address dest_addr); |
61 | 61 |
62 // Code info | 62 // Code info |
63 address code_begin() const { return (address)this + round_to(sizeof(ICStub), CodeEntryAlignment); } | 63 address code_begin() const { return (address)this + round_to(sizeof(ICStub), CodeEntryAlignment); } |
64 address code_end() const { return (address)this + size(); } | 64 address code_end() const { return (address)this + size(); } |
65 | 65 |
68 void clear(); | 68 void clear(); |
69 bool is_empty() const { return _ic_site == NULL; } | 69 bool is_empty() const { return _ic_site == NULL; } |
70 | 70 |
71 // stub info | 71 // stub info |
72 address destination() const; // destination of jump instruction | 72 address destination() const; // destination of jump instruction |
73 oop cached_oop() const; // cached_oop for stub | 73 void* cached_value() const; // cached_value for stub |
74 | 74 |
75 // Debugging | 75 // Debugging |
76 void verify() PRODUCT_RETURN; | 76 void verify() PRODUCT_RETURN; |
77 void print() PRODUCT_RETURN; | 77 void print() PRODUCT_RETURN; |
78 | 78 |
97 static int ic_stub_code_size(); | 97 static int ic_stub_code_size(); |
98 | 98 |
99 static StubQueue* _buffer; | 99 static StubQueue* _buffer; |
100 static ICStub* _next_stub; | 100 static ICStub* _next_stub; |
101 | 101 |
102 static CompiledICHolder* _pending_released; | |
103 static int _pending_count; | |
104 | |
102 static StubQueue* buffer() { return _buffer; } | 105 static StubQueue* buffer() { return _buffer; } |
103 static void set_next_stub(ICStub* next_stub) { _next_stub = next_stub; } | 106 static void set_next_stub(ICStub* next_stub) { _next_stub = next_stub; } |
104 static ICStub* get_next_stub() { return _next_stub; } | 107 static ICStub* get_next_stub() { return _next_stub; } |
105 | 108 |
106 static void init_next_stub(); | 109 static void init_next_stub(); |
107 | 110 |
108 static ICStub* new_ic_stub(); | 111 static ICStub* new_ic_stub(); |
109 | 112 |
110 | 113 |
111 // Machine-dependent implementation of ICBuffer | 114 // Machine-dependent implementation of ICBuffer |
112 static void assemble_ic_buffer_code(address code_begin, oop cached_oop, address entry_point); | 115 static void assemble_ic_buffer_code(address code_begin, void* cached_value, address entry_point); |
113 static address ic_buffer_entry_point (address code_begin); | 116 static address ic_buffer_entry_point (address code_begin); |
114 static oop ic_buffer_cached_oop (address code_begin); | 117 static void* ic_buffer_cached_value (address code_begin); |
115 | 118 |
116 public: | 119 public: |
117 | 120 |
118 // Initialization; must be called before first usage | 121 // Initialization; must be called before first usage |
119 static void initialize(); | 122 static void initialize(); |
125 static void update_inline_caches(); | 128 static void update_inline_caches(); |
126 | 129 |
127 // for debugging | 130 // for debugging |
128 static bool is_empty(); | 131 static bool is_empty(); |
129 | 132 |
133 static void release_pending_icholders(); | |
134 static void queue_for_release(CompiledICHolder* icholder); | |
135 static int pending_icholder_count() { return _pending_count; } | |
130 | 136 |
131 // New interface | 137 // New interface |
132 static void create_transition_stub(CompiledIC *ic, oop cached_oop, address entry); | 138 static void create_transition_stub(CompiledIC *ic, void* cached_value, address entry); |
133 static address ic_destination_for(CompiledIC *ic); | 139 static address ic_destination_for(CompiledIC *ic); |
134 static oop cached_oop_for(CompiledIC *ic); | 140 static void* cached_value_for(CompiledIC *ic); |
135 }; | 141 }; |
136 | 142 |
137 #endif // SHARE_VM_CODE_ICBUFFER_HPP | 143 #endif // SHARE_VM_CODE_ICBUFFER_HPP |