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

Side by Side Diff: src/conversions.h

Issue 2625873009: [ast] Remove heap accesses from AST numbering (Closed)
Patch Set: Fix condition to not be stupid Created 3 years, 11 months 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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_CONVERSIONS_H_ 5 #ifndef V8_CONVERSIONS_H_
6 #define V8_CONVERSIONS_H_ 6 #define V8_CONVERSIONS_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "src/base/logging.h" 10 #include "src/base/logging.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // Integer32 is an integer that can be represented as a signed 32-bit 160 // Integer32 is an integer that can be represented as a signed 32-bit
161 // integer. It has to be in the range [-2^31, 2^31 - 1]. 161 // integer. It has to be in the range [-2^31, 2^31 - 1].
162 // We also have to check for negative 0 as it is not an Integer32. 162 // We also have to check for negative 0 as it is not an Integer32.
163 inline bool IsInt32Double(double value); 163 inline bool IsInt32Double(double value);
164 164
165 // UInteger32 is an integer that can be represented as an unsigned 32-bit 165 // UInteger32 is an integer that can be represented as an unsigned 32-bit
166 // integer. It has to be in the range [0, 2^32 - 1]. 166 // integer. It has to be in the range [0, 2^32 - 1].
167 // We also have to check for negative 0 as it is not a UInteger32. 167 // We also have to check for negative 0 as it is not a UInteger32.
168 inline bool IsUint32Double(double value); 168 inline bool IsUint32Double(double value);
169 169
170 // Tries to convert |value| to uint32 -- if it fails, returns false; otherwise,
171 // sets |uint32_value| to the integer value and returns true.
172 inline bool DoubleToUint32(double value, uint32_t* uint32_value);
173
170 // Convert from Number object to C integer. 174 // Convert from Number object to C integer.
171 inline uint32_t PositiveNumberToUint32(Object* number); 175 inline uint32_t PositiveNumberToUint32(Object* number);
172 inline int32_t NumberToInt32(Object* number); 176 inline int32_t NumberToInt32(Object* number);
173 inline uint32_t NumberToUint32(Object* number); 177 inline uint32_t NumberToUint32(Object* number);
174 inline int64_t NumberToInt64(Object* number); 178 inline int64_t NumberToInt64(Object* number);
175 179
176 double StringToDouble(UnicodeCache* unicode_cache, Handle<String> string, 180 double StringToDouble(UnicodeCache* unicode_cache, Handle<String> string,
177 int flags, double empty_string_val = 0.0); 181 int flags, double empty_string_val = 0.0);
178 182
179 inline bool TryNumberToSize(Object* number, size_t* result); 183 inline bool TryNumberToSize(Object* number, size_t* result);
180 184
181 // Converts a number into size_t. 185 // Converts a number into size_t.
182 inline size_t NumberToSize(Object* number); 186 inline size_t NumberToSize(Object* number);
183 187
184 // returns DoubleToString(StringToDouble(string)) == string 188 // returns DoubleToString(StringToDouble(string)) == string
185 bool IsSpecialIndex(UnicodeCache* unicode_cache, String* string); 189 bool IsSpecialIndex(UnicodeCache* unicode_cache, String* string);
186 190
187 } // namespace internal 191 } // namespace internal
188 } // namespace v8 192 } // namespace v8
189 193
190 #endif // V8_CONVERSIONS_H_ 194 #endif // V8_CONVERSIONS_H_
OLDNEW
« src/compiler.cc ('K') | « src/compiler/ast-graph-builder.cc ('k') | src/conversions-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698