| Index: src/compiler/x64/code-generator-x64.cc
|
| diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
|
| index 745ac5084166e80b649898fbd5f163ac57ce0af4..b61f89f3c282fe9583e84605ef93e17a8cef281b 100644
|
| --- a/src/compiler/x64/code-generator-x64.cc
|
| +++ b/src/compiler/x64/code-generator-x64.cc
|
| @@ -270,18 +270,21 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
|
|
| class WasmOutOfLineTrap final : public OutOfLineCode {
|
| public:
|
| - WasmOutOfLineTrap(CodeGenerator* gen, Address pc, bool frame_elided,
|
| + WasmOutOfLineTrap(CodeGenerator* gen, int pc, bool frame_elided,
|
| Register context, int32_t position)
|
| : OutOfLineCode(gen),
|
| + gen_(gen),
|
| pc_(pc),
|
| frame_elided_(frame_elided),
|
| context_(context),
|
| position_(position) {}
|
|
|
| + // TODO(eholk): Refactor this method to take the code generator as a
|
| + // parameter.
|
| void Generate() final {
|
| - // TODO(eholk): record pc_ and the current pc in a table so that
|
| - // the signal handler can find it.
|
| - USE(pc_);
|
| + int current_pc = __ pc_offset();
|
| +
|
| + gen_->AddProtectedInstruction(pc_, current_pc);
|
|
|
| if (frame_elided_) {
|
| __ EnterFrame(StackFrame::WASM);
|
| @@ -296,7 +299,8 @@ class WasmOutOfLineTrap final : public OutOfLineCode {
|
| }
|
|
|
| private:
|
| - Address pc_;
|
| + CodeGenerator* gen_;
|
| + int pc_;
|
| bool frame_elided_;
|
| Register context_;
|
| int32_t position_;
|
| @@ -1897,7 +1901,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
| __ movl(i.OutputRegister(), i.InputOperand(0));
|
| }
|
| } else {
|
| - Address pc = __ pc();
|
| + int pc = __ pc_offset();
|
| __ movl(i.OutputRegister(), i.MemoryOperand());
|
|
|
| if (arch_opcode == kX64TrapMovl) {
|
|
|