Chromium Code Reviews| Index: src/IceAssembler.h |
| diff --git a/src/IceAssembler.h b/src/IceAssembler.h |
| index d80e3d26e9b4f4f1b8d2a09e06e4539efb7993b7..0febc624b52384cc4234a5021754a1b6bbd8ebda 100644 |
| --- a/src/IceAssembler.h |
| +++ b/src/IceAssembler.h |
| @@ -32,6 +32,8 @@ |
| namespace Ice { |
| +class Assembler; |
| + |
| /// A Label can be in one of three states: |
| /// - Unused. |
| /// - Linked, unplaced and tracking the position of branches to the label. |
| @@ -82,11 +84,7 @@ public: |
| assert(isBound()); |
| } |
| - void linkTo(intptr_t position) { |
| - assert(!isBound()); |
| - Position = position + kWordSize; |
| - assert(isLinked()); |
| - } |
| + inline void linkTo(const Assembler &Asm, intptr_t position); |
|
Jim Stichnoth
2015/12/08 22:20:00
Does the "inline" really help here?
Also, we may
Karl
2015/12/08 22:39:32
The "inline" is needed if we don't want the functi
Jim Stichnoth
2015/12/08 23:06:44
No - "const Assembler *Asm" means that the pointed
|
| protected: |
| intptr_t Position = 0; |
| @@ -354,6 +352,14 @@ protected: |
| AssemblerBuffer Buffer; |
| }; |
| +void Label::linkTo(const Assembler &Asm, intptr_t position) { |
|
Jim Stichnoth
2015/12/08 22:20:00
I think this should be moved into the .cpp file.
Karl
2015/12/08 22:39:32
Done.
|
| + if (Asm.getPreliminary() || Asm.needsTextFixup()) |
|
Jim Stichnoth
2015/12/08 22:20:00
I think it's important to leave some documentation
Karl
2015/12/08 22:39:32
Done.
|
| + return; |
| + assert(!isBound()); |
| + Position = position + kWordSize; |
| + assert(isLinked()); |
| +} |
| + |
| } // end of namespace Ice |
| #endif // SUBZERO_SRC_ICEASSEMBLER_H_ |