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