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

Side by Side Diff: src/objects.h

Issue 2577143002: [runtime] Add PositiveNumberToUint32 helper to avoid double to uint roundtrip (Closed)
Patch Set: avoid overflows Created 4 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
« no previous file with comments | « src/conversions-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 9945 matching lines...) Expand 10 before | Expand all | Expand 10 after
9956 int* length_output = 0); 9956 int* length_output = 0);
9957 9957
9958 bool ComputeArrayIndex(uint32_t* index); 9958 bool ComputeArrayIndex(uint32_t* index);
9959 9959
9960 // Externalization. 9960 // Externalization.
9961 bool MakeExternal(v8::String::ExternalStringResource* resource); 9961 bool MakeExternal(v8::String::ExternalStringResource* resource);
9962 bool MakeExternal(v8::String::ExternalOneByteStringResource* resource); 9962 bool MakeExternal(v8::String::ExternalOneByteStringResource* resource);
9963 9963
9964 // Conversion. 9964 // Conversion.
9965 inline bool AsArrayIndex(uint32_t* index); 9965 inline bool AsArrayIndex(uint32_t* index);
9966 uint32_t inline ToValidIndex(Object* number);
9966 9967
9967 // Trimming. 9968 // Trimming.
9968 enum TrimMode { kTrim, kTrimLeft, kTrimRight }; 9969 enum TrimMode { kTrim, kTrimLeft, kTrimRight };
9969 static Handle<String> Trim(Handle<String> string, TrimMode mode); 9970 static Handle<String> Trim(Handle<String> string, TrimMode mode);
9970 9971
9971 DECLARE_CAST(String) 9972 DECLARE_CAST(String)
9972 9973
9973 void PrintOn(FILE* out); 9974 void PrintOn(FILE* out);
9974 9975
9975 // For use during stack traces. Performs rudimentary sanity check. 9976 // For use during stack traces. Performs rudimentary sanity check.
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
12008 } 12009 }
12009 return value; 12010 return value;
12010 } 12011 }
12011 }; 12012 };
12012 12013
12013 12014
12014 } // NOLINT, false-positive due to second-order macros. 12015 } // NOLINT, false-positive due to second-order macros.
12015 } // NOLINT, false-positive due to second-order macros. 12016 } // NOLINT, false-positive due to second-order macros.
12016 12017
12017 #endif // V8_OBJECTS_H_ 12018 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/conversions-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698