| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 shared_function_info_candidates_head_ = NULL; | 1063 shared_function_info_candidates_head_ = NULL; |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 | 1066 |
| 1067 void CodeFlusher::ProcessOptimizedCodeMaps() { | 1067 void CodeFlusher::ProcessOptimizedCodeMaps() { |
| 1068 static const int kEntriesStart = SharedFunctionInfo::kEntriesStart; | 1068 static const int kEntriesStart = SharedFunctionInfo::kEntriesStart; |
| 1069 static const int kEntryLength = SharedFunctionInfo::kEntryLength; | 1069 static const int kEntryLength = SharedFunctionInfo::kEntryLength; |
| 1070 static const int kContextOffset = 0; | 1070 static const int kContextOffset = 0; |
| 1071 static const int kCodeOffset = 1; | 1071 static const int kCodeOffset = 1; |
| 1072 static const int kLiteralsOffset = 2; | 1072 static const int kLiteralsOffset = 2; |
| 1073 STATIC_ASSERT(kEntryLength == 3); | 1073 static const int kOsrAstIdOffset = 3; |
| 1074 STATIC_ASSERT(kEntryLength == 4); |
| 1074 | 1075 |
| 1075 SharedFunctionInfo* holder = optimized_code_map_holder_head_; | 1076 SharedFunctionInfo* holder = optimized_code_map_holder_head_; |
| 1076 SharedFunctionInfo* next_holder; | 1077 SharedFunctionInfo* next_holder; |
| 1077 while (holder != NULL) { | 1078 while (holder != NULL) { |
| 1078 next_holder = GetNextCodeMap(holder); | 1079 next_holder = GetNextCodeMap(holder); |
| 1079 ClearNextCodeMap(holder); | 1080 ClearNextCodeMap(holder); |
| 1080 | 1081 |
| 1081 FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); | 1082 FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); |
| 1082 int new_length = kEntriesStart; | 1083 int new_length = kEntriesStart; |
| 1083 int old_length = code_map->length(); | 1084 int old_length = code_map->length(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1107 RecordSlot(code_slot, code_slot, *code_slot); | 1108 RecordSlot(code_slot, code_slot, *code_slot); |
| 1108 | 1109 |
| 1109 // Update and record the literals slot in the optimized code map. | 1110 // Update and record the literals slot in the optimized code map. |
| 1110 Object** literals_slot = HeapObject::RawField(code_map, | 1111 Object** literals_slot = HeapObject::RawField(code_map, |
| 1111 FixedArray::OffsetOfElementAt(new_length)); | 1112 FixedArray::OffsetOfElementAt(new_length)); |
| 1112 code_map->set(new_length++, code_map->get(i + kLiteralsOffset)); | 1113 code_map->set(new_length++, code_map->get(i + kLiteralsOffset)); |
| 1113 ASSERT(Marking::IsBlack( | 1114 ASSERT(Marking::IsBlack( |
| 1114 Marking::MarkBitFrom(HeapObject::cast(*literals_slot)))); | 1115 Marking::MarkBitFrom(HeapObject::cast(*literals_slot)))); |
| 1115 isolate_->heap()->mark_compact_collector()-> | 1116 isolate_->heap()->mark_compact_collector()-> |
| 1116 RecordSlot(literals_slot, literals_slot, *literals_slot); | 1117 RecordSlot(literals_slot, literals_slot, *literals_slot); |
| 1118 |
| 1119 // Update OSR AST id. No write barrier necessary for a smi. |
| 1120 ASSERT(code_map->get(i + kOsrAstIdOffset)->IsSmi()); |
| 1121 code_map->set(new_length++, code_map->get(i + kOsrAstIdOffset)); |
| 1117 } | 1122 } |
| 1118 | 1123 |
| 1119 // Trim the optimized code map if entries have been removed. | 1124 // Trim the optimized code map if entries have been removed. |
| 1120 if (new_length < old_length) { | 1125 if (new_length < old_length) { |
| 1121 holder->TrimOptimizedCodeMap(old_length - new_length); | 1126 holder->TrimOptimizedCodeMap(old_length - new_length); |
| 1122 } | 1127 } |
| 1123 | 1128 |
| 1124 holder = next_holder; | 1129 holder = next_holder; |
| 1125 } | 1130 } |
| 1126 | 1131 |
| (...skipping 3236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4363 while (buffer != NULL) { | 4368 while (buffer != NULL) { |
| 4364 SlotsBuffer* next_buffer = buffer->next(); | 4369 SlotsBuffer* next_buffer = buffer->next(); |
| 4365 DeallocateBuffer(buffer); | 4370 DeallocateBuffer(buffer); |
| 4366 buffer = next_buffer; | 4371 buffer = next_buffer; |
| 4367 } | 4372 } |
| 4368 *buffer_address = NULL; | 4373 *buffer_address = NULL; |
| 4369 } | 4374 } |
| 4370 | 4375 |
| 4371 | 4376 |
| 4372 } } // namespace v8::internal | 4377 } } // namespace v8::internal |
| OLD | NEW |