| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 | 834 |
| 835 | 835 |
| 836 bool LCodeGen::GenerateDeoptJumpTable() { | 836 bool LCodeGen::GenerateDeoptJumpTable() { |
| 837 if (deopt_jump_table_.length() > 0) { | 837 if (deopt_jump_table_.length() > 0) { |
| 838 Comment(";;; -------------------- Jump table --------------------"); | 838 Comment(";;; -------------------- Jump table --------------------"); |
| 839 } | 839 } |
| 840 Label table_start; | 840 Label table_start; |
| 841 __ bind(&table_start); | 841 __ bind(&table_start); |
| 842 Label needs_frame; | 842 Label needs_frame; |
| 843 for (int i = 0; i < deopt_jump_table_.length(); i++) { | 843 for (int i = 0; i < deopt_jump_table_.length(); i++) { |
| 844 __ Bind(&deopt_jump_table_[i].label); | 844 __ Bind(&deopt_jump_table_[i]->label); |
| 845 Address entry = deopt_jump_table_[i].address; | 845 Address entry = deopt_jump_table_[i]->address; |
| 846 Deoptimizer::BailoutType type = deopt_jump_table_[i].bailout_type; | 846 Deoptimizer::BailoutType type = deopt_jump_table_[i]->bailout_type; |
| 847 int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type); | 847 int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type); |
| 848 if (id == Deoptimizer::kNotDeoptimizationEntry) { | 848 if (id == Deoptimizer::kNotDeoptimizationEntry) { |
| 849 Comment(";;; jump table entry %d.", i); | 849 Comment(";;; jump table entry %d.", i); |
| 850 } else { | 850 } else { |
| 851 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); | 851 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); |
| 852 } | 852 } |
| 853 if (deopt_jump_table_[i].needs_frame) { | 853 if (deopt_jump_table_[i]->needs_frame) { |
| 854 ASSERT(!info()->saves_caller_doubles()); | 854 ASSERT(!info()->saves_caller_doubles()); |
| 855 | 855 |
| 856 UseScratchRegisterScope temps(masm()); | 856 UseScratchRegisterScope temps(masm()); |
| 857 Register stub_deopt_entry = temps.AcquireX(); | 857 Register stub_deopt_entry = temps.AcquireX(); |
| 858 Register stub_marker = temps.AcquireX(); | 858 Register stub_marker = temps.AcquireX(); |
| 859 | 859 |
| 860 __ Mov(stub_deopt_entry, | 860 __ Mov(stub_deopt_entry, |
| 861 Operand(ExternalReference::ForDeoptEntry(entry))); | 861 Operand(ExternalReference::ForDeoptEntry(entry))); |
| 862 if (needs_frame.is_bound()) { | 862 if (needs_frame.is_bound()) { |
| 863 __ B(&needs_frame); | 863 __ B(&needs_frame); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 // Go through jump table if we need to build frame, or restore caller doubles. | 1032 // Go through jump table if we need to build frame, or restore caller doubles. |
| 1033 if (frame_is_built_ && !info()->saves_caller_doubles()) { | 1033 if (frame_is_built_ && !info()->saves_caller_doubles()) { |
| 1034 Label dont_deopt; | 1034 Label dont_deopt; |
| 1035 __ B(&dont_deopt, InvertBranchType(branch_type), reg, bit); | 1035 __ B(&dont_deopt, InvertBranchType(branch_type), reg, bit); |
| 1036 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 1036 __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
| 1037 __ Bind(&dont_deopt); | 1037 __ Bind(&dont_deopt); |
| 1038 } else { | 1038 } else { |
| 1039 // We often have several deopts to the same entry, reuse the last | 1039 // We often have several deopts to the same entry, reuse the last |
| 1040 // jump entry if this is the case. | 1040 // jump entry if this is the case. |
| 1041 if (deopt_jump_table_.is_empty() || | 1041 if (deopt_jump_table_.is_empty() || |
| 1042 (deopt_jump_table_.last().address != entry) || | 1042 (deopt_jump_table_.last()->address != entry) || |
| 1043 (deopt_jump_table_.last().bailout_type != bailout_type) || | 1043 (deopt_jump_table_.last()->bailout_type != bailout_type) || |
| 1044 (deopt_jump_table_.last().needs_frame != !frame_is_built_)) { | 1044 (deopt_jump_table_.last()->needs_frame != !frame_is_built_)) { |
| 1045 Deoptimizer::JumpTableEntry table_entry(entry, | 1045 Deoptimizer::JumpTableEntry* table_entry = |
| 1046 bailout_type, | 1046 new(zone()) Deoptimizer::JumpTableEntry(entry, |
| 1047 !frame_is_built_); | 1047 bailout_type, |
| 1048 !frame_is_built_); |
| 1048 deopt_jump_table_.Add(table_entry, zone()); | 1049 deopt_jump_table_.Add(table_entry, zone()); |
| 1049 } | 1050 } |
| 1050 __ B(&deopt_jump_table_.last().label, | 1051 __ B(&deopt_jump_table_.last()->label, |
| 1051 branch_type, reg, bit); | 1052 branch_type, reg, bit); |
| 1052 } | 1053 } |
| 1053 } | 1054 } |
| 1054 | 1055 |
| 1055 | 1056 |
| 1056 void LCodeGen::Deoptimize(LEnvironment* environment, | 1057 void LCodeGen::Deoptimize(LEnvironment* environment, |
| 1057 Deoptimizer::BailoutType* override_bailout_type) { | 1058 Deoptimizer::BailoutType* override_bailout_type) { |
| 1058 DeoptimizeBranch(environment, always, NoReg, -1, override_bailout_type); | 1059 DeoptimizeBranch(environment, always, NoReg, -1, override_bailout_type); |
| 1059 } | 1060 } |
| 1060 | 1061 |
| (...skipping 4775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5836 __ Bind(&out_of_object); | 5837 __ Bind(&out_of_object); |
| 5837 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5838 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5838 // Index is equal to negated out of object property index plus 1. | 5839 // Index is equal to negated out of object property index plus 1. |
| 5839 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5840 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5840 __ Ldr(result, FieldMemOperand(result, | 5841 __ Ldr(result, FieldMemOperand(result, |
| 5841 FixedArray::kHeaderSize - kPointerSize)); | 5842 FixedArray::kHeaderSize - kPointerSize)); |
| 5842 __ Bind(&done); | 5843 __ Bind(&done); |
| 5843 } | 5844 } |
| 5844 | 5845 |
| 5845 } } // namespace v8::internal | 5846 } } // namespace v8::internal |
| OLD | NEW |