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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2495543002: [Interpreter] Fix logical-or/and to ensure it always visits the lhs. (Closed)
Patch Set: Cleanup test Created 4 years, 1 month 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 | « no previous file | test/mjsunit/ignition/regress-664146.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index acbe53a4b43876c0d77d49a6f22d563e998a8f34..83a2ae21a6450a4154af6c56d04dfba3c00e22a4 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2839,7 +2839,7 @@ void BytecodeGenerator::VisitLogicalOrExpression(BinaryOperation* binop) {
if (execution_result()->IsTest()) {
TestResultScope* test_result = execution_result()->AsTest();
- if (left->ToBooleanIsTrue() || right->ToBooleanIsTrue()) {
+ if (left->ToBooleanIsTrue()) {
builder()->Jump(test_result->NewThenLabel());
} else if (left->ToBooleanIsFalse() && right->ToBooleanIsFalse()) {
builder()->Jump(test_result->NewElseLabel());
@@ -2874,7 +2874,7 @@ void BytecodeGenerator::VisitLogicalAndExpression(BinaryOperation* binop) {
if (execution_result()->IsTest()) {
TestResultScope* test_result = execution_result()->AsTest();
- if (left->ToBooleanIsFalse() || right->ToBooleanIsFalse()) {
+ if (left->ToBooleanIsFalse()) {
builder()->Jump(test_result->NewElseLabel());
} else if (left->ToBooleanIsTrue() && right->ToBooleanIsTrue()) {
builder()->Jump(test_result->NewThenLabel());
« no previous file with comments | « no previous file | test/mjsunit/ignition/regress-664146.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698