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

Unified Diff: src/code-stub-assembler.cc

Issue 2146293003: [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactor based on bmeurer comments 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/code-stub-assembler.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index eb7e49da46d352883ccad891f19f348217b8cdec..497caddd11b86edb533de43ce1a3c5d9149cbe55 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -471,6 +471,32 @@ Node* CodeStubAssembler::WordIsPositiveSmi(Node* a) {
IntPtrConstant(0));
}
+void CodeStubAssembler::BranchIfSameValueZero(Node* a, Node* b, Node* context,
+ Label* if_true, Label* if_false) {
+ Label if_noteq(this), if_a_isnan(this);
+ Node* heap_number_type = Int32Constant(HEAP_NUMBER_TYPE);
+ BranchIf(CallRuntime(Runtime::kInlineStrictEqual, context, a, b), if_true,
caitp 2016/07/15 17:24:35 this was the problem --- fixing this made the perf
+ &if_noteq);
+
+ Bind(&if_noteq);
+ GotoIf(WordIsSmi(a), if_false);
+
+ Node* a_type = LoadInstanceType(a);
+ GotoIf(WordNotEqual(a_type, heap_number_type), if_false);
+
+ Node* a_value = LoadHeapNumberValue(a);
+ BranchIfFloat64IsNaN(a_value, &if_a_isnan, if_false);
+
+ Bind(&if_a_isnan);
+ GotoIf(WordIsSmi(b), if_false);
+
+ Node* b_type = LoadInstanceType(b);
+ GotoIf(WordNotEqual(b_type, heap_number_type), if_false);
+
+ Node* b_value = LoadHeapNumberValue(b);
+ BranchIfFloat64IsNaN(b_value, if_true, if_false);
+}
+
Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes,
AllocationFlags flags,
Node* top_address,
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698