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

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

Issue 251293002: WeakHashTable::Lookup() handlified and ObjectHashTable's interface cleaned up. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('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 "v8.h" 5 #include "v8.h"
6 6
7 #include "disassembler.h" 7 #include "disassembler.h"
8 #include "disasm.h" 8 #include "disasm.h"
9 #include "jsregexp.h" 9 #include "jsregexp.h"
10 #include "macro-assembler.h" 10 #include "macro-assembler.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { 648 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) {
649 CHECK(it.rinfo()->pc() != last_gc_pc); 649 CHECK(it.rinfo()->pc() != last_gc_pc);
650 last_gc_pc = it.rinfo()->pc(); 650 last_gc_pc = it.rinfo()->pc();
651 } 651 }
652 } 652 }
653 } 653 }
654 654
655 655
656 void Code::VerifyEmbeddedObjectsDependency() { 656 void Code::VerifyEmbeddedObjectsDependency() {
657 if (!CanContainWeakObjects()) return; 657 if (!CanContainWeakObjects()) return;
658 DisallowHeapAllocation no_gc;
659 Isolate* isolate = GetIsolate();
660 HandleScope scope(isolate);
658 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); 661 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
659 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { 662 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
660 Object* obj = it.rinfo()->target_object(); 663 Object* obj = it.rinfo()->target_object();
661 if (IsWeakObject(obj)) { 664 if (IsWeakObject(obj)) {
662 if (obj->IsMap()) { 665 if (obj->IsMap()) {
663 Map* map = Map::cast(obj); 666 Map* map = Map::cast(obj);
664 DependentCode::DependencyGroup group = is_optimized_code() ? 667 DependentCode::DependencyGroup group = is_optimized_code() ?
665 DependentCode::kWeakCodeGroup : DependentCode::kWeakICGroup; 668 DependentCode::kWeakCodeGroup : DependentCode::kWeakICGroup;
666 CHECK(map->dependent_code()->Contains(group, this)); 669 CHECK(map->dependent_code()->Contains(group, this));
667 } else if (obj->IsJSObject()) { 670 } else if (obj->IsJSObject()) {
668 Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table(); 671 Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table();
669 WeakHashTable* table = WeakHashTable::cast(raw_table); 672 WeakHashTable* table = WeakHashTable::cast(raw_table);
670 CHECK(DependentCode::cast(table->Lookup(obj))->Contains( 673 Handle<Object> key_obj(obj, isolate);
674 CHECK(DependentCode::cast(table->Lookup(key_obj))->Contains(
671 DependentCode::kWeakCodeGroup, this)); 675 DependentCode::kWeakCodeGroup, this));
672 } 676 }
673 } 677 }
674 } 678 }
675 } 679 }
676 680
677 681
678 void JSArray::JSArrayVerify() { 682 void JSArray::JSArrayVerify() {
679 JSObjectVerify(); 683 JSObjectVerify();
680 CHECK(length()->IsNumber() || length()->IsUndefined()); 684 CHECK(length()->IsNumber() || length()->IsUndefined());
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 for (int i = 0; i < number_of_transitions(); ++i) { 1210 for (int i = 0; i < number_of_transitions(); ++i) {
1207 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1211 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1208 } 1212 }
1209 return true; 1213 return true;
1210 } 1214 }
1211 1215
1212 1216
1213 #endif // DEBUG 1217 #endif // DEBUG
1214 1218
1215 } } // namespace v8::internal 1219 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698