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

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: Rebase. 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
« no previous file with comments | « BUILD.gn ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a23d9189f911e556f71a006f1e20fc17154fff9a 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(const BytecodeLabel& target, BytecodeLabel* label);
+
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_; }
@@ -105,7 +110,6 @@ class BytecodeArrayBuilder {
static bool FitsInIdxOperand(int value);
static bool FitsInIdxOperand(size_t value);
static bool FitsInImm8Operand(int value);
- static bool IsJumpWithImm8Operand(Bytecode jump_bytecode);
static Bytecode GetJumpWithConstantOperand(Bytecode jump_with_smi8_operand);
template <size_t N>
@@ -133,6 +137,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 +164,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 +192,6 @@ class BytecodeLabel final {
size_t offset_;
friend class BytecodeArrayBuilder;
- DISALLOW_COPY_AND_ASSIGN(BytecodeLabel);
};
« no previous file with comments | « BUILD.gn ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698