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

Unified Diff: src/builtins/builtins-global.cc

Issue 2752143004: [refactor] Separate generated builtins and C++ builtins into separate files (Closed)
Patch Set: tentative gcmole fix Created 3 years, 9 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/builtins/builtins-generator-gen.cc ('k') | src/builtins/builtins-global-gen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-global.cc
diff --git a/src/builtins/builtins-global.cc b/src/builtins/builtins-global.cc
index 2bbd7c78b557d7705cae5598fd4be375686b4ce7..4d3337f2135a911111be72e10ac5650b78a8c488 100644
--- a/src/builtins/builtins-global.cc
+++ b/src/builtins/builtins-global.cc
@@ -5,7 +5,6 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
-#include "src/code-stub-assembler.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/objects-inl.h"
@@ -103,100 +102,5 @@ BUILTIN(GlobalEval) {
Execution::Call(isolate, function, target_global_proxy, 0, nullptr));
}
-// ES6 section 18.2.2 isFinite ( number )
-TF_BUILTIN(GlobalIsFinite, CodeStubAssembler) {
- Node* context = Parameter(4);
-
- Label return_true(this), return_false(this);
-
- // We might need to loop once for ToNumber conversion.
- Variable var_num(this, MachineRepresentation::kTagged);
- Label loop(this, &var_num);
- var_num.Bind(Parameter(1));
- Goto(&loop);
- Bind(&loop);
- {
- Node* num = var_num.value();
-
- // Check if {num} is a Smi or a HeapObject.
- GotoIf(TaggedIsSmi(num), &return_true);
-
- // Check if {num} is a HeapNumber.
- Label if_numisheapnumber(this),
- if_numisnotheapnumber(this, Label::kDeferred);
- Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber,
- &if_numisnotheapnumber);
-
- Bind(&if_numisheapnumber);
- {
- // Check if {num} contains a finite, non-NaN value.
- Node* num_value = LoadHeapNumberValue(num);
- BranchIfFloat64IsNaN(Float64Sub(num_value, num_value), &return_false,
- &return_true);
- }
-
- Bind(&if_numisnotheapnumber);
- {
- // Need to convert {num} to a Number first.
- Callable callable = CodeFactory::NonNumberToNumber(isolate());
- var_num.Bind(CallStub(callable, context, num));
- Goto(&loop);
- }
- }
-
- Bind(&return_true);
- Return(BooleanConstant(true));
-
- Bind(&return_false);
- Return(BooleanConstant(false));
-}
-
-// ES6 section 18.2.3 isNaN ( number )
-TF_BUILTIN(GlobalIsNaN, CodeStubAssembler) {
- Node* context = Parameter(4);
-
- Label return_true(this), return_false(this);
-
- // We might need to loop once for ToNumber conversion.
- Variable var_num(this, MachineRepresentation::kTagged);
- Label loop(this, &var_num);
- var_num.Bind(Parameter(1));
- Goto(&loop);
- Bind(&loop);
- {
- Node* num = var_num.value();
-
- // Check if {num} is a Smi or a HeapObject.
- GotoIf(TaggedIsSmi(num), &return_false);
-
- // Check if {num} is a HeapNumber.
- Label if_numisheapnumber(this),
- if_numisnotheapnumber(this, Label::kDeferred);
- Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber,
- &if_numisnotheapnumber);
-
- Bind(&if_numisheapnumber);
- {
- // Check if {num} contains a NaN.
- Node* num_value = LoadHeapNumberValue(num);
- BranchIfFloat64IsNaN(num_value, &return_true, &return_false);
- }
-
- Bind(&if_numisnotheapnumber);
- {
- // Need to convert {num} to a Number first.
- Callable callable = CodeFactory::NonNumberToNumber(isolate());
- var_num.Bind(CallStub(callable, context, num));
- Goto(&loop);
- }
- }
-
- Bind(&return_true);
- Return(BooleanConstant(true));
-
- Bind(&return_false);
- Return(BooleanConstant(false));
-}
-
} // namespace internal
} // namespace v8
« no previous file with comments | « src/builtins/builtins-generator-gen.cc ('k') | src/builtins/builtins-global-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698