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

Side by Side Diff: src/interpreter/bytecode-peephole-optimizer.h

Issue 1998203002: [Interpreter] Preserve source positions in peephole optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nitlet on last patch set. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ 6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
7 7
8 #include "src/interpreter/bytecode-pipeline.h" 8 #include "src/interpreter/bytecode-pipeline.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 11 matching lines...) Expand all
22 BytecodePeepholeOptimizer(ConstantArrayBuilder* constant_array_builder, 22 BytecodePeepholeOptimizer(ConstantArrayBuilder* constant_array_builder,
23 BytecodePipelineStage* next_stage); 23 BytecodePipelineStage* next_stage);
24 24
25 void Write(BytecodeNode* node) override; 25 void Write(BytecodeNode* node) override;
26 size_t FlushForOffset() override; 26 size_t FlushForOffset() override;
27 void FlushBasicBlock() override; 27 void FlushBasicBlock() override;
28 28
29 private: 29 private:
30 BytecodeNode* Optimize(BytecodeNode* current); 30 BytecodeNode* Optimize(BytecodeNode* current);
31 31
32 void UpdateCurrentBytecode(BytecodeNode* const current); 32 void UpdateLastAndCurrentBytecodes(BytecodeNode* const current);
33 bool CanElideCurrent(const BytecodeNode* const current) const; 33 bool CanElideCurrent(const BytecodeNode* const current) const;
34 bool CanElideLast(const BytecodeNode* const current) const; 34 bool CanElideLast(const BytecodeNode* const current) const;
35 bool CanElideLastBasedOnSourcePosition(
36 const BytecodeNode* const current) const;
35 37
36 void InvalidateLast(); 38 void InvalidateLast();
37 bool LastIsValid() const; 39 bool LastIsValid() const;
38 void SetLast(const BytecodeNode* const node); 40 void SetLast(const BytecodeNode* const node);
39 41
40 bool LastBytecodePutsNameInAccumulator() const; 42 bool LastBytecodePutsNameInAccumulator() const;
41 43
42 Handle<Object> GetConstantForIndexOperand(const BytecodeNode* const node, 44 Handle<Object> GetConstantForIndexOperand(const BytecodeNode* const node,
43 int index) const; 45 int index) const;
44 46
45 ConstantArrayBuilder* constant_array_builder_; 47 ConstantArrayBuilder* constant_array_builder_;
46 BytecodePipelineStage* next_stage_; 48 BytecodePipelineStage* next_stage_;
47 BytecodeNode last_; 49 BytecodeNode last_;
48 bool last_is_discardable_; 50 bool last_is_discardable_;
49 51
50 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer); 52 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer);
51 }; 53 };
52 54
53 } // namespace interpreter 55 } // namespace interpreter
54 } // namespace internal 56 } // namespace internal
55 } // namespace v8 57 } // namespace v8
56 58
57 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ 59 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698