Commit d3ed71ed authored by bmeurer's avatar bmeurer Committed by Commit bot

[ic] Use StrictEqual/Equal builtins for CompareIC slow path.

Don't fallback to the %StrictEqual / %Equal runtime functions for the
generic CompareIC slow path, but use the (new) StrictEqual and Equal
builtins instead. This avoids a performance cliff when mixing input
types for strict equality sites.

R=jochen@chromium.org
BUG=v8:4773

Review-Url: https://codereview.chromium.org/2609153002
Cr-Commit-Position: refs/heads/master@{#42021}
parent 08f00a15
......@@ -624,8 +624,11 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
if (cc == eq) {
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(lhs, rhs);
__ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual);
__ Push(cp);
__ Call(strict() ? isolate()->builtins()->StrictEqual()
: isolate()->builtins()->Equal(),
RelocInfo::CODE_TARGET);
__ Pop(cp);
}
// Turn true into 0 and false into some non-zero value.
STATIC_ASSERT(EQUAL == 0);
......
......@@ -579,8 +579,11 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
if (cond == eq) {
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(lhs, rhs);
__ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual);
__ Push(cp);
__ Call(strict() ? isolate()->builtins()->StrictEqual()
: isolate()->builtins()->Equal(),
RelocInfo::CODE_TARGET);
__ Pop(cp);
}
// Turn true into 0 and false into some non-zero value.
STATIC_ASSERT(EQUAL == 0);
......
......@@ -1214,9 +1214,11 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
if (cc == equal) {
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(edx);
__ Push(eax);
__ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual);
__ Push(esi);
__ Call(strict() ? isolate()->builtins()->StrictEqual()
: isolate()->builtins()->Equal(),
RelocInfo::CODE_TARGET);
__ Pop(esi);
}
// Turn true into 0 and false into some non-zero value.
STATIC_ASSERT(EQUAL == 0);
......
......@@ -673,8 +673,11 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
if (cc == eq) {
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(lhs, rhs);
__ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual);
__ Push(cp);
__ Call(strict() ? isolate()->builtins()->StrictEqual()
: isolate()->builtins()->Equal(),
RelocInfo::CODE_TARGET);
__ Pop(cp);
}
// Turn true into 0 and false into some non-zero value.
STATIC_ASSERT(EQUAL == 0);
......
......@@ -670,8 +670,11 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
if (cc == eq) {
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(lhs, rhs);
__ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual);
__ Push(cp);
__ Call(strict() ? isolate()->builtins()->StrictEqual()
: isolate()->builtins()->Equal(),
RelocInfo::CODE_TARGET);
__ Pop(cp);
}
// Turn true into 0 and false into some non-zero value.
STATIC_ASSERT(EQUAL == 0);
......
......@@ -1106,9 +1106,11 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
if (cc == equal) {
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(rdx);
__ Push(rax);
__ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual);
__ Push(rsi);
__ Call(strict() ? isolate()->builtins()->StrictEqual()
: isolate()->builtins()->Equal(),
RelocInfo::CODE_TARGET);
__ Pop(rsi);
}
// Turn true into 0 and false into some non-zero value.
STATIC_ASSERT(EQUAL == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment