Chromium Code Reviews| 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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 845 private: | 845 private: |
| 846 const char* name; | 846 const char* name; |
| 847 uintptr_t value; | 847 uintptr_t value; |
| 848 uintptr_t size; | 848 uintptr_t size; |
| 849 uint8_t info; | 849 uint8_t info; |
| 850 uint8_t other; | 850 uint8_t other; |
| 851 uint16_t section; | 851 uint16_t section; |
| 852 }; | 852 }; |
| 853 | 853 |
| 854 | 854 |
| 855 class ELFSymbolTable : public ELFSection { | 855 class ELFStringTable : public ELFSection { |
|
Yang
2013/02/11 12:26:36
I was thinking that this use of "symbol" has nothi
rossberg
2013/02/11 13:30:16
Indeed, reverted.
| |
| 856 public: | 856 public: |
| 857 ELFSymbolTable(const char* name, Zone* zone) | 857 ELFStringTable(const char* name, Zone* zone) |
| 858 : ELFSection(name, TYPE_SYMTAB, sizeof(uintptr_t)), | 858 : ELFSection(name, TYPE_SYMTAB, sizeof(uintptr_t)), |
| 859 locals_(1, zone), | 859 locals_(1, zone), |
| 860 globals_(1, zone) { | 860 globals_(1, zone) { |
| 861 } | 861 } |
| 862 | 862 |
| 863 virtual void WriteBody(Writer::Slot<Header> header, Writer* w) { | 863 virtual void WriteBody(Writer::Slot<Header> header, Writer* w) { |
| 864 w->Align(header->alignment); | 864 w->Align(header->alignment); |
| 865 int total_symbols = locals_.length() + globals_.length() + 1; | 865 int total_symbols = locals_.length() + globals_.length() + 1; |
| 866 header->offset = w->position(); | 866 header->offset = w->position(); |
| 867 | 867 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1015 #ifdef V8_TARGET_ARCH_X64 | 1015 #ifdef V8_TARGET_ARCH_X64 |
| 1016 uintptr_t stack_state_start_addresses_[STACK_STATE_MAX]; | 1016 uintptr_t stack_state_start_addresses_[STACK_STATE_MAX]; |
| 1017 #endif | 1017 #endif |
| 1018 }; | 1018 }; |
| 1019 | 1019 |
| 1020 #if defined(__ELF) | 1020 #if defined(__ELF) |
| 1021 static void CreateSymbolsTable(CodeDescription* desc, | 1021 static void CreateSymbolsTable(CodeDescription* desc, |
| 1022 ELF* elf, | 1022 ELF* elf, |
| 1023 int text_section_index) { | 1023 int text_section_index) { |
| 1024 Zone* zone = desc->info()->zone(); | 1024 Zone* zone = desc->info()->zone(); |
| 1025 ELFSymbolTable* symtab = new(zone) ELFSymbolTable(".symtab", zone); | 1025 ELFStringTable* symtab = new(zone) ELFStringTable(".symtab", zone); |
| 1026 StringTable* strtab = new(zone) StringTable(".strtab"); | 1026 StringTable* strtab = new(zone) StringTable(".strtab"); |
| 1027 | 1027 |
| 1028 // Symbol table should be followed by the linked string table. | 1028 // Symbol table should be followed by the linked string table. |
| 1029 elf->AddSection(symtab, zone); | 1029 elf->AddSection(symtab, zone); |
| 1030 elf->AddSection(strtab, zone); | 1030 elf->AddSection(strtab, zone); |
| 1031 | 1031 |
| 1032 symtab->Add(ELFSymbol("V8 Code", | 1032 symtab->Add(ELFSymbol("V8 Code", |
| 1033 0, | 1033 0, |
| 1034 0, | 1034 0, |
| 1035 ELFSymbol::BIND_LOCAL, | 1035 ELFSymbol::BIND_LOCAL, |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2164 ScopedLock lock(mutex.Pointer()); | 2164 ScopedLock lock(mutex.Pointer()); |
| 2165 ASSERT(!IsLineInfoTagged(line_info)); | 2165 ASSERT(!IsLineInfoTagged(line_info)); |
| 2166 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); | 2166 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
| 2167 ASSERT(e->value == NULL); | 2167 ASSERT(e->value == NULL); |
| 2168 e->value = TagLineInfo(line_info); | 2168 e->value = TagLineInfo(line_info); |
| 2169 } | 2169 } |
| 2170 | 2170 |
| 2171 | 2171 |
| 2172 } } // namespace v8::internal | 2172 } } // namespace v8::internal |
| 2173 #endif | 2173 #endif |
| OLD | NEW |