Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Side by Side Diff: src/utils.h

Issue 795383003: Don't use AddSubstring for external natives (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/natives-external.cc ('K') | « src/natives-external.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« src/natives-external.cc ('K') | « src/natives-external.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698