OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 Type type_; | 348 Type type_; |
349 uintptr_t align_; | 349 uintptr_t align_; |
350 uint16_t index_; | 350 uint16_t index_; |
351 }; | 351 }; |
352 #endif // defined(__ELF) | 352 #endif // defined(__ELF) |
353 | 353 |
354 | 354 |
355 #if defined(__MACH_O) | 355 #if defined(__MACH_O) |
356 class MachOTextSection : public MachOSection { | 356 class MachOTextSection : public MachOSection { |
357 public: | 357 public: |
358 MachOTextSection(uintptr_t align, | 358 MachOTextSection(uint32_t align, |
359 uintptr_t addr, | 359 uintptr_t addr, |
360 uintptr_t size) | 360 uintptr_t size) |
361 : MachOSection("__text", | 361 : MachOSection("__text", |
362 "__TEXT", | 362 "__TEXT", |
363 align, | 363 align, |
364 MachOSection::S_REGULAR | | 364 MachOSection::S_REGULAR | |
365 MachOSection::S_ATTR_SOME_INSTRUCTIONS | | 365 MachOSection::S_ATTR_SOME_INSTRUCTIONS | |
366 MachOSection::S_ATTR_PURE_INSTRUCTIONS), | 366 MachOSection::S_ATTR_PURE_INSTRUCTIONS), |
367 addr_(addr), | 367 addr_(addr), |
368 size_(size) { } | 368 size_(size) { } |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } | 581 } |
582 | 582 |
583 | 583 |
584 void WriteSections(Writer* w, | 584 void WriteSections(Writer* w, |
585 Writer::Slot<MachOSegmentCommand> cmd, | 585 Writer::Slot<MachOSegmentCommand> cmd, |
586 Writer::Slot<MachOHeader> header, | 586 Writer::Slot<MachOHeader> header, |
587 uintptr_t load_command_start) { | 587 uintptr_t load_command_start) { |
588 Writer::Slot<MachOSection::Header> headers = | 588 Writer::Slot<MachOSection::Header> headers = |
589 w->CreateSlotsHere<MachOSection::Header>(sections_.length()); | 589 w->CreateSlotsHere<MachOSection::Header>(sections_.length()); |
590 cmd->fileoff = w->position(); | 590 cmd->fileoff = w->position(); |
591 header->sizeofcmds = w->position() - load_command_start; | 591 header->sizeofcmds = static_cast<uint32_t>(w->position() - |
| 592 load_command_start); |
592 for (int section = 0; section < sections_.length(); ++section) { | 593 for (int section = 0; section < sections_.length(); ++section) { |
593 sections_[section]->PopulateHeader(headers.at(section)); | 594 sections_[section]->PopulateHeader(headers.at(section)); |
594 sections_[section]->WriteBody(headers.at(section), w); | 595 sections_[section]->WriteBody(headers.at(section), w); |
595 } | 596 } |
596 cmd->filesize = w->position() - (uintptr_t)cmd->fileoff; | 597 cmd->filesize = w->position() - (uintptr_t)cmd->fileoff; |
597 } | 598 } |
598 | 599 |
599 Zone* zone_; | 600 Zone* zone_; |
600 ZoneList<MachOSection*> sections_; | 601 ZoneList<MachOSection*> sections_; |
601 }; | 602 }; |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2160 LineInfo* line_info = reinterpret_cast<LineInfo*>(event->user_data); | 2161 LineInfo* line_info = reinterpret_cast<LineInfo*>(event->user_data); |
2161 PutLineInfo(reinterpret_cast<Address>(event->code_start), line_info); | 2162 PutLineInfo(reinterpret_cast<Address>(event->code_start), line_info); |
2162 break; | 2163 break; |
2163 } | 2164 } |
2164 } | 2165 } |
2165 } | 2166 } |
2166 #endif | 2167 #endif |
2167 } // namespace GDBJITInterface | 2168 } // namespace GDBJITInterface |
2168 } // namespace internal | 2169 } // namespace internal |
2169 } // namespace v8 | 2170 } // namespace v8 |
OLD | NEW |