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 2ce9d51377571c58f027bc3e3f07ff983e4e0eee..dec1c0a1673655f1f03adf5a3da23d7ddaa859ad 100644 |
| --- a/src/interpreter/bytecode-array-builder.cc |
| +++ b/src/interpreter/bytecode-array-builder.cc |
| @@ -263,6 +263,8 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadFalse() { |
| BytecodeArrayBuilder& BytecodeArrayBuilder::LoadAccumulatorWithRegister( |
| Register reg) { |
| + // TODO(oth): Avoid loading the accumulator with the register if the |
| + // previous bytecode stored the accumulator with the same register. |
|
rmcilroy
2015/10/28 13:46:22
Same could apply for StoreAccumulatorInRegister co
oth
2015/10/28 22:50:40
Comment added.
|
| Output(Bytecode::kLdar, reg.ToOperand()); |
| return *this; |
| } |
| @@ -481,6 +483,12 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() { |
| } |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToJSObject() { |
| + Output(Bytecode::kToObject); |
| + return *this; |
| +} |
| + |
| + |
| BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToName() { |
| Output(Bytecode::kToName); |
| return *this; |
| @@ -531,6 +539,10 @@ Bytecode BytecodeArrayBuilder::GetJumpWithConstantOperand( |
| return Bytecode::kJumpIfToBooleanTrueConstant; |
| case Bytecode::kJumpIfToBooleanFalse: |
| return Bytecode::kJumpIfToBooleanFalseConstant; |
| + case Bytecode::kJumpIfNull: |
| + return Bytecode::kJumpIfNullConstant; |
| + case Bytecode::kJumpIfUndefined: |
| + return Bytecode::kJumpIfUndefinedConstant; |
| default: |
| UNREACHABLE(); |
| return Bytecode::kJumpConstant; |
| @@ -631,6 +643,17 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfToBooleanFalse( |
| } |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) { |
| + return OutputJump(Bytecode::kJumpIfNull, label); |
| +} |
| + |
| + |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( |
| + BytecodeLabel* label) { |
| + return OutputJump(Bytecode::kJumpIfUndefined, label); |
| +} |
| + |
| + |
| BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { |
| Output(Bytecode::kThrow); |
| exit_seen_in_block_ = true; |
| @@ -645,6 +668,24 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Return() { |
| } |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::ForInPrepare(Register receiver) { |
| + Output(Bytecode::kForInPrepare, receiver.ToOperand()); |
| + return *this; |
| +} |
| + |
| + |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::ForInNext(Register for_in_state) { |
| + Output(Bytecode::kForInNext, for_in_state.ToOperand()); |
| + return *this; |
| +} |
| + |
| + |
| +BytecodeArrayBuilder& BytecodeArrayBuilder::ForInDone(Register for_in_state) { |
| + Output(Bytecode::kForInDone, for_in_state.ToOperand()); |
| + return *this; |
| +} |
| + |
| + |
| BytecodeArrayBuilder& BytecodeArrayBuilder::EnterBlock() { return *this; } |