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

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

Issue 1426913002: [Interpreter] Merges ToBoolean and JumpIfTrue/False bytecodes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased the patch and used the new Repeat_32 macro for tests Created 5 years, 2 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('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 8e6c9c53295a530ed45649645f7dc1f0a7953282..3fb6a39bbe449467c0840722dfdd11491056b912 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -496,7 +496,6 @@ void BytecodeGenerator::VisitIfStatement(IfStatement* stmt) {
BytecodeLabel else_label, end_label;
VisitForAccumulatorValue(stmt->condition());
- builder()->CastAccumulatorToBoolean();
builder()->JumpIfFalse(&else_label);
Visit(stmt->then_statement());
if (stmt->HasElseStatement()) {
@@ -793,7 +792,6 @@ void BytecodeGenerator::VisitConditional(Conditional* expr) {
BytecodeLabel else_label, end_label;
VisitForAccumulatorValue(expr->condition());
- builder()->CastAccumulatorToBoolean();
builder()->JumpIfFalse(&else_label);
VisitForAccumulatorValue(expr->then_expression());
@@ -1793,7 +1791,7 @@ void BytecodeGenerator::VisitLogicalOrExpression(BinaryOperation* binop) {
} else {
BytecodeLabel end_label;
VisitForAccumulatorValue(left);
- builder()->JumpIfToBooleanTrue(&end_label);
+ builder()->JumpIfTrue(&end_label);
VisitForAccumulatorValue(right);
builder()->Bind(&end_label);
}
@@ -1812,7 +1810,7 @@ void BytecodeGenerator::VisitLogicalAndExpression(BinaryOperation* binop) {
} else {
BytecodeLabel end_label;
VisitForAccumulatorValue(left);
- builder()->JumpIfToBooleanFalse(&end_label);
+ builder()->JumpIfFalse(&end_label);
VisitForAccumulatorValue(right);
builder()->Bind(&end_label);
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698