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 8935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8946 if (Marking::IsBlack(Marking::MarkBitFrom(start_of_string))) { | 8946 if (Marking::IsBlack(Marking::MarkBitFrom(start_of_string))) { |
8947 MemoryChunk::IncrementLiveBytesFromMutator(start_of_string, -delta); | 8947 MemoryChunk::IncrementLiveBytesFromMutator(start_of_string, -delta); |
8948 } | 8948 } |
8949 | 8949 |
8950 | 8950 |
8951 if (new_length == 0) return heap->isolate()->factory()->empty_string(); | 8951 if (new_length == 0) return heap->isolate()->factory()->empty_string(); |
8952 return string; | 8952 return string; |
8953 } | 8953 } |
8954 | 8954 |
8955 | 8955 |
| 8956 AllocationSite* AllocationSite::GetLastNestedSite() { |
| 8957 AllocationSite* current_site = this; |
| 8958 while (current_site->nested_sites() != Smi::FromInt(0)) { |
| 8959 current_site = AllocationSite::cast(current_site->nested_sites()); |
| 8960 } |
| 8961 return current_site == this ? NULL : current_site; |
| 8962 } |
| 8963 |
| 8964 |
| 8965 void AllocationSite::AppendNestedSite(AllocationSite* nested_site) { |
| 8966 AllocationSite* last_nested_site = GetLastNestedSite(); |
| 8967 AllocationSite* append_to = last_nested_site == NULL |
| 8968 ? this |
| 8969 : last_nested_site; |
| 8970 append_to->set_nested_sites(nested_site); |
| 8971 } |
| 8972 |
| 8973 |
8956 AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object) { | 8974 AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object) { |
8957 // Currently, AllocationMemento objects are only allocated immediately | 8975 // Currently, AllocationMemento objects are only allocated immediately |
8958 // after JSArrays in NewSpace, and detecting whether a JSArray has one | 8976 // after JSArrays in NewSpace, and detecting whether a JSArray has one |
8959 // involves carefully checking the object immediately after the JSArray | 8977 // involves carefully checking the object immediately after the JSArray |
8960 // (if there is one) to see if it's an AllocationMemento. | 8978 // (if there is one) to see if it's an AllocationMemento. |
8961 if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) { | 8979 if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) { |
8962 ASSERT(object->GetHeap()->InToSpace(object)); | 8980 ASSERT(object->GetHeap()->InToSpace(object)); |
8963 Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) + | 8981 Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) + |
8964 object->Size(); | 8982 object->Size(); |
8965 if ((ptr_end + AllocationMemento::kSize) <= | 8983 if ((ptr_end + AllocationMemento::kSize) <= |
(...skipping 7121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16087 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16105 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16088 static const char* error_messages_[] = { | 16106 static const char* error_messages_[] = { |
16089 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16107 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16090 }; | 16108 }; |
16091 #undef ERROR_MESSAGES_TEXTS | 16109 #undef ERROR_MESSAGES_TEXTS |
16092 return error_messages_[reason]; | 16110 return error_messages_[reason]; |
16093 } | 16111 } |
16094 | 16112 |
16095 | 16113 |
16096 } } // namespace v8::internal | 16114 } } // namespace v8::internal |
OLD | NEW |