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 9006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9017 object->Size(); | 9017 object->Size(); |
9018 if ((ptr_end + AllocationMemento::kSize) <= | 9018 if ((ptr_end + AllocationMemento::kSize) <= |
9019 object->GetHeap()->NewSpaceTop()) { | 9019 object->GetHeap()->NewSpaceTop()) { |
9020 // There is room in newspace for allocation info. Do we have some? | 9020 // There is room in newspace for allocation info. Do we have some? |
9021 Map** possible_allocation_memento_map = | 9021 Map** possible_allocation_memento_map = |
9022 reinterpret_cast<Map**>(ptr_end); | 9022 reinterpret_cast<Map**>(ptr_end); |
9023 if (*possible_allocation_memento_map == | 9023 if (*possible_allocation_memento_map == |
9024 object->GetHeap()->allocation_memento_map()) { | 9024 object->GetHeap()->allocation_memento_map()) { |
9025 AllocationMemento* memento = AllocationMemento::cast( | 9025 AllocationMemento* memento = AllocationMemento::cast( |
9026 reinterpret_cast<Object*>(ptr_end + kHeapObjectTag)); | 9026 reinterpret_cast<Object*>(ptr_end + kHeapObjectTag)); |
9027 | 9027 return memento; |
9028 // TODO(mvstanton): because of chromium bug 284577, put extra care | |
9029 // into validating that the memento points to a valid AllocationSite. | |
9030 // This check is expensive so remove it asap. Also, this check | |
9031 // HIDES bug 284577, so it must be disabled to debug/diagnose. | |
9032 Object* site = memento->allocation_site(); | |
9033 Heap* heap = object->GetHeap(); | |
9034 if (heap->InOldPointerSpace(site) && | |
9035 site->IsHeapObject() && | |
9036 HeapObject::cast(site)->map() == heap->allocation_site_map()) { | |
9037 return memento; | |
9038 } | |
9039 } | 9028 } |
9040 } | 9029 } |
9041 } | 9030 } |
9042 return NULL; | 9031 return NULL; |
9043 } | 9032 } |
9044 | 9033 |
9045 | 9034 |
9046 uint32_t StringHasher::MakeArrayIndexHash(uint32_t value, int length) { | 9035 uint32_t StringHasher::MakeArrayIndexHash(uint32_t value, int length) { |
9047 // For array indexes mix the length into the hash as an array index could | 9036 // For array indexes mix the length into the hash as an array index could |
9048 // be zero. | 9037 // be zero. |
(...skipping 7100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16149 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16138 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16150 static const char* error_messages_[] = { | 16139 static const char* error_messages_[] = { |
16151 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16140 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16152 }; | 16141 }; |
16153 #undef ERROR_MESSAGES_TEXTS | 16142 #undef ERROR_MESSAGES_TEXTS |
16154 return error_messages_[reason]; | 16143 return error_messages_[reason]; |
16155 } | 16144 } |
16156 | 16145 |
16157 | 16146 |
16158 } } // namespace v8::internal | 16147 } } // namespace v8::internal |
OLD | NEW |