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

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

Issue 1150953002: Generalize HeapObject alignment requirements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments. Created 5 years, 7 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') | no next file » | 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/v8.h" 5 #include "src/v8.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 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 "NewLargeObject"); 1722 "NewLargeObject");
1723 sink_->PutInt(size >> kObjectAlignmentBits, "ObjectSizeInWords"); 1723 sink_->PutInt(size >> kObjectAlignmentBits, "ObjectSizeInWords");
1724 if (object_->IsCode()) { 1724 if (object_->IsCode()) {
1725 sink_->Put(EXECUTABLE, "executable large object"); 1725 sink_->Put(EXECUTABLE, "executable large object");
1726 } else { 1726 } else {
1727 sink_->Put(NOT_EXECUTABLE, "not executable large object"); 1727 sink_->Put(NOT_EXECUTABLE, "not executable large object");
1728 } 1728 }
1729 back_reference = serializer_->AllocateLargeObject(size); 1729 back_reference = serializer_->AllocateLargeObject(size);
1730 } else { 1730 } else {
1731 bool needs_double_align = false; 1731 bool needs_double_align = false;
1732 if (object_->NeedsToEnsureDoubleAlignment()) { 1732 // TODO(bbudge): Generalize to other alignment constraints.
1733 if (object_->RequiredAlignment() == kDoubleAligned) {
1733 // Add wriggle room for double alignment padding. 1734 // Add wriggle room for double alignment padding.
1734 back_reference = serializer_->Allocate(space, size + kPointerSize); 1735 back_reference = serializer_->Allocate(space, size + kPointerSize);
1735 needs_double_align = true; 1736 needs_double_align = true;
1736 } else { 1737 } else {
1737 back_reference = serializer_->Allocate(space, size); 1738 back_reference = serializer_->Allocate(space, size);
1738 } 1739 }
1739 sink_->Put(kNewObject + reference_representation_ + space, "NewObject"); 1740 sink_->Put(kNewObject + reference_representation_ + space, "NewObject");
1740 if (needs_double_align) 1741 if (needs_double_align)
1741 sink_->PutInt(kDoubleAlignmentSentinel, "DoubleAlignSentinel"); 1742 sink_->PutInt(kDoubleAlignmentSentinel, "DoubleAlignSentinel");
1742 int encoded_size = size >> kObjectAlignmentBits; 1743 int encoded_size = size >> kObjectAlignmentBits;
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 DisallowHeapAllocation no_gc; 2687 DisallowHeapAllocation no_gc;
2687 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2688 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2688 SanityCheckResult r = scd->SanityCheck(isolate, source); 2689 SanityCheckResult r = scd->SanityCheck(isolate, source);
2689 if (r == CHECK_SUCCESS) return scd; 2690 if (r == CHECK_SUCCESS) return scd;
2690 cached_data->Reject(); 2691 cached_data->Reject();
2691 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2692 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2692 delete scd; 2693 delete scd;
2693 return NULL; 2694 return NULL;
2694 } 2695 }
2695 } } // namespace v8::internal 2696 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698