Index: src/compiler/interpreter-assembler.cc |
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc |
index 6d10b150a47622d0130b5b3bec6723365b25282a..1fbfc3b6eba07d5f68c34ff0619617aee1abfdb2 100644 |
--- a/src/compiler/interpreter-assembler.cc |
+++ b/src/compiler/interpreter-assembler.cc |
@@ -24,7 +24,6 @@ namespace v8 { |
namespace internal { |
namespace compiler { |
- |
InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone, |
interpreter::Bytecode bytecode) |
: bytecode_(bytecode), |
@@ -39,8 +38,11 @@ InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone, |
Linkage::kInterpreterBytecodeOffsetParameter)), |
context_( |
raw_assembler_->Parameter(Linkage::kInterpreterContextParameter)), |
- code_generated_(false) {} |
- |
+ code_generated_(false) { |
+ if (FLAG_trace_ignition) { |
+ TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry); |
+ } |
+} |
InterpreterAssembler::~InterpreterAssembler() {} |
@@ -469,13 +471,6 @@ void InterpreterAssembler::CallPrologue() { |
} |
-void InterpreterAssembler::CallEpilogue() { |
- // Restore the bytecode offset from the stack frame. |
- bytecode_offset_ = SmiUntag(LoadRegister( |
- InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); |
-} |
- |
- |
Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
Node** args) { |
CallPrologue(); |
@@ -491,7 +486,6 @@ Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
kUnexpectedStackPointer); |
} |
- CallEpilogue(); |
return return_val; |
} |
@@ -594,7 +588,6 @@ Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
CallPrologue(); |
Node* return_val = |
raw_assembler_->CallRuntime1(function_id, arg1, GetContext()); |
- CallEpilogue(); |
return return_val; |
} |
@@ -604,10 +597,16 @@ Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
CallPrologue(); |
Node* return_val = |
raw_assembler_->CallRuntime2(function_id, arg1, arg2, GetContext()); |
- CallEpilogue(); |
return return_val; |
} |
+Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
+ Node* arg1, Node* arg2, Node* arg3) { |
+ CallPrologue(); |
+ Node* return_val = |
+ raw_assembler_->CallRuntime3(function_id, arg1, arg2, arg3, GetContext()); |
+ return return_val; |
+} |
Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
Node* arg1, Node* arg2, Node* arg3, |
@@ -615,12 +614,15 @@ Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
CallPrologue(); |
Node* return_val = raw_assembler_->CallRuntime4(function_id, arg1, arg2, arg3, |
arg4, GetContext()); |
- CallEpilogue(); |
return return_val; |
} |
void InterpreterAssembler::Return() { |
+ if (FLAG_trace_ignition) { |
+ TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); |
+ } |
+ |
Node* exit_trampoline_code_object = |
HeapConstant(isolate()->builtins()->InterpreterExitTrampoline()); |
// If the order of the parameters you need to change the call signature below. |
@@ -650,10 +652,8 @@ Node* InterpreterAssembler::Advance(Node* delta) { |
return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta); |
} |
- |
void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); } |
- |
void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) { |
RawMachineLabel match, no_match; |
Node* condition = raw_assembler_->WordEqual(lhs, rhs); |
@@ -671,6 +671,9 @@ void InterpreterAssembler::Dispatch() { |
void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) { |
+ if (FLAG_trace_ignition) { |
+ TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); |
+ } |
Node* target_bytecode = raw_assembler_->Load( |
MachineType::Uint8(), BytecodeArrayTaggedPointer(), new_bytecode_offset); |
@@ -716,6 +719,10 @@ void InterpreterAssembler::AbortIfWordNotEqual(Node* lhs, Node* rhs, |
raw_assembler_->Bind(&match); |
} |
+void InterpreterAssembler::TraceBytecode(Runtime::FunctionId function_id) { |
+ CallRuntime(function_id, BytecodeArrayTaggedPointer(), |
+ SmiTag(BytecodeOffset()), GetAccumulator()); |
+} |
// static |
bool InterpreterAssembler::TargetSupportsUnalignedAccess() { |