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

Side by Side Diff: src/objects-debug.cc

Issue 12094036: Fix clearing of dead dependent codes and verify weak embedded maps on full GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/objects-visiting-inl.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 // 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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "v8.h" 28 #include "v8.h"
29 29
30 #include "disassembler.h" 30 #include "disassembler.h"
31 #include "disasm.h" 31 #include "disasm.h"
32 #include "jsregexp.h" 32 #include "jsregexp.h"
33 #include "macro-assembler.h"
33 #include "objects-visiting.h" 34 #include "objects-visiting.h"
34 35
35 namespace v8 { 36 namespace v8 {
36 namespace internal { 37 namespace internal {
37 38
38 #ifdef VERIFY_HEAP 39 #ifdef VERIFY_HEAP
39 40
40 void MaybeObject::Verify() { 41 void MaybeObject::Verify() {
41 Object* this_as_object; 42 Object* this_as_object;
42 if (ToObject(&this_as_object)) { 43 if (ToObject(&this_as_object)) {
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 it.rinfo()->Verify(); 589 it.rinfo()->Verify();
589 // Ensure that GC will not iterate twice over the same pointer. 590 // Ensure that GC will not iterate twice over the same pointer.
590 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { 591 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) {
591 CHECK(it.rinfo()->pc() != last_gc_pc); 592 CHECK(it.rinfo()->pc() != last_gc_pc);
592 last_gc_pc = it.rinfo()->pc(); 593 last_gc_pc = it.rinfo()->pc();
593 } 594 }
594 } 595 }
595 } 596 }
596 597
597 598
599 void Code::VerifyEmbeddedMapsDependency() {
600 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
601 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
602 RelocInfo::Mode mode = it.rinfo()->rmode();
603 if (mode == RelocInfo::EMBEDDED_OBJECT &&
604 it.rinfo()->target_object()->IsMap()) {
605 Map* map = Map::cast(it.rinfo()->target_object());
606 if (map->CanTransition()) {
607 CHECK(map->dependent_codes()->Contains(this));
608 }
609 }
610 }
611 }
612
613
598 void JSArray::JSArrayVerify() { 614 void JSArray::JSArrayVerify() {
599 JSObjectVerify(); 615 JSObjectVerify();
600 CHECK(length()->IsNumber() || length()->IsUndefined()); 616 CHECK(length()->IsNumber() || length()->IsUndefined());
601 CHECK(elements()->IsUndefined() || 617 CHECK(elements()->IsUndefined() ||
602 elements()->IsFixedArray() || 618 elements()->IsFixedArray() ||
603 elements()->IsFixedDoubleArray()); 619 elements()->IsFixedDoubleArray());
604 } 620 }
605 621
606 622
607 void JSSet::JSSetVerify() { 623 void JSSet::JSSetVerify() {
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 for (int i = 0; i < number_of_transitions(); ++i) { 1030 for (int i = 0; i < number_of_transitions(); ++i) {
1015 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1031 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1016 } 1032 }
1017 return true; 1033 return true;
1018 } 1034 }
1019 1035
1020 1036
1021 #endif // DEBUG 1037 #endif // DEBUG
1022 1038
1023 } } // namespace v8::internal 1039 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698