Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 961973002: [turbofan] First shot at eager deoptimization in Turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix 2 Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/ppc/macro-assembler-ppc.h" 10 #include "src/ppc/macro-assembler-ppc.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 561 DCHECK_EQ(LeaveRC, i.OutputRCBit());
562 break; 562 break;
563 case kArchTableSwitch: 563 case kArchTableSwitch:
564 AssembleArchTableSwitch(instr); 564 AssembleArchTableSwitch(instr);
565 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 565 DCHECK_EQ(LeaveRC, i.OutputRCBit());
566 break; 566 break;
567 case kArchNop: 567 case kArchNop:
568 // don't emit code for nops. 568 // don't emit code for nops.
569 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 569 DCHECK_EQ(LeaveRC, i.OutputRCBit());
570 break; 570 break;
571 case kArchDeoptimize: {
572 int deopt_state_id =
573 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
574 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER);
575 break;
576 }
571 case kArchRet: 577 case kArchRet:
572 AssembleReturn(); 578 AssembleReturn();
573 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 579 DCHECK_EQ(LeaveRC, i.OutputRCBit());
574 break; 580 break;
575 case kArchStackPointer: 581 case kArchStackPointer:
576 __ mr(i.OutputRegister(), sp); 582 __ mr(i.OutputRegister(), sp);
577 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 583 DCHECK_EQ(LeaveRC, i.OutputRCBit());
578 break; 584 break;
579 case kArchTruncateDoubleToI: 585 case kArchTruncateDoubleToI:
580 // TODO(mbrandy): move slow call to stub out of line. 586 // TODO(mbrandy): move slow call to stub out of line.
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 Label* const table = AddJumpTable(cases, case_count); 1111 Label* const table = AddJumpTable(cases, case_count);
1106 __ Cmpli(input, Operand(case_count), r0); 1112 __ Cmpli(input, Operand(case_count), r0);
1107 __ bge(GetLabel(i.InputRpo(1))); 1113 __ bge(GetLabel(i.InputRpo(1)));
1108 __ mov_label_addr(kScratchReg, table); 1114 __ mov_label_addr(kScratchReg, table);
1109 __ ShiftLeftImm(r0, input, Operand(kPointerSizeLog2)); 1115 __ ShiftLeftImm(r0, input, Operand(kPointerSizeLog2));
1110 __ LoadPX(kScratchReg, MemOperand(kScratchReg, r0)); 1116 __ LoadPX(kScratchReg, MemOperand(kScratchReg, r0));
1111 __ Jump(kScratchReg); 1117 __ Jump(kScratchReg);
1112 } 1118 }
1113 1119
1114 1120
1115 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { 1121 void CodeGenerator::AssembleDeoptimizerCall(
1122 int deoptimization_id, Deoptimizer::BailoutType bailout_type) {
1116 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( 1123 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
1117 isolate(), deoptimization_id, Deoptimizer::LAZY); 1124 isolate(), deoptimization_id, bailout_type);
1118 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); 1125 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
1119 } 1126 }
1120 1127
1121 1128
1122 void CodeGenerator::AssemblePrologue() { 1129 void CodeGenerator::AssemblePrologue() {
1123 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); 1130 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
1124 int stack_slots = frame()->GetSpillSlotCount(); 1131 int stack_slots = frame()->GetSpillSlotCount();
1125 if (descriptor->kind() == CallDescriptor::kCallAddress) { 1132 if (descriptor->kind() == CallDescriptor::kCallAddress) {
1126 __ function_descriptor(); 1133 __ function_descriptor();
1127 int register_save_area_size = 0; 1134 int register_save_area_size = 0;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 } 1405 }
1399 } 1406 }
1400 MarkLazyDeoptSite(); 1407 MarkLazyDeoptSite();
1401 } 1408 }
1402 1409
1403 #undef __ 1410 #undef __
1404 1411
1405 } // namespace compiler 1412 } // namespace compiler
1406 } // namespace internal 1413 } // namespace internal
1407 } // namespace v8 1414 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698