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

Unified Diff: src/factory.h

Issue 2205883003: Reland [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compiler warning Created 4 years, 4 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 98472ba0b83b152510a26d2d2180e25c1ba24269..4908d5fad85313cb0088582483a6d52ce11f6b71 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -380,6 +380,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);
« src/code-stub-assembler.cc ('K') | « src/elements.cc ('k') | src/js/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698