OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 break; | 548 break; |
549 case kArchLookupSwitch: | 549 case kArchLookupSwitch: |
550 AssembleArchLookupSwitch(instr); | 550 AssembleArchLookupSwitch(instr); |
551 break; | 551 break; |
552 case kArchTableSwitch: | 552 case kArchTableSwitch: |
553 AssembleArchTableSwitch(instr); | 553 AssembleArchTableSwitch(instr); |
554 break; | 554 break; |
555 case kArchNop: | 555 case kArchNop: |
556 // don't emit code for nops. | 556 // don't emit code for nops. |
557 break; | 557 break; |
| 558 case kArchDeoptimize: { |
| 559 int deopt_state_id = |
| 560 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); |
| 561 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); |
| 562 break; |
| 563 } |
558 case kArchRet: | 564 case kArchRet: |
559 AssembleReturn(); | 565 AssembleReturn(); |
560 break; | 566 break; |
561 case kArchStackPointer: | 567 case kArchStackPointer: |
562 __ movq(i.OutputRegister(), rsp); | 568 __ movq(i.OutputRegister(), rsp); |
563 break; | 569 break; |
564 case kArchTruncateDoubleToI: { | 570 case kArchTruncateDoubleToI: { |
565 auto result = i.OutputRegister(); | 571 auto result = i.OutputRegister(); |
566 auto input = i.InputDoubleRegister(0); | 572 auto input = i.InputDoubleRegister(0); |
567 auto ool = new (zone()) OutOfLineTruncateDoubleToI(this, result, input); | 573 auto ool = new (zone()) OutOfLineTruncateDoubleToI(this, result, input); |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 cases[index] = GetLabel(i.InputRpo(index + 2)); | 1164 cases[index] = GetLabel(i.InputRpo(index + 2)); |
1159 } | 1165 } |
1160 Label* const table = AddJumpTable(cases, case_count); | 1166 Label* const table = AddJumpTable(cases, case_count); |
1161 __ cmpl(input, Immediate(case_count)); | 1167 __ cmpl(input, Immediate(case_count)); |
1162 __ j(above_equal, GetLabel(i.InputRpo(1))); | 1168 __ j(above_equal, GetLabel(i.InputRpo(1))); |
1163 __ leaq(kScratchRegister, Operand(table)); | 1169 __ leaq(kScratchRegister, Operand(table)); |
1164 __ jmp(Operand(kScratchRegister, input, times_8, 0)); | 1170 __ jmp(Operand(kScratchRegister, input, times_8, 0)); |
1165 } | 1171 } |
1166 | 1172 |
1167 | 1173 |
1168 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { | 1174 void CodeGenerator::AssembleDeoptimizerCall( |
| 1175 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
1169 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1176 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1170 isolate(), deoptimization_id, Deoptimizer::LAZY); | 1177 isolate(), deoptimization_id, bailout_type); |
1171 __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1178 __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1172 } | 1179 } |
1173 | 1180 |
1174 | 1181 |
1175 void CodeGenerator::AssemblePrologue() { | 1182 void CodeGenerator::AssemblePrologue() { |
1176 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1183 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1177 int stack_slots = frame()->GetSpillSlotCount(); | 1184 int stack_slots = frame()->GetSpillSlotCount(); |
1178 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 1185 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
1179 __ pushq(rbp); | 1186 __ pushq(rbp); |
1180 __ movq(rbp, rsp); | 1187 __ movq(rbp, rsp); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 } | 1442 } |
1436 } | 1443 } |
1437 MarkLazyDeoptSite(); | 1444 MarkLazyDeoptSite(); |
1438 } | 1445 } |
1439 | 1446 |
1440 #undef __ | 1447 #undef __ |
1441 | 1448 |
1442 } // namespace internal | 1449 } // namespace internal |
1443 } // namespace compiler | 1450 } // namespace compiler |
1444 } // namespace v8 | 1451 } // namespace v8 |
OLD | NEW |