OLD | NEW |
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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 293 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { |
294 if (descriptors->GetDetails(i).type() == DATA) { | 294 if (descriptors->GetDetails(i).type() == DATA) { |
295 Representation r = descriptors->GetDetails(i).representation(); | 295 Representation r = descriptors->GetDetails(i).representation(); |
296 FieldIndex index = FieldIndex::ForDescriptor(map(), i); | 296 FieldIndex index = FieldIndex::ForDescriptor(map(), i); |
297 if (IsUnboxedDoubleField(index)) { | 297 if (IsUnboxedDoubleField(index)) { |
298 DCHECK(r.IsDouble()); | 298 DCHECK(r.IsDouble()); |
299 continue; | 299 continue; |
300 } | 300 } |
301 Object* value = RawFastPropertyAt(index); | 301 Object* value = RawFastPropertyAt(index); |
302 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); | 302 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); |
303 if (value->IsUninitialized()) continue; | 303 if (value->IsUninitialized(isolate)) continue; |
304 if (r.IsSmi()) DCHECK(value->IsSmi()); | 304 if (r.IsSmi()) DCHECK(value->IsSmi()); |
305 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); | 305 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); |
306 FieldType* field_type = descriptors->GetFieldType(i); | 306 FieldType* field_type = descriptors->GetFieldType(i); |
307 bool type_is_none = field_type->IsNone(); | 307 bool type_is_none = field_type->IsNone(); |
308 bool type_is_any = field_type->IsAny(); | 308 bool type_is_any = field_type->IsAny(); |
309 if (r.IsNone()) { | 309 if (r.IsNone()) { |
310 CHECK(type_is_none); | 310 CHECK(type_is_none); |
311 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) { | 311 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) { |
312 // If allocation folding is off then GC could happen during inner | 312 // If allocation folding is off then GC could happen during inner |
313 // object literal creation and we will end up having and undefined | 313 // object literal creation and we will end up having and undefined |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 | 824 |
825 | 825 |
826 void JSProxy::JSProxyVerify() { | 826 void JSProxy::JSProxyVerify() { |
827 CHECK(IsJSProxy()); | 827 CHECK(IsJSProxy()); |
828 VerifyPointer(target()); | 828 VerifyPointer(target()); |
829 VerifyPointer(handler()); | 829 VerifyPointer(handler()); |
830 Isolate* isolate = GetIsolate(); | 830 Isolate* isolate = GetIsolate(); |
831 CHECK_EQ(target()->IsCallable(), map()->is_callable()); | 831 CHECK_EQ(target()->IsCallable(), map()->is_callable()); |
832 CHECK_EQ(target()->IsConstructor(), map()->is_constructor()); | 832 CHECK_EQ(target()->IsConstructor(), map()->is_constructor()); |
833 CHECK(hash()->IsSmi() || hash()->IsUndefined(isolate)); | 833 CHECK(hash()->IsSmi() || hash()->IsUndefined(isolate)); |
834 CHECK(map()->prototype()->IsNull()); | 834 CHECK(map()->prototype()->IsNull(isolate)); |
835 // There should be no properties on a Proxy. | 835 // There should be no properties on a Proxy. |
836 CHECK_EQ(0, map()->NumberOfOwnDescriptors()); | 836 CHECK_EQ(0, map()->NumberOfOwnDescriptors()); |
837 } | 837 } |
838 | 838 |
839 | 839 |
840 void JSArrayBuffer::JSArrayBufferVerify() { | 840 void JSArrayBuffer::JSArrayBufferVerify() { |
841 CHECK(IsJSArrayBuffer()); | 841 CHECK(IsJSArrayBuffer()); |
842 JSObjectVerify(); | 842 JSObjectVerify(); |
843 VerifyPointer(byte_length()); | 843 VerifyPointer(byte_length()); |
844 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() || | 844 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() || |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 | 1323 |
1324 // Both are done at the same time. | 1324 // Both are done at the same time. |
1325 CHECK_EQ(new_it.done(), old_it.done()); | 1325 CHECK_EQ(new_it.done(), old_it.done()); |
1326 } | 1326 } |
1327 | 1327 |
1328 | 1328 |
1329 #endif // DEBUG | 1329 #endif // DEBUG |
1330 | 1330 |
1331 } // namespace internal | 1331 } // namespace internal |
1332 } // namespace v8 | 1332 } // namespace v8 |
OLD | NEW |