Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 85fa74fc87a40c5d41643ea6ae151fefb26910b8..270ff58931fbb70a6cb3fb4bff64edb908d2f09b 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -683,6 +683,37 @@ void Interpreter::DoJumpIfTrueConstant( |
} |
+// JumpIfToBooleanTrue <imm8> |
rmcilroy
2015/10/13 15:43:24
nit - group all ToBoolean versions together below
mythria
2015/10/14 13:33:42
Done.
|
+// |
+// Jump by number of bytes represented by an immediate operand if the object |
+// referenced by the accumulator is true when the object is cast to boolean. |
+void Interpreter::DoJumpIfToBooleanTrue( |
+ compiler::InterpreterAssembler* assembler) { |
+ Node* accumulator = __ GetAccumulator(); |
+ Node* relative_jump = __ BytecodeOperandImm8(0); |
+ Node* toBoolean = __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); |
rmcilroy
2015/10/13 15:43:24
/s/toBoolean/to_boolean_value (throughout)
mythria
2015/10/14 13:33:42
Done.
|
+ Node* true_value = __ BooleanConstant(true); |
+ __ JumpIfWordEqual(toBoolean, true_value, relative_jump); |
+} |
+ |
+ |
+// JumpIfToBooleanTrueConstant <idx> |
+// |
+// Jump by number of bytes in the Smi in the |idx| entry in the constant pool |
+// if the object referenced by the accumulator is true when the object is cast |
+// to boolean. |
+void Interpreter::DoJumpIfToBooleanTrueConstant( |
+ compiler::InterpreterAssembler* assembler) { |
+ Node* accumulator = __ GetAccumulator(); |
+ Node* toBoolean = __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); |
+ Node* index = __ BytecodeOperandIdx8(0); |
+ Node* constant = __ LoadConstantPoolEntry(index); |
+ Node* relative_jump = __ SmiUntag(constant); |
+ Node* true_value = __ BooleanConstant(true); |
+ __ JumpIfWordEqual(toBoolean, true_value, relative_jump); |
+} |
+ |
+ |
// JumpIfFalse <imm8> |
// |
// Jump by number of bytes represented by an immediate operand if the |
@@ -710,6 +741,37 @@ void Interpreter::DoJumpIfFalseConstant( |
} |
+// JumpIfToBooleanFalse <imm8> |
+// |
+// Jump by number of bytes represented by an immediate operand if the object |
+// referenced by the accumulator is false when the object is cast to boolean. |
+void Interpreter::DoJumpIfToBooleanFalse( |
+ compiler::InterpreterAssembler* assembler) { |
+ Node* accumulator = __ GetAccumulator(); |
+ Node* relative_jump = __ BytecodeOperandImm8(0); |
+ Node* toBoolean = __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); |
+ Node* false_value = __ BooleanConstant(false); |
+ __ JumpIfWordEqual(toBoolean, false_value, relative_jump); |
+} |
+ |
+ |
+// JumpIfToBooleanFalseConstant <idx> |
+// |
+// Jump by number of bytes in the Smi in the |idx| entry in the constant pool |
+// if the object referenced by the accumulator is false when the object is cast |
+// to boolean. |
+void Interpreter::DoJumpIfToBooleanFalseConstant( |
+ compiler::InterpreterAssembler* assembler) { |
+ Node* accumulator = __ GetAccumulator(); |
+ Node* toBoolean = __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator); |
+ Node* index = __ BytecodeOperandIdx8(0); |
+ Node* constant = __ LoadConstantPoolEntry(index); |
+ Node* relative_jump = __ SmiUntag(constant); |
+ Node* false_value = __ BooleanConstant(false); |
+ __ JumpIfWordEqual(toBoolean, false_value, relative_jump); |
+} |
+ |
+ |
// CreateClosure <tenured> |
// |
// Creates a new closure for SharedFunctionInfo in the accumulator with the |