Chromium Code Reviews| Index: src/compiler/code-generator.cc |
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc |
| index a7c2c65c0856a72fd33f832528c42eca167bd5c9..c6ad74a70d092f74f44f48c08d56a17937e57ea9 100644 |
| --- a/src/compiler/code-generator.cc |
| +++ b/src/compiler/code-generator.cc |
| @@ -33,8 +33,10 @@ class CodeGenerator::JumpTable final : public ZoneObject { |
| size_t const target_count_; |
| }; |
| -CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage, |
| - InstructionSequence* code, CompilationInfo* info) |
| +CodeGenerator::CodeGenerator( |
| + Frame* frame, Linkage* linkage, InstructionSequence* code, |
| + CompilationInfo* info, |
| + trap_handler::ProtectedInstructionList* protected_instructions) |
| : frame_access_state_(nullptr), |
| linkage_(linkage), |
| code_(code), |
| @@ -57,7 +59,8 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage, |
| ools_(nullptr), |
| osr_pc_offset_(-1), |
| source_position_table_builder_(code->zone(), |
| - info->SourcePositionRecordingMode()) { |
| + info->SourcePositionRecordingMode()), |
| + protected_instructions_(protected_instructions) { |
| for (int i = 0; i < code->InstructionBlockCount(); ++i) { |
| new (&labels_[i]) Label; |
| } |
| @@ -71,6 +74,16 @@ void CodeGenerator::CreateFrameAccessState(Frame* frame) { |
| frame_access_state_ = new (code()->zone()) FrameAccessState(frame); |
| } |
| +void CodeGenerator::AddProtectedInstruction(int instr_offset, |
| + int landing_offset) { |
| + if (protected_instructions_ != nullptr) { |
| + trap_handler::ProtectedInstructionData data; |
|
titzer
2016/11/30 17:31:12
This can be a little shorter if you either introdu
Eric Holk
2016/11/30 20:16:19
Done.
|
| + data.instr_offset = instr_offset; |
| + data.landing_offset = landing_offset; |
| + protected_instructions_->push_back(data); |
| + } |
| +} |
| + |
| Handle<Code> CodeGenerator::GenerateCode() { |
| CompilationInfo* info = this->info(); |