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

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

Issue 1736233002: [interpreter] ToObject never yields null. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | test/cctest/interpreter/bytecode_expectations/ForIn.golden » ('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 fc151a654c240205122dca11ba000cc86e059fcb..0af549ca266c36216362c248b7d63ae9cf2bff40 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1099,7 +1099,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
}
LoopBuilder loop_builder(builder());
- BytecodeLabel subject_null_label, subject_undefined_label, not_object_label;
+ BytecodeLabel subject_null_label, subject_undefined_label;
// Prepare the state for executing ForIn.
VisitForAccumulatorValue(stmt->subject());
@@ -1107,7 +1107,6 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
builder()->JumpIfNull(&subject_null_label);
Register receiver = register_allocator()->NewRegister();
builder()->CastAccumulatorToJSObject();
- builder()->JumpIfNull(&not_object_label);
builder()->StoreAccumulatorInRegister(receiver);
register_allocator()->PrepareForConsecutiveAllocations(3);
@@ -1138,7 +1137,6 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
builder()->StoreAccumulatorInRegister(index);
loop_builder.JumpToHeader();
loop_builder.EndLoop();
- builder()->Bind(&not_object_label);
builder()->Bind(&subject_null_label);
builder()->Bind(&subject_undefined_label);
}
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/ForIn.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698