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 8775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8786 // copy reloc info | 8786 // copy reloc info |
8787 memmove(relocation_start(), | 8787 memmove(relocation_start(), |
8788 desc.buffer + desc.buffer_size - desc.reloc_size, | 8788 desc.buffer + desc.buffer_size - desc.reloc_size, |
8789 desc.reloc_size); | 8789 desc.reloc_size); |
8790 | 8790 |
8791 // unbox handles and relocate | 8791 // unbox handles and relocate |
8792 intptr_t delta = instruction_start() - desc.buffer; | 8792 intptr_t delta = instruction_start() - desc.buffer; |
8793 int mode_mask = RelocInfo::kCodeTargetMask | | 8793 int mode_mask = RelocInfo::kCodeTargetMask | |
8794 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 8794 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
8795 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | | 8795 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
8796 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | | |
8797 RelocInfo::kApplyMask; | 8796 RelocInfo::kApplyMask; |
8798 // Needed to find target_object and runtime_entry on X64 | 8797 Assembler* origin = desc.origin; // Needed to find target_object on X64. |
8799 Assembler* origin = desc.origin; | |
8800 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 8798 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
8801 RelocInfo::Mode mode = it.rinfo()->rmode(); | 8799 RelocInfo::Mode mode = it.rinfo()->rmode(); |
8802 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 8800 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
8803 Handle<Object> p = it.rinfo()->target_object_handle(origin); | 8801 Handle<Object> p = it.rinfo()->target_object_handle(origin); |
8804 it.rinfo()->set_target_object(*p, SKIP_WRITE_BARRIER); | 8802 it.rinfo()->set_target_object(*p, SKIP_WRITE_BARRIER); |
8805 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 8803 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
8806 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); | 8804 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); |
8807 it.rinfo()->set_target_cell(*cell, SKIP_WRITE_BARRIER); | 8805 it.rinfo()->set_target_cell(*cell, SKIP_WRITE_BARRIER); |
8808 } else if (RelocInfo::IsCodeTarget(mode)) { | 8806 } else if (RelocInfo::IsCodeTarget(mode)) { |
8809 // rewrite code handles in inline cache targets to direct | 8807 // rewrite code handles in inline cache targets to direct |
8810 // pointers to the first instruction in the code object | 8808 // pointers to the first instruction in the code object |
8811 Handle<Object> p = it.rinfo()->target_object_handle(origin); | 8809 Handle<Object> p = it.rinfo()->target_object_handle(origin); |
8812 Code* code = Code::cast(*p); | 8810 Code* code = Code::cast(*p); |
8813 it.rinfo()->set_target_address(code->instruction_start(), | 8811 it.rinfo()->set_target_address(code->instruction_start(), |
8814 SKIP_WRITE_BARRIER); | 8812 SKIP_WRITE_BARRIER); |
8815 } else if (RelocInfo::IsRuntimeEntry(mode)) { | |
8816 Address p = it.rinfo()->target_runtime_entry(origin); | |
8817 it.rinfo()->set_target_runtime_entry(p, SKIP_WRITE_BARRIER); | |
8818 } else { | 8813 } else { |
8819 it.rinfo()->apply(delta); | 8814 it.rinfo()->apply(delta); |
8820 } | 8815 } |
8821 } | 8816 } |
8822 CPU::FlushICache(instruction_start(), instruction_size()); | 8817 CPU::FlushICache(instruction_start(), instruction_size()); |
8823 } | 8818 } |
8824 | 8819 |
8825 | 8820 |
8826 // Locate the source position which is closest to the address in the code. This | 8821 // Locate the source position which is closest to the address in the code. This |
8827 // is using the source position information embedded in the relocation info. | 8822 // is using the source position information embedded in the relocation info. |
(...skipping 5456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14284 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14279 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
14285 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14280 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
14286 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14281 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
14287 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14282 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
14288 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14283 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
14289 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14284 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
14290 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14285 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
14291 } | 14286 } |
14292 | 14287 |
14293 } } // namespace v8::internal | 14288 } } // namespace v8::internal |
OLD | NEW |