Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/snapshot/serialize.h" | 5 #include "src/snapshot/serialize.h" | 
| 6 | 6 | 
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" | 
| 8 #include "src/api.h" | 8 #include "src/api.h" | 
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" | 
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) { | 47 ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) { | 
| 48 // Miscellaneous | 48 // Miscellaneous | 
| 49 Add(ExternalReference::roots_array_start(isolate).address(), | 49 Add(ExternalReference::roots_array_start(isolate).address(), | 
| 50 "Heap::roots_array_start()"); | 50 "Heap::roots_array_start()"); | 
| 51 Add(ExternalReference::address_of_stack_limit(isolate).address(), | 51 Add(ExternalReference::address_of_stack_limit(isolate).address(), | 
| 52 "StackGuard::address_of_jslimit()"); | 52 "StackGuard::address_of_jslimit()"); | 
| 53 Add(ExternalReference::address_of_real_stack_limit(isolate).address(), | 53 Add(ExternalReference::address_of_real_stack_limit(isolate).address(), | 
| 54 "StackGuard::address_of_real_jslimit()"); | 54 "StackGuard::address_of_real_jslimit()"); | 
| 55 Add(ExternalReference::new_space_start(isolate).address(), | 55 Add(ExternalReference::new_space_start(isolate).address(), | 
| 56 "Heap::NewSpaceStart()"); | 56 "Heap::NewSpaceStart()"); | 
| 57 Add(ExternalReference::new_space_mask(isolate).address(), | |
| 58 "Heap::NewSpaceMask()"); | |
| 59 Add(ExternalReference::new_space_allocation_limit_address(isolate).address(), | 57 Add(ExternalReference::new_space_allocation_limit_address(isolate).address(), | 
| 60 "Heap::NewSpaceAllocationLimitAddress()"); | 58 "Heap::NewSpaceAllocationLimitAddress()"); | 
| 61 Add(ExternalReference::new_space_allocation_top_address(isolate).address(), | 59 Add(ExternalReference::new_space_allocation_top_address(isolate).address(), | 
| 62 "Heap::NewSpaceAllocationTopAddress()"); | 60 "Heap::NewSpaceAllocationTopAddress()"); | 
| 63 Add(ExternalReference::mod_two_doubles_operation(isolate).address(), | 61 Add(ExternalReference::mod_two_doubles_operation(isolate).address(), | 
| 64 "mod_two_doubles"); | 62 "mod_two_doubles"); | 
| 65 // Keyed lookup cache. | 63 // Keyed lookup cache. | 
| 66 Add(ExternalReference::keyed_lookup_cache_keys(isolate).address(), | 64 Add(ExternalReference::keyed_lookup_cache_keys(isolate).address(), | 
| 67 "KeyedLookupCache::keys()"); | 65 "KeyedLookupCache::keys()"); | 
| 68 Add(ExternalReference::keyed_lookup_cache_field_offsets(isolate).address(), | 66 Add(ExternalReference::keyed_lookup_cache_field_offsets(isolate).address(), | 
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1007 reinterpret_cast<Address>(new_object)); \ | 1005 reinterpret_cast<Address>(new_object)); \ | 
| 1008 location_of_branch_data += Assembler::kSpecialTargetSize; \ | 1006 location_of_branch_data += Assembler::kSpecialTargetSize; \ | 
| 1009 current = reinterpret_cast<Object**>(location_of_branch_data); \ | 1007 current = reinterpret_cast<Object**>(location_of_branch_data); \ | 
| 1010 current_was_incremented = true; \ | 1008 current_was_incremented = true; \ | 
| 1011 } else { \ | 1009 } else { \ | 
| 1012 UnalignedCopy(current, &new_object); \ | 1010 UnalignedCopy(current, &new_object); \ | 
| 1013 } \ | 1011 } \ | 
| 1014 } \ | 1012 } \ | 
| 1015 if (emit_write_barrier && write_barrier_needed) { \ | 1013 if (emit_write_barrier && write_barrier_needed) { \ | 
| 1016 Address current_address = reinterpret_cast<Address>(current); \ | 1014 Address current_address = reinterpret_cast<Address>(current); \ | 
| 1017 isolate->heap()->RecordWrite( \ | 1015 isolate->heap()->RecordWriteSlow( \ | 
| 
 
Michael Lippautz
2016/02/05 12:44:40
I tried switching this to the fast check, which as
 
Yang
2016/02/05 12:54:05
Yes I think this is the case. The deserializer is
 
Michael Lippautz
2016/02/08 18:00:38
Actually, we are in a path where we can cast to Ob
 
 | |
| 1018 current_object_address, \ | 1016 current_object_address, \ | 
| 1019 static_cast<int>(current_address - current_object_address)); \ | 1017 static_cast<int>(current_address - current_object_address)); \ | 
| 1020 } \ | 1018 } \ | 
| 1021 if (!current_was_incremented) { \ | 1019 if (!current_was_incremented) { \ | 
| 1022 current++; \ | 1020 current++; \ | 
| 1023 } \ | 1021 } \ | 
| 1024 break; \ | 1022 break; \ | 
| 1025 } | 1023 } | 
| 1026 | 1024 | 
| 1027 // This generates a case and a body for the new space (which has to do extra | 1025 // This generates a case and a body for the new space (which has to do extra | 
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1243 // Fall through. | 1241 // Fall through. | 
| 1244 } | 1242 } | 
| 1245 | 1243 | 
| 1246 FOUR_CASES(kHotObject) | 1244 FOUR_CASES(kHotObject) | 
| 1247 FOUR_CASES(kHotObject + 4) { | 1245 FOUR_CASES(kHotObject + 4) { | 
| 1248 int index = data & kHotObjectMask; | 1246 int index = data & kHotObjectMask; | 
| 1249 Object* hot_object = hot_objects_.Get(index); | 1247 Object* hot_object = hot_objects_.Get(index); | 
| 1250 UnalignedCopy(current, &hot_object); | 1248 UnalignedCopy(current, &hot_object); | 
| 1251 if (write_barrier_needed && isolate->heap()->InNewSpace(hot_object)) { | 1249 if (write_barrier_needed && isolate->heap()->InNewSpace(hot_object)) { | 
| 1252 Address current_address = reinterpret_cast<Address>(current); | 1250 Address current_address = reinterpret_cast<Address>(current); | 
| 1253 isolate->heap()->RecordWrite( | 1251 isolate->heap()->RecordWriteSlow( | 
| 1254 current_object_address, | 1252 current_object_address, | 
| 1255 static_cast<int>(current_address - current_object_address)); | 1253 static_cast<int>(current_address - current_object_address)); | 
| 1256 } | 1254 } | 
| 1257 current++; | 1255 current++; | 
| 1258 break; | 1256 break; | 
| 1259 } | 1257 } | 
| 1260 | 1258 | 
| 1261 // Deserialize raw data of fixed length from 1 to 32 words. | 1259 // Deserialize raw data of fixed length from 1 to 32 words. | 
| 1262 STATIC_ASSERT(kNumberOfFixedRawData == 32); | 1260 STATIC_ASSERT(kNumberOfFixedRawData == 32); | 
| 1263 SIXTEEN_CASES(kFixedRawData) | 1261 SIXTEEN_CASES(kFixedRawData) | 
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2847 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 2845 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 
| 2848 SanityCheckResult r = scd->SanityCheck(isolate, source); | 2846 SanityCheckResult r = scd->SanityCheck(isolate, source); | 
| 2849 if (r == CHECK_SUCCESS) return scd; | 2847 if (r == CHECK_SUCCESS) return scd; | 
| 2850 cached_data->Reject(); | 2848 cached_data->Reject(); | 
| 2851 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 2849 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 
| 2852 delete scd; | 2850 delete scd; | 
| 2853 return NULL; | 2851 return NULL; | 
| 2854 } | 2852 } | 
| 2855 } // namespace internal | 2853 } // namespace internal | 
| 2856 } // namespace v8 | 2854 } // namespace v8 | 
| OLD | NEW |