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

Side by Side Diff: src/interpreter/bytecode-label.h

Issue 2254493002: [interpreter] Use VisitForTest for loop conditions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase(line) golden file Created 4 years, 4 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-generator.cc ('k') | src/interpreter/bytecode-label.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_LABEL_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_LABEL_H_
6 #define V8_INTERPRETER_BYTECODE_LABEL_H_ 6 #define V8_INTERPRETER_BYTECODE_LABEL_H_
7 7
8 #include "src/zone-containers.h" 8 #include "src/zone-containers.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 // Class representing a branch target of multiple jumps. 56 // Class representing a branch target of multiple jumps.
57 class BytecodeLabels { 57 class BytecodeLabels {
58 public: 58 public:
59 explicit BytecodeLabels(Zone* zone) : labels_(zone) {} 59 explicit BytecodeLabels(Zone* zone) : labels_(zone) {}
60 60
61 BytecodeLabel* New(); 61 BytecodeLabel* New();
62 62
63 void Bind(BytecodeArrayBuilder* builder); 63 void Bind(BytecodeArrayBuilder* builder);
64 64
65 void BindToLabel(BytecodeArrayBuilder* builder, const BytecodeLabel& target);
66
67 bool is_bound() const {
68 bool is_bound = !labels_.empty() && labels_.at(0).is_bound();
69 DCHECK(!is_bound ||
70 std::all_of(labels_.begin(), labels_.end(),
71 [](const BytecodeLabel& l) { return l.is_bound(); }));
72 return is_bound;
73 }
74
75 bool empty() const { return labels_.empty(); }
76
65 private: 77 private:
66 ZoneVector<BytecodeLabel> labels_; 78 ZoneVector<BytecodeLabel> labels_;
67 79
68 DISALLOW_COPY_AND_ASSIGN(BytecodeLabels); 80 DISALLOW_COPY_AND_ASSIGN(BytecodeLabels);
69 }; 81 };
70 82
71 } // namespace interpreter 83 } // namespace interpreter
72 } // namespace internal 84 } // namespace internal
73 } // namespace v8 85 } // namespace v8
74 86
75 #endif // V8_INTERPRETER_BYTECODE_LABEL_H_ 87 #endif // V8_INTERPRETER_BYTECODE_LABEL_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698