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