OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |