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/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 if (p->IsHeapObject()) { | 29 if (p->IsHeapObject()) { |
30 HeapObject::VerifyHeapPointer(p); | 30 HeapObject::VerifyHeapPointer(p); |
31 } else { | 31 } else { |
32 CHECK(p->IsSmi()); | 32 CHECK(p->IsSmi()); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 void Smi::SmiVerify() { | 37 void Smi::SmiVerify() { |
38 CHECK(IsSmi()); | 38 CHECK(IsSmi()); |
| 39 CHECK(!IsCallable()); |
39 } | 40 } |
40 | 41 |
41 | 42 |
42 void HeapObject::HeapObjectVerify() { | 43 void HeapObject::HeapObjectVerify() { |
43 InstanceType instance_type = map()->instance_type(); | 44 InstanceType instance_type = map()->instance_type(); |
44 | 45 |
45 if (instance_type < FIRST_NONSTRING_TYPE) { | 46 if (instance_type < FIRST_NONSTRING_TYPE) { |
46 String::cast(this)->StringVerify(); | 47 String::cast(this)->StringVerify(); |
47 return; | 48 return; |
48 } | 49 } |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 527 |
527 | 528 |
528 void JSFunction::JSFunctionVerify() { | 529 void JSFunction::JSFunctionVerify() { |
529 CHECK(IsJSFunction()); | 530 CHECK(IsJSFunction()); |
530 VerifyObjectField(kPrototypeOrInitialMapOffset); | 531 VerifyObjectField(kPrototypeOrInitialMapOffset); |
531 VerifyObjectField(kNextFunctionLinkOffset); | 532 VerifyObjectField(kNextFunctionLinkOffset); |
532 CHECK(code()->IsCode()); | 533 CHECK(code()->IsCode()); |
533 CHECK(next_function_link() == NULL || | 534 CHECK(next_function_link() == NULL || |
534 next_function_link()->IsUndefined() || | 535 next_function_link()->IsUndefined() || |
535 next_function_link()->IsJSFunction()); | 536 next_function_link()->IsJSFunction()); |
| 537 CHECK(map()->is_callable()); |
536 } | 538 } |
537 | 539 |
538 | 540 |
539 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 541 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
540 CHECK(IsSharedFunctionInfo()); | 542 CHECK(IsSharedFunctionInfo()); |
541 VerifyObjectField(kNameOffset); | 543 VerifyObjectField(kNameOffset); |
542 VerifyObjectField(kCodeOffset); | 544 VerifyObjectField(kCodeOffset); |
543 VerifyObjectField(kOptimizedCodeMapOffset); | 545 VerifyObjectField(kOptimizedCodeMapOffset); |
544 VerifyObjectField(kFeedbackVectorOffset); | 546 VerifyObjectField(kFeedbackVectorOffset); |
545 VerifyObjectField(kScopeInfoOffset); | 547 VerifyObjectField(kScopeInfoOffset); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 VerifyPointer(handler()); | 806 VerifyPointer(handler()); |
805 CHECK(hash()->IsSmi() || hash()->IsUndefined()); | 807 CHECK(hash()->IsSmi() || hash()->IsUndefined()); |
806 } | 808 } |
807 | 809 |
808 | 810 |
809 void JSFunctionProxy::JSFunctionProxyVerify() { | 811 void JSFunctionProxy::JSFunctionProxyVerify() { |
810 CHECK(IsJSFunctionProxy()); | 812 CHECK(IsJSFunctionProxy()); |
811 JSProxyVerify(); | 813 JSProxyVerify(); |
812 VerifyPointer(call_trap()); | 814 VerifyPointer(call_trap()); |
813 VerifyPointer(construct_trap()); | 815 VerifyPointer(construct_trap()); |
| 816 CHECK(map()->is_callable()); |
814 } | 817 } |
815 | 818 |
816 | 819 |
817 void JSArrayBuffer::JSArrayBufferVerify() { | 820 void JSArrayBuffer::JSArrayBufferVerify() { |
818 CHECK(IsJSArrayBuffer()); | 821 CHECK(IsJSArrayBuffer()); |
819 JSObjectVerify(); | 822 JSObjectVerify(); |
820 VerifyPointer(byte_length()); | 823 VerifyPointer(byte_length()); |
821 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() | 824 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
822 || byte_length()->IsUndefined()); | 825 || byte_length()->IsUndefined()); |
823 } | 826 } |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 | 1318 |
1316 // Both are done at the same time. | 1319 // Both are done at the same time. |
1317 CHECK_EQ(new_it.done(), old_it.done()); | 1320 CHECK_EQ(new_it.done(), old_it.done()); |
1318 } | 1321 } |
1319 | 1322 |
1320 | 1323 |
1321 #endif // DEBUG | 1324 #endif // DEBUG |
1322 | 1325 |
1323 } // namespace internal | 1326 } // namespace internal |
1324 } // namespace v8 | 1327 } // namespace v8 |
OLD | NEW |