| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 } else { | 407 } else { |
| 408 RecordSafepoint(instr->pointer_map(), Safepoint::kNoDeoptimizationIndex); | 408 RecordSafepoint(instr->pointer_map(), Safepoint::kNoDeoptimizationIndex); |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 | 412 |
| 413 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { | 413 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { |
| 414 // Create the environment to bailout to. If the call has side effects | 414 // Create the environment to bailout to. If the call has side effects |
| 415 // execution has to continue after the call otherwise execution can continue | 415 // execution has to continue after the call otherwise execution can continue |
| 416 // from a previous bailout point repeating the call. | 416 // from a previous bailout point repeating the call. |
| 417 LEnvironment* lazy_deoptimization_environment; | 417 LEnvironment* deoptimization_environment; |
| 418 ASSERT(!instr->IsControl()); | 418 if (instr->HasDeoptimizationEnvironment()) { |
| 419 ASSERT(instructions_->at(current_instruction_ + 1)->IsGap()); | 419 deoptimization_environment = instr->deoptimization_environment(); |
| 420 LInstruction* next_instr = instructions_->at(current_instruction_ + 2); | |
| 421 if (next_instr->IsLazyBailout()) { | |
| 422 ASSERT(next_instr->HasEnvironment()); | |
| 423 lazy_deoptimization_environment = next_instr->environment(); | |
| 424 } else { | 420 } else { |
| 425 lazy_deoptimization_environment = instr->environment(); | 421 deoptimization_environment = instr->environment(); |
| 426 } | 422 } |
| 427 | 423 |
| 428 RegisterEnvironmentForDeoptimization(lazy_deoptimization_environment); | 424 RegisterEnvironmentForDeoptimization(deoptimization_environment); |
| 429 RecordSafepoint(instr->pointer_map(), | 425 RecordSafepoint(instr->pointer_map(), |
| 430 lazy_deoptimization_environment->deoptimization_index()); | 426 deoptimization_environment->deoptimization_index()); |
| 431 } | 427 } |
| 432 | 428 |
| 433 | 429 |
| 434 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { | 430 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { |
| 435 if (!environment->HasBeenRegistered()) { | 431 if (!environment->HasBeenRegistered()) { |
| 436 // Physical stack frame layout: | 432 // Physical stack frame layout: |
| 437 // -x ............. -4 0 ..................................... y | 433 // -x ............. -4 0 ..................................... y |
| 438 // [incoming arguments] [spill slots] [pushed outgoing arguments] | 434 // [incoming arguments] [spill slots] [pushed outgoing arguments] |
| 439 | 435 |
| 440 // Layout of the environment: | 436 // Layout of the environment: |
| (...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3600 ASSERT(osr_pc_offset_ == -1); | 3596 ASSERT(osr_pc_offset_ == -1); |
| 3601 osr_pc_offset_ = masm()->pc_offset(); | 3597 osr_pc_offset_ = masm()->pc_offset(); |
| 3602 } | 3598 } |
| 3603 | 3599 |
| 3604 | 3600 |
| 3605 #undef __ | 3601 #undef __ |
| 3606 | 3602 |
| 3607 } } // namespace v8::internal | 3603 } } // namespace v8::internal |
| 3608 | 3604 |
| 3609 #endif // V8_TARGET_ARCH_IA32 | 3605 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |