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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 }; | 842 }; |
843 | 843 |
844 | 844 |
845 // Helper class that ensures that there is enough space for generating | 845 // Helper class that ensures that there is enough space for generating |
846 // instructions and relocation information. The constructor makes | 846 // instructions and relocation information. The constructor makes |
847 // sure that there is enough space and (in debug mode) the destructor | 847 // sure that there is enough space and (in debug mode) the destructor |
848 // checks that we did not generate too much. | 848 // checks that we did not generate too much. |
849 class EnsureSpace BASE_EMBEDDED { | 849 class EnsureSpace BASE_EMBEDDED { |
850 public: | 850 public: |
851 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { | 851 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { |
852 if (assembler_->overflow()) assembler_->GrowBuffer(); | 852 if (assembler_->buffer_overflow()) assembler_->GrowBuffer(); |
853 #ifdef DEBUG | 853 #ifdef DEBUG |
854 space_before_ = assembler_->available_space(); | 854 space_before_ = assembler_->available_space(); |
855 #endif | 855 #endif |
856 } | 856 } |
857 | 857 |
858 #ifdef DEBUG | 858 #ifdef DEBUG |
859 ~EnsureSpace() { | 859 ~EnsureSpace() { |
860 int bytes_generated = space_before_ - assembler_->available_space(); | 860 int bytes_generated = space_before_ - assembler_->available_space(); |
861 ASSERT(bytes_generated < assembler_->kGap); | 861 ASSERT(bytes_generated < assembler_->kGap); |
862 } | 862 } |
863 #endif | 863 #endif |
864 | 864 |
865 private: | 865 private: |
866 Assembler* assembler_; | 866 Assembler* assembler_; |
867 #ifdef DEBUG | 867 #ifdef DEBUG |
868 int space_before_; | 868 int space_before_; |
869 #endif | 869 #endif |
870 }; | 870 }; |
871 | 871 |
872 } } // namespace v8::internal | 872 } } // namespace v8::internal |
873 | 873 |
874 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 874 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
OLD | NEW |