Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: src/snapshot/serialize.cc

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips ports Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 reinterpret_cast<Address>(new_object)); \ 1007 reinterpret_cast<Address>(new_object)); \
1010 location_of_branch_data += Assembler::kSpecialTargetSize; \ 1008 location_of_branch_data += Assembler::kSpecialTargetSize; \
1011 current = reinterpret_cast<Object**>(location_of_branch_data); \ 1009 current = reinterpret_cast<Object**>(location_of_branch_data); \
1012 current_was_incremented = true; \ 1010 current_was_incremented = true; \
1013 } else { \ 1011 } else { \
1014 UnalignedCopy(current, &new_object); \ 1012 UnalignedCopy(current, &new_object); \
1015 } \ 1013 } \
1016 } \ 1014 } \
1017 if (emit_write_barrier && write_barrier_needed) { \ 1015 if (emit_write_barrier && write_barrier_needed) { \
1018 Address current_address = reinterpret_cast<Address>(current); \ 1016 Address current_address = reinterpret_cast<Address>(current); \
1017 SLOW_DCHECK(isolate->heap()->ContainsSlow(current_object_address)); \
1019 isolate->heap()->RecordWrite( \ 1018 isolate->heap()->RecordWrite( \
1020 current_object_address, \ 1019 HeapObject::FromAddress(current_object_address), \
1021 static_cast<int>(current_address - current_object_address)); \ 1020 static_cast<int>(current_address - current_object_address), \
1021 *reinterpret_cast<Object**>(current_address)); \
1022 } \ 1022 } \
1023 if (!current_was_incremented) { \ 1023 if (!current_was_incremented) { \
1024 current++; \ 1024 current++; \
1025 } \ 1025 } \
1026 break; \ 1026 break; \
1027 } 1027 }
1028 1028
1029 // This generates a case and a body for the new space (which has to do extra 1029 // This generates a case and a body for the new space (which has to do extra
1030 // write barrier handling) and handles the other spaces with fall-through cases 1030 // write barrier handling) and handles the other spaces with fall-through cases
1031 // and one body. 1031 // and one body.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 current = reinterpret_cast<Object**>( 1243 current = reinterpret_cast<Object**>(
1244 reinterpret_cast<Address>(current) + skip); 1244 reinterpret_cast<Address>(current) + skip);
1245 // Fall through. 1245 // Fall through.
1246 } 1246 }
1247 1247
1248 FOUR_CASES(kHotObject) 1248 FOUR_CASES(kHotObject)
1249 FOUR_CASES(kHotObject + 4) { 1249 FOUR_CASES(kHotObject + 4) {
1250 int index = data & kHotObjectMask; 1250 int index = data & kHotObjectMask;
1251 Object* hot_object = hot_objects_.Get(index); 1251 Object* hot_object = hot_objects_.Get(index);
1252 UnalignedCopy(current, &hot_object); 1252 UnalignedCopy(current, &hot_object);
1253 if (write_barrier_needed && isolate->heap()->InNewSpace(hot_object)) { 1253 if (write_barrier_needed) {
1254 Address current_address = reinterpret_cast<Address>(current); 1254 Address current_address = reinterpret_cast<Address>(current);
1255 SLOW_DCHECK(isolate->heap()->ContainsSlow(current_object_address));
1255 isolate->heap()->RecordWrite( 1256 isolate->heap()->RecordWrite(
1256 current_object_address, 1257 HeapObject::FromAddress(current_object_address),
1257 static_cast<int>(current_address - current_object_address)); 1258 static_cast<int>(current_address - current_object_address),
1259 hot_object);
1258 } 1260 }
1259 current++; 1261 current++;
1260 break; 1262 break;
1261 } 1263 }
1262 1264
1263 // Deserialize raw data of fixed length from 1 to 32 words. 1265 // Deserialize raw data of fixed length from 1 to 32 words.
1264 STATIC_ASSERT(kNumberOfFixedRawData == 32); 1266 STATIC_ASSERT(kNumberOfFixedRawData == 32);
1265 SIXTEEN_CASES(kFixedRawData) 1267 SIXTEEN_CASES(kFixedRawData)
1266 SIXTEEN_CASES(kFixedRawData + 16) { 1268 SIXTEEN_CASES(kFixedRawData + 16) {
1267 byte* raw_data_out = reinterpret_cast<byte*>(current); 1269 byte* raw_data_out = reinterpret_cast<byte*>(current);
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
2854 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2856 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2855 SanityCheckResult r = scd->SanityCheck(isolate, source); 2857 SanityCheckResult r = scd->SanityCheck(isolate, source);
2856 if (r == CHECK_SUCCESS) return scd; 2858 if (r == CHECK_SUCCESS) return scd;
2857 cached_data->Reject(); 2859 cached_data->Reject();
2858 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2860 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2859 delete scd; 2861 delete scd;
2860 return NULL; 2862 return NULL;
2861 } 2863 }
2862 } // namespace internal 2864 } // namespace internal
2863 } // namespace v8 2865 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698