diff options
| author | Ben Murdoch <benm@google.com> | 2012-04-11 10:23:59 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2012-04-11 15:40:41 +0100 |
| commit | 5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b (patch) | |
| tree | 7b717e53b80c4a64bf9b723aabcf7c909ae3c243 /src/objects-debug.cc | |
| parent | c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9 (diff) | |
| download | android_external_v8-5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b.tar.gz android_external_v8-5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b.tar.bz2 android_external_v8-5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b.zip | |
Merge V8 3.9 at 3.9.24.9
http://v8.googlecode.com/svn/branches/3.9@11260
Bug: 5688872
Change-Id: Iddd944e82189d92df3fc427dc5f0d3f1b2f0c6c8
Diffstat (limited to 'src/objects-debug.cc')
| -rw-r--r-- | src/objects-debug.cc | 71 |
1 files changed, 68 insertions, 3 deletions
diff --git a/src/objects-debug.cc b/src/objects-debug.cc index 3a667a43..8eefb23d 100644 --- a/src/objects-debug.cc +++ b/src/objects-debug.cc @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -138,6 +138,9 @@ void HeapObject::HeapObjectVerify() { case JS_VALUE_TYPE: JSValue::cast(this)->JSValueVerify(); break; + case JS_DATE_TYPE: + JSDate::cast(this)->JSDateVerify(); + break; case JS_FUNCTION_TYPE: JSFunction::cast(this)->JSFunctionVerify(); break; @@ -280,7 +283,9 @@ void JSObject::JSObjectVerify() { (map()->inobject_properties() + properties()->length() - map()->NextFreePropertyIndex())); } - ASSERT_EQ((map()->has_fast_elements() || map()->has_fast_smi_only_elements()), + ASSERT_EQ((map()->has_fast_elements() || + map()->has_fast_smi_only_elements() || + (elements() == GetHeap()->empty_fixed_array())), (elements()->map() == GetHeap()->fixed_array_map() || elements()->map() == GetHeap()->fixed_cow_array_map())); ASSERT(map()->has_fast_elements() == HasFastElements()); @@ -324,6 +329,18 @@ void PolymorphicCodeCache::PolymorphicCodeCacheVerify() { } +void TypeFeedbackInfo::TypeFeedbackInfoVerify() { + VerifyObjectField(kIcTotalCountOffset); + VerifyObjectField(kIcWithTypeinfoCountOffset); + VerifyHeapPointer(type_feedback_cells()); +} + + +void AliasedArgumentsEntry::AliasedArgumentsEntryVerify() { + VerifySmiField(kAliasedContextSlot); +} + + void FixedArray::FixedArrayVerify() { for (int i = 0; i < length(); i++) { Object* e = get(i); @@ -357,6 +374,53 @@ void JSValue::JSValueVerify() { } +void JSDate::JSDateVerify() { + if (value()->IsHeapObject()) { + VerifyHeapPointer(value()); + } + CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber()); + CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN()); + CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN()); + CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN()); + CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN()); + CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN()); + CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN()); + CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN()); + CHECK(cache_stamp()->IsUndefined() || + cache_stamp()->IsSmi() || + cache_stamp()->IsNaN()); + + if (month()->IsSmi()) { + int month = Smi::cast(this->month())->value(); + CHECK(0 <= month && month <= 11); + } + if (day()->IsSmi()) { + int day = Smi::cast(this->day())->value(); + CHECK(1 <= day && day <= 31); + } + if (hour()->IsSmi()) { + int hour = Smi::cast(this->hour())->value(); + CHECK(0 <= hour && hour <= 23); + } + if (min()->IsSmi()) { + int min = Smi::cast(this->min())->value(); + CHECK(0 <= min && min <= 59); + } + if (sec()->IsSmi()) { + int sec = Smi::cast(this->sec())->value(); + CHECK(0 <= sec && sec <= 59); + } + if (weekday()->IsSmi()) { + int weekday = Smi::cast(this->weekday())->value(); + CHECK(0 <= weekday && weekday <= 6); + } + if (cache_stamp()->IsSmi()) { + CHECK(Smi::cast(cache_stamp())->value() <= + Smi::cast(Isolate::Current()->date_cache()->stamp())->value()); + } +} + + void JSMessageObject::JSMessageObjectVerify() { CHECK(IsJSMessageObject()); CHECK(type()->IsString()); @@ -468,8 +532,9 @@ void Oddball::OddballVerify() { } else { ASSERT(number->IsSmi()); int value = Smi::cast(number)->value(); - ASSERT(value <= 1); // Hidden oddballs have negative smis. + const int kLeastHiddenOddballNumber = -4; + ASSERT(value <= 1); ASSERT(value >= kLeastHiddenOddballNumber); } } |
