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

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

Issue 2189463006: [interpreter] Put object in register for ToObject/ForInPrepare (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix tests Created 4 years, 5 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') | src/interpreter/bytecodes.h » ('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 f6276da9a7ea954efba6d7799c7b438330166a6f..06eb53e92a499233fd83a0a73502eceeebf72b28 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -983,7 +983,6 @@ void BytecodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
void BytecodeGenerator::VisitWithStatement(WithStatement* stmt) {
builder()->SetStatementPosition(stmt);
VisitForAccumulatorValue(stmt->expression());
- builder()->CastAccumulatorToJSObject();
VisitNewLocalWithContext();
VisitInScope(stmt->statement(), stmt->scope());
}
@@ -1201,8 +1200,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
builder()->JumpIfUndefined(&subject_undefined_label);
builder()->JumpIfNull(&subject_null_label);
Register receiver = register_allocator()->NewRegister();
- builder()->CastAccumulatorToJSObject();
- builder()->StoreAccumulatorInRegister(receiver);
+ builder()->CastAccumulatorToJSObject(receiver);
register_allocator()->PrepareForConsecutiveAllocations(3);
Register cache_type = register_allocator()->NextConsecutiveRegister();
@@ -1210,7 +1208,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
Register cache_length = register_allocator()->NextConsecutiveRegister();
// Used as kRegTriple and kRegPair in ForInPrepare and ForInNext.
USE(cache_array);
- builder()->ForInPrepare(cache_type);
+ builder()->ForInPrepare(receiver, cache_type);
// Set up loop counter
Register index = register_allocator()->NewRegister();
@@ -3071,7 +3069,7 @@ void BytecodeGenerator::VisitNewLocalWithContext() {
Register extension_object = register_allocator()->NextConsecutiveRegister();
Register closure = register_allocator()->NextConsecutiveRegister();
- builder()->StoreAccumulatorInRegister(extension_object);
+ builder()->CastAccumulatorToJSObject(extension_object);
VisitFunctionClosureForContext();
builder()->StoreAccumulatorInRegister(closure).CallRuntime(
Runtime::kPushWithContext, extension_object, 2);
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698