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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 CHECK(code()->IsCode()); | 597 CHECK(code()->IsCode()); |
598 CHECK(next_function_link() == NULL || | 598 CHECK(next_function_link() == NULL || |
599 next_function_link()->IsUndefined(GetIsolate()) || | 599 next_function_link()->IsUndefined(GetIsolate()) || |
600 next_function_link()->IsJSFunction()); | 600 next_function_link()->IsJSFunction()); |
601 CHECK(map()->is_callable()); | 601 CHECK(map()->is_callable()); |
602 } | 602 } |
603 | 603 |
604 | 604 |
605 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 605 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
606 CHECK(IsSharedFunctionInfo()); | 606 CHECK(IsSharedFunctionInfo()); |
| 607 |
| 608 VerifyObjectField(kCodeOffset); |
| 609 VerifyObjectField(kDebugInfoOffset); |
| 610 VerifyObjectField(kFeedbackMetadataOffset); |
| 611 VerifyObjectField(kFunctionDataOffset); |
| 612 VerifyObjectField(kFunctionIdentifierOffset); |
| 613 VerifyObjectField(kInstanceClassNameOffset); |
607 VerifyObjectField(kNameOffset); | 614 VerifyObjectField(kNameOffset); |
608 VerifyObjectField(kCodeOffset); | |
609 VerifyObjectField(kOptimizedCodeMapOffset); | 615 VerifyObjectField(kOptimizedCodeMapOffset); |
610 VerifyObjectField(kFeedbackMetadataOffset); | 616 VerifyObjectField(kOuterScopeInfoOffset); |
611 VerifyObjectField(kScopeInfoOffset); | 617 VerifyObjectField(kScopeInfoOffset); |
612 VerifyObjectField(kOuterScopeInfoOffset); | 618 VerifyObjectField(kScriptOffset); |
613 VerifyObjectField(kInstanceClassNameOffset); | 619 |
614 CHECK(function_data()->IsUndefined(GetIsolate()) || IsApiFunction() || | 620 CHECK(function_data()->IsUndefined(GetIsolate()) || IsApiFunction() || |
615 HasBytecodeArray() || HasAsmWasmData()); | 621 HasBytecodeArray() || HasAsmWasmData()); |
616 VerifyObjectField(kFunctionDataOffset); | 622 |
617 VerifyObjectField(kScriptOffset); | |
618 VerifyObjectField(kDebugInfoOffset); | |
619 CHECK(function_identifier()->IsUndefined(GetIsolate()) || | 623 CHECK(function_identifier()->IsUndefined(GetIsolate()) || |
620 HasBuiltinFunctionId() || HasInferredName()); | 624 HasBuiltinFunctionId() || HasInferredName()); |
621 VerifyObjectField(kFunctionIdentifierOffset); | 625 |
| 626 if (scope_info()->length() > 0) { |
| 627 CHECK(kind() == scope_info()->function_kind()); |
| 628 CHECK_EQ(kind() == kModule, scope_info()->scope_type() == MODULE_SCOPE); |
| 629 } |
622 } | 630 } |
623 | 631 |
624 | 632 |
625 void JSGlobalProxy::JSGlobalProxyVerify() { | 633 void JSGlobalProxy::JSGlobalProxyVerify() { |
626 CHECK(IsJSGlobalProxy()); | 634 CHECK(IsJSGlobalProxy()); |
627 JSObjectVerify(); | 635 JSObjectVerify(); |
628 VerifyObjectField(JSGlobalProxy::kNativeContextOffset); | 636 VerifyObjectField(JSGlobalProxy::kNativeContextOffset); |
629 // Make sure that this object has no properties, elements. | 637 // Make sure that this object has no properties, elements. |
630 CHECK_EQ(0, properties()->length()); | 638 CHECK_EQ(0, properties()->length()); |
631 CHECK_EQ(0, FixedArray::cast(elements())->length()); | 639 CHECK_EQ(0, FixedArray::cast(elements())->length()); |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 | 1515 |
1508 // Both are done at the same time. | 1516 // Both are done at the same time. |
1509 CHECK_EQ(new_it.done(), old_it.done()); | 1517 CHECK_EQ(new_it.done(), old_it.done()); |
1510 } | 1518 } |
1511 | 1519 |
1512 | 1520 |
1513 #endif // DEBUG | 1521 #endif // DEBUG |
1514 | 1522 |
1515 } // namespace internal | 1523 } // namespace internal |
1516 } // namespace v8 | 1524 } // namespace v8 |
OLD | NEW |