| 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 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
| 7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/mips/macro-assembler-mips.h" | 9 #include "src/mips/macro-assembler-mips.h" |
| 10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 break; | 430 break; |
| 431 case kArchLookupSwitch: | 431 case kArchLookupSwitch: |
| 432 AssembleArchLookupSwitch(instr); | 432 AssembleArchLookupSwitch(instr); |
| 433 break; | 433 break; |
| 434 case kArchTableSwitch: | 434 case kArchTableSwitch: |
| 435 AssembleArchTableSwitch(instr); | 435 AssembleArchTableSwitch(instr); |
| 436 break; | 436 break; |
| 437 case kArchNop: | 437 case kArchNop: |
| 438 // don't emit code for nops. | 438 // don't emit code for nops. |
| 439 break; | 439 break; |
| 440 case kArchDeoptimize: { |
| 441 int deopt_state_id = |
| 442 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); |
| 443 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); |
| 444 break; |
| 445 } |
| 440 case kArchRet: | 446 case kArchRet: |
| 441 AssembleReturn(); | 447 AssembleReturn(); |
| 442 break; | 448 break; |
| 443 case kArchStackPointer: | 449 case kArchStackPointer: |
| 444 __ mov(i.OutputRegister(), sp); | 450 __ mov(i.OutputRegister(), sp); |
| 445 break; | 451 break; |
| 446 case kArchTruncateDoubleToI: | 452 case kArchTruncateDoubleToI: |
| 447 __ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0)); | 453 __ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0)); |
| 448 break; | 454 break; |
| 449 case kMipsAdd: | 455 case kMipsAdd: |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 __ addu(at, at, ra); | 916 __ addu(at, at, ra); |
| 911 __ lw(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); | 917 __ lw(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); |
| 912 __ jr(at); | 918 __ jr(at); |
| 913 __ nop(); // Branch delay slot nop. | 919 __ nop(); // Branch delay slot nop. |
| 914 for (size_t index = 0; index < case_count; ++index) { | 920 for (size_t index = 0; index < case_count; ++index) { |
| 915 __ dd(GetLabel(i.InputRpo(index + 2))); | 921 __ dd(GetLabel(i.InputRpo(index + 2))); |
| 916 } | 922 } |
| 917 } | 923 } |
| 918 | 924 |
| 919 | 925 |
| 920 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { | 926 void CodeGenerator::AssembleDeoptimizerCall( |
| 927 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
| 921 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 928 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
| 922 isolate(), deoptimization_id, Deoptimizer::LAZY); | 929 isolate(), deoptimization_id, bailout_type); |
| 923 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 930 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| 924 } | 931 } |
| 925 | 932 |
| 926 | 933 |
| 927 void CodeGenerator::AssemblePrologue() { | 934 void CodeGenerator::AssemblePrologue() { |
| 928 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 935 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 929 int stack_slots = frame()->GetSpillSlotCount(); | 936 int stack_slots = frame()->GetSpillSlotCount(); |
| 930 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 937 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 931 __ Push(ra, fp); | 938 __ Push(ra, fp); |
| 932 __ mov(fp, sp); | 939 __ mov(fp, sp); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 } | 1205 } |
| 1199 } | 1206 } |
| 1200 MarkLazyDeoptSite(); | 1207 MarkLazyDeoptSite(); |
| 1201 } | 1208 } |
| 1202 | 1209 |
| 1203 #undef __ | 1210 #undef __ |
| 1204 | 1211 |
| 1205 } // namespace compiler | 1212 } // namespace compiler |
| 1206 } // namespace internal | 1213 } // namespace internal |
| 1207 } // namespace v8 | 1214 } // namespace v8 |
| OLD | NEW |