Index: src/interpreter/bytecodes.cc |
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc |
index a50e39cc2f3f97b12d6162105b7cfafffeba2b83..7102e664d56d5a961d16e7ff7f13493dc9afa582 100644 |
--- a/src/interpreter/bytecodes.cc |
+++ b/src/interpreter/bytecodes.cc |
@@ -225,7 +225,11 @@ std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start, |
break; |
case interpreter::OperandType::kReg8: { |
Register reg = Register::FromOperand(*operand_start); |
- if (reg.is_parameter()) { |
+ if (reg.is_function_context()) { |
+ os << "<context>"; |
+ } else if (reg.is_function_closure()) { |
+ os << "<closure>"; |
+ } else if (reg.is_parameter()) { |
int parameter_index = reg.ToParameterIndex(parameter_count); |
if (parameter_index == 0) { |
os << "<this>"; |
@@ -266,6 +270,8 @@ std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) { |
static const int kLastParamRegisterIndex = |
-InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; |
+static const int kFunctionClosureRegisterIndex = |
+ -InterpreterFrameConstants::kFunctionFromRegisterPointer / kPointerSize; |
static const int kFunctionContextRegisterIndex = |
-InterpreterFrameConstants::kContextFromRegisterPointer / kPointerSize; |
@@ -293,6 +299,16 @@ int Register::ToParameterIndex(int parameter_count) const { |
} |
+Register Register::function_closure() { |
+ return Register(kFunctionClosureRegisterIndex); |
+} |
+ |
+ |
+bool Register::is_function_closure() const { |
+ return index() == kFunctionClosureRegisterIndex; |
+} |
+ |
+ |
Register Register::function_context() { |
return Register(kFunctionContextRegisterIndex); |
} |