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

Unified Diff: src/conversions-inl.h

Issue 2625873009: [ast] Remove heap accesses from AST numbering (Closed)
Patch Set: Address nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/conversions.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions-inl.h
diff --git a/src/conversions-inl.h b/src/conversions-inl.h
index d7789f9180880868baac232fbc4eeab9e58cb4d9..b71fcfcf69db1dcb206e6f954341ea5efb448451 100644
--- a/src/conversions-inl.h
+++ b/src/conversions-inl.h
@@ -122,6 +122,17 @@ bool IsUint32Double(double value) {
value == FastUI2D(FastD2UI(value));
}
+bool DoubleToUint32IfEqualToSelf(double value, uint32_t* uint32_value) {
+ if (value < 0) return false;
+ // TODO(leszeks): We maybe could be faster than FastD2UI here, since we only
+ // care about the value being valid if the conversion is valid.
+ uint32_t converted_value = FastD2UI(value);
+ if (FastUI2D(converted_value) == value) {
+ *uint32_value = converted_value;
+ return true;
+ }
+ return false;
+}
int32_t NumberToInt32(Object* number) {
if (number->IsSmi()) return Smi::cast(number)->value();
« no previous file with comments | « src/conversions.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698