OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_UTILS_H_ | 5 #ifndef V8_UTILS_H_ |
6 #define V8_UTILS_H_ | 6 #define V8_UTILS_H_ |
7 | 7 |
8 #include <limits.h> | 8 #include <limits.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 void AddCharacter(char c) { | 856 void AddCharacter(char c) { |
857 DCHECK(c != '\0'); | 857 DCHECK(c != '\0'); |
858 DCHECK(!is_finalized() && position_ < buffer_.length()); | 858 DCHECK(!is_finalized() && position_ < buffer_.length()); |
859 buffer_[position_++] = c; | 859 buffer_[position_++] = c; |
860 } | 860 } |
861 | 861 |
862 // Add an entire string to the builder. Uses strlen() internally to | 862 // Add an entire string to the builder. Uses strlen() internally to |
863 // compute the length of the input string. | 863 // compute the length of the input string. |
864 void AddString(const char* s); | 864 void AddString(const char* s); |
865 | 865 |
866 // Add the first 'n' characters of the given string 's' to the | 866 // Add the first 'n' characters of the given 0-terminated string 's' to the |
867 // builder. The input string must have enough characters. | 867 // builder. The input string must have enough characters. |
868 void AddSubstring(const char* s, int n); | 868 void AddSubstring(const char* s, int n); |
869 | 869 |
870 // Add character padding to the builder. If count is non-positive, | 870 // Add character padding to the builder. If count is non-positive, |
871 // nothing is added to the builder. | 871 // nothing is added to the builder. |
872 void AddPadding(char c, int count); | 872 void AddPadding(char c, int count); |
873 | 873 |
874 // Add the decimal representation of the value. | 874 // Add the decimal representation of the value. |
875 void AddDecimalInteger(int value); | 875 void AddDecimalInteger(int value); |
876 | 876 |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 // Takes the address of the limit variable in order to find out where | 1537 // Takes the address of the limit variable in order to find out where |
1538 // the top of stack is right now. | 1538 // the top of stack is right now. |
1539 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); | 1539 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); |
1540 return limit; | 1540 return limit; |
1541 } | 1541 } |
1542 | 1542 |
1543 } // namespace internal | 1543 } // namespace internal |
1544 } // namespace v8 | 1544 } // namespace v8 |
1545 | 1545 |
1546 #endif // V8_UTILS_H_ | 1546 #endif // V8_UTILS_H_ |
OLD | NEW |