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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1298603002: [runtime] Unify and fix the strict equality comparison. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 29de1bdfa284e9c67ff428c99d005d334529646c..5d999152ef61618b34b8f31372d1b2478704a44d 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -1763,20 +1763,25 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
__ Push(rax);
// Figure out which native to call and setup the arguments.
- Builtins::JavaScript builtin;
- if (cc == equal) {
- builtin = strict() ? Builtins::STRICT_EQUALS : Builtins::EQUALS;
+ if (cc == equal && strict()) {
+ __ PushReturnAddressFrom(rcx);
+ __ TailCallRuntime(Runtime::kStrictEquals, 2, 1);
} else {
- builtin =
- is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE;
- __ Push(Smi::FromInt(NegativeComparisonResult(cc)));
- }
+ Builtins::JavaScript builtin;
+ if (cc == equal) {
+ builtin = Builtins::EQUALS;
+ } else {
+ builtin =
+ is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE;
+ __ Push(Smi::FromInt(NegativeComparisonResult(cc)));
+ }
- __ PushReturnAddressFrom(rcx);
+ __ PushReturnAddressFrom(rcx);
- // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
- // tagged as a small integer.
- __ InvokeBuiltin(builtin, JUMP_FUNCTION);
+ // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
+ // tagged as a small integer.
+ __ InvokeBuiltin(builtin, JUMP_FUNCTION);
+ }
__ bind(&miss);
GenerateMiss(masm);
« src/api.cc ('K') | « src/runtime/runtime-simd.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698