Chromium Code Reviews| 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()); | |
|
Michael Starzinger
2015/08/27 10:47:14
This CHECK does not really verify the Smi value, b
| |
| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 524 | 525 |
| 525 | 526 |
| 526 void JSFunction::JSFunctionVerify() { | 527 void JSFunction::JSFunctionVerify() { |
| 527 CHECK(IsJSFunction()); | 528 CHECK(IsJSFunction()); |
| 528 VerifyObjectField(kPrototypeOrInitialMapOffset); | 529 VerifyObjectField(kPrototypeOrInitialMapOffset); |
| 529 VerifyObjectField(kNextFunctionLinkOffset); | 530 VerifyObjectField(kNextFunctionLinkOffset); |
| 530 CHECK(code()->IsCode()); | 531 CHECK(code()->IsCode()); |
| 531 CHECK(next_function_link() == NULL || | 532 CHECK(next_function_link() == NULL || |
| 532 next_function_link()->IsUndefined() || | 533 next_function_link()->IsUndefined() || |
| 533 next_function_link()->IsJSFunction()); | 534 next_function_link()->IsJSFunction()); |
| 535 CHECK(map()->is_callable()); | |
| 534 } | 536 } |
| 535 | 537 |
| 536 | 538 |
| 537 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 539 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
| 538 CHECK(IsSharedFunctionInfo()); | 540 CHECK(IsSharedFunctionInfo()); |
| 539 VerifyObjectField(kNameOffset); | 541 VerifyObjectField(kNameOffset); |
| 540 VerifyObjectField(kCodeOffset); | 542 VerifyObjectField(kCodeOffset); |
| 541 VerifyObjectField(kOptimizedCodeMapOffset); | 543 VerifyObjectField(kOptimizedCodeMapOffset); |
| 542 VerifyObjectField(kFeedbackVectorOffset); | 544 VerifyObjectField(kFeedbackVectorOffset); |
| 543 VerifyObjectField(kScopeInfoOffset); | 545 VerifyObjectField(kScopeInfoOffset); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 VerifyPointer(handler()); | 804 VerifyPointer(handler()); |
| 803 CHECK(hash()->IsSmi() || hash()->IsUndefined()); | 805 CHECK(hash()->IsSmi() || hash()->IsUndefined()); |
| 804 } | 806 } |
| 805 | 807 |
| 806 | 808 |
| 807 void JSFunctionProxy::JSFunctionProxyVerify() { | 809 void JSFunctionProxy::JSFunctionProxyVerify() { |
| 808 CHECK(IsJSFunctionProxy()); | 810 CHECK(IsJSFunctionProxy()); |
| 809 JSProxyVerify(); | 811 JSProxyVerify(); |
| 810 VerifyPointer(call_trap()); | 812 VerifyPointer(call_trap()); |
| 811 VerifyPointer(construct_trap()); | 813 VerifyPointer(construct_trap()); |
| 814 CHECK(map()->is_callable()); | |
| 812 } | 815 } |
| 813 | 816 |
| 814 | 817 |
| 815 void JSArrayBuffer::JSArrayBufferVerify() { | 818 void JSArrayBuffer::JSArrayBufferVerify() { |
| 816 CHECK(IsJSArrayBuffer()); | 819 CHECK(IsJSArrayBuffer()); |
| 817 JSObjectVerify(); | 820 JSObjectVerify(); |
| 818 VerifyPointer(byte_length()); | 821 VerifyPointer(byte_length()); |
| 819 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() | 822 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
| 820 || byte_length()->IsUndefined()); | 823 || byte_length()->IsUndefined()); |
| 821 } | 824 } |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1313 | 1316 |
| 1314 // Both are done at the same time. | 1317 // Both are done at the same time. |
| 1315 CHECK_EQ(new_it.done(), old_it.done()); | 1318 CHECK_EQ(new_it.done(), old_it.done()); |
| 1316 } | 1319 } |
| 1317 | 1320 |
| 1318 | 1321 |
| 1319 #endif // DEBUG | 1322 #endif // DEBUG |
| 1320 | 1323 |
| 1321 } // namespace internal | 1324 } // namespace internal |
| 1322 } // namespace v8 | 1325 } // namespace v8 |
| OLD | NEW |