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

Side by Side Diff: src/interpreter/bytecode-pipeline.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 | « src/interpreter/bytecode-peephole-optimizer.cc ('k') | src/interpreter/bytecode-pipeline.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_PIPELINE_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_PIPELINE_H_
6 #define V8_INTERPRETER_BYTECODE_PIPELINE_H_ 6 #define V8_INTERPRETER_BYTECODE_PIPELINE_H_
7 7
8 #include "src/interpreter/bytecode-register-allocator.h" 8 #include "src/interpreter/bytecode-register-allocator.h"
9 #include "src/interpreter/bytecodes.h" 9 #include "src/interpreter/bytecodes.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Combine later source info with current. 46 // Combine later source info with current.
47 void Update(const BytecodeSourceInfo& entry); 47 void Update(const BytecodeSourceInfo& entry);
48 48
49 int source_position() const { 49 int source_position() const {
50 DCHECK(is_valid()); 50 DCHECK(is_valid());
51 return source_position_; 51 return source_position_;
52 } 52 }
53 53
54 bool is_statement() const { return is_valid() && is_statement_; } 54 bool is_statement() const { return is_valid() && is_statement_; }
55 bool is_expression() const { return is_valid() && !is_statement_; }
55 56
56 bool is_valid() const { return source_position_ != kUninitializedPosition; } 57 bool is_valid() const { return source_position_ != kUninitializedPosition; }
57 void set_invalid() { source_position_ = kUninitializedPosition; } 58 void set_invalid() { source_position_ = kUninitializedPosition; }
58 59
59 bool operator==(const BytecodeSourceInfo& other) const { 60 bool operator==(const BytecodeSourceInfo& other) const {
60 return source_position_ == other.source_position_ && 61 return source_position_ == other.source_position_ &&
61 is_statement_ == other.is_statement_; 62 is_statement_ == other.is_statement_;
62 } 63 }
63 bool operator!=(const BytecodeSourceInfo& other) const { 64 bool operator!=(const BytecodeSourceInfo& other) const {
64 return source_position_ != other.source_position_ || 65 return source_position_ != other.source_position_ ||
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 }; 130 };
130 131
131 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); 132 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info);
132 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); 133 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node);
133 134
134 } // namespace interpreter 135 } // namespace interpreter
135 } // namespace internal 136 } // namespace internal
136 } // namespace v8 137 } // namespace v8
137 138
138 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_ 139 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-peephole-optimizer.cc ('k') | src/interpreter/bytecode-pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698