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_; |