Chromium Code Reviews| Index: src/interpreter/bytecode-array-builder.cc |
| diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
| index 9c6b5905ccf19ecb436b9689b5f0ba6a93762c13..f4e05c728c589cde92c6cc0beac48fc7fe9fa75d 100644 |
| --- a/src/interpreter/bytecode-array-builder.cc |
| +++ b/src/interpreter/bytecode-array-builder.cc |
| @@ -10,6 +10,7 @@ namespace interpreter { |
| BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone) |
| : isolate_(isolate), |
| + zone_(zone), |
| bytecodes_(zone), |
| bytecode_generated_(false), |
| last_block_end_(0), |
| @@ -314,6 +315,17 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(BytecodeLabel* label) { |
| } |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::Bind( |
| + BytecodeLabel* unbound, const BytecodeLabel* const bound) { |
| + DCHECK_EQ(unbound->is_bound(), false); |
| + DCHECK_EQ(bound->is_bound(), true); |
| + PatchJump(bytecodes()->begin() + bound->offset(), |
| + bytecodes()->begin() + unbound->offset()); |
| + unbound->bind_to(bound->offset()); |
| + return *this; |
| +} |
| + |
| + |
| // static |
| bool BytecodeArrayBuilder::IsJumpWithImm8Operand(Bytecode jump_bytecode) { |
|
rmcilroy
2015/10/01 12:12:07
replace this with your newly added Bytecodes::IsJu
oth
2015/10/01 13:13:56
Done.
|
| return jump_bytecode == Bytecode::kJump || |
| @@ -347,7 +359,6 @@ void BytecodeArrayBuilder::PatchJump( |
| DCHECK(IsJumpWithImm8Operand(jump_bytecode)); |
| DCHECK_EQ(Bytecodes::Size(jump_bytecode), 2); |
| - DCHECK_GE(delta, 0); |
|
rmcilroy
2015/10/01 12:12:07
Maybe make this DCHECK_NE(delta, 0) instead of rem
oth
2015/10/01 13:13:56
Done.
|
| if (FitsInImm8Operand(delta)) { |
| // Just update the operand |