OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 }; | 845 }; |
846 | 846 |
847 | 847 |
848 // Helper class that ensures that there is enough space for generating | 848 // Helper class that ensures that there is enough space for generating |
849 // instructions and relocation information. The constructor makes | 849 // instructions and relocation information. The constructor makes |
850 // sure that there is enough space and (in debug mode) the destructor | 850 // sure that there is enough space and (in debug mode) the destructor |
851 // checks that we did not generate too much. | 851 // checks that we did not generate too much. |
852 class EnsureSpace BASE_EMBEDDED { | 852 class EnsureSpace BASE_EMBEDDED { |
853 public: | 853 public: |
854 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { | 854 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { |
855 if (assembler_->buffer_overflow()) assembler_->GrowBuffer(); | 855 if (assembler_->overflow()) assembler_->GrowBuffer(); |
856 #ifdef DEBUG | 856 #ifdef DEBUG |
857 space_before_ = assembler_->available_space(); | 857 space_before_ = assembler_->available_space(); |
858 #endif | 858 #endif |
859 } | 859 } |
860 | 860 |
861 #ifdef DEBUG | 861 #ifdef DEBUG |
862 ~EnsureSpace() { | 862 ~EnsureSpace() { |
863 int bytes_generated = space_before_ - assembler_->available_space(); | 863 int bytes_generated = space_before_ - assembler_->available_space(); |
864 ASSERT(bytes_generated < assembler_->kGap); | 864 ASSERT(bytes_generated < assembler_->kGap); |
865 } | 865 } |
866 #endif | 866 #endif |
867 | 867 |
868 private: | 868 private: |
869 Assembler* assembler_; | 869 Assembler* assembler_; |
870 #ifdef DEBUG | 870 #ifdef DEBUG |
871 int space_before_; | 871 int space_before_; |
872 #endif | 872 #endif |
873 }; | 873 }; |
874 | 874 |
875 } } // namespace v8::internal | 875 } } // namespace v8::internal |
876 | 876 |
877 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 877 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
OLD | NEW |