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

Unified Diff: src/interpreter/bytecode-peephole-optimizer.h

Issue 2118183002: [interpeter] Move to table based peephole optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Undo experimental in last patch set. 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/bytecode-peephole-optimizer.h
diff --git a/src/interpreter/bytecode-peephole-optimizer.h b/src/interpreter/bytecode-peephole-optimizer.h
index e6ada2aa1ef244c4f3c07c176f80ac26df4994ca..9b64331f0e4a817dea0e4ac70260f7f084dbaacd 100644
--- a/src/interpreter/bytecode-peephole-optimizer.h
+++ b/src/interpreter/bytecode-peephole-optimizer.h
@@ -32,31 +32,37 @@ class BytecodePeepholeOptimizer final : public BytecodePipelineStage,
Handle<FixedArray> handler_table) override;
private:
- BytecodeNode* OptimizeAndEmitLast(BytecodeNode* current);
- BytecodeNode* Optimize(BytecodeNode* current);
+ // Actions for non-jump bytecodes.
+ void DefaultAction(BytecodeNode* const node);
+ void UpdateLastAction(BytecodeNode* const node);
+ void ElideCurrentAction(BytecodeNode* const node);
+ void ElideCurrentIfOperand0MatchesAction(BytecodeNode* const node);
+ void ElideCurrentIfLoadingNameConstantAction(BytecodeNode* const node);
+ void ElideLastAction(BytecodeNode* const node);
+ void ChangeBytecodeAction(BytecodeNode* const node, Bytecode replacement);
+ void TransformLdaStarToLdrLdarAction(BytecodeNode* const node,
+ Bytecode replacement);
+
+ // Actions for jump bytecodes.
+ void DefaultJumpAction(BytecodeNode* const node);
+ void UpdateLastJumpAction(BytecodeNode* const node);
+ void ChangeJumpBytecodeAction(BytecodeNode* const node, Bytecode replacement);
+ void ElideLastBeforeJumpAction(BytecodeNode* const node);
+
+ void Optimize(BytecodeNode* const node);
void Flush();
-
- void TryToRemoveLastExpressionPosition(const BytecodeNode* const current);
- bool TransformCurrentBytecode(BytecodeNode* const current);
- bool TransformLastAndCurrentBytecodes(BytecodeNode* const current);
- bool CanElideCurrent(const BytecodeNode* const current) const;
- bool CanElideLast(const BytecodeNode* const current) const;
bool CanElideLastBasedOnSourcePosition(
const BytecodeNode* const current) const;
-
- // Simple substitution methods.
- bool RemoveToBooleanFromJump(BytecodeNode* const current);
- bool RemoveToBooleanFromLogicalNot(BytecodeNode* const current);
-
void InvalidateLast();
bool LastIsValid() const;
void SetLast(const BytecodeNode* const node);
- bool LastBytecodePutsNameInAccumulator() const;
-
Handle<Object> GetConstantForIndexOperand(const BytecodeNode* const node,
int index) const;
+ BytecodePipelineStage* next_stage() const { return next_stage_; }
+ BytecodeNode* last() { return &last_; }
+
ConstantArrayBuilder* constant_array_builder_;
BytecodePipelineStage* next_stage_;
BytecodeNode last_;
« no previous file with comments | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | src/interpreter/bytecode-peephole-optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698