Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 3e7af6e90d446f426a18c6e50d8185c75af32d51..3cf035437fe5ea2a1f727553391aac98be2a056d 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -2095,6 +2095,47 @@ void Interpreter::DoJumpIfUndefinedConstant(InterpreterAssembler* assembler) { |
__ JumpIfWordEqual(accumulator, undefined_value, relative_jump); |
} |
+// JumpIfJSReceiverConstant <imm> |
neis
2016/12/07 10:17:27
s/Constant//
caitp
2016/12/07 14:49:41
Oop, done
|
+// |
+// Jump by number of bytes represented by an immediate operand if the object |
+// referenced by the accumulator is a JSReceiver. |
+void Interpreter::DoJumpIfJSReceiver(InterpreterAssembler* assembler) { |
+ Node* accumulator = __ GetAccumulator(); |
+ Node* relative_jump = __ BytecodeOperandImm(0); |
+ |
+ Label if_object(assembler), if_notobject(assembler, Label::kDeferred), |
+ if_notsmi(assembler); |
+ __ Branch(__ TaggedIsSmi(accumulator), &if_notobject, &if_notsmi); |
+ |
+ __ Bind(&if_notsmi); |
+ __ Branch(__ IsJSReceiver(accumulator), &if_object, &if_notobject); |
+ __ Bind(&if_object); |
+ __ Jump(relative_jump); |
+ __ Bind(&if_notobject); |
rmcilroy
2016/12/06 15:02:28
nit - add a newline above this bind
|
+ __ Dispatch(); |
+} |
+ |
+// JumpIfJSReceiverConstant <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 a JSReceiver. |
+void Interpreter::DoJumpIfJSReceiverConstant(InterpreterAssembler* assembler) { |
+ Node* accumulator = __ GetAccumulator(); |
+ Node* index = __ BytecodeOperandIdx(0); |
+ Node* relative_jump = __ LoadAndUntagConstantPoolEntry(index); |
+ |
+ Label if_object(assembler), if_notobject(assembler), if_notsmi(assembler); |
+ __ Branch(__ TaggedIsSmi(accumulator), &if_notobject, &if_notsmi); |
+ |
+ __ Bind(&if_notsmi); |
+ __ Branch(__ IsJSReceiver(accumulator), &if_object, &if_notobject); |
+ |
+ __ Bind(&if_object); |
+ __ Jump(relative_jump); |
+ __ Bind(&if_notobject); |
rmcilroy
2016/12/06 15:02:28
ditto
|
+ __ Dispatch(); |
+} |
+ |
// JumpIfNotHole <imm> |
// |
// Jump by number of bytes represented by an immediate operand if the object |