Skip to content

Commit a1090a7

Browse files
committed
---
yaml --- r: 2776 b: refs/heads/master c: 3eafea4 h: refs/heads/master v: v3
1 parent 9815936 commit a1090a7

File tree

3 files changed

+3
-98
lines changed

3 files changed

+3
-98
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 70106f35ce603e60530abe333d6f4fcd75fe675e
2+
refs/heads/master: 3eafea46a3f66f28c358a50f97005e0893efd8b8

trunk/src/rt/rust_crate_cache.cpp

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -65,73 +65,6 @@ rust_crate_cache::c_sym::get_val() {
6565
return val;
6666
}
6767

68-
69-
70-
rust_crate_cache::rust_sym::rust_sym(rust_dom *dom,
71-
rust_crate const *curr_crate,
72-
c_sym *crate_sym,
73-
char const **path)
74-
: val(0),
75-
crate_sym(crate_sym),
76-
dom(dom)
77-
{
78-
crate_sym->ref();
79-
typedef rust_crate_reader::die die;
80-
rust_crate const *crate = (rust_crate*)crate_sym->get_val();
81-
if (!crate) {
82-
DLOG_ERR(dom, cache, "failed to resolve symbol, null crate symbol");
83-
return;
84-
}
85-
rust_crate_reader rdr(dom, crate);
86-
bool found_root = false;
87-
bool found_leaf = false;
88-
for (die d = rdr.dies.first_die();
89-
!(found_root || d.is_null());
90-
d = d.next_sibling()) {
91-
92-
die t1 = d;
93-
die t2 = d;
94-
for (char const **c = crate_rel(curr_crate, path);
95-
(*c
96-
&& !t1.is_null()
97-
&& t1.find_child_by_name(crate_rel(curr_crate, *c), t2));
98-
++c, t1=t2) {
99-
DLOG(dom, dwarf, "matched die <0x%" PRIxPTR
100-
">, child '%s' = die<0x%" PRIxPTR ">",
101-
t1.off, crate_rel(curr_crate, *c), t2.off);
102-
found_root = found_root || true;
103-
if (!*(c+1) && t2.find_num_attr(DW_AT_low_pc, val)) {
104-
DLOG(dom, dwarf, "found relative address: 0x%" PRIxPTR, val);
105-
DLOG(dom, dwarf, "plus image-base 0x%" PRIxPTR,
106-
crate->get_image_base());
107-
val += crate->get_image_base();
108-
found_leaf = true;
109-
break;
110-
}
111-
}
112-
if (found_root || found_leaf)
113-
break;
114-
}
115-
if (found_leaf) {
116-
DLOG(dom, cache, "resolved symbol to 0x%" PRIxPTR, val);
117-
} else {
118-
DLOG_ERR(dom, cache, "failed to resolve symbol");
119-
}
120-
}
121-
122-
rust_crate_cache::rust_sym::~rust_sym() {
123-
DLOG(dom, cache,
124-
"~rust_crate_cache::rust_sym(0x%" PRIxPTR ")", val);
125-
crate_sym->deref();
126-
}
127-
128-
uintptr_t
129-
rust_crate_cache::rust_sym::get_val() {
130-
return val;
131-
}
132-
133-
134-
13568
static inline void
13669
adjust_disp(uintptr_t &disp, const void *oldp, const void *newp)
13770
{
@@ -180,33 +113,20 @@ rust_crate_cache::get_type_desc(size_t size,
180113

181114
rust_crate_cache::rust_crate_cache(rust_dom *dom,
182115
rust_crate const *crate)
183-
: rust_syms((rust_sym**)
184-
dom->calloc(sizeof(rust_sym*) * crate->n_rust_syms)),
185-
c_syms((c_sym**) dom->calloc(sizeof(c_sym*) * crate->n_c_syms)),
116+
: c_syms((c_sym**) dom->calloc(sizeof(c_sym*) * crate->n_c_syms)),
186117
libs((lib**) dom->calloc(sizeof(lib*) * crate->n_libs)),
187118
type_descs(NULL),
188119
crate(crate),
189120
dom(dom),
190121
idx(0)
191122
{
192-
I(dom, rust_syms);
193123
I(dom, c_syms);
194124
I(dom, libs);
195125
}
196126

197127
void
198128
rust_crate_cache::flush() {
199129
DLOG(dom, cache, "rust_crate_cache::flush()");
200-
for (size_t i = 0; i < crate->n_rust_syms; ++i) {
201-
rust_sym *s = rust_syms[i];
202-
if (s) {
203-
DLOG(dom, cache,
204-
"rust_crate_cache::flush() deref rust_sym %"
205-
PRIdPTR " (rc=%" PRIdPTR ")", i, s->ref_count);
206-
s->deref();
207-
}
208-
rust_syms[i] = NULL;
209-
}
210130

211131
for (size_t i = 0; i < crate->n_c_syms; ++i) {
212132
c_sym *s = c_syms[i];
@@ -240,7 +160,6 @@ rust_crate_cache::flush() {
240160
rust_crate_cache::~rust_crate_cache()
241161
{
242162
flush();
243-
dom->free(rust_syms);
244163
dom->free(c_syms);
245164
dom->free(libs);
246165
}

trunk/src/rt/rust_internal.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class rust_crate {
239239

240240
public:
241241

242-
size_t n_rust_syms;
242+
size_t pad6;
243243
size_t n_c_syms;
244244
size_t n_libs;
245245

@@ -309,27 +309,13 @@ rust_crate_cache : public dom_owned<rust_crate_cache>,
309309
~c_sym();
310310
};
311311

312-
class rust_sym :
313-
public rc_base<rust_sym>, public dom_owned<rust_sym>
314-
{
315-
uintptr_t val;
316-
c_sym *crate_sym;
317-
public:
318-
rust_dom *dom;
319-
rust_sym(rust_dom *dom, rust_crate const *curr_crate,
320-
c_sym *crate_sym, char const **path);
321-
uintptr_t get_val();
322-
~rust_sym();
323-
};
324-
325312
type_desc *get_type_desc(size_t size,
326313
size_t align,
327314
size_t n_descs,
328315
type_desc const **descs);
329316

330317
private:
331318

332-
rust_sym **rust_syms;
333319
c_sym **c_syms;
334320
lib **libs;
335321
type_desc *type_descs;

0 commit comments

Comments
 (0)