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 6913 matching lines...) Loading... |
6924 } | 6924 } |
6925 } | 6925 } |
6926 | 6926 |
6927 | 6927 |
6928 void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) { | 6928 void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) { |
6929 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); | 6929 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); |
6930 Object* cell = rinfo->target_cell(); | 6930 Object* cell = rinfo->target_cell(); |
6931 Object* old_cell = cell; | 6931 Object* old_cell = cell; |
6932 VisitPointer(&cell); | 6932 VisitPointer(&cell); |
6933 if (cell != old_cell) { | 6933 if (cell != old_cell) { |
6934 rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell), NULL); | 6934 rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell)); |
6935 } | 6935 } |
6936 } | 6936 } |
6937 | 6937 |
6938 | 6938 |
6939 void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) { | 6939 void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) { |
6940 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 6940 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
6941 rinfo->IsPatchedReturnSequence()) || | 6941 rinfo->IsPatchedReturnSequence()) || |
6942 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 6942 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
6943 rinfo->IsPatchedDebugBreakSlotSequence())); | 6943 rinfo->IsPatchedDebugBreakSlotSequence())); |
6944 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 6944 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
(...skipping 29 matching lines...) Loading... |
6974 intptr_t delta = instruction_start() - desc.buffer; | 6974 intptr_t delta = instruction_start() - desc.buffer; |
6975 int mode_mask = RelocInfo::kCodeTargetMask | | 6975 int mode_mask = RelocInfo::kCodeTargetMask | |
6976 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 6976 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
6977 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | | 6977 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
6978 RelocInfo::kApplyMask; | 6978 RelocInfo::kApplyMask; |
6979 Assembler* origin = desc.origin; // Needed to find target_object on X64. | 6979 Assembler* origin = desc.origin; // Needed to find target_object on X64. |
6980 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 6980 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
6981 RelocInfo::Mode mode = it.rinfo()->rmode(); | 6981 RelocInfo::Mode mode = it.rinfo()->rmode(); |
6982 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 6982 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
6983 Handle<Object> p = it.rinfo()->target_object_handle(origin); | 6983 Handle<Object> p = it.rinfo()->target_object_handle(origin); |
6984 it.rinfo()->set_target_object(*p, this); | 6984 it.rinfo()->set_target_object(*p); |
6985 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 6985 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
6986 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); | 6986 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); |
6987 it.rinfo()->set_target_cell(*cell, this); | 6987 it.rinfo()->set_target_cell(*cell); |
6988 } else if (RelocInfo::IsCodeTarget(mode)) { | 6988 } else if (RelocInfo::IsCodeTarget(mode)) { |
6989 // rewrite code handles in inline cache targets to direct | 6989 // rewrite code handles in inline cache targets to direct |
6990 // pointers to the first instruction in the code object | 6990 // pointers to the first instruction in the code object |
6991 Handle<Object> p = it.rinfo()->target_object_handle(origin); | 6991 Handle<Object> p = it.rinfo()->target_object_handle(origin); |
6992 Code* code = Code::cast(*p); | 6992 Code* code = Code::cast(*p); |
6993 it.rinfo()->set_target_address(code->instruction_start(), this); | 6993 it.rinfo()->set_target_address(code->instruction_start()); |
6994 } else { | 6994 } else { |
6995 it.rinfo()->apply(delta); | 6995 it.rinfo()->apply(delta); |
6996 } | 6996 } |
6997 } | 6997 } |
6998 CPU::FlushICache(instruction_start(), instruction_size()); | 6998 CPU::FlushICache(instruction_start(), instruction_size()); |
6999 } | 6999 } |
7000 | 7000 |
7001 | 7001 |
7002 // Locate the source position which is closest to the address in the code. This | 7002 // Locate the source position which is closest to the address in the code. This |
7003 // is using the source position information embedded in the relocation info. | 7003 // is using the source position information embedded in the relocation info. |
(...skipping 4706 matching lines...) Loading... |
11710 if (break_point_objects()->IsUndefined()) return 0; | 11710 if (break_point_objects()->IsUndefined()) return 0; |
11711 // Single break point. | 11711 // Single break point. |
11712 if (!break_point_objects()->IsFixedArray()) return 1; | 11712 if (!break_point_objects()->IsFixedArray()) return 1; |
11713 // Multiple break points. | 11713 // Multiple break points. |
11714 return FixedArray::cast(break_point_objects())->length(); | 11714 return FixedArray::cast(break_point_objects())->length(); |
11715 } | 11715 } |
11716 #endif | 11716 #endif |
11717 | 11717 |
11718 | 11718 |
11719 } } // namespace v8::internal | 11719 } } // namespace v8::internal |
OLD | NEW |