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

Unified Diff: src/interpreter/mkpeephole.cc

Issue 2169813002: [interpreter] Add output register to ToName (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@addregouts
Patch Set: comments 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
Index: src/interpreter/mkpeephole.cc
diff --git a/src/interpreter/mkpeephole.cc b/src/interpreter/mkpeephole.cc
index d89390d45d125f9ca2d6dfaf619ce911794bdcb6..87678e06dff2825e06de5c7f907956ae08fc0d6a 100644
--- a/src/interpreter/mkpeephole.cc
+++ b/src/interpreter/mkpeephole.cc
@@ -106,13 +106,14 @@ PeepholeActionAndData PeepholeActionTableWriter::LookupActionAndData(
}
}
- // ToName optimizations: remove unnecessary ToName bytecodes.
+ // ToName bytecodes can be replaced by Star with the same output register if
+ // the value in the accumulator is already a name.
if (current == Bytecode::kToName) {
if (last == Bytecode::kLdaConstant) {
- return {PeepholeAction::kElideCurrentIfLoadingNameConstantAction,
+ return {PeepholeAction::kTransformToStarIfLoadingNameConstantAction,
Bytecode::kIllegal};
} else if (Bytecodes::PutsNameInAccumulator(last)) {
- return {PeepholeAction::kElideCurrentAction, Bytecode::kIllegal};
+ return {PeepholeAction::kChangeBytecodeAction, Bytecode::kStar};
}
}
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698