OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5892 } | 5892 } |
5893 } | 5893 } |
5894 | 5894 |
5895 | 5895 |
5896 void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) { | 5896 void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) { |
5897 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); | 5897 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); |
5898 Object* cell = rinfo->target_cell(); | 5898 Object* cell = rinfo->target_cell(); |
5899 Object* old_cell = cell; | 5899 Object* old_cell = cell; |
5900 VisitPointer(&cell); | 5900 VisitPointer(&cell); |
5901 if (cell != old_cell) { | 5901 if (cell != old_cell) { |
5902 rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell)); | 5902 rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell), NULL); |
5903 } | 5903 } |
5904 } | 5904 } |
5905 | 5905 |
5906 | 5906 |
5907 void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) { | 5907 void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) { |
5908 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 5908 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
5909 rinfo->IsPatchedReturnSequence()) || | 5909 rinfo->IsPatchedReturnSequence()) || |
5910 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 5910 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
5911 rinfo->IsPatchedDebugBreakSlotSequence())); | 5911 rinfo->IsPatchedDebugBreakSlotSequence())); |
5912 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 5912 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
(...skipping 30 matching lines...) Expand all Loading... |
5943 intptr_t delta = instruction_start() - desc.buffer; | 5943 intptr_t delta = instruction_start() - desc.buffer; |
5944 int mode_mask = RelocInfo::kCodeTargetMask | | 5944 int mode_mask = RelocInfo::kCodeTargetMask | |
5945 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 5945 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
5946 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | | 5946 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
5947 RelocInfo::kApplyMask; | 5947 RelocInfo::kApplyMask; |
5948 Assembler* origin = desc.origin; // Needed to find target_object on X64. | 5948 Assembler* origin = desc.origin; // Needed to find target_object on X64. |
5949 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 5949 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
5950 RelocInfo::Mode mode = it.rinfo()->rmode(); | 5950 RelocInfo::Mode mode = it.rinfo()->rmode(); |
5951 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 5951 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
5952 Handle<Object> p = it.rinfo()->target_object_handle(origin); | 5952 Handle<Object> p = it.rinfo()->target_object_handle(origin); |
5953 it.rinfo()->set_target_object(*p); | 5953 it.rinfo()->set_target_object(*p, this); |
5954 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 5954 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
5955 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); | 5955 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); |
5956 it.rinfo()->set_target_cell(*cell); | 5956 it.rinfo()->set_target_cell(*cell, this); |
5957 } else if (RelocInfo::IsCodeTarget(mode)) { | 5957 } else if (RelocInfo::IsCodeTarget(mode)) { |
5958 // rewrite code handles in inline cache targets to direct | 5958 // rewrite code handles in inline cache targets to direct |
5959 // pointers to the first instruction in the code object | 5959 // pointers to the first instruction in the code object |
5960 Handle<Object> p = it.rinfo()->target_object_handle(origin); | 5960 Handle<Object> p = it.rinfo()->target_object_handle(origin); |
5961 Code* code = Code::cast(*p); | 5961 Code* code = Code::cast(*p); |
5962 it.rinfo()->set_target_address(code->instruction_start()); | 5962 it.rinfo()->set_target_address(code->instruction_start(), this); |
5963 } else { | 5963 } else { |
5964 it.rinfo()->apply(delta); | 5964 it.rinfo()->apply(delta); |
5965 } | 5965 } |
5966 } | 5966 } |
5967 CPU::FlushICache(instruction_start(), instruction_size()); | 5967 CPU::FlushICache(instruction_start(), instruction_size()); |
5968 } | 5968 } |
5969 | 5969 |
5970 | 5970 |
5971 // Locate the source position which is closest to the address in the code. This | 5971 // Locate the source position which is closest to the address in the code. This |
5972 // is using the source position information embedded in the relocation info. | 5972 // is using the source position information embedded in the relocation info. |
(...skipping 3998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9971 if (break_point_objects()->IsUndefined()) return 0; | 9971 if (break_point_objects()->IsUndefined()) return 0; |
9972 // Single beak point. | 9972 // Single beak point. |
9973 if (!break_point_objects()->IsFixedArray()) return 1; | 9973 if (!break_point_objects()->IsFixedArray()) return 1; |
9974 // Multiple break points. | 9974 // Multiple break points. |
9975 return FixedArray::cast(break_point_objects())->length(); | 9975 return FixedArray::cast(break_point_objects())->length(); |
9976 } | 9976 } |
9977 #endif | 9977 #endif |
9978 | 9978 |
9979 | 9979 |
9980 } } // namespace v8::internal | 9980 } } // namespace v8::internal |
OLD | NEW |