diff options
Diffstat (limited to 'deps/v8/src/objects-debug.cc')
-rw-r--r-- | deps/v8/src/objects-debug.cc | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/deps/v8/src/objects-debug.cc b/deps/v8/src/objects-debug.cc index 815a5b53f8..3ce7672c1c 100644 --- a/deps/v8/src/objects-debug.cc +++ b/deps/v8/src/objects-debug.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/v8.h" +#include "src/objects.h" #include "src/bootstrapper.h" #include "src/disasm.h" @@ -22,6 +22,7 @@ void Object::ObjectVerify() { } else { HeapObject::cast(this)->HeapObjectVerify(); } + CHECK(!IsConstructor() || IsCallable()); } @@ -36,6 +37,8 @@ void Object::VerifyPointer(Object* p) { void Smi::SmiVerify() { CHECK(IsSmi()); + CHECK(!IsCallable()); + CHECK(!IsConstructor()); } @@ -143,6 +146,9 @@ void HeapObject::HeapObjectVerify() { case JS_MAP_ITERATOR_TYPE: JSMapIterator::cast(this)->JSMapIteratorVerify(); break; + case JS_ITERATOR_RESULT_TYPE: + JSIteratorResult::cast(this)->JSIteratorResultVerify(); + break; case JS_WEAK_MAP_TYPE: JSWeakMap::cast(this)->JSWeakMapVerify(); break; @@ -205,7 +211,6 @@ void Symbol::SymbolVerify() { CHECK(HasHashCode()); CHECK_GT(Hash(), 0u); CHECK(name()->IsUndefined() || name()->IsString()); - CHECK(flags()->IsSmi()); } @@ -225,6 +230,8 @@ void ByteArray::ByteArrayVerify() { void BytecodeArray::BytecodeArrayVerify() { // TODO(oth): Walk bytecodes and immediate values to validate sanity. CHECK(IsBytecodeArray()); + CHECK(constant_pool()->IsFixedArray()); + VerifyHeapPointer(constant_pool()); } @@ -337,7 +344,7 @@ void Map::DictionaryMapVerify() { CHECK(is_dictionary_map()); CHECK(instance_descriptors()->IsEmpty()); CHECK_EQ(0, unused_property_fields()); - CHECK_EQ(StaticVisitorBase::GetVisitorId(this), visitor_id()); + CHECK_EQ(Heap::GetStaticVisitorIdForMap(this), visitor_id()); } @@ -531,6 +538,7 @@ void JSFunction::JSFunctionVerify() { CHECK(next_function_link() == NULL || next_function_link()->IsUndefined() || next_function_link()->IsJSFunction()); + CHECK(map()->is_callable()); } @@ -737,6 +745,14 @@ void JSMapIterator::JSMapIteratorVerify() { } +void JSIteratorResult::JSIteratorResultVerify() { + CHECK(IsJSIteratorResult()); + JSObjectVerify(); + VerifyPointer(done()); + VerifyPointer(value()); +} + + void JSWeakMap::JSWeakMapVerify() { CHECK(IsJSWeakMap()); JSObjectVerify(); @@ -809,6 +825,7 @@ void JSFunctionProxy::JSFunctionProxyVerify() { JSProxyVerify(); VerifyPointer(call_trap()); VerifyPointer(construct_trap()); + CHECK(map()->is_callable()); } @@ -880,11 +897,18 @@ void PrototypeInfo::PrototypeInfoVerify() { void AccessorInfo::AccessorInfoVerify() { VerifyPointer(name()); - VerifyPointer(flag()); VerifyPointer(expected_receiver_type()); } +void SloppyBlockWithEvalContextExtension:: + SloppyBlockWithEvalContextExtensionVerify() { + CHECK(IsSloppyBlockWithEvalContextExtension()); + VerifyObjectField(kScopeInfoOffset); + VerifyObjectField(kExtensionOffset); +} + + void ExecutableAccessorInfo::ExecutableAccessorInfoVerify() { CHECK(IsExecutableAccessorInfo()); AccessorInfoVerify(); @@ -980,12 +1004,8 @@ void Script::ScriptVerify() { CHECK(IsScript()); VerifyPointer(source()); VerifyPointer(name()); - line_offset()->SmiVerify(); - column_offset()->SmiVerify(); VerifyPointer(wrapper()); - type()->SmiVerify(); VerifyPointer(line_ends()); - VerifyPointer(id()); } @@ -1014,9 +1034,6 @@ void DebugInfo::DebugInfoVerify() { void BreakPointInfo::BreakPointInfoVerify() { CHECK(IsBreakPointInfo()); - code_position()->SmiVerify(); - source_position()->SmiVerify(); - statement_position()->SmiVerify(); VerifyPointer(break_point_objects()); } #endif // VERIFY_HEAP @@ -1228,7 +1245,8 @@ bool CanLeak(Object* obj, Heap* heap, bool skip_weak_cell) { if (obj->IsMap()) { Map* map = Map::cast(obj); for (int i = 0; i < Heap::kStrongRootListLength; i++) { - if (map == heap->roots_array_start()[i]) return false; + Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i); + if (map == heap->root(root_index)) return false; } return true; } @@ -1295,7 +1313,7 @@ void Code::VerifyRecompiledCode(Code* old_code, Code* new_code) { // Check call target for equality unless it's an IC or an interrupt check. // In both cases they may be patched to be something else. if (!old_target->is_handler() && !old_target->is_inline_cache_stub() && - new_target == isolate->builtins()->builtin(Builtins::kInterruptCheck)) { + new_target != isolate->builtins()->builtin(Builtins::kInterruptCheck)) { CHECK_EQ(old_target, new_target); } old_it.next(); |