Reviewers: jarin,

Description:
[crankshaft] Fix some useless deopts in for-in.

The one in lithium codegen for x64 was probably an oversight during
refactoring.

[email protected]

Please review this at https://codereview.chromium.org/1157423003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+3, -4 lines):
  M src/hydrogen.cc
  M src/x64/lithium-codegen-x64.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 8af0c337a4bdec2800e607bb2c4d57ed28a0aba0..cae34a9de3bf57a6ada474e63f449994f1b8261e 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5111,9 +5111,10 @@ void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
   if_undefined_or_null.Or();
   if_undefined_or_null.If<HCompareObjectEqAndBranch>(
       enumerable, graph()->GetConstantNull());
-  if_undefined_or_null.ThenDeopt(Deoptimizer::kUndefinedOrNullInForIn);
-  if_undefined_or_null.End();
+  if_undefined_or_null.Then();
+  if_undefined_or_null.Else();
   BuildForInBody(stmt, each_var, enumerable);
+  if_undefined_or_null.End();
 }


Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index b9b6abac7152c02127c5b4358e3a3dfd08a1c239..1aaae6aa8776a29732d39b119911c851f8147ab5 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -5884,8 +5884,6 @@ void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
   DCHECK(ToRegister(instr->context()).is(rsi));

-  DeoptimizeIf(equal, instr, Deoptimizer::kNull);
-
   Condition cc = masm()->CheckSmi(rax);
   DeoptimizeIf(cc, instr, Deoptimizer::kSmi);



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to