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

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

Issue 2164583002: Reland "[interpeter] Move to table based peephole optimizer." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nit. 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 | « gypfiles/standalone.gypi ('k') | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..95c9d57795e3029f5d49efa9699715d02bd8a67d 100644
--- a/src/interpreter/bytecode-peephole-optimizer.h
+++ b/src/interpreter/bytecode-peephole-optimizer.h
@@ -1,10 +1,11 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
+// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
#define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
+#include "src/interpreter/bytecode-peephole-table.h"
#include "src/interpreter/bytecode-pipeline.h"
namespace v8 {
@@ -12,6 +13,7 @@ namespace internal {
namespace interpreter {
class ConstantArrayBuilder;
+class BytecodePeepholeActionAndData;
// An optimization stage for performing peephole optimizations on
// generated bytecode. The optimizer may buffer one bytecode
@@ -32,31 +34,26 @@ class BytecodePeepholeOptimizer final : public BytecodePipelineStage,
Handle<FixedArray> handler_table) override;
private:
- BytecodeNode* OptimizeAndEmitLast(BytecodeNode* current);
- BytecodeNode* Optimize(BytecodeNode* current);
- void Flush();
+#define DECLARE_ACTION(Action) \
+ void Action(BytecodeNode* const node, \
+ const PeepholeActionAndData* const action_data = nullptr);
+ PEEPHOLE_ACTION_LIST(DECLARE_ACTION)
+#undef DECLARE_ACTION
- 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;
+ void ApplyPeepholeAction(BytecodeNode* const node);
+ void Flush();
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 | « gypfiles/standalone.gypi ('k') | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698