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

Unified Diff: src/factory.h

Issue 2146293003: [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add a basic impl in ElementsAccessor, cleanup %ArrayIncludes_Slow, lots of new tests 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
Index: src/factory.h
diff --git a/src/factory.h b/src/factory.h
index 172f473a11fec0d337081193530da29649cbe508..bb2fb7d0b1dcbfe57130f0b9e1c10c3b502fa7c4 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -372,6 +372,16 @@ class Factory final {
}
return NewNumber(static_cast<double>(value), pretenure);
}
+ Handle<Object> NewNumberFromInt64(int64_t value,
+ PretenureFlag pretenure = NOT_TENURED) {
+ if (value <= std::numeric_limits<int32_t>::max() &&
+ value >= std::numeric_limits<int32_t>::min() &&
+ Smi::IsValid(static_cast<int32_t>(value))) {
+ return Handle<Object>(Smi::FromInt(static_cast<int32_t>(value)),
+ isolate());
+ }
+ return NewNumber(static_cast<double>(value), pretenure);
+ }
Handle<HeapNumber> NewHeapNumber(double value,
MutableMode mode = IMMUTABLE,
PretenureFlag pretenure = NOT_TENURED);

Powered by Google App Engine
This is Rietveld 408576698