| OLD | NEW |
| 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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 341 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 342 break; | 342 break; |
| 343 case kArchTableSwitch: | 343 case kArchTableSwitch: |
| 344 AssembleArchTableSwitch(instr); | 344 AssembleArchTableSwitch(instr); |
| 345 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 345 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 346 break; | 346 break; |
| 347 case kArchNop: | 347 case kArchNop: |
| 348 // don't emit code for nops. | 348 // don't emit code for nops. |
| 349 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 349 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 350 break; | 350 break; |
| 351 case kArchDeoptimize: { |
| 352 int deopt_state_id = |
| 353 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); |
| 354 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); |
| 355 break; |
| 356 } |
| 351 case kArchRet: | 357 case kArchRet: |
| 352 AssembleReturn(); | 358 AssembleReturn(); |
| 353 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 359 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 354 break; | 360 break; |
| 355 case kArchStackPointer: | 361 case kArchStackPointer: |
| 356 __ mov(i.OutputRegister(), sp); | 362 __ mov(i.OutputRegister(), sp); |
| 357 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 363 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 358 break; | 364 break; |
| 359 case kArchTruncateDoubleToI: | 365 case kArchTruncateDoubleToI: |
| 360 __ TruncateDoubleToI(i.OutputRegister(), i.InputFloat64Register(0)); | 366 __ TruncateDoubleToI(i.OutputRegister(), i.InputFloat64Register(0)); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 __ cmp(input, Operand(case_count)); | 784 __ cmp(input, Operand(case_count)); |
| 779 __ BlockConstPoolFor(case_count + 2); | 785 __ BlockConstPoolFor(case_count + 2); |
| 780 __ ldr(pc, MemOperand(pc, input, LSL, 2), lo); | 786 __ ldr(pc, MemOperand(pc, input, LSL, 2), lo); |
| 781 __ b(GetLabel(i.InputRpo(1))); | 787 __ b(GetLabel(i.InputRpo(1))); |
| 782 for (size_t index = 0; index < case_count; ++index) { | 788 for (size_t index = 0; index < case_count; ++index) { |
| 783 __ dd(GetLabel(i.InputRpo(index + 2))); | 789 __ dd(GetLabel(i.InputRpo(index + 2))); |
| 784 } | 790 } |
| 785 } | 791 } |
| 786 | 792 |
| 787 | 793 |
| 788 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { | 794 void CodeGenerator::AssembleDeoptimizerCall( |
| 795 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
| 789 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 796 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
| 790 isolate(), deoptimization_id, Deoptimizer::LAZY); | 797 isolate(), deoptimization_id, bailout_type); |
| 791 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 798 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| 792 } | 799 } |
| 793 | 800 |
| 794 | 801 |
| 795 void CodeGenerator::AssemblePrologue() { | 802 void CodeGenerator::AssemblePrologue() { |
| 796 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 803 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 797 int stack_slots = frame()->GetSpillSlotCount(); | 804 int stack_slots = frame()->GetSpillSlotCount(); |
| 798 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 805 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 799 bool saved_pp; | 806 bool saved_pp; |
| 800 if (FLAG_enable_ool_constant_pool) { | 807 if (FLAG_enable_ool_constant_pool) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 } | 1080 } |
| 1074 } | 1081 } |
| 1075 MarkLazyDeoptSite(); | 1082 MarkLazyDeoptSite(); |
| 1076 } | 1083 } |
| 1077 | 1084 |
| 1078 #undef __ | 1085 #undef __ |
| 1079 | 1086 |
| 1080 } // namespace compiler | 1087 } // namespace compiler |
| 1081 } // namespace internal | 1088 } // namespace internal |
| 1082 } // namespace v8 | 1089 } // namespace v8 |
| OLD | NEW |