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

Unified Diff: src/bootstrapper.cc

Issue 2313073002: [builtins] Migrate Number predicates and make them optimizable. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 99abda1754defd13a03dac46431c4fed2c1babd3..f9a13a4ed98de3ebc0ec6214b963d70ccdd0075e 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1303,6 +1303,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
// Install i18n fallback functions.
SimpleInstallFunction(prototype, "toLocaleString",
Builtins::kNumberPrototypeToLocaleString, 0, false);
+
+ // Install the Number functions.
+ SimpleInstallFunction(number_fun, "isFinite", Builtins::kNumberIsFinite, 1,
+ true);
+ SimpleInstallFunction(number_fun, "isInteger", Builtins::kNumberIsInteger,
+ 1, true);
+ SimpleInstallFunction(number_fun, "isNaN", Builtins::kNumberIsNaN, 1, true);
+ SimpleInstallFunction(number_fun, "isSafeInteger",
+ Builtins::kNumberIsSafeInteger, 1, true);
}
{ // --- B o o l e a n ---
@@ -3138,6 +3147,14 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
native_context()->set_global_eval_fun(*eval);
}
+ // Install Global.isFinite
+ SimpleInstallFunction(global_object, "isFinite", Builtins::kGlobalIsFinite, 1,
+ true, kGlobalIsFinite);
+
+ // Install Global.isNaN
+ SimpleInstallFunction(global_object, "isNaN", Builtins::kGlobalIsNaN, 1, true,
+ kGlobalIsNaN);
+
// Install Array.prototype.concat
{
Handle<JSFunction> array_constructor(native_context()->array_function());
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698