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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
588 } | 588 } |
589 | 589 |
590 ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on ARM. | 590 ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on ARM. |
591 | 591 |
592 if (FLAG_deopt_every_n_times == 1 && | 592 if (FLAG_deopt_every_n_times == 1 && |
593 info_->shared_info()->opt_count() == id) { | 593 info_->shared_info()->opt_count() == id) { |
594 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 594 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
595 return; | 595 return; |
596 } | 596 } |
597 | 597 |
598 if (FLAG_trap_on_deopt) { | |
599 __ stop("trap_on_deopt", cc); | |
600 } | |
601 | |
598 if (cc == al) { | 602 if (cc == al) { |
599 if (FLAG_trap_on_deopt) __ stop("trap_on_deopt"); | 603 // We don't need to optimize this code since the branch is always taken. |
600 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 604 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
601 } else { | 605 } else { |
Søren Thygesen Gjesse
2011/05/16 07:26:39
The x64 also uses a jump table, which is emitted a
| |
602 if (FLAG_trap_on_deopt) { | 606 Label record_deopt_jump_entry; |
603 Label done; | 607 __ bind(&record_deopt_jump_entry); |
604 __ b(&done, NegateCondition(cc)); | 608 // This breakpoint will be patched to a branch to the correct location when |
605 __ stop("trap_on_deopt"); | 609 // the deoptimization jump table is emitted (in Assembler::CheckConstPool). |
606 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 610 // This happens before the code is executed so we should actually never hit |
607 __ bind(&done); | 611 // this breakpoint. |
608 } else { | 612 // Make sure the constant pool is not emitted between our record and the |
609 __ Jump(entry, RelocInfo::RUNTIME_ENTRY, cc); | 613 // breakpoint instruction. |
610 } | 614 __ BlockConstPoolFor(1); |
615 __ RecordDeoptJumpEntry(entry, cc); | |
616 __ bkpt(kBkptUninitializedCode); | |
617 // This is a performance critical section. We don't want to emit more | |
618 // than this breakpoint patched to an almost never taken branch. | |
619 ASSERT(__ InstructionsGeneratedSince(&record_deopt_jump_entry) == 1); | |
611 } | 620 } |
612 } | 621 } |
613 | 622 |
614 | 623 |
615 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 624 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
616 int length = deoptimizations_.length(); | 625 int length = deoptimizations_.length(); |
617 if (length == 0) return; | 626 if (length == 0) return; |
618 ASSERT(FLAG_deopt); | 627 ASSERT(FLAG_deopt); |
619 Handle<DeoptimizationInputData> data = | 628 Handle<DeoptimizationInputData> data = |
620 factory()->NewDeoptimizationInputData(length, TENURED); | 629 factory()->NewDeoptimizationInputData(length, TENURED); |
(...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4416 ASSERT(osr_pc_offset_ == -1); | 4425 ASSERT(osr_pc_offset_ == -1); |
4417 osr_pc_offset_ = masm()->pc_offset(); | 4426 osr_pc_offset_ = masm()->pc_offset(); |
4418 } | 4427 } |
4419 | 4428 |
4420 | 4429 |
4421 | 4430 |
4422 | 4431 |
4423 #undef __ | 4432 #undef __ |
4424 | 4433 |
4425 } } // namespace v8::internal | 4434 } } // namespace v8::internal |
OLD | NEW |