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 kMips64Add: | 455 case kMips64Add: |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 __ daddu(at, at, ra); | 1076 __ daddu(at, at, ra); |
1071 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); | 1077 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); |
1072 __ jr(at); | 1078 __ jr(at); |
1073 __ nop(); // Branch delay slot nop. | 1079 __ nop(); // Branch delay slot nop. |
1074 for (size_t index = 0; index < case_count; ++index) { | 1080 for (size_t index = 0; index < case_count; ++index) { |
1075 __ dd(GetLabel(i.InputRpo(index + 2))); | 1081 __ dd(GetLabel(i.InputRpo(index + 2))); |
1076 } | 1082 } |
1077 } | 1083 } |
1078 | 1084 |
1079 | 1085 |
1080 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { | 1086 void CodeGenerator::AssembleDeoptimizerCall( |
| 1087 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
1081 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1088 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1082 isolate(), deoptimization_id, Deoptimizer::LAZY); | 1089 isolate(), deoptimization_id, bailout_type); |
1083 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1090 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1084 } | 1091 } |
1085 | 1092 |
1086 | 1093 |
1087 void CodeGenerator::AssemblePrologue() { | 1094 void CodeGenerator::AssemblePrologue() { |
1088 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1095 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1089 int stack_slots = frame()->GetSpillSlotCount(); | 1096 int stack_slots = frame()->GetSpillSlotCount(); |
1090 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 1097 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
1091 __ Push(ra, fp); | 1098 __ Push(ra, fp); |
1092 __ mov(fp, sp); | 1099 __ mov(fp, sp); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 } | 1365 } |
1359 } | 1366 } |
1360 MarkLazyDeoptSite(); | 1367 MarkLazyDeoptSite(); |
1361 } | 1368 } |
1362 | 1369 |
1363 #undef __ | 1370 #undef __ |
1364 | 1371 |
1365 } // namespace compiler | 1372 } // namespace compiler |
1366 } // namespace internal | 1373 } // namespace internal |
1367 } // namespace v8 | 1374 } // namespace v8 |
OLD | NEW |