Commit e80cbe03 authored by jing.bao's avatar jing.bao Committed by Commit Bot

Delay rhs_instance_type load until needed in StrictEqual

When var_type_feedback is nullptr and {lhs} is not a String,
rhs_instance_type is not needed.

Bug: 
Change-Id: Ia39aa39ec7ad0063d2fb9b01fd326d7993ab4d26
Reviewed-on: https://chromium-review.googlesource.com/659340
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48086}
parent ec952aaa
...@@ -8824,9 +8824,6 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs, ...@@ -8824,9 +8824,6 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs,
// Load the instance type of {lhs}. // Load the instance type of {lhs}.
Node* lhs_instance_type = LoadMapInstanceType(lhs_map); Node* lhs_instance_type = LoadMapInstanceType(lhs_map);
// Load the instance type of {rhs}.
Node* rhs_instance_type = LoadInstanceType(rhs);
// Check if {lhs} is a String. // Check if {lhs} is a String.
Label if_lhsisstring(this), if_lhsisnotstring(this); Label if_lhsisstring(this), if_lhsisnotstring(this);
Branch(IsStringInstanceType(lhs_instance_type), &if_lhsisstring, Branch(IsStringInstanceType(lhs_instance_type), &if_lhsisstring,
...@@ -8834,6 +8831,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs, ...@@ -8834,6 +8831,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs,
BIND(&if_lhsisstring); BIND(&if_lhsisstring);
{ {
// Load the instance type of {rhs}.
Node* rhs_instance_type = LoadInstanceType(rhs);
// Check if {rhs} is also a String. // Check if {rhs} is also a String.
Label if_rhsisstring(this, Label::kDeferred), Label if_rhsisstring(this, Label::kDeferred),
if_rhsisnotstring(this); if_rhsisnotstring(this);
...@@ -8867,6 +8867,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs, ...@@ -8867,6 +8867,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs,
BIND(&if_lhsisbigint); BIND(&if_lhsisbigint);
{ {
// Load the instance type of {rhs}.
Node* rhs_instance_type = LoadInstanceType(rhs);
// Check if {rhs} is also a BigInt. // Check if {rhs} is also a BigInt.
Label if_rhsisbigint(this, Label::kDeferred), Label if_rhsisbigint(this, Label::kDeferred),
if_rhsisnotbigint(this); if_rhsisnotbigint(this);
...@@ -8892,6 +8895,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs, ...@@ -8892,6 +8895,9 @@ Node* CodeStubAssembler::StrictEqual(Node* lhs, Node* rhs,
BIND(&if_lhsisnotbigint); BIND(&if_lhsisnotbigint);
if (var_type_feedback != nullptr) { if (var_type_feedback != nullptr) {
// Load the instance type of {rhs}.
Node* rhs_instance_type = LoadInstanceType(rhs);
Label if_lhsissymbol(this), if_lhsisreceiver(this); Label if_lhsissymbol(this), if_lhsisreceiver(this);
GotoIf(IsJSReceiverInstanceType(lhs_instance_type), GotoIf(IsJSReceiverInstanceType(lhs_instance_type),
&if_lhsisreceiver); &if_lhsisreceiver);
......
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