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

Unified Diff: src/interpreter/bytecode-array-builder.h

Issue 1373903005: [Interpreter] Add for/while/do support to the bytecode generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments / re-work IfBuilder. Created 5 years, 3 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
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index d68d5e7ffbf4b3860cfa985eb1d041732a799a8e..edbe3bfc1d04ce0cd0faeeff1af6ee50e1d823e4 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -87,6 +87,8 @@ class BytecodeArrayBuilder {
// Flow Control.
BytecodeArrayBuilder& Bind(BytecodeLabel* label);
+ BytecodeArrayBuilder& Bind(BytecodeLabel* unbound,
+ const BytecodeLabel* const bound);
rmcilroy 2015/10/01 12:12:07 const ref instead? Also, the names still confuse m
oth 2015/10/01 13:13:56 As discussed, changed to: BytecodeArrayBuilder::B
BytecodeArrayBuilder& Jump(BytecodeLabel* label);
BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label);
BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label);
@@ -95,6 +97,9 @@ class BytecodeArrayBuilder {
BytecodeArrayBuilder& EnterBlock();
BytecodeArrayBuilder& LeaveBlock();
+ // Accessors
+ Zone* zone() const { return zone_; }
+
private:
ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; }
const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; }
@@ -133,6 +138,7 @@ class BytecodeArrayBuilder {
void ReturnTemporaryRegister(int reg_index);
Isolate* isolate_;
+ Zone* zone_;
ZoneVector<uint8_t> bytecodes_;
bool bytecode_generated_;
size_t last_block_end_;
@@ -159,7 +165,6 @@ class BytecodeArrayBuilder {
class BytecodeLabel final {
public:
BytecodeLabel() : bound_(false), offset_(kInvalidOffset) {}
- ~BytecodeLabel() { DCHECK(bound_ && offset_ != kInvalidOffset); }
private:
static const size_t kInvalidOffset = static_cast<size_t>(-1);
@@ -188,7 +193,6 @@ class BytecodeLabel final {
size_t offset_;
friend class BytecodeArrayBuilder;
- DISALLOW_COPY_AND_ASSIGN(BytecodeLabel);
};

Powered by Google App Engine
This is Rietveld 408576698