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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1353363002: Share literals arrays per <NativeContext, SharedFunctionInfo> pair. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 5 years, 3 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/factory.cc ('k') | src/objects.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/heap/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 // Process context-dependent entries in the optimized code map. 1006 // Process context-dependent entries in the optimized code map.
1007 FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); 1007 FixedArray* code_map = FixedArray::cast(holder->optimized_code_map());
1008 int new_length = SharedFunctionInfo::kEntriesStart; 1008 int new_length = SharedFunctionInfo::kEntriesStart;
1009 int old_length = code_map->length(); 1009 int old_length = code_map->length();
1010 for (int i = SharedFunctionInfo::kEntriesStart; i < old_length; 1010 for (int i = SharedFunctionInfo::kEntriesStart; i < old_length;
1011 i += SharedFunctionInfo::kEntryLength) { 1011 i += SharedFunctionInfo::kEntryLength) {
1012 // Each entry contains [ context, code, literals, ast-id ] as fields. 1012 // Each entry contains [ context, code, literals, ast-id ] as fields.
1013 STATIC_ASSERT(SharedFunctionInfo::kEntryLength == 4); 1013 STATIC_ASSERT(SharedFunctionInfo::kEntryLength == 4);
1014 Context* context = 1014 Context* context =
1015 Context::cast(code_map->get(i + SharedFunctionInfo::kContextOffset)); 1015 Context::cast(code_map->get(i + SharedFunctionInfo::kContextOffset));
1016 Code* code = 1016 HeapObject* code = HeapObject::cast(
1017 Code::cast(code_map->get(i + SharedFunctionInfo::kCachedCodeOffset)); 1017 code_map->get(i + SharedFunctionInfo::kCachedCodeOffset));
1018 FixedArray* literals = FixedArray::cast( 1018 FixedArray* literals = FixedArray::cast(
1019 code_map->get(i + SharedFunctionInfo::kLiteralsOffset)); 1019 code_map->get(i + SharedFunctionInfo::kLiteralsOffset));
1020 Smi* ast_id = 1020 Smi* ast_id =
1021 Smi::cast(code_map->get(i + SharedFunctionInfo::kOsrAstIdOffset)); 1021 Smi::cast(code_map->get(i + SharedFunctionInfo::kOsrAstIdOffset));
1022 if (Marking::IsWhite(Marking::MarkBitFrom(context))) continue; 1022 if (Marking::IsWhite(Marking::MarkBitFrom(context))) continue;
1023 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(context))); 1023 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(context)));
1024 if (Marking::IsWhite(Marking::MarkBitFrom(code))) continue; 1024 if (Marking::IsWhite(Marking::MarkBitFrom(code))) continue;
1025 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(code))); 1025 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(code)));
1026 if (Marking::IsWhite(Marking::MarkBitFrom(literals))) continue; 1026 if (Marking::IsWhite(Marking::MarkBitFrom(literals))) continue;
1027 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(literals))); 1027 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(literals)));
(...skipping 3556 matching lines...) Expand 10 before | Expand all | Expand 10 after
4584 MarkBit mark_bit = Marking::MarkBitFrom(host); 4584 MarkBit mark_bit = Marking::MarkBitFrom(host);
4585 if (Marking::IsBlack(mark_bit)) { 4585 if (Marking::IsBlack(mark_bit)) {
4586 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); 4586 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
4587 RecordRelocSlot(&rinfo, target); 4587 RecordRelocSlot(&rinfo, target);
4588 } 4588 }
4589 } 4589 }
4590 } 4590 }
4591 4591
4592 } // namespace internal 4592 } // namespace internal
4593 } // namespace v8 4593 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698