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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 320 |
321 Register entry_offset = scratch0(); | 321 Register entry_offset = scratch0(); |
322 | 322 |
323 int length = jump_table_.length(); | 323 int length = jump_table_.length(); |
324 for (int i = 0; i < length; i++) { | 324 for (int i = 0; i < length; i++) { |
325 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i]; | 325 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i]; |
326 __ bind(&table_entry->label); | 326 __ bind(&table_entry->label); |
327 | 327 |
328 DCHECK_EQ(jump_table_[0].bailout_type, table_entry->bailout_type); | 328 DCHECK_EQ(jump_table_[0].bailout_type, table_entry->bailout_type); |
329 Address entry = table_entry->address; | 329 Address entry = table_entry->address; |
330 DeoptComment(table_entry->reason); | 330 DeoptComment(table_entry->deopt_info); |
331 | 331 |
332 // Second-level deopt table entries are contiguous and small, so instead | 332 // Second-level deopt table entries are contiguous and small, so instead |
333 // of loading the full, absolute address of each one, load an immediate | 333 // of loading the full, absolute address of each one, load an immediate |
334 // offset which will be added to the base address later. | 334 // offset which will be added to the base address later. |
335 __ mov(entry_offset, Operand(entry - base)); | 335 __ mov(entry_offset, Operand(entry - base)); |
336 | 336 |
337 if (table_entry->needs_frame) { | 337 if (table_entry->needs_frame) { |
338 DCHECK(!info()->saves_caller_doubles()); | 338 DCHECK(!info()->saves_caller_doubles()); |
339 if (needs_frame.is_bound()) { | 339 if (needs_frame.is_bound()) { |
340 __ b(&needs_frame); | 340 __ b(&needs_frame); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 805 __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
806 __ bind(&no_deopt); | 806 __ bind(&no_deopt); |
807 __ stw(r4, MemOperand(scratch)); | 807 __ stw(r4, MemOperand(scratch)); |
808 __ Pop(r4, scratch); | 808 __ Pop(r4, scratch); |
809 } | 809 } |
810 | 810 |
811 if (info()->ShouldTrapOnDeopt()) { | 811 if (info()->ShouldTrapOnDeopt()) { |
812 __ stop("trap_on_deopt", cond, kDefaultStopCode, cr); | 812 __ stop("trap_on_deopt", cond, kDefaultStopCode, cr); |
813 } | 813 } |
814 | 814 |
815 Deoptimizer::Reason reason(instr->hydrogen_value()->position().raw(), | 815 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position().raw(), |
816 instr->Mnemonic(), deopt_reason); | 816 instr->Mnemonic(), deopt_reason); |
817 DCHECK(info()->IsStub() || frame_is_built_); | 817 DCHECK(info()->IsStub() || frame_is_built_); |
818 // Go through jump table if we need to handle condition, build frame, or | 818 // Go through jump table if we need to handle condition, build frame, or |
819 // restore caller doubles. | 819 // restore caller doubles. |
820 if (cond == al && frame_is_built_ && !info()->saves_caller_doubles()) { | 820 if (cond == al && frame_is_built_ && !info()->saves_caller_doubles()) { |
821 DeoptComment(reason); | 821 DeoptComment(deopt_info); |
822 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 822 __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
823 } else { | 823 } else { |
824 Deoptimizer::JumpTableEntry table_entry(entry, reason, bailout_type, | 824 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, |
825 !frame_is_built_); | 825 !frame_is_built_); |
826 // We often have several deopts to the same entry, reuse the last | 826 // We often have several deopts to the same entry, reuse the last |
827 // jump entry if this is the case. | 827 // jump entry if this is the case. |
828 if (jump_table_.is_empty() || | 828 if (jump_table_.is_empty() || |
829 !table_entry.IsEquivalentTo(jump_table_.last())) { | 829 !table_entry.IsEquivalentTo(jump_table_.last())) { |
830 jump_table_.Add(table_entry, zone()); | 830 jump_table_.Add(table_entry, zone()); |
831 } | 831 } |
832 __ b(cond, &jump_table_.last().label, cr); | 832 __ b(cond, &jump_table_.last().label, cr); |
833 } | 833 } |
834 } | 834 } |
(...skipping 5406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6241 __ Push(scope_info); | 6241 __ Push(scope_info); |
6242 __ push(ToRegister(instr->function())); | 6242 __ push(ToRegister(instr->function())); |
6243 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6243 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6244 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6244 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6245 } | 6245 } |
6246 | 6246 |
6247 | 6247 |
6248 #undef __ | 6248 #undef __ |
6249 } | 6249 } |
6250 } // namespace v8::internal | 6250 } // namespace v8::internal |
OLD | NEW |