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

Unified Diff: src/conversions-inl.h

Issue 2152853002: [Interpreter] Avoid accessing on-heap literal in VisitLiteral. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: DCHECK to CHECK Created 4 years, 5 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/factory.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 5fe71e09d3cc49d79277d434c66fbcfbd26e3b55..d449a8fcd8270d787bf078d73d2ad7bdaf29917a 100644
--- a/src/conversions-inl.h
+++ b/src/conversions-inl.h
@@ -97,6 +97,13 @@ int32_t DoubleToInt32(double x) {
}
}
+bool DoubleToSmiInteger(double value, int* smi_int_value) {
+ if (IsMinusZero(value)) return false;
+ int i = FastD2IChecked(value);
+ if (value != i || !Smi::IsValid(i)) return false;
+ *smi_int_value = i;
+ return true;
+}
bool IsSmiDouble(double value) {
return !IsMinusZero(value) && value >= Smi::kMinValue &&
« no previous file with comments | « src/conversions.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698