Skip to content

Commit 31cedf6

Browse files
committed
auto merge of #6478 : dotdash/rust/inlining, r=catamorphism
Not inlining these affects the hash table performance quite badly.
2 parents 2fc6b09 + 7ba685c commit 31cedf6

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/libcore/to_bytes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ pub fn iter_bytes_2<A:IterBytes,B:IterBytes>(a: &A, b: &B,
458458
b.iter_bytes(lsb0, |bytes| {flag = z(bytes); flag});
459459
}
460460
#[cfg(not(stage0))]
461+
#[inline(always)]
461462
pub fn iter_bytes_2<A:IterBytes,B:IterBytes>(a: &A, b: &B,
462463
lsb0: bool, z: Cb) -> bool {
463464
a.iter_bytes(lsb0, z) && b.iter_bytes(lsb0, z)

src/libsyntax/ast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ impl<D:Decoder> Decodable<D> for ident {
9898

9999
#[cfg(stage0)]
100100
impl to_bytes::IterBytes for ident {
101+
#[inline(always)]
101102
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
102103
self.repr.iter_bytes(lsb0, f)
103104
}
104105
}
105106
#[cfg(not(stage0))]
106107
impl to_bytes::IterBytes for ident {
108+
#[inline(always)]
107109
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
108110
self.repr.iter_bytes(lsb0, f)
109111
}

src/libsyntax/parse/token.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,14 @@ impl<'self> Equiv<@~str> for StringRef<'self> {
357357

358358
#[cfg(stage0)]
359359
impl<'self> to_bytes::IterBytes for StringRef<'self> {
360+
#[inline(always)]
360361
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
361362
(**self).iter_bytes(lsb0, f);
362363
}
363364
}
364365
#[cfg(not(stage0))]
365366
impl<'self> to_bytes::IterBytes for StringRef<'self> {
367+
#[inline(always)]
366368
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
367369
(**self).iter_bytes(lsb0, f)
368370
}

0 commit comments

Comments
 (0)