| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 case JS_OBJECT_TYPE: | 101 case JS_OBJECT_TYPE: |
| 102 case JS_API_OBJECT_TYPE: | 102 case JS_API_OBJECT_TYPE: |
| 103 case JS_SPECIAL_API_OBJECT_TYPE: | 103 case JS_SPECIAL_API_OBJECT_TYPE: |
| 104 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 104 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
| 105 case JS_PROMISE_TYPE: | 105 case JS_PROMISE_TYPE: |
| 106 JSObject::cast(this)->JSObjectVerify(); | 106 JSObject::cast(this)->JSObjectVerify(); |
| 107 break; | 107 break; |
| 108 case JS_GENERATOR_OBJECT_TYPE: | 108 case JS_GENERATOR_OBJECT_TYPE: |
| 109 JSGeneratorObject::cast(this)->JSGeneratorObjectVerify(); | 109 JSGeneratorObject::cast(this)->JSGeneratorObjectVerify(); |
| 110 break; | 110 break; |
| 111 case JS_MODULE_TYPE: | |
| 112 JSModule::cast(this)->JSModuleVerify(); | |
| 113 break; | |
| 114 case JS_VALUE_TYPE: | 111 case JS_VALUE_TYPE: |
| 115 JSValue::cast(this)->JSValueVerify(); | 112 JSValue::cast(this)->JSValueVerify(); |
| 116 break; | 113 break; |
| 117 case JS_DATE_TYPE: | 114 case JS_DATE_TYPE: |
| 118 JSDate::cast(this)->JSDateVerify(); | 115 JSDate::cast(this)->JSDateVerify(); |
| 119 break; | 116 break; |
| 120 case JS_BOUND_FUNCTION_TYPE: | 117 case JS_BOUND_FUNCTION_TYPE: |
| 121 JSBoundFunction::cast(this)->JSBoundFunctionVerify(); | 118 JSBoundFunction::cast(this)->JSBoundFunctionVerify(); |
| 122 break; | 119 break; |
| 123 case JS_FUNCTION_TYPE: | 120 case JS_FUNCTION_TYPE: |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // object is allocated but its fields are all undefined, as it hasn't yet been | 420 // object is allocated but its fields are all undefined, as it hasn't yet been |
| 424 // initialized by the generator. Hence these weak checks. | 421 // initialized by the generator. Hence these weak checks. |
| 425 VerifyObjectField(kFunctionOffset); | 422 VerifyObjectField(kFunctionOffset); |
| 426 VerifyObjectField(kContextOffset); | 423 VerifyObjectField(kContextOffset); |
| 427 VerifyObjectField(kReceiverOffset); | 424 VerifyObjectField(kReceiverOffset); |
| 428 VerifyObjectField(kOperandStackOffset); | 425 VerifyObjectField(kOperandStackOffset); |
| 429 VerifyObjectField(kContinuationOffset); | 426 VerifyObjectField(kContinuationOffset); |
| 430 } | 427 } |
| 431 | 428 |
| 432 | 429 |
| 433 void JSModule::JSModuleVerify() { | |
| 434 VerifyObjectField(kContextOffset); | |
| 435 VerifyObjectField(kScopeInfoOffset); | |
| 436 CHECK(context()->IsUndefined(GetIsolate()) || | |
| 437 Context::cast(context())->IsModuleContext()); | |
| 438 } | |
| 439 | |
| 440 | |
| 441 void JSValue::JSValueVerify() { | 430 void JSValue::JSValueVerify() { |
| 442 Object* v = value(); | 431 Object* v = value(); |
| 443 if (v->IsHeapObject()) { | 432 if (v->IsHeapObject()) { |
| 444 VerifyHeapPointer(v); | 433 VerifyHeapPointer(v); |
| 445 } | 434 } |
| 446 } | 435 } |
| 447 | 436 |
| 448 | 437 |
| 449 void JSDate::JSDateVerify() { | 438 void JSDate::JSDateVerify() { |
| 450 if (value()->IsHeapObject()) { | 439 if (value()->IsHeapObject()) { |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 | 1315 |
| 1327 // Both are done at the same time. | 1316 // Both are done at the same time. |
| 1328 CHECK_EQ(new_it.done(), old_it.done()); | 1317 CHECK_EQ(new_it.done(), old_it.done()); |
| 1329 } | 1318 } |
| 1330 | 1319 |
| 1331 | 1320 |
| 1332 #endif // DEBUG | 1321 #endif // DEBUG |
| 1333 | 1322 |
| 1334 } // namespace internal | 1323 } // namespace internal |
| 1335 } // namespace v8 | 1324 } // namespace v8 |
| OLD | NEW |