| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 break; | 107 break; |
| 108 case JS_MODULE_TYPE: | 108 case JS_MODULE_TYPE: |
| 109 JSModule::cast(this)->JSModuleVerify(); | 109 JSModule::cast(this)->JSModuleVerify(); |
| 110 break; | 110 break; |
| 111 case JS_VALUE_TYPE: | 111 case JS_VALUE_TYPE: |
| 112 JSValue::cast(this)->JSValueVerify(); | 112 JSValue::cast(this)->JSValueVerify(); |
| 113 break; | 113 break; |
| 114 case JS_DATE_TYPE: | 114 case JS_DATE_TYPE: |
| 115 JSDate::cast(this)->JSDateVerify(); | 115 JSDate::cast(this)->JSDateVerify(); |
| 116 break; | 116 break; |
| 117 case JS_BOUND_FUNCTION_TYPE: | |
| 118 JSBoundFunction::cast(this)->JSBoundFunctionVerify(); | |
| 119 break; | |
| 120 case JS_FUNCTION_TYPE: | 117 case JS_FUNCTION_TYPE: |
| 121 JSFunction::cast(this)->JSFunctionVerify(); | 118 JSFunction::cast(this)->JSFunctionVerify(); |
| 122 break; | 119 break; |
| 123 case JS_GLOBAL_PROXY_TYPE: | 120 case JS_GLOBAL_PROXY_TYPE: |
| 124 JSGlobalProxy::cast(this)->JSGlobalProxyVerify(); | 121 JSGlobalProxy::cast(this)->JSGlobalProxyVerify(); |
| 125 break; | 122 break; |
| 126 case JS_GLOBAL_OBJECT_TYPE: | 123 case JS_GLOBAL_OBJECT_TYPE: |
| 127 JSGlobalObject::cast(this)->JSGlobalObjectVerify(); | 124 JSGlobalObject::cast(this)->JSGlobalObjectVerify(); |
| 128 break; | 125 break; |
| 129 case CELL_TYPE: | 126 case CELL_TYPE: |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 535 } |
| 539 | 536 |
| 540 | 537 |
| 541 void SlicedString::SlicedStringVerify() { | 538 void SlicedString::SlicedStringVerify() { |
| 542 CHECK(!this->parent()->IsConsString()); | 539 CHECK(!this->parent()->IsConsString()); |
| 543 CHECK(!this->parent()->IsSlicedString()); | 540 CHECK(!this->parent()->IsSlicedString()); |
| 544 CHECK(this->length() >= SlicedString::kMinLength); | 541 CHECK(this->length() >= SlicedString::kMinLength); |
| 545 } | 542 } |
| 546 | 543 |
| 547 | 544 |
| 548 void JSBoundFunction::JSBoundFunctionVerify() { | |
| 549 CHECK(IsJSBoundFunction()); | |
| 550 VerifyObjectField(kLengthOffset); | |
| 551 VerifyObjectField(kNameOffset); | |
| 552 VerifyObjectField(kBoundThisOffset); | |
| 553 VerifyObjectField(kBoundTargetFunctionOffset); | |
| 554 VerifyObjectField(kBoundArgumentsOffset); | |
| 555 VerifyObjectField(kCreationContextOffset); | |
| 556 CHECK(bound_target_function()->IsCallable()); | |
| 557 CHECK(creation_context()->IsNativeContext()); | |
| 558 CHECK(IsCallable()); | |
| 559 CHECK_EQ(IsConstructor(), bound_target_function()->IsConstructor()); | |
| 560 } | |
| 561 | |
| 562 | |
| 563 void JSFunction::JSFunctionVerify() { | 545 void JSFunction::JSFunctionVerify() { |
| 564 CHECK(IsJSFunction()); | 546 CHECK(IsJSFunction()); |
| 565 VerifyObjectField(kPrototypeOrInitialMapOffset); | 547 VerifyObjectField(kPrototypeOrInitialMapOffset); |
| 566 VerifyObjectField(kNextFunctionLinkOffset); | 548 VerifyObjectField(kNextFunctionLinkOffset); |
| 567 CHECK(code()->IsCode()); | 549 CHECK(code()->IsCode()); |
| 568 CHECK(next_function_link() == NULL || | 550 CHECK(next_function_link() == NULL || |
| 569 next_function_link()->IsUndefined() || | 551 next_function_link()->IsUndefined() || |
| 570 next_function_link()->IsJSFunction()); | 552 next_function_link()->IsJSFunction()); |
| 571 CHECK(map()->is_callable()); | 553 CHECK(map()->is_callable()); |
| 572 } | 554 } |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 | 1308 |
| 1327 // Both are done at the same time. | 1309 // Both are done at the same time. |
| 1328 CHECK_EQ(new_it.done(), old_it.done()); | 1310 CHECK_EQ(new_it.done(), old_it.done()); |
| 1329 } | 1311 } |
| 1330 | 1312 |
| 1331 | 1313 |
| 1332 #endif // DEBUG | 1314 #endif // DEBUG |
| 1333 | 1315 |
| 1334 } // namespace internal | 1316 } // namespace internal |
| 1335 } // namespace v8 | 1317 } // namespace v8 |
| OLD | NEW |