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

Unified Diff: src/interpreter/bytecode-peephole-optimizer.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
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-peephole-table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-peephole-optimizer.cc
diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc
index 8570ddd843b317897c66d7786bf2f6073879d92a..4e9d27fcbfbdc6117e4d1afe22e2b5dcf178a867 100644
--- a/src/interpreter/bytecode-peephole-optimizer.cc
+++ b/src/interpreter/bytecode-peephole-optimizer.cc
@@ -221,18 +221,6 @@ void BytecodePeepholeOptimizer::ElideCurrentIfOperand0MatchesAction(
}
}
-void BytecodePeepholeOptimizer::ElideCurrentIfLoadingNameConstantAction(
- BytecodeNode* const node, const PeepholeActionAndData* action_data) {
- DCHECK_EQ(last()->bytecode(), Bytecode::kLdaConstant);
- DCHECK(!Bytecodes::IsJump(node->bytecode()));
-
- if (GetConstantForIndexOperand(last(), 0)->IsName()) {
- ElideCurrentAction(node);
- } else {
- DefaultAction(node);
- }
-}
-
void BytecodePeepholeOptimizer::ElideLastAction(
BytecodeNode* const node, const PeepholeActionAndData* action_data) {
DCHECK(LastIsValid());
@@ -256,7 +244,7 @@ void BytecodePeepholeOptimizer::ChangeBytecodeAction(
DCHECK(LastIsValid());
DCHECK(!Bytecodes::IsJump(node->bytecode()));
- node->set_bytecode(action_data->bytecode);
+ node->replace_bytecode(action_data->bytecode);
DefaultAction(node);
}
@@ -301,6 +289,17 @@ void BytecodePeepholeOptimizer::
}
}
+void BytecodePeepholeOptimizer::TransformToStarIfLoadingNameConstantAction(
+ BytecodeNode* const node, const PeepholeActionAndData* action_data) {
+ DCHECK_EQ(last()->bytecode(), Bytecode::kLdaConstant);
+ DCHECK(!Bytecodes::IsJump(node->bytecode()));
+
+ if (GetConstantForIndexOperand(last(), 0)->IsName()) {
+ node->replace_bytecode(Bytecode::kStar);
+ }
+ DefaultAction(node);
+}
+
void BytecodePeepholeOptimizer::DefaultJumpAction(
BytecodeNode* const node, const PeepholeActionAndData* action_data) {
DCHECK(LastIsValid());
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-peephole-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698