OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 int num_arguments, | 518 int num_arguments, |
519 LInstruction* instr) { | 519 LInstruction* instr) { |
520 Abort("Unimplemented: %s", "CallRuntime"); | 520 Abort("Unimplemented: %s", "CallRuntime"); |
521 } | 521 } |
522 | 522 |
523 | 523 |
524 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { | 524 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { |
525 // Create the environment to bailout to. If the call has side effects | 525 // Create the environment to bailout to. If the call has side effects |
526 // execution has to continue after the call otherwise execution can continue | 526 // execution has to continue after the call otherwise execution can continue |
527 // from a previous bailout point repeating the call. | 527 // from a previous bailout point repeating the call. |
528 LEnvironment* deoptimization_environment; | 528 LEnvironment* lazy_deoptimization_environment; |
529 if (instr->HasDeoptimizationEnvironment()) { | 529 ASSERT(!instr->IsControl()); |
530 deoptimization_environment = instr->deoptimization_environment(); | 530 ASSERT(instructions_->at(current_instruction_ + 1)->IsGap()); |
| 531 LInstruction* next_instr = instructions_->at(current_instruction_ + 2); |
| 532 if (next_instr->IsLazyBailout()) { |
| 533 ASSERT(next_instr->HasEnvironment()); |
| 534 lazy_deoptimization_environment = next_instr->environment(); |
531 } else { | 535 } else { |
532 deoptimization_environment = instr->environment(); | 536 lazy_deoptimization_environment = instr->environment(); |
533 } | 537 } |
534 | 538 |
535 RegisterEnvironmentForDeoptimization(deoptimization_environment); | 539 RegisterEnvironmentForDeoptimization(lazy_deoptimization_environment); |
536 RecordSafepoint(instr->pointer_map(), | 540 RecordSafepoint(instr->pointer_map(), |
537 deoptimization_environment->deoptimization_index()); | 541 lazy_deoptimization_environment->deoptimization_index()); |
538 } | 542 } |
539 | 543 |
540 | 544 |
541 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { | 545 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { |
542 if (!environment->HasBeenRegistered()) { | 546 if (!environment->HasBeenRegistered()) { |
543 // Physical stack frame layout: | 547 // Physical stack frame layout: |
544 // -x ............. -4 0 ..................................... y | 548 // -x ............. -4 0 ..................................... y |
545 // [incoming arguments] [spill slots] [pushed outgoing arguments] | 549 // [incoming arguments] [spill slots] [pushed outgoing arguments] |
546 | 550 |
547 // Layout of the environment: | 551 // Layout of the environment: |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 | 1936 |
1933 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 1937 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
1934 Abort("Unimplemented: %s", "DoOsrEntry"); | 1938 Abort("Unimplemented: %s", "DoOsrEntry"); |
1935 } | 1939 } |
1936 | 1940 |
1937 #undef __ | 1941 #undef __ |
1938 | 1942 |
1939 } } // namespace v8::internal | 1943 } } // namespace v8::internal |
1940 | 1944 |
1941 #endif // V8_TARGET_ARCH_X64 | 1945 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |